diff options
author | Paul Selkirk <paul@psgd.org> | 2015-10-26 15:18:58 -0400 |
---|---|---|
committer | Paul Selkirk <paul@psgd.org> | 2015-10-26 15:18:58 -0400 |
commit | 26f12903dab2fafeaaefb02349763618ce96d070 (patch) | |
tree | b37cceea7014770ea2ae039928e57b6f02c0aaa2 /include/stm-led.h |
Based on user/ft/stm32-dev-bridge, without the project-specific build
directories (and duplicated code).
Diffstat (limited to 'include/stm-led.h')
-rw-r--r-- | include/stm-led.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/stm-led.h b/include/stm-led.h new file mode 100644 index 0000000..bd2a1e3 --- /dev/null +++ b/include/stm-led.h @@ -0,0 +1,16 @@ +#ifndef __STM_LED_H +#define __STM_LED_H + +#include "stm32f4xx_hal.h" + +#define LED_PORT GPIOJ +#define LED_RED GPIO_PIN_1 +#define LED_YELLOW GPIO_PIN_2 +#define LED_GREEN GPIO_PIN_3 +#define LED_BLUE GPIO_PIN_4 + +#define led_on(pin) HAL_GPIO_WritePin(LED_PORT,pin,SET) +#define led_off(pin) HAL_GPIO_WritePin(LED_PORT,pin,RESET) +#define led_toggle(pin) HAL_GPIO_TogglePin(LED_PORT,pin) + +#endif /* __STM_LED_H */ |