diff --git a/boards/qn9080dk/Kconfig b/boards/qn9080dk/Kconfig index 9dde9a2d30..da1a0ec8eb 100644 --- a/boards/qn9080dk/Kconfig +++ b/boards/qn9080dk/Kconfig @@ -19,6 +19,7 @@ config BOARD_QN9080DK select BOARD_HAS_XTAL_32M select HAS_PERIPH_TIMER select HAS_PERIPH_UART + select HAS_PERIPH_I2C select HAS_PERIPH_UART_MODECFG source "$(RIOTBOARD)/common/qn908x/Kconfig" diff --git a/boards/qn9080dk/Makefile.features b/boards/qn9080dk/Makefile.features index 81ce8c8757..4337aa8c92 100644 --- a/boards/qn9080dk/Makefile.features +++ b/boards/qn9080dk/Makefile.features @@ -3,6 +3,7 @@ CPU_MODEL = qn9080xhn # Put defined MCU peripherals here (in alphabetical order) FEATURES_PROVIDED += periph_gpio periph_gpio_irq +FEATURES_PROVIDED += periph_i2c FEATURES_PROVIDED += periph_timer FEATURES_PROVIDED += periph_uart periph_uart_modecfg diff --git a/boards/qn9080dk/include/board.h b/boards/qn9080dk/include/board.h index 421536c7c7..df047bcbe7 100644 --- a/boards/qn9080dk/include/board.h +++ b/boards/qn9080dk/include/board.h @@ -56,6 +56,18 @@ extern "C" { #define BTN2_MODE GPIO_IN_PU /** @} */ +/** + * @name MMA8652FC 3-axis accelerometer bus configuration + * + * The MMA8652FC in the QN9080DK is only available when JP11 is shorted (the + * factory default). + * @{ + */ +#define MMA8X5X_PARAM_I2C I2C_DEV(0) +#define MMA8X5X_PARAM_ADDR 0x1D +#define MMA8X5X_PARAM_TYPE (MMA8X5X_TYPE_MMA8652) +/** @} */ + /** * @brief Initialize board specific hardware */ diff --git a/boards/qn9080dk/include/periph_conf.h b/boards/qn9080dk/include/periph_conf.h index 3687ba5a5b..1d55e0be1f 100644 --- a/boards/qn9080dk/include/periph_conf.h +++ b/boards/qn9080dk/include/periph_conf.h @@ -28,6 +28,21 @@ extern "C" { #endif +/** + * @name I2C configuration + * @{ + */ +static const i2c_conf_t i2c_config[] = { + { + .dev = I2C1, + .pin_scl = GPIO_PIN(PORT_A, 6), + .pin_sda = GPIO_PIN(PORT_A, 7), + .speed = I2C_SPEED_FAST, + }, +}; +#define I2C_NUMOF ARRAY_SIZE(i2c_config) +/** @} */ + /** * @name UART configuration * @{ @@ -54,7 +69,6 @@ static const uart_conf_t uart_config[] = { - Available clocks - PWMs - SPIs - - I2C - ADC - RTC - RTT