37 #if defined(I2C_COUNT) && (I2C_COUNT > 0)
71 #if defined(_SILICON_LABS_32B_SERIES_0) \
72 && (defined(_EFM32_GECKO_FAMILY) \
73 || defined(_EFM32_TINY_FAMILY) \
74 || defined(_EFM32_ZERO_FAMILY) \
75 || defined(_EFM32_HAPPY_FAMILY))
76 #define I2C_FREQ_STANDARD_MAX 93000
77 #elif defined(_SILICON_LABS_32B_SERIES_0) \
78 && (defined(_EFM32_GIANT_FAMILY) \
79 || defined(_EFM32_WONDER_FAMILY))
80 #define I2C_FREQ_STANDARD_MAX 92000
81 #elif defined(_SILICON_LABS_32B_SERIES_1)
84 #define I2C_FREQ_STANDARD_MAX 92000
86 #error "Unknown device family."
99 #define I2C_FREQ_FAST_MAX 392157
112 #define I2C_FREQ_FASTPLUS_MAX 987167
124 #define I2C_FLAG_WRITE 0x0001
135 #define I2C_FLAG_READ 0x0002
148 #define I2C_FLAG_WRITE_READ 0x0004
159 #define I2C_FLAG_WRITE_WRITE 0x0008
162 #define I2C_FLAG_10BIT_ADDR 0x0010
227 #define I2C_INIT_DEFAULT \
232 I2C_FREQ_STANDARD_MAX, \
234 i2cClockHLRStandard \
330 i2c->
IEN &= ~(flags);
398 return i2c->
IF & ien;
439 return ((uint8_t)(i2c->
SADDR));
462 i2c->
SADDR = (uint32_t)addr & 0xfe;
I2C_TransferReturn_TypeDef I2C_TransferInit(I2C_TypeDef *i2c, I2C_TransferSeq_TypeDef *seq)
Prepare and start an I2C transfer (single master mode only).
__STATIC_INLINE void I2C_SlaveAddressMaskSet(I2C_TypeDef *i2c, uint8_t mask)
Set slave address mask used for I2C peripheral (when operating in slave mode).
#define _I2C_CTRL_CLHR_FAST
CMSIS Cortex-M Peripheral Access Layer for Silicon Laboratories microcontroller devices.
void I2C_Enable(I2C_TypeDef *i2c, bool enable)
Enable/disable I2C.
#define _I2C_CTRL_CLHR_ASYMMETRIC
I2C_TransferReturn_TypeDef
__STATIC_INLINE void I2C_IntSet(I2C_TypeDef *i2c, uint32_t flags)
Set one or more pending I2C interrupts from SW.
void I2C_Reset(I2C_TypeDef *i2c)
Reset I2C to same state as after a HW reset.
I2C_ClockHLR_TypeDef clhr
void I2C_Init(I2C_TypeDef *i2c, const I2C_Init_TypeDef *init)
Initialize I2C.
__STATIC_INLINE uint32_t I2C_IntGet(I2C_TypeDef *i2c)
Get pending I2C interrupt flags.
#define _I2C_CTRL_CLHR_STANDARD
__STATIC_INLINE uint32_t I2C_IntGetEnabled(I2C_TypeDef *i2c)
Get enabled and pending I2C interrupt flags. Useful for handling more interrupt sources in the same i...
__STATIC_INLINE void I2C_IntClear(I2C_TypeDef *i2c, uint32_t flags)
Clear one or more pending I2C interrupts.
__STATIC_INLINE void I2C_SlaveAddressSet(I2C_TypeDef *i2c, uint8_t addr)
Set slave address to use for I2C peripheral (when operating in slave mode).
__STATIC_INLINE uint8_t I2C_SlaveAddressGet(I2C_TypeDef *i2c)
Get slave address used for I2C peripheral (when operating in slave mode).
void I2C_BusFreqSet(I2C_TypeDef *i2c, uint32_t freqRef, uint32_t freqScl, I2C_ClockHLR_TypeDef i2cMode)
Set I2C bus frequency.
Master mode transfer message structure used to define a complete I2C transfer sequence (from start to...
__STATIC_INLINE void I2C_IntEnable(I2C_TypeDef *i2c, uint32_t flags)
Enable one or more I2C interrupts.
__STATIC_INLINE uint8_t I2C_SlaveAddressMaskGet(I2C_TypeDef *i2c)
Get slave address mask used for I2C peripheral (when operating in slave mode).
__STATIC_INLINE void I2C_IntDisable(I2C_TypeDef *i2c, uint32_t flags)
Disable one or more I2C interrupts.
uint32_t I2C_BusFreqGet(I2C_TypeDef *i2c)
Get current configured I2C bus frequency.
uint16_t addr
Address to use after (repeated) start.
I2C_TransferReturn_TypeDef I2C_Transfer(I2C_TypeDef *i2c)
Continue an initiated I2C transfer (single master mode only).