19 #include "i2cspmconfig.h"
45 EFM_ASSERT(init != NULL);
60 else if (init->
port == I2C1)
62 i2cClock = cmuClock_I2C1;
81 for (i = 0; i < 9; i++)
88 #if defined (_I2C_ROUTEPEN_MASK)
89 init->
port->ROUTEPEN = I2C_ROUTEPEN_SDAPEN | I2C_ROUTEPEN_SCLPEN;
90 init->
port->ROUTELOC0 = (init->portLocationSda << _I2C_ROUTELOC0_SDALOC_SHIFT)
91 | (init->portLocationScl << _I2C_ROUTELOC0_SCLLOC_SHIFT);
127 uint32_t timeout = I2CSPM_TRANSFER_TIMEOUT;
Clock management unit (CMU) API.
I2C_TransferReturn_TypeDef I2CSPM_Transfer(I2C_TypeDef *i2c, I2C_TransferSeq_TypeDef *seq)
Perform I2C transfer.
Emlib peripheral API "assert" implementation.
GPIO_Port_TypeDef sclPort
void I2CSPM_Init(I2CSPM_Init_TypeDef *init)
Initalize I2C peripheral.
I2C_TransferReturn_TypeDef I2C_TransferInit(I2C_TypeDef *i2c, I2C_TransferSeq_TypeDef *seq)
Prepare and start an I2C transfer (single master mode only).
GPIO_Port_TypeDef sdaPort
#define _I2C_ROUTE_LOCATION_SHIFT
I2C_TransferReturn_TypeDef
I2C_ClockHLR_TypeDef i2cClhr
void GPIO_PinModeSet(GPIO_Port_TypeDef port, unsigned int pin, GPIO_Mode_TypeDef mode, unsigned int out)
Set the mode for a GPIO pin.
I2C_ClockHLR_TypeDef clhr
void I2C_Init(I2C_TypeDef *i2c, const I2C_Init_TypeDef *init)
Initialize I2C.
General Purpose IO (GPIO) peripheral API.
I2C simple poll-based master mode driver for the DK/STK.
__STATIC_INLINE void GPIO_PinOutSet(GPIO_Port_TypeDef port, unsigned int pin)
Set a single pin in GPIO data out register to 1.
void CMU_ClockEnable(CMU_Clock_TypeDef clock, bool enable)
Enable/disable a clock.
Master mode transfer message structure used to define a complete I2C transfer sequence (from start to...
__STATIC_INLINE void GPIO_PinOutClear(GPIO_Port_TypeDef port, unsigned int pin)
Set a single pin in GPIO data out port register to 0.
I2C_TransferReturn_TypeDef I2C_Transfer(I2C_TypeDef *i2c)
Continue an initiated I2C transfer (single master mode only).