Paparazzi UAS  v4.0.4_stable-3-gf39211a
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
led_hw.h File Reference
#include <stm32/gpio.h>
#include <stm32/rcc.h>
#include "std.h"
+ Include dependency graph for led_hw.h:

Go to the source code of this file.

Macros

#define _LED_GPIO_CLK(i)   i
 
#define _LED_GPIO(i)   i
 
#define _LED_GPIO_PIN(i)   i
 
#define _LED_AFIO_REMAP(i)   i
 
#define LED_GPIO_CLK(i)   _LED_GPIO_CLK(LED_ ## i ## _GPIO_CLK)
 
#define LED_GPIO(i)   _LED_GPIO(LED_ ## i ## _GPIO)
 
#define LED_GPIO_PIN(i)   _LED_GPIO_PIN(LED_ ## i ## _GPIO_PIN)
 
#define LED_AFIO_REMAP(i)   _LED_AFIO_REMAP(LED_ ## i ## _AFIO_REMAP)
 
#define LED_INIT(i)
 
#define LED_ON(i)   {LED_GPIO(i)->BRR = LED_GPIO_PIN(i);}
 
#define LED_OFF(i)   { LED_GPIO(i)->BSRR = LED_GPIO_PIN(i);}
 
#define LED_TOGGLE(i)   { LED_GPIO(i)->ODR ^= LED_GPIO_PIN(i);}
 
#define LED_PERIODIC()   {}
 

Macro Definition Documentation

#define _LED_AFIO_REMAP (   i)    i

Definition at line 45 of file led_hw.h.

#define _LED_GPIO (   i)    i

Definition at line 43 of file led_hw.h.

#define _LED_GPIO_CLK (   i)    i

Definition at line 42 of file led_hw.h.

#define _LED_GPIO_PIN (   i)    i

Definition at line 44 of file led_hw.h.

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

Definition at line 50 of file led_hw.h.

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

Definition at line 48 of file led_hw.h.

#define LED_GPIO_CLK (   i)    _LED_GPIO_CLK(LED_ ## i ## _GPIO_CLK)

Definition at line 47 of file led_hw.h.

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

Definition at line 49 of file led_hw.h.

#define LED_INIT (   i)
Value:
{ \
GPIO_InitTypeDef GPIO_InitStructure; \
RCC_APB2PeriphClockCmd(LED_GPIO_CLK(i), ENABLE); \
GPIO_InitStructure.GPIO_Pin = LED_GPIO_PIN(i); \
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; \
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; \
GPIO_Init(LED_GPIO(i), &GPIO_InitStructure); \
}
#define LED_AFIO_REMAP(i)
Definition: led_hw.h:50
#define LED_GPIO(i)
Definition: led_hw.h:48
#define LED_GPIO_PIN(i)
Definition: led_hw.h:49
#define LED_GPIO_CLK(i)
Definition: led_hw.h:47

Definition at line 53 of file led_hw.h.

#define LED_OFF (   i)    { LED_GPIO(i)->BSRR = LED_GPIO_PIN(i);}

Definition at line 64 of file led_hw.h.

#define LED_ON (   i)    {LED_GPIO(i)->BRR = LED_GPIO_PIN(i);}

Definition at line 63 of file led_hw.h.

#define LED_PERIODIC ( )    {}

Definition at line 67 of file led_hw.h.

#define LED_TOGGLE (   i)    { LED_GPIO(i)->ODR ^= LED_GPIO_PIN(i);}

Definition at line 65 of file led_hw.h.