mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-01 19:07:45 +08:00
px4fmu-v4pro:Board does CAN GPIO init
This commit is contained in:
committed by
Daniel Agar
parent
f2fbffab84
commit
5da93ad7c5
@@ -269,24 +269,24 @@
|
|||||||
* The following definitions are used to access individual LEDs.
|
* The following definitions are used to access individual LEDs.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* LED index values for use with board_userled() */
|
/* LED index values for use with board_userled() */
|
||||||
|
|
||||||
#define BOARD_LED1 0
|
#define BOARD_LED1 0
|
||||||
#define BOARD_LED2 1
|
#define BOARD_LED2 1
|
||||||
#define BOARD_LED3 2
|
#define BOARD_LED3 2
|
||||||
#define BOARD_NLEDS 3
|
#define BOARD_NLEDS 3
|
||||||
|
|
||||||
#define BOARD_LED_RED BOARD_LED1
|
#define BOARD_LED_RED BOARD_LED1
|
||||||
#define BOARD_LED_GREEN BOARD_LED2
|
#define BOARD_LED_GREEN BOARD_LED2
|
||||||
#define BOARD_LED_BLUE BOARD_LED3
|
#define BOARD_LED_BLUE BOARD_LED3
|
||||||
|
|
||||||
/* LED bits for use with board_userled_all() */
|
/* LED bits for use with board_userled_all() */
|
||||||
|
|
||||||
#define BOARD_LED1_BIT (1 << BOARD_LED1)
|
#define BOARD_LED1_BIT (1 << BOARD_LED1)
|
||||||
#define BOARD_LED2_BIT (1 << BOARD_LED2)
|
#define BOARD_LED2_BIT (1 << BOARD_LED2)
|
||||||
#define BOARD_LED3_BIT (1 << BOARD_LED3)
|
#define BOARD_LED3_BIT (1 << BOARD_LED3)
|
||||||
|
|
||||||
/* If CONFIG_ARCH_LEDS is defined, the usage by the board port is defined in
|
/* If CONFIG_ARCH_LEDS is defined, the usage by the board port is defined in
|
||||||
* include/board.h and src/stm32_leds.c. The LEDs are used to encode OS-related
|
* include/board.h and src/stm32_leds.c. The LEDs are used to encode OS-related
|
||||||
* events as follows:
|
* events as follows:
|
||||||
*
|
*
|
||||||
@@ -295,17 +295,17 @@
|
|||||||
* Red Green Blue
|
* Red Green Blue
|
||||||
* ---------------------- -------------------------- ------ ------ ----*/
|
* ---------------------- -------------------------- ------ ------ ----*/
|
||||||
|
|
||||||
#define LED_STARTED 0 /* NuttX has been started OFF OFF OFF */
|
#define LED_STARTED 0 /* NuttX has been started OFF OFF OFF */
|
||||||
#define LED_HEAPALLOCATE 1 /* Heap has been allocated OFF OFF ON */
|
#define LED_HEAPALLOCATE 1 /* Heap has been allocated OFF OFF ON */
|
||||||
#define LED_IRQSENABLED 2 /* Interrupts enabled OFF ON OFF */
|
#define LED_IRQSENABLED 2 /* Interrupts enabled OFF ON OFF */
|
||||||
#define LED_STACKCREATED 3 /* Idle stack created OFF ON ON */
|
#define LED_STACKCREATED 3 /* Idle stack created OFF ON ON */
|
||||||
#define LED_INIRQ 4 /* In an interrupt N/C N/C GLOW */
|
#define LED_INIRQ 4 /* In an interrupt N/C N/C GLOW */
|
||||||
#define LED_SIGNAL 5 /* In a signal handler N/C GLOW N/C */
|
#define LED_SIGNAL 5 /* In a signal handler N/C GLOW N/C */
|
||||||
#define LED_ASSERTION 6 /* An assertion failed GLOW N/C GLOW */
|
#define LED_ASSERTION 6 /* An assertion failed GLOW N/C GLOW */
|
||||||
#define LED_PANIC 7 /* The system has crashed Blink OFF N/C */
|
#define LED_PANIC 7 /* The system has crashed Blink OFF N/C */
|
||||||
#define LED_IDLE 8 /* MCU is is sleep mode ON OFF OFF */
|
#define LED_IDLE 8 /* MCU is is sleep mode ON OFF OFF */
|
||||||
|
|
||||||
/* Thus if the Green LED is statically on, NuttX has successfully booted and
|
/* Thus if the Green LED is statically on, NuttX has successfully booted and
|
||||||
* is, apparently, running normally. If the Red LED is flashing at
|
* is, apparently, running normally. If the Red LED is flashing at
|
||||||
* approximately 2Hz, then a fatal error has been detected and the system
|
* approximately 2Hz, then a fatal error has been detected and the system
|
||||||
* has halted.
|
* has halted.
|
||||||
@@ -348,7 +348,7 @@
|
|||||||
/*
|
/*
|
||||||
* CAN
|
* CAN
|
||||||
*
|
*
|
||||||
* CAN1 is routed to the onboard transceiver.
|
* CAN1 and CAN2 is routed to the onboard transceiver.
|
||||||
*/
|
*/
|
||||||
#define GPIO_CAN1_RX GPIO_CAN1_RX_3
|
#define GPIO_CAN1_RX GPIO_CAN1_RX_3
|
||||||
#define GPIO_CAN1_TX GPIO_CAN1_TX_3
|
#define GPIO_CAN1_TX GPIO_CAN1_TX_3
|
||||||
|
|||||||
@@ -227,6 +227,13 @@ stm32_boardinitialize(void)
|
|||||||
stm32_configgpio(GPIO_ADC1_IN11); /* BATT2_VOLTAGE_SENS */
|
stm32_configgpio(GPIO_ADC1_IN11); /* BATT2_VOLTAGE_SENS */
|
||||||
stm32_configgpio(GPIO_ADC1_IN13); /* BATT2_CURRENT_SENS */
|
stm32_configgpio(GPIO_ADC1_IN13); /* BATT2_CURRENT_SENS */
|
||||||
|
|
||||||
|
/* configure CAN interfaces */
|
||||||
|
|
||||||
|
stm32_configgpio(GPIO_CAN1_RX);
|
||||||
|
stm32_configgpio(GPIO_CAN1_TX);
|
||||||
|
stm32_configgpio(GPIO_CAN2_RX);
|
||||||
|
stm32_configgpio(GPIO_CAN2_TX);
|
||||||
|
|
||||||
/* configure power supply control/sense pins */
|
/* configure power supply control/sense pins */
|
||||||
stm32_configgpio(GPIO_VDD_3V3_PERIPH_EN);
|
stm32_configgpio(GPIO_VDD_3V3_PERIPH_EN);
|
||||||
stm32_configgpio(GPIO_VDD_5V_PERIPH_EN);
|
stm32_configgpio(GPIO_VDD_5V_PERIPH_EN);
|
||||||
|
|||||||
Reference in New Issue
Block a user