Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
led_hw.h File Reference
#include "mcu_periph/gpio.h"
#include <libopencm3/stm32/gpio.h>
#include <libopencm3/stm32/rcc.h>
#include <BOARD_CONFIG>
#include "std.h"
+ Include dependency graph for led_hw.h:

Go to the source code of this file.

Macros

#define _LED_EVAL(i)   i
 
#define LED_GPIO(i)   _LED_EVAL(LED_ ## i ## _GPIO)
 
#define LED_GPIO_PIN(i)   _LED_EVAL(LED_ ## i ## _GPIO_PIN)
 
#define LED_GPIO_ON(i)   _LED_EVAL(LED_ ## i ## _GPIO_ON)
 
#define LED_GPIO_OFF(i)   _LED_EVAL(LED_ ## i ## _GPIO_OFF)
 
#define LED_AFIO_REMAP(i)   _LED_EVAL(LED_ ## i ## _AFIO_REMAP)
 
#define LED_INIT(i)
 
#define LED_ON(i)   LED_GPIO_ON(i)(LED_GPIO(i), LED_GPIO_PIN(i))
 
#define LED_OFF(i)   LED_GPIO_OFF(i)(LED_GPIO(i), LED_GPIO_PIN(i))
 
#define LED_TOGGLE(i)   gpio_toggle(LED_GPIO(i), LED_GPIO_PIN(i))
 
#define LED_DISABLE(i)   gpio_setup_input(LED_GPIO(i), LED_GPIO_PIN(i))
 
#define LED_PERIODIC()   {}
 

Macro Definition Documentation

◆ _LED_EVAL

#define _LED_EVAL (   i)    i

Definition at line 40 of file led_hw.h.

◆ LED_AFIO_REMAP

#define LED_AFIO_REMAP (   i)    _LED_EVAL(LED_ ## i ## _AFIO_REMAP)

Definition at line 46 of file led_hw.h.

◆ LED_DISABLE

#define LED_DISABLE (   i)    gpio_setup_input(LED_GPIO(i), LED_GPIO_PIN(i))

Definition at line 58 of file led_hw.h.

◆ LED_GPIO

#define LED_GPIO (   i)    _LED_EVAL(LED_ ## i ## _GPIO)

Definition at line 42 of file led_hw.h.

◆ LED_GPIO_OFF

#define LED_GPIO_OFF (   i)    _LED_EVAL(LED_ ## i ## _GPIO_OFF)

Definition at line 45 of file led_hw.h.

◆ LED_GPIO_ON

#define LED_GPIO_ON (   i)    _LED_EVAL(LED_ ## i ## _GPIO_ON)

Definition at line 44 of file led_hw.h.

◆ LED_GPIO_PIN

#define LED_GPIO_PIN (   i)    _LED_EVAL(LED_ ## i ## _GPIO_PIN)

Definition at line 43 of file led_hw.h.

◆ LED_INIT

#define LED_INIT (   i)
Value:
{ \
gpio_setup_output(LED_GPIO(i), LED_GPIO_PIN(i)); \
LED_AFIO_REMAP(i); \
}
#define LED_GPIO_PIN(i)
Definition: led_hw.h:43
#define LED_GPIO(i)
Definition: led_hw.h:42

Definition at line 49 of file led_hw.h.

◆ LED_OFF

#define LED_OFF (   i)    LED_GPIO_OFF(i)(LED_GPIO(i), LED_GPIO_PIN(i))

Definition at line 55 of file led_hw.h.

◆ LED_ON

#define LED_ON (   i)    LED_GPIO_ON(i)(LED_GPIO(i), LED_GPIO_PIN(i))

Definition at line 54 of file led_hw.h.

◆ LED_PERIODIC

#define LED_PERIODIC ( )    {}

Definition at line 60 of file led_hw.h.

◆ LED_TOGGLE

#define LED_TOGGLE (   i)    gpio_toggle(LED_GPIO(i), LED_GPIO_PIN(i))

Definition at line 56 of file led_hw.h.