Skip to content

Commit

Permalink
[led] more flexibility in LED configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
gautierhattenberger authored and flixr committed May 22, 2012
1 parent 04d224c commit 831372a
Show file tree
Hide file tree
Showing 19 changed files with 216 additions and 78 deletions.
20 changes: 15 additions & 5 deletions sw/airborne/boards/beth.h
Expand Up @@ -7,27 +7,37 @@
//#define HSE_TYPE RCC_HSE_ON

/* Onboard LEDs */
#define USE_LED_1
#ifndef USE_LED_1
#define USE_LED_1 1
#endif
#define LED_1_GPIO GPIOC
#define LED_1_GPIO_CLK RCC_APB2Periph_GPIOC
#define LED_1_GPIO_PIN GPIO_Pin_12

#define USE_LED_4
#ifndef USE_LED_4
#define USE_LED_4 1
#endif
#define LED_4_GPIO GPIOA
#define LED_4_GPIO_CLK RCC_APB2Periph_GPIOA
#define LED_4_GPIO_PIN GPIO_Pin_6

#define USE_LED_5
#ifndef USE_LED_5
#define USE_LED_5 1
#endif
#define LED_5_GPIO GPIOA
#define LED_5_GPIO_CLK RCC_APB2Periph_GPIOA
#define LED_5_GPIO_PIN GPIO_Pin_7

#define USE_LED_6
#ifndef USE_LED_6
#define USE_LED_6 1
#endif
#define LED_6_GPIO GPIOB
#define LED_6_GPIO_CLK RCC_APB2Periph_GPIOB
#define LED_6_GPIO_PIN GPIO_Pin_0

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

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

#define USE_LED_2
#ifndef USE_LED_2
#define USE_LED_2 1
#endif
#define LED_2_BANK 1
#define LED_2_PIN 24

#define USE_LED_3
#ifndef USE_LED_3
#define USE_LED_3 1
#endif
#define LED_3_BANK 1
#define LED_3_PIN 23

#define USE_LED_4
#ifndef USE_LED_4
#define USE_LED_4 1
#endif
#define LED_4_BANK 1
#define LED_4_PIN 31

#define USE_LED_5
#ifndef USE_LED_5
#define USE_LED_5 1
#endif
#define LED_5_BANK 1
#define LED_5_PIN 18

#define POWER_SWITCH_LED 5

#define USE_LED_6
#ifndef USE_LED_6
#define USE_LED_6 1
#endif
#define LED_6_BANK 1
#define LED_6_PIN 22

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


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

#define USE_LED_2
#ifndef USE_LED_2
#define USE_LED_2 1
#endif
#define LED_2_BANK 1
#define LED_2_PIN 31

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

#define USE_LED_1
#ifndef USE_LED_1
#define USE_LED_1 1
#endif
#define LED_1_BANK 1
#define LED_1_PIN 18

#define USE_LED_2
#ifndef USE_LED_2
#define USE_LED_2 1
#endif
#define LED_2_BANK 1
#define LED_2_PIN 19

#define USE_LED_3
#ifndef USE_LED_3
#define USE_LED_3 1
#endif
#define LED_3_BANK 1
#define LED_3_PIN 20

Expand Down
16 changes: 12 additions & 4 deletions sw/airborne/boards/hb_1.1.h
Expand Up @@ -20,23 +20,31 @@
/* Onboard LEDs */
/* led 1 and led 2 are not seperate leds, but leds indicating the power switch status */

#define USE_LED_1
#ifndef USE_LED_1
#define USE_LED_1 1
#endif
#define LED_1_BANK 1
#define LED_1_PIN 18

#define USE_LED_2
#ifndef USE_LED_2
#define USE_LED_2 1
#endif
#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
#ifndef USE_LED_3
#define USE_LED_3 1
#endif
#define LED_3_BANK 1
#define LED_3_PIN 20

#define USE_LED_4
#ifndef USE_LED_4
#define USE_LED_4 1
#endif
#define LED_4_BANK 1
#define LED_4_PIN 25

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

/* Onboard LEDs */
#define USE_LED_1
#ifndef USE_LED_1
#define USE_LED_1 1
#endif
#define LED_STP08

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

/* Onboard LEDs */
/* red */
#define USE_LED_1
#ifndef USE_LED_1
#define USE_LED_1 1
#endif
#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 USE_LED_2
#ifndef USE_LED_2
#define USE_LED_2 1
#endif
#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 USE_LED_3
#ifndef USE_LED_3
#define USE_LED_3 1
#endif
#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 USE_LED_4
#ifndef USE_LED_4
#define USE_LED_4 1
#endif
#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 USE_LED_5
#ifndef USE_LED_5
#define USE_LED_5 1
#endif
#define LED_5_GPIO GPIOC
#define LED_5_GPIO_CLK RCC_APB2Periph_GPIOC
#define LED_5_GPIO_PIN GPIO_Pin_10
Expand Down
20 changes: 15 additions & 5 deletions sw/airborne/boards/lisa_m_2.0.h
Expand Up @@ -10,35 +10,45 @@
*/

/* red, on PA8 */
#define USE_LED_1
#ifndef USE_LED_1
#define USE_LED_1 1
#endif
#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 USE_LED_2
#ifndef USE_LED_2
#define USE_LED_2 1
#endif
#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 USE_LED_3
#ifndef USE_LED_3
#define USE_LED_3 1
#endif
#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 USE_LED_4
#ifndef USE_LED_4
#define USE_LED_4 1
#endif
#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 USE_LED_5
#ifndef USE_LED_5
#define USE_LED_5 1
#endif
#define LED_5_GPIO GPIOC
#define LED_5_GPIO_CLK RCC_APB2Periph_GPIOC
#define LED_5_GPIO_PIN GPIO_Pin_15
Expand Down
24 changes: 18 additions & 6 deletions sw/airborne/boards/logom_2.6.h
Expand Up @@ -35,31 +35,43 @@
/* Peripheral bus clock freq. */
#define PCLK (CCLK / PBSD_VAL)

#define USE_LED_1
#ifndef USE_LED_1
#define USE_LED_1 1
#endif
#define LED_1_BANK 1
#define LED_1_PIN 16

#define USE_LED_2
#ifndef USE_LED_2
#define USE_LED_2 1
#endif
#define LED_2_BANK 0
#define LED_2_PIN 2

#define USE_LED_3
#ifndef USE_LED_3
#define USE_LED_3 1
#endif
#define LED_3_BANK 0
#define LED_3_PIN 11

#define USE_LED_4
#ifndef USE_LED_4
#define USE_LED_4 1
#endif
#define LED_4_BANK 1
#define LED_4_PIN 17

#define POWER_SWITCH_LED 4

#define USE_LED_5
#ifndef USE_LED_5
#define USE_LED_5 1
#endif
#define LED_5_BANK 1
#define LED_5_PIN 18

#define CAM_SWITCH_LED 5

#define USE_LED_6
#ifndef USE_LED_6
#define USE_LED_6 1
#endif
#define LED_6_BANK 1
#define LED_6_PIN 19

Expand Down
16 changes: 12 additions & 4 deletions sw/airborne/boards/navgo_1.0.h
Expand Up @@ -18,19 +18,27 @@
#define PCLK (CCLK / PBSD_VAL)

/* Onboard LEDs */
#define USE_LED_1
#ifndef USE_LED_1
#define USE_LED_1 1
#endif
#define LED_1_BANK 0
#define LED_1_PIN 22

#define USE_LED_2
#ifndef USE_LED_2
#define USE_LED_2 1
#endif
#define LED_2_BANK 1
#define LED_2_PIN 28

#define USE_LED_3
#ifndef USE_LED_3
#define USE_LED_3 1
#endif
#define LED_3_BANK 1
#define LED_3_PIN 29

#define USE_LED_4
#ifndef USE_LED_4
#define USE_LED_4 1
#endif
#define LED_4_BANK 1
#define LED_4_PIN 30

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

#define USE_LED_1
#ifndef USE_LED_1
#define USE_LED_1 1
#endif
#define LED_1_BANK 1
#define LED_1_PIN 24

#define USE_LED_2
#ifndef USE_LED_2
#define USE_LED_2 1
#endif
#define LED_2_BANK 1
#define LED_2_PIN 23

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

/* Onboard LEDs */
#define USE_LED_1
#ifndef USE_LED_1
#define USE_LED_1 1
#endif
#define LED_1_GPIO GPIOC
#define LED_1_GPIO_CLK RCC_APB2Periph_GPIOC
#define LED_1_GPIO_PIN GPIO_Pin_12
Expand Down

0 comments on commit 831372a

Please sign in to comment.