diff options
-rw-r--r-- | board/hadoken/board.c | 8 | ||||
-rw-r--r-- | board/hadoken/board.h | 15 |
2 files changed, 23 insertions, 0 deletions
diff --git a/board/hadoken/board.c b/board/hadoken/board.c index 895974efee..24c71882e5 100644 --- a/board/hadoken/board.c +++ b/board/hadoken/board.c @@ -4,9 +4,17 @@ */ #include "gpio.h" #include "registers.h" +#include "i2c.h" #include "util.h" /* To define the gpio_list[] instance. */ #include "gpio_list.h" +/* I2C ports */ +const struct i2c_port_t i2c_ports[] = { + {"master", 0 /*Port*/, 100 /*Kbps*/, GPIO_MCU_SCL, GPIO_MCU_SDA}, +}; + +const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); + diff --git a/board/hadoken/board.h b/board/hadoken/board.h index feb27e668d..db6e53b187 100644 --- a/board/hadoken/board.h +++ b/board/hadoken/board.h @@ -15,6 +15,8 @@ #undef CONFIG_WATCHDOG #undef CONFIG_LID_SWITCH +#define CONFIG_I2C +#define CONFIG_I2C_DEBUG /* * nRF51 board specific configuration. @@ -22,6 +24,19 @@ #define NRF51_UART_TX_PIN 25 #define NRF51_UART_RX_PIN 29 +#define NRF51_TWI_PORT 0 +#define NRF51_TWI0_SCL_PIN 23 +#define NRF51_TWI0_SDA_PIN 22 + +#define NRF51_TWI0_SCL_GPIO MCU_SCL +#define NRF51_TWI0_SDA_GPIO MCU_SDA + +#define NRF51_TWI_SCL_PIN(port) NRF51_TWI0_SCL_PIN +#define NRF51_TWI_SDA_PIN(port) NRF51_TWI0_SDA_PIN +#define NRF51_TWI_FREQ(port) NRF51_TWI_100KBPS +#define NRF51_TWI_PPI_CHAN(port) 0 + + #include "gpio_signal.h" #endif /* !__ASSEMBLER__ */ |