STM32 core 3.0.1-dev
Arduino core for STM32 based boards: API reference
← STM32duino documentation
Loading...
Searching...
No Matches
i2c_s Struct Reference

I2C peripheral context: instance, HAL handle, pins, interrupts and slave buffers. More...

#include <twi.h>

Public Attributes

I2C_TypeDef * i2c
 I2C peripheral instance.
 
I2C_HandleTypeDef handle
 HAL handle of the I2C peripheral.
 
void * __this
 Pointer to the owning TwoWire instance, used by the slave callbacks.
 
PinName sda
 SDA pin.
 
PinName scl
 SCL pin.
 
IRQn_Type irq
 Event interrupt number.
 
IRQn_Type irqER
 Error interrupt number.
 
volatile int slaveRxNbData
 Number of accumulated bytes received in slave mode.
 
void(* i2c_onSlaveReceive )(i2c_t *)
 Callback called when the slave has received data from the master.
 
void(* i2c_onSlaveTransmit )(i2c_t *)
 Callback called when the master requests data from the slave.
 
volatile uint8_t i2cTxRxBuffer [I2C_TXRX_BUFFER_SIZE]
 Slave Tx/Rx buffer, I2C_TXRX_BUFFER_SIZE bytes.
 
volatile uint8_t i2cTxRxBufferSize
 Number of bytes currently stored in i2cTxRxBuffer for transmission.
 
volatile uint8_t slaveMode
 Current slave mode: SLAVE_MODE_TRANSMIT, SLAVE_MODE_RECEIVE or SLAVE_MODE_LISTEN.
 
bool isMaster
 true when the peripheral is configured as master, false as slave.
 
bool generalCall
 true to enable the general call address (slave mode).
 
bool NoStretchMode
 true to disable clock stretching (slave mode).
 

Detailed Description

I2C peripheral context: instance, HAL handle, pins, interrupts and slave buffers.

Note
The first two members (i2c and handle) must be kept first for the get_i2c_obj() function to work as expected.

The documentation for this struct was generated from the following file: