41 #if BOARD == BOARD_LPCXPRESSO1347
63 BOARD_BUTTON_COUNT =
sizeof(buttons) /
sizeof(buttons[0])
71 #if TUSB_CFG_OS == TUSB_OS_NONE // TODO may move to main.c
78 GPIOSetDir(LED_PORT, LED_PIN, 1);
81 for(uint8_t i=0; i<BOARD_BUTTON_COUNT; i++) GPIOSetDir(buttons[i].port,
BIT_(buttons[i].pin), 0);
91 void board_leds(uint32_t on_mask, uint32_t off_mask)
93 if (on_mask &
BIT_(0))
95 GPIOSetBitValue(LED_PORT, LED_PIN, LED_ON);
96 }
else if (off_mask &
BIT_(0))
98 GPIOSetBitValue(LED_PORT, LED_PIN, LED_OFF);
105 static bool button_read(uint8_t
id)
107 return !GPIOGetPinValue(buttons[
id].port, buttons[
id].pin);
114 for(uint8_t i=0; i<BOARD_BUTTON_COUNT; i++) result |= (button_read(i) ?
BIT_(i) : 0);
void board_init(void)
Initialize all required peripherals on board including uart, led, buttons etc ... ...
void board_leds(uint32_t on_mask, uint32_t off_mask)
Turns on and off leds on the board.
uint32_t board_buttons(void)
Get the current state of the buttons on the board.
void board_uart_putchar(uint8_t c)
Send a character to UART.
#define TUSB_CFG_TICKS_HZ
The rate ticks in hert. This is used in conjunction with tusb_tick_get to calculate timing...
uint8_t board_uart_getchar(void)
Get a character input from UART.
#define CFG_UART_BAUDRATE
Baudrate for UART.