diff options
| author | hathach <[email protected]> | 2018-11-14 13:28:39 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2018-11-14 13:28:39 +0700 |
| commit | eea1f8597e190307d2b058e2d343cf65daec152f (patch) | |
| tree | 5e052c792b48c531b8dc7bad4cb51fa33966da0d | |
| parent | 4b1f4c7b6f01a4a0a2da6218958f381674e7f52c (diff) | |
added board led for metro m4
| -rw-r--r-- | hw/bsp/metro_m4_express/board_metro_m4_express.c | 12 | ||||
| -rw-r--r-- | hw/bsp/metro_m4_express/board_metro_m4_express.h | 2 | ||||
| -rw-r--r-- | hw/bsp/pca10056/board_pca10056.c | 2 |
3 files changed, 12 insertions, 4 deletions
diff --git a/hw/bsp/metro_m4_express/board_metro_m4_express.c b/hw/bsp/metro_m4_express/board_metro_m4_express.c index 0838dd2ac..78a72327c 100644 --- a/hw/bsp/metro_m4_express/board_metro_m4_express.c +++ b/hw/bsp/metro_m4_express/board_metro_m4_express.c @@ -36,12 +36,22 @@ */ /**************************************************************************/ +#include "bsp/board.h" +#include "hal/include/hal_gpio.h" + //--------------------------------------------------------------------+ // MACRO TYPEDEF CONSTANT ENUM DECLARATION //--------------------------------------------------------------------+ - +#define LED_STATE_ON 1 void board_init(void) { + gpio_set_pin_direction(BOARD_LED0, GPIO_DIRECTION_OUT); + gpio_set_pin_level(BOARD_LED0, 1-LED_STATE_ON); +} +void board_led_control(uint32_t led_id, bool state) +{ + gpio_set_pin_level(led_id, state ? LED_STATE_ON : (1-LED_STATE_ON)); } + diff --git a/hw/bsp/metro_m4_express/board_metro_m4_express.h b/hw/bsp/metro_m4_express/board_metro_m4_express.h index 226e52382..a50d71b16 100644 --- a/hw/bsp/metro_m4_express/board_metro_m4_express.h +++ b/hw/bsp/metro_m4_express/board_metro_m4_express.h @@ -43,7 +43,7 @@ #endif #define BOARD_LED_NUM 1 -#define BOARD_LED0 13 +#define BOARD_LED0 16 #ifdef __cplusplus } diff --git a/hw/bsp/pca10056/board_pca10056.c b/hw/bsp/pca10056/board_pca10056.c index cef272447..e34ed27fa 100644 --- a/hw/bsp/pca10056/board_pca10056.c +++ b/hw/bsp/pca10056/board_pca10056.c @@ -47,8 +47,6 @@ /* MACRO TYPEDEF CONSTANT ENUM *------------------------------------------------------------------*/ #define LED_STATE_ON 0 -#define LED_STATE_OFF (1-LED_STATE_ON) - uint8_t _button_pins[] = { 11, 12, 24, 25 }; |
