Linux_HAL_Essentials: Add (UAV)CAN support

This commit is contained in:
mirkix 2015-04-07 18:41:21 +00:00 committed by Andrew Tridgell
parent 8335399525
commit 2e04effd4d
3 changed files with 254 additions and 209 deletions

View File

@ -41,7 +41,7 @@
"P9.28", /* spi1: spi1_cs0, MPU9250 CS0 */ "P9.28", /* spi1: spi1_cs0, MPU9250 CS0 */
"P9.42", /* spi1: spi1_cs1, MS5611 CS1 */ "P9.42", /* spi1: spi1_cs1, MS5611 CS1 */
/* UART4 */ /* UART4 MAVLink */
"P9.11", /* uart4: uart4_rxd */ "P9.11", /* uart4: uart4_rxd */
"P9.13", /* uart4: uart4_txd */ "P9.13", /* uart4: uart4_txd */
@ -49,12 +49,17 @@
"P8.38", /* uart5: uart5_rxd */ "P8.38", /* uart5: uart5_rxd */
"P8.37", /* uart5: uart5_txd */ "P8.37", /* uart5: uart5_txd */
/* CAN1 */
"P9.24", /* can1: dcan1_rx */
"P9.26", /* can1: dcan1_tx */
/* Hardware in use */ /* Hardware in use */
"pru1", "pru1",
"spi0", "spi0",
"spi1", "spi1",
"uart4", "uart4",
"uart5"; "uart5",
"can1";
fragment@0 { fragment@0 {
target = <&am33xx_pinmux>; target = <&am33xx_pinmux>;
@ -102,7 +107,6 @@
bb_uart4_pins: pinmux_bb_uart4_pins { bb_uart4_pins: pinmux_bb_uart4_pins {
pinctrl-single,pins = < pinctrl-single,pins = <
/* UART4 pins */
0x070 0x26 /* lcd_data9.uart4_rxd | MODE6 P9.11 */ 0x070 0x26 /* lcd_data9.uart4_rxd | MODE6 P9.11 */
0x074 0x06 /* lcd_data8.uart4_txd | MODE6 P8.13 */ 0x074 0x06 /* lcd_data8.uart4_txd | MODE6 P8.13 */
>; >;
@ -110,11 +114,18 @@
bb_uart5_pins: pinmux_bb_uart5_pins { bb_uart5_pins: pinmux_bb_uart5_pins {
pinctrl-single,pins = < pinctrl-single,pins = <
/* UART5 GPS pins */
0x0C4 0x24 /* lcd_data9.uart5_rxd | MODE4 P8.38 */ 0x0C4 0x24 /* lcd_data9.uart5_rxd | MODE4 P8.38 */
0x0C0 0x04 /* lcd_data8.uart5_txd | MODE4 P8.37 */ 0x0C0 0x04 /* lcd_data8.uart5_txd | MODE4 P8.37 */
>; >;
}; };
dcan1_pins_s0: dcan1_pins_s0 {
pinctrl-single,pins = <
0x180 0x12 /* d_can1_tx, SLEWCTRL_FAST | INPUT_PULLUP | MODE2 */
0x184 0x32 /* d_can1_rx, SLEWCTRL_FAST | RECV_ENABLE | INPUT_PULLUP | MODE2 */
>;
};
}; };
}; };
@ -194,4 +205,17 @@
pinctrl-0 = <&bb_uart5_pins>; pinctrl-0 = <&bb_uart5_pins>;
}; };
}; };
fragment@6 {
target = <&dcan1>;
__overlay__ {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&dcan1_pins_s0>;
};
};
}; };

View File

@ -9,57 +9,78 @@ To rebuild the dtbo file type `make` and than `make install`to copy the dtbo fil
## Pin assigment ## Pin assigment
### RCInput ### RCInput
BBB | RC Receiver | Remark BBB | RC Receiver | I/O | Remark
------------ | ------------- | ------------- ------------ | ------------- | ------------- | -------------
P8.15 RC_IN | RC Out (Spektrum / PPM-sum) P9.01 DGND | GND | |
P9.03 VDD_3V3 | VDD | |
P8.15 RC_IN | RC Out | IN | 3.3 Volt (Spektrum / PPM-sum)
### RCOutput ### RCOutput
BBB | ESC / Servo | Remark BBB | ESC / Servo | I/O | Remark
------------ | ------------- | ------------- ------------ | ------------- | ------------- | -------------
P8.28 | RC_OUT_CH_1 | Use level shifter 3.3 Volt to 5 Volt P8.01 DGND | GND |
P8.27 | RC_OUT_CH_2 | Use level shifter 3.3 Volt to 5 Volt P8.28 | RC_OUT_CH_1 | OUT | 3.3 Volt
P8.30 | RC_OUT_CH_3 | Use level shifter 3.3 Volt to 5 Volt P8.27 | RC_OUT_CH_2 | OUT | 3.3 Volt
P8.29 | RC_OUT_CH_4 | Use level shifter 3.3 Volt to 5 Volt P8.30 | RC_OUT_CH_3 | OUT | 3.3 Volt
P8.40 | RC_OUT_CH_5 | Use level shifter 3.3 Volt to 5 Volt P8.29 | RC_OUT_CH_4 | OUT | 3.3 Volt
P8.39 | RC_OUT_CH_6 | Use level shifter 3.3 Volt to 5 Volt P8.40 | RC_OUT_CH_5 | OUT | 3.3 Volt
P8.42 | RC_OUT_CH_7 | Use level shifter 3.3 Volt to 5 Volt P8.39 | RC_OUT_CH_6 | OUT | 3.3 Volt
P8.41 | RC_OUT_CH_8 | Use level shifter 3.3 Volt to 5 Volt P8.42 | RC_OUT_CH_7 | OUT | 3.3 Volt
P8.44 | RC_OUT_CH_9 | Use level shifter 3.3 Volt to 5 Volt P8.41 | RC_OUT_CH_8 | OUT | 3.3 Volt
P8.43 | RC_OUT_CH_10 | Use level shifter 3.3 Volt to 5 Volt P8.44 | RC_OUT_CH_9 | OUT | 3.3 Volt
P8.46 | RC_OUT_CH_11 | Use level shifter 3.3 Volt to 5 Volt P8.43 | RC_OUT_CH_10 | OUT | 3.3 Volt
P8.45 | RC_OUT_CH_12 | Use level shifter 3.3 Volt to 5 Volt P8.46 | RC_OUT_CH_11 | OUT | 3.3 Volt
P8.45 | RC_OUT_CH_12 | OUT | 3.3 Volt
### SPI0 ### IMU MPU-9250
BBB | Sensor | Remark BBB | MPU-9250 | I/O | Remark
------------ | ------------- | ------------- ------------ | ------------- | ------------- | -------------
P9.22 | SPI0_SCLK | not used P9.01 DGND | GND | |
P9.21 | SPI0_MISO | not used P9.03 VDD_3V3 | VDD | |
P9.18 | SPI0_MOSI | not used P9.28 MPU9250_CS | MPU9250_CS | OUT | 3.3 Volt
P9.17 | SPI0_CS | not used P9.29 SPI1_MISO | MISO / SD0 | IN | 3.3 Volt
P9.30 SPI1_MOSI | MOSI / SD1 | OUT | 3.3 Volt
P9.31 SPI1_SCLK | SCLK / SCL | OUT | 3.3 Volt
### SPI1
BBB | Sensor | Remark
------------ | ------------- | -------------
P9.31 | SPI1_SCLK | MPU9250, MS5611
P9.29 | SPI1_MISO | MPU9250, MS5611
P9.30 | SPI1_MOSI | MPU9250, MS5611
P9.28 | SPI1_CS0 | MPU9250 CS
P9.19 | SPI1_CS1 | MS5611 CS
### UART4 ### Baro MS 5611
BBB | Sensor | Remark BBB | MS 5611 | I/O | Remark
------------ | ------------- | ------------- ------------ | ------------- | ------------- | -------------
P9.11 UART4_RXD | not used P9.01 DGND | GND | |
P9.13 UART4_TXD | not used P9.03 VDD_3V3 | VDD | |
P9.29 SPI1_MISO | MISO / SDO | IN | 3.3 Volt
P9.30 SPI1_MOSI | MOSI / SD1 | OUT | 3.3 Volt
P9.31 SPI1_SCLK | SCLK / SCL | OUT | 3.3 Volt
P9.42 MS5611_CS | MS5611_CS | OUT | 3.3 Volt
### UART4 MAVLink radio module
Baudrate 57600, 8, n, 1
BBB | Radio | I/O | Remark
------------ | ------------- | ------------- | -------------
P9.01 DGND | GND |
P9.13 TX | RADIO_RX | OUT | 3.3 Volt
P9.11 RX | RADIO_TX | IN | 3.3 Volt
### UART5 GPS ### UART5 GPS
Baudrate 38400, 8, n, 1
38400,8,n,1 BBB | GPS | I/O | Remark
------------ | ------------- | ------------- | -------------
P8.01 DGND | GND |
P8.37 TX | GPS_RX | OUT | 3.3 Volt
P8.38 RX | GPS_TX | IN | 3.3 Volt
BBB | Sensor | Remark
### CAN1 UAVCAN
You have to use a CAN transceiver (e.g. MCP 2562-E/P) for CAN datatransfer.
BBB | I/O | Remark
------------ | ------------- | ------------- ------------ | ------------- | -------------
P8.38 UART5_RXD | GPS_TXD | P9.24 RX | IN | 3.3 Volt
P8.37 UART5_TXD | GPS_RXD | P9.26 TX | OUT | 3.3 Volt
### Sound (PWM) ### Sound (PWM)