Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default defineConfig({
autogenerate: { directory: 'other' },
},
],
favicon: "/favicon.ico",
favicon: "/static/favicon.ico",
Comment thread
Pertempto marked this conversation as resolved.
}),
],
image: {
Expand Down
25 changes: 24 additions & 1 deletion src/content/docs/getting-started/setting-up-neuralplex.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,27 @@ root@neuralplex:~# cd /rw_data

<Aside type="tip">
After writing files to the read/write partition, ensure to issue the **sync** command to complete the process of writing to the partition.
</Aside>
</Aside>

### Device Tree Overlays
To allow users to load and initialize only the perpheals that are needed, Device Tree Overlays (DTOs) are used. DTOs enable hardware customization without the need to modify the base device tree. This flexibility is especially valuable since NeuralPlex supports multiple configurations. However, once it has been determined what features are required for your application, it may be beneficial to bake everything into a single device tree, which will speed up the boot process a bit.

To enable a device tree overlay, edit the `/boot/overlays.txt` file and append the name of the DTO to the `overlay_files=`. DTOs must be space delimited; do not add commas or try to enter the DTOs on new lines.

```bash title="/boot/overlays.txt"
overlay_files=imx8qm-np-audio.dtbo imx8qm-np-wifi.dtbo
```

List of available DTOs:
* imx8qm-np-audio.dtbo
* imx8qm-np-cameras.dtbo
* imx8qm-np-cellular-gps.dtbo
* imx8qm-np-hdmi.dtbo
* imx8qm-np-pci.dtbo
* imx8qm-np-sata.dtbo
* imx8qm-np-video0-12-3.dtbo
* imx8qm-np-video1-12-3.dtbo
* imx8qm-np-video2-12-3.dtbo
* imx8qm-np-video3-12-3.dtbo
* imx8qm-np-video2-15-6.dtbo
* imx8qm-np-wifi.dtbo
165 changes: 77 additions & 88 deletions src/content/docs/hardware/inputs-outputs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,148 +21,137 @@ The NeuralPlex has a separate Vehicle Interface Processor (VIP) that is responsi

### OP Codes
```bash title="OP Codes"
0x00 - NOP
0x10 - ANALOG_INPUT_READ
0x11 - ANALOG_INPUT_CONFIG
0x20 - PWM_ENABLE
0x21 - PWM_CONFIG
0x30 - VREF_ENABLE
0x31 - VREF_CONFIG
0x41 - CAN_BAUD_RATE_CONFIG
0x50 - RS232_STREAM
0x51 - RS232_CONFIG
0x60 - DATA_READY_DECODE
0x61 - DATA_RECEIVE
SPI_NOP 0x00
ANALOG_INPUT_READ 0x10
PWM_ENABLE 0x20
PWM_CONFIG 0x21
VREF_ENABLE 0x30
VREF_CONFIG 0x31
CAN_ENABLE 0x40
CAN_BAUD_RATE_CONFIG 0x41
CAN_TIMEOUT 0x42
RS232_STREAM 0x50
RS232_CONFIG 0x51
DATA_READY_ENCODE 0x60
DATA_RECEIVE 0x61
IMX_KEEP_ALIVE 0x70
IMX_SHUTDOWN 0x71
IMX_REBOOT 0x72
S32K_RESET 0x73
```

### Messages
Individual messages are outlined in the protocol below. The ID represents the OP Code, Byte 0 represents MSB. Message with ID of `0x1XY` represents the response message sent back to the SOC (master) one frame after receiving `0xXY`. A full frame of 0's serves as a NOP to allow the SOC to receive a response without sending more data to the VIP. Response to NOP will also be a frame consisting entirely of 0's.

```bash title="spidev_test"
# Enable PWM 1 (opcode=0x20, channel=0x01)
$ spidev_test -D /dev/spidev0.1 -O -s 100000 -v -S 5 -p "\x20\x01\x00\x00\x00"n
$ spidev_test -D /dev/spidev0.1 -O -s 100000 -v -S 5 -p "\x20\x01\x00\x00\x00"

# Enable PWM 1 and 3 (opcode=0x20, channel=0x05)
$ spidev_test -D /dev/spidev0.1 -O -s 100000 -v -S 5 -p "\x20\x05\x00\x00\x00"n
$ spidev_test -D /dev/spidev0.1 -O -s 100000 -v -S 5 -p "\x20\x05\x00\x00\x00"
```

### SPI Protocol

```bash title="SPI_Protocol.sym"
FormatVersion=6.0 // Do not edit this line!
FormatVersion=5.0 // Do not edit this line!
Title="SOC to VIP SPI Bus Protocol"

{ENUMS}
Enum=PWM_PARAMETER(0="FREQUENCY", 1="PERIOD", 2="DUTY_CYCLE")
Enum=PARITY(0="NONE", 1="ODD", 2="EVEN", 3="MARK", 4="SPACE")
Enum=ADC_RESOLUTION(0="10", 1="11", 2="12")
Enum=DATA_TYPE(0="NONE", 1="STATUSES", 2="RS232", 3="RS485")
enum PWM_PARAMETER(0="FREQUENCY", 1="DUTY_CYCLE")
enum PARITY(0="NONE", 1="EVEN", 2="ODD")
enum ADC_RESOLUTION(0="10", 1="11", 2="12")
enum DATA_TYPE(0="NONE", 1="STATUSES", 2="RS232", 3="RS485")

{SENDRECEIVE}

[PWM_CONFIG]
ID=021h
Var=PWM_PARAMTER unsigned 0,2 /max:1 /e:PWM_PARAMETER
Var=VALUE unsigned 8,24 -m /max:1
Var=CHANNELS unsigned 4,4
[NOP]
ID=000h

[ANALOG_INPUT_READ]
ID=010h
Var=ADC_CHANNEL unsigned 0,4 /max:1

[ANALOG_INPUT_CONFIG]
ID=011h
Var=RESOLUTION unsigned 0,2 /max:1 /e:ADC_RESOLUTION

[PWM_ENABLE]
ID=020h
Var=ENABLE unsigned 0,4 /max:1
Var=CHANNELS unsigned 0,4

[VREF_CONFIG]
ID=031h
Var=VALUE unsigned 0,32 -m /max:1
[PWM_CONFIG]
ID=021h
Var=PWM_PARAMTER unsigned 4,2 /e:PWM_PARAMETER
Var=VALUE unsigned 8,24 -m
Var=CHANNELS unsigned 0,4

[VREF_ENABLE]
ID=030h
Var=ENABLE unsigned 0,1

[RS232_CONFIG]
ID=051h
Var=BAUD_RATE unsigned 0,5 /max:1
Var=RS485_FLAG unsigned 7,1
Var=BITS_PER_CHAR unsigned 8,4 /max:1
Var=PARITY unsigned 12,3 /max:1 /e:PARITY
Var=STOP_BITS unsigned 15,1

[RS232_STREAM]
ID=050h
Var=TX unsigned 0,32 -m /max:1

[ANALOG_INPUT_CONFIG]
ID=011h
Var=RESOLUTION unsigned 0,2 /max:1 /e:ADC_RESOLUTION
[VREF_CONFIG]
ID=031h
Var=VALUE unsigned 0,16 -m

[ANALOG_INPUT_READ]
ID=010h
Var=CHANNEL unsigned 0,4 /max:1
[CAN_ENABLE]
ID=040h
Var=CAN_CHANNEL unsigned 0,4

[CAN_BAUD_RATE_CONFIG]
ID=041h
Var=CHANNEL unsigned 0,4 /max:1
Var=VALUE unsigned 8,24 -m /max:1

[ANALOG_INPUT_CONFIG_Response]
ID=111h
Var=RESOLUTION unsigned 0,2 /max:1 /e:ADC_RESOLUTION

[ANALOG_INPUT_READ_Response]
ID=110h
Var=CHANNEL unsigned 0,4 /max:1
Var=VALUE unsigned 8,16 -m /max:1

[CAN_BAUD_RATE_CONFIG_Response]
ID=141h
Var=CHANNEL unsigned 0,4 /max:1
Var=CAN_CHANNEL unsigned 0,4 /max:1
Var=VALUE unsigned 8,24 -m /max:1

[PWM_CONFIG_Response]
ID=121h
Var=PWM_PARAMTER unsigned 0,2 /max:1 /e:PWM_PARAMETER
Var=VALUE unsigned 8,24 -m /max:1
Var=CHANNELS unsigned 4,4
[CAN_TIMEOUT]
ID=042h
Var=CAN_TIMEOUT_S unsigned 8,16 /u:s
Var=CAN_CHANNEL unsigned 0,4

[PWM_ENABLE_Response]
ID=120h
Var=ENABLE unsigned 0,4 /max:1
[RS232_STREAM]
ID=050h
Var=TX unsigned 0,32 -m /max:1

[RS232_CONFIG_Response]
ID=151h
[RS232_CONFIG]
ID=051h
Var=BAUD_RATE unsigned 0,5 /max:1
Var=RS485_FLAG unsigned 7,1
Var=BITS_PER_CHAR unsigned 8,4 /max:1
Var=PARITY unsigned 12,3 /max:1 /e:PARITY
Var=STOP_BITS unsigned 15,1

[RS232_STREAM_Response]
ID=150h
Var=TX unsigned 0,32 -m /max:1
[DATA_READY_DECODE]
ID=060h

[VREF_CONFIG_Response]
ID=131h
Var=VALUE unsigned 0,32 -m /max:1
[DATA_RECEIVE]
ID=061h

[VREF_ENABLE_Response]
ID=130h
Var=ENABLE unsigned 0,1
[IMX_KEEP_ALIVE]
ID=070h
Var=KEEP_ALIVE unsigned 0,1

[NOP]
ID=000h
[IMX_SHUTDOWN]
ID=071h
Var=IMX_SHUTDOWN unsigned 0,1
Var=IMX_SHUTDOWN_DELAY_S unsigned 8,16 /u:s

[NOP_Response]
ID=100h
[IMX_REBOOT]
ID=072h
Var=IMX_REBOOT unsigned 0,1

[DATA_READY_DECODE]
ID=060h
[S32K_RESET]
ID=073h
Var=S32K_RESET unsigned 0,1

[DATA_READY_DECODE_Response]
ID=160h
Var=DATA_TYPE unsigned 0,2 /e:DATA_TYPE
Var=BYTES unsigned 8,8

[DATA_RECEIVE]
ID=061h
[ANALOG_INPUT_READ_Response]
ID=110h
Var=ADC_CHANNEL unsigned 0,4 /max:1
Var=VALUE unsigned 8,16 -m /max:1

[DATA_RECEIVE_Response]
ID=161h
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/operating-system/multimedia.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ s7 = AMP_R
s8 = OUT6

# Record Audio
arecord -D plughw:0,1 -r 48000 -f S32_LE sample.wav -c4
arecord -D plughw:0,0 -r 48000 -f S32_LE sample.wav -c4

# Play Audio
aplay Sultans_Of_Swing.wav
Expand Down