diff --git a/demos/bsp/boards/embedded_artists/ea4357/board_ea4357.c b/demos/bsp/boards/embedded_artists/ea4357/board_ea4357.c index c76b94bd..f65e46b6 100644 --- a/demos/bsp/boards/embedded_artists/ea4357/board_ea4357.c +++ b/demos/bsp/boards/embedded_artists/ea4357/board_ea4357.c @@ -40,12 +40,31 @@ #if BOARD == BOARD_EA4357 - #define BOARD_UART_PORT LPC_USART0 #define BOARD_UART_PIN_PORT 0x0f #define BOARD_UART_PIN_TX 10 // PF.10 : UART0_TXD #define BOARD_UART_PIN_RX 11 // PF.11 : UART0_RXD +const static struct { + uint8_t mux_port; + uint8_t mux_pin; + + uint8_t gpio_port; + uint8_t gpio_pin; +}buttons[] = +{ + {0x0a, 3, 4, 10 }, // Joystick up + {0x09, 1, 4, 13 }, // Joystick down + {0x0a, 2, 4, 9 }, // Joystick left + {0x09, 0, 4, 12 }, // Joystick right + {0x0a, 1, 4, 8 }, // Joystick press + {0x02, 7, 0, 7 }, // SW6 +}; + +enum { + BOARD_BUTTON_COUNT = sizeof(buttons) / sizeof(buttons[0]) +}; + void board_init(void) { CGU_Init(); @@ -66,7 +85,13 @@ void board_init(void) I2C_Cmd(LPC_I2C0, ENABLE); pca9532_init(); -#if CFG_UART_ENABLE + //------------- BUTTON -------------// + for(uint8_t i=0; i - - -