Skip to content

Commit

Permalink
[led] LEDs are automatically initialized if USE_LED_X is defined
Browse files Browse the repository at this point in the history
  • Loading branch information
gautierhattenberger authored and flixr committed May 22, 2012
1 parent 8db733c commit 04d224c
Show file tree
Hide file tree
Showing 19 changed files with 103 additions and 43 deletions.
10 changes: 5 additions & 5 deletions sw/airborne/boards/beth.h
Expand Up @@ -7,27 +7,27 @@
//#define HSE_TYPE RCC_HSE_ON

/* Onboard LEDs */
#define LED_1_BANK
#define USE_LED_1
#define LED_1_GPIO GPIOC
#define LED_1_GPIO_CLK RCC_APB2Periph_GPIOC
#define LED_1_GPIO_PIN GPIO_Pin_12

#define LED_4_BANK
#define USE_LED_4
#define LED_4_GPIO GPIOA
#define LED_4_GPIO_CLK RCC_APB2Periph_GPIOA
#define LED_4_GPIO_PIN GPIO_Pin_6

#define LED_5_BANK
#define USE_LED_5
#define LED_5_GPIO GPIOA
#define LED_5_GPIO_CLK RCC_APB2Periph_GPIOA
#define LED_5_GPIO_PIN GPIO_Pin_7

#define LED_6_BANK
#define USE_LED_6
#define LED_6_GPIO GPIOB
#define LED_6_GPIO_CLK RCC_APB2Periph_GPIOB
#define LED_6_GPIO_PIN GPIO_Pin_0

#define LED_7_BANK
#define USE_LED_7
#define LED_7_GPIO GPIOB
#define LED_7_GPIO_CLK RCC_APB2Periph_GPIOB
#define LED_7_GPIO_PIN GPIO_Pin_1
Expand Down
6 changes: 6 additions & 0 deletions sw/airborne/boards/booz_1.0.h
Expand Up @@ -18,23 +18,29 @@
#define PCLK (CCLK / PBSD_VAL)

/* Onboard LEDs */
#define USE_LED_1
#define LED_1_BANK 1
#define LED_1_PIN 25

#define USE_LED_2
#define LED_2_BANK 1
#define LED_2_PIN 24

#define USE_LED_3
#define LED_3_BANK 1
#define LED_3_PIN 23

#define USE_LED_4
#define LED_4_BANK 1
#define LED_4_PIN 31

#define USE_LED_5
#define LED_5_BANK 1
#define LED_5_PIN 18

#define POWER_SWITCH_LED 5

#define USE_LED_6
#define LED_6_BANK 1
#define LED_6_PIN 22

Expand Down
5 changes: 5 additions & 0 deletions sw/airborne/boards/classix_1.0.h
Expand Up @@ -16,9 +16,11 @@


#ifdef FBW
#define USE_LED_1
#define LED_1_BANK 1
#define LED_1_PIN 24

#define USE_LED_2
#define LED_2_BANK 1
#define LED_2_PIN 31

Expand Down Expand Up @@ -69,12 +71,15 @@
/* sitl handles this board as a mono-processor one: unfortunately these
definitions are already in FBW */

#define USE_LED_1
#define LED_1_BANK 1
#define LED_1_PIN 18

#define USE_LED_2
#define LED_2_BANK 1
#define LED_2_PIN 19

#define USE_LED_3
#define LED_3_BANK 1
#define LED_3_PIN 20

Expand Down
5 changes: 5 additions & 0 deletions sw/airborne/boards/hb_1.1.h
Expand Up @@ -19,19 +19,24 @@

/* Onboard LEDs */
/* led 1 and led 2 are not seperate leds, but leds indicating the power switch status */

#define USE_LED_1
#define LED_1_BANK 1
#define LED_1_PIN 18

#define USE_LED_2
#define LED_2_BANK 1
#define LED_2_PIN 19

#define POWER_SWITCH_LED 1
#define POWER_SWITCH_2_LED 2

/* there are no actual leds 3 and 4, these defines are just to conveniently switch the buzzer and the cam switch */
#define USE_LED_3
#define LED_3_BANK 1
#define LED_3_PIN 20

#define USE_LED_4
#define LED_4_BANK 1
#define LED_4_PIN 25

Expand Down
2 changes: 1 addition & 1 deletion sw/airborne/boards/lisa_l_1.0.h
Expand Up @@ -11,7 +11,7 @@
#define STM32_PLL_MULT RCC_PLLMul_9

/* Onboard LEDs */
#define LED_1_BANK
#define USE_LED_1
#define LED_STP08

// FIXME, this is just to make it compile
Expand Down
10 changes: 5 additions & 5 deletions sw/airborne/boards/lisa_m_1.0.h
Expand Up @@ -7,34 +7,34 @@

/* Onboard LEDs */
/* red */
#define LED_1_BANK
#define USE_LED_1
#define LED_1_GPIO GPIOB
#define LED_1_GPIO_CLK RCC_APB2Periph_GPIOB | RCC_APB2Periph_AFIO
#define LED_1_GPIO_PIN GPIO_Pin_4
#define LED_1_AFIO_REMAP GPIO_PinRemapConfig(GPIO_Remap_SWJ_NoJTRST, ENABLE)

/* blue */
#define LED_2_BANK
#define USE_LED_2
#define LED_2_GPIO GPIOC
#define LED_2_GPIO_CLK RCC_APB2Periph_GPIOC
#define LED_2_GPIO_PIN GPIO_Pin_5
#define LED_2_AFIO_REMAP ((void)0)

/* blue */
#define LED_3_BANK
#define USE_LED_3
#define LED_3_GPIO GPIOC
#define LED_3_GPIO_CLK RCC_APB2Periph_GPIOC
#define LED_3_GPIO_PIN GPIO_Pin_2
#define LED_3_AFIO_REMAP ((void)0)

// GPIO pins
#define LED_4_BANK
#define USE_LED_4
#define LED_4_GPIO GPIOC
#define LED_4_GPIO_CLK RCC_APB2Periph_GPIOC
#define LED_4_GPIO_PIN GPIO_Pin_12
#define LED_4_AFIO_REMAP ((void)0)

#define LED_5_BANK
#define USE_LED_5
#define LED_5_GPIO GPIOC
#define LED_5_GPIO_CLK RCC_APB2Periph_GPIOC
#define LED_5_GPIO_PIN GPIO_Pin_10
Expand Down
14 changes: 5 additions & 9 deletions sw/airborne/boards/lisa_m_2.0.h
Expand Up @@ -10,35 +10,35 @@
*/

/* red, on PA8 */
#define LED_1_BANK
#define USE_LED_1
#define LED_1_GPIO GPIOA
#define LED_1_GPIO_CLK RCC_APB2Periph_GPIOA
#define LED_1_GPIO_PIN GPIO_Pin_8
#define LED_1_AFIO_REMAP ((void)0)

/* green, shared with JTAG_TRST */
#define LED_2_BANK
#define USE_LED_2
#define LED_2_GPIO GPIOB
#define LED_2_GPIO_CLK RCC_APB2Periph_GPIOB | RCC_APB2Periph_AFIO
#define LED_2_GPIO_PIN GPIO_Pin_4
#define LED_2_AFIO_REMAP GPIO_PinRemapConfig(GPIO_Remap_SWJ_NoJTRST, ENABLE)

/* green, shared with ADC12 (ADC_6 on connector ANALOG2) */
#define LED_3_BANK
#define USE_LED_3
#define LED_3_GPIO GPIOC
#define LED_3_GPIO_CLK RCC_APB2Periph_GPIOC
#define LED_3_GPIO_PIN GPIO_Pin_2
#define LED_3_AFIO_REMAP ((void)0)

/* red, shared with ADC15 (ADC_4 on connector ANALOG2) */
#define LED_4_BANK
#define USE_LED_4
#define LED_4_GPIO GPIOC
#define LED_4_GPIO_CLK RCC_APB2Periph_GPIOC
#define LED_4_GPIO_PIN GPIO_Pin_5
#define LED_4_AFIO_REMAP ((void)0)

/* green, on PC15 */
#define LED_5_BANK
#define USE_LED_5
#define LED_5_GPIO GPIOC
#define LED_5_GPIO_CLK RCC_APB2Periph_GPIOC
#define LED_5_GPIO_PIN GPIO_Pin_15
Expand All @@ -48,21 +48,18 @@
* LEDs not populated by default
*/
/* PC3, ADC13 on ADC_1 */
#define LED_6_BANK
#define LED_6_GPIO GPIOC
#define LED_6_GPIO_CLK RCC_APB2Periph_GPIOC
#define LED_6_GPIO_PIN GPIO_Pin_3
#define LED_6_AFIO_REMAP ((void)0)

/* PC0, ADC10 on ADC_2 */
#define LED_7_BANK
#define LED_7_GPIO GPIOC
#define LED_7_GPIO_CLK RCC_APB2Periph_GPIOC
#define LED_7_GPIO_PIN GPIO_Pin_0
#define LED_7_AFIO_REMAP ((void)0)

/* PC1, ADC11 on ADC_3 */
#define LED_8_BANK
#define LED_8_GPIO GPIOC
#define LED_8_GPIO_CLK RCC_APB2Periph_GPIOC
#define LED_8_GPIO_PIN GPIO_Pin_1
Expand All @@ -74,7 +71,6 @@
*/

/* PC12, on GPIO connector*/
#define LED_12_BANK
#define LED_12_GPIO GPIOC
#define LED_12_GPIO_CLK RCC_APB2Periph_GPIOC
#define LED_12_GPIO_PIN GPIO_Pin_12
Expand Down
12 changes: 10 additions & 2 deletions sw/airborne/boards/logom_2.6.h
Expand Up @@ -35,27 +35,35 @@
/* Peripheral bus clock freq. */
#define PCLK (CCLK / PBSD_VAL)

#define USE_LED_1
#define LED_1_BANK 1
#define LED_1_PIN 16

#define USE_LED_2
#define LED_2_BANK 0
#define LED_2_PIN 2

#define USE_LED_3
#define LED_3_BANK 0
#define LED_3_PIN 11

#define USE_LED_4
#define LED_4_BANK 1
#define LED_4_PIN 17

#define POWER_SWITCH_LED 4

#define USE_LED_5
#define LED_5_BANK 1
#define LED_5_PIN 18

#define CAM_SWITCH_LED 5

#define LED_GPS_RESET_BANK 1
#define LED_GPS_RESET_PIN 19
#define USE_LED_6
#define LED_6_BANK 1
#define LED_6_PIN 19

#define GPS_RESET 6

#define Configure_GPS_RESET_Pin() LED_INIT(GPS_RESET)
#define Set_GPS_RESET_Pin_LOW() LED_ON(GPS_RESET)
Expand Down
4 changes: 4 additions & 0 deletions sw/airborne/boards/navgo_1.0.h
Expand Up @@ -18,15 +18,19 @@
#define PCLK (CCLK / PBSD_VAL)

/* Onboard LEDs */
#define USE_LED_1
#define LED_1_BANK 0
#define LED_1_PIN 22

#define USE_LED_2
#define LED_2_BANK 1
#define LED_2_PIN 28

#define USE_LED_3
#define LED_3_BANK 1
#define LED_3_PIN 29

#define USE_LED_4
#define LED_4_BANK 1
#define LED_4_PIN 30

Expand Down
2 changes: 2 additions & 0 deletions sw/airborne/boards/olimex_lpc_h2148.h
Expand Up @@ -13,9 +13,11 @@
/* Peripheral bus clock freq. */
#define PCLK (CCLK / PBSD_VAL)

#define USE_LED_1
#define LED_1_BANK 1
#define LED_1_PIN 24

#define USE_LED_2
#define LED_2_BANK 1
#define LED_2_PIN 23

Expand Down
2 changes: 1 addition & 1 deletion sw/airborne/boards/olimex_stm32-h103.h
Expand Up @@ -8,7 +8,7 @@
//#define HSE_TYPE RCC_HSE_ON

/* Onboard LEDs */
#define LED_1_BANK
#define USE_LED_1
#define LED_1_GPIO GPIOC
#define LED_1_GPIO_CLK RCC_APB2Periph_GPIOC
#define LED_1_GPIO_PIN GPIO_Pin_12
Expand Down
12 changes: 10 additions & 2 deletions sw/airborne/boards/sdlog_1.0.h
Expand Up @@ -39,27 +39,35 @@
/* Peripheral bus clock freq. */
#define PCLK (CCLK / PBSD_VAL)

#define USE_LED_1
#define LED_1_BANK 1
#define LED_1_PIN 17

#define USE_LED_2
#define LED_2_BANK 1
#define LED_2_PIN 16

#define USE_LED_3
#define LED_3_BANK 1
#define LED_3_PIN 23

#define USE_LED_4
#define LED_4_BANK 1
#define LED_4_PIN 18

#define POWER_SWITCH_LED 4

#define USE_LED_5
#define LED_5_BANK 1
#define LED_5_PIN 22

#define CAM_SWITCH_LED 5

#define LED_GPS_RESET_BANK 1
#define LED_GPS_RESET_PIN 21
#define USE_LED_6
#define LED_6_BANK 1
#define LED_6_PIN 21

#define GPS_RESET 6

#define Configure_GPS_RESET_Pin() LED_INIT(GPS_RESET)
#define Set_GPS_RESET_Pin_LOW() LED_ON(GPS_RESET)
Expand Down
2 changes: 2 additions & 0 deletions sw/airborne/boards/tiny_0.99.h
Expand Up @@ -23,9 +23,11 @@
/* Peripheral bus clock freq. */
#define PCLK (CCLK / PBSD_VAL)

#define USE_LED_1
#define LED_1_BANK 1
#define LED_1_PIN 28

#define USE_LED_2
#define LED_2_BANK 1
#define LED_2_PIN 19

Expand Down
3 changes: 3 additions & 0 deletions sw/airborne/boards/tiny_1.1.h
Expand Up @@ -25,13 +25,16 @@
#define PCLK (CCLK / PBSD_VAL)

/* Onboard leds */
#define USE_LED_1
#define LED_1_BANK 1
#define LED_1_PIN 28

#define USE_LED_2
#define LED_2_BANK 1
#define LED_2_PIN 19

/* Switch pin */
#define USE_LED_3
#define LED_3_BANK 0
#define LED_3_PIN 11

Expand Down

0 comments on commit 04d224c

Please sign in to comment.