1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

boards/qn9080dk: Enable driver for I2C0

The QN9080DK board can expose the I2C bus SDA and SCL in the pins
labeled D14 and D15 respectively in the J5 headers, and in the Pmod (J8)
connector in the pins 10 and 9 of the header respectively.

The bus has a 2K2 pull up resistor on each line when SB7 and SB8 (next
to the Pmod connector) are closed, which is the factory default.
This commit is contained in:
iosabi 2020-12-19 13:37:51 +00:00
parent 70113b5fd3
commit 5f78519b29
4 changed files with 29 additions and 1 deletions

View File

@ -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"

View File

@ -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

View File

@ -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
*/

View File

@ -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