Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alberto Ruiz Garcia
Firmware
Commits
5da93ad7
Commit
5da93ad7
authored
6 years ago
by
David Sidrane
Committed by
Daniel Agar
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
px4fmu-v4pro:Board does CAN GPIO init
parent
f2fbffab
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
platforms/nuttx/nuttx-configs/px4fmu-v4pro/include/board.h
+50
-50
50 additions, 50 deletions
platforms/nuttx/nuttx-configs/px4fmu-v4pro/include/board.h
src/drivers/boards/px4fmu-v4pro/init.c
+7
-0
7 additions, 0 deletions
src/drivers/boards/px4fmu-v4pro/init.c
with
57 additions
and
50 deletions
platforms/nuttx/nuttx-configs/px4fmu-v4pro/include/board.h
+
50
−
50
View file @
5da93ad7
...
...
@@ -269,47 +269,47 @@
* The following definitions are used to access individual LEDs.
*/
/* LED index values for use with board_userled() */
#define BOARD_LED1 0
#define BOARD_LED2 1
#define BOARD_LED3 2
#define BOARD_NLEDS 3
#define BOARD_LED_RED BOARD_LED1
#define BOARD_LED_GREEN BOARD_LED2
#define BOARD_LED_BLUE BOARD_LED3
/* LED bits for use with board_userled_all() */
#define BOARD_LED1_BIT (1 << BOARD_LED1)
#define BOARD_LED2_BIT (1 << BOARD_LED2)
#define BOARD_LED3_BIT (1 << BOARD_LED3)
/* 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
* events as follows:
*
*
* SYMBOL Meaning LED state
* Red Green Blue
* ---------------------- -------------------------- ------ ------ ----*/
#define LED_STARTED 0
/* NuttX has been started OFF OFF OFF */
#define LED_HEAPALLOCATE 1
/* Heap has been allocated OFF OFF ON */
#define LED_IRQSENABLED 2
/* Interrupts enabled OFF ON OFF */
#define LED_STACKCREATED 3
/* Idle stack created OFF ON ON */
#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_ASSERTION 6
/* An assertion failed GLOW N/C GLOW */
#define LED_PANIC 7
/* The system has crashed Blink OFF N/C */
#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
* is, apparently, running normally. If the Red LED is flashing at
* approximately 2Hz, then a fatal error has been detected and the system
* has halted.
*/
/* LED index values for use with board_userled() */
#define BOARD_LED1 0
#define BOARD_LED2 1
#define BOARD_LED3 2
#define BOARD_NLEDS 3
#define BOARD_LED_RED BOARD_LED1
#define BOARD_LED_GREEN BOARD_LED2
#define BOARD_LED_BLUE BOARD_LED3
/* LED bits for use with board_userled_all() */
#define BOARD_LED1_BIT (1 << BOARD_LED1)
#define BOARD_LED2_BIT (1 << BOARD_LED2)
#define BOARD_LED3_BIT (1 << BOARD_LED3)
/* 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
* events as follows:
*
*
* SYMBOL Meaning LED state
* Red Green Blue
* ---------------------- -------------------------- ------ ------ ----*/
#define LED_STARTED 0
/* NuttX has been started OFF OFF OFF */
#define LED_HEAPALLOCATE 1
/* Heap has been allocated OFF OFF ON */
#define LED_IRQSENABLED 2
/* Interrupts enabled OFF ON OFF */
#define LED_STACKCREATED 3
/* Idle stack created OFF ON ON */
#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_ASSERTION 6
/* An assertion failed GLOW N/C GLOW */
#define LED_PANIC 7
/* The system has crashed Blink OFF N/C */
#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
* is, apparently, running normally. If the Red LED is flashing at
* approximately 2Hz, then a fatal error has been detected and the system
* has halted.
*/
/* Alternate function pin selections ************************************************/
...
...
@@ -348,7 +348,7 @@
/*
* 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_TX GPIO_CAN1_TX_3
...
...
@@ -405,14 +405,14 @@
# define PROBE_6 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN14)
# define PROBE_INIT(mask) \
do { \
if ((mask)& PROBE_N(1)) { stm32_configgpio(PROBE_1); } \
if ((mask)& PROBE_N(2)) { stm32_configgpio(PROBE_2); } \
if ((mask)& PROBE_N(3)) { stm32_configgpio(PROBE_3); } \
if ((mask)& PROBE_N(4)) { stm32_configgpio(PROBE_4); } \
if ((mask)& PROBE_N(5)) { stm32_configgpio(PROBE_5); } \
if ((mask)& PROBE_N(6)) { stm32_configgpio(PROBE_6); } \
} while(0)
do { \
if ((mask)& PROBE_N(1)) { stm32_configgpio(PROBE_1); } \
if ((mask)& PROBE_N(2)) { stm32_configgpio(PROBE_2); } \
if ((mask)& PROBE_N(3)) { stm32_configgpio(PROBE_3); } \
if ((mask)& PROBE_N(4)) { stm32_configgpio(PROBE_4); } \
if ((mask)& PROBE_N(5)) { stm32_configgpio(PROBE_5); } \
if ((mask)& PROBE_N(6)) { stm32_configgpio(PROBE_6); } \
} while(0)
# define PROBE(n,s) do {stm32_gpiowrite(PROBE_##n,(s));}while(0)
# define PROBE_MARK(n) PROBE(n,false);PROBE(n,true)
...
...
This diff is collapsed.
Click to expand it.
src/drivers/boards/px4fmu-v4pro/init.c
+
7
−
0
View file @
5da93ad7
...
...
@@ -227,6 +227,13 @@ stm32_boardinitialize(void)
stm32_configgpio
(
GPIO_ADC1_IN11
);
/* BATT2_VOLTAGE_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 */
stm32_configgpio
(
GPIO_VDD_3V3_PERIPH_EN
);
stm32_configgpio
(
GPIO_VDD_5V_PERIPH_EN
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment