## CMSIS I2C Driver Function Documentation

### ARM_I2C_GetVersion

ARM_DRIVER_VERSION ARM_I2C_GetVersion()

Get driver version.

Location: Driver_I2C.c:38

Return

ARM_DRIVER_VERSION

### ARM_I2C_GetCapabilities

ARM_I2C_CAPABILITIES ARM_I2C_GetCapabilities()

Get driver capabilities.

Location: Driver_I2C.c:43

Return

ARM_I2C_CAPABILITIES

### ARM_I2C_Initialize

int32_t ARM_I2C_Initialize(ARM_I2C_SignalEvent_t cb_event)

Initialize I2C Interface.

Location: Driver_I2C.c:48

Parameters

Direction | Name | Description
--- | --- | ---
in | cb_event | Pointer to ARM_I2C_SignalEvent

Return

execution_status

### ARM_I2C_Uninitialize

int32_t ARM_I2C_Uninitialize()

De-initialize I2C Interface.

Location: Driver_I2C.c:52

Return

execution_status

### ARM_I2C_PowerControl

int32_t ARM_I2C_PowerControl(ARM_POWER_STATE state)

Control I2C Interface Power.

Location: Driver_I2C.c:56

Parameters

Direction | Name | Description
--- | --- | ---
in | state | Power state

Return

execution_status

### ARM_I2C_MasterTransmit

int32_t ARM_I2C_MasterTransmit(uint32_t addr, const uint8_t * data, uint32_t num, bool xfer_pending)

Start transmitting data as I2C Master.

Location: Driver_I2C.c:72

Parameters

Direction | Name | Description
--- | --- | ---
in | addr | Slave address (7-bit or 10-bit)
in | data | Pointer to buffer with data to transmit to I2C Slave
in | num | Number of data bytes to transmit
in | xfer_pending | Transfer operation is pending - Stop condition will not be generated

Return

execution_status

### ARM_I2C_MasterReceive

int32_t ARM_I2C_MasterReceive(uint32_t addr, uint8_t * data, uint32_t num, bool xfer_pending)

Start receiving data as I2C Master.

Location: Driver_I2C.c:76

Parameters

Direction | Name | Description
--- | --- | ---
in | addr | Slave address (7-bit or 10-bit)
out | data | Pointer to buffer for data to receive from I2C Slave
in | num | Number of data bytes to receive
in | xfer_pending | Transfer operation is pending - Stop condition will not be generated

Return

execution_status

### ARM_I2C_SlaveTransmit

int32_t ARM_I2C_SlaveTransmit(const uint8_t * data, uint32_t num)

Start transmitting data as I2C Slave.

Location: Driver_I2C.c:80

Parameters

Direction | Name | Description
--- | --- | ---
in | data | Pointer to buffer with data to transmit to I2C Master
in | num | Number of data bytes to transmit

Return

execution_status

### ARM_I2C_SlaveReceive

int32_t ARM_I2C_SlaveReceive(uint8_t * data, uint32_t num)

Start receiving data as I2C Slave.

Location: Driver_I2C.c:84

Parameters

Direction | Name | Description
--- | --- | ---
out | data | Pointer to buffer for data to receive from I2C Master
in | num | Number of data bytes to receive

Return

execution_status

### ARM_I2C_GetDataCount

int32_t ARM_I2C_GetDataCount()

Get transferred data count.

Location: Driver_I2C.c:88

Return

number of data bytes transferred; -1 when Slave is not addressed by Master

### ARM_I2C_Control

int32_t ARM_I2C_Control(uint32_t control, uint32_t arg)

Control I2C Interface.

Location: Driver_I2C.c:92

Parameters

Direction | Name | Description
--- | --- | ---
in | control | Operation
in | arg | Argument of operation (optional)

Return

execution_status

### ARM_I2C_GetStatus

ARM_I2C_STATUS ARM_I2C_GetStatus()

Get I2C status.

Location: Driver_I2C.c:124

Return

I2C status ARM_I2C_STATUS

### ARM_I2C_SignalEvent

void ARM_I2C_SignalEvent(uint32_t event)

Signal I2C Events.

Location: Driver_I2C.c:128

Parameters

Direction | Name | Description
--- | --- | ---
in | event | I2C_events notification mask