![]() |
Dataflow Runtime API
3.0.3.0
|
#include <Imt.Base.Core.Platform/Platform.h>
#include "SystemMemoryMap.h"
#include "RegisterDefinitions/hw_hsi2c.h"
Functions | |
void | I2C_Init (const I2CModuleAddress moduleBaseAddress, const I2CClockRate clockRateHz, const uint8_t deviceAddress) |
Initialize the I2C module with FIFO buffers. More... | |
void | I2C_Reset (const I2CModuleAddress moduleBaseAddress) |
Reset the I2C module. More... | |
I2COperatingMode | I2C_GetOperatingMode (const I2CModuleAddress moduleBaseAddress) |
void | I2C_GenerateStart (const I2CModuleAddress moduleBaseAddress, const uint8_t slaveAddress, const bool writeEnabled, const uint16_t bytesToTransfer) |
Generate START signal (I2C-protocol specific signal timing). More... | |
void | I2C_GenerateStop (const I2CModuleAddress moduleBaseAddress) |
Generate STOP signal (I2C-protocol specific signal timing). More... | |
bool | I2C_IsInterruptEventPending (const I2CModuleAddress moduleBaseAddress, const I2CInterruptEvent eventFlag) |
Check if the given interrupt event is pending. More... | |
void | I2C_ClearInterruptEvent (const I2CModuleAddress moduleBaseAddress, const I2CInterruptEvent eventFlag) |
Clear the given interrupt event. More... | |
void | I2C_ClearFIFOBuffers (const I2CModuleAddress moduleBaseAddress) |
Clear the RX and TX FIFO buffer. More... | |
uint8_t | I2C_GetRxBufferStatus (const I2CModuleAddress moduleBaseAddress) |
RX buffer status. More... | |
uint16_t | I2C_GetRxBufferThreshold (const I2CModuleAddress moduleBaseAddress) |
Threshold value for FIFO buffer in RX mode. More... | |
uint8_t | I2C_GetTxBufferStatus (const I2CModuleAddress moduleBaseAddress) |
TX buffer status. More... | |
uint16_t | I2C_GetTxBufferThreshold (const I2CModuleAddress moduleBaseAddress) |
Threshold value for FIFO buffer in TX mode. More... | |
uint8_t | I2C_ReceiveData (const I2CModuleAddress moduleBaseAddress) |
Receive next byte (use I2C_GetRxBufferStatus to determinate the amount of bytes which can be read) More... | |
void | I2C_SendData (const I2CModuleAddress moduleBaseAddress, const uint8_t data) |
Send the byte. More... | |
enum I2CClockRate |
enum I2CInterruptEvent |
Enumeration of the interrupt events.
enum I2CModuleAddress |
I2C module.
The multi-master I2C peripheral provides an interface between a CPU and any I2C-bus-compatible device that connects via the I2C serial bus. External components attached to the I2C bus can serially transmit/receive up to 8-bit data to/from the CPU device through the two-wire I2C interface. This device includes three instantiations of the I2C module: I2C0, I2C1 and I2C2. Enumeration of the available I2C modules
Enumerator | |
---|---|
I2CModuleAddress_I2C0 | |
I2CModuleAddress_I2C1 | |
I2CModuleAddress_I2C2 |
enum I2COperatingMode |
void I2C_ClearFIFOBuffers | ( | const I2CModuleAddress | moduleBaseAddress | ) |
Clear the RX and TX FIFO buffer.
moduleBaseAddress | The module base address |
void I2C_ClearInterruptEvent | ( | const I2CModuleAddress | moduleBaseAddress, |
const I2CInterruptEvent | eventFlag | ||
) |
Clear the given interrupt event.
moduleBaseAddress | The module base address |
eventFlag |
void I2C_GenerateStart | ( | const I2CModuleAddress | moduleBaseAddress, |
const uint8_t | slaveAddress, | ||
const bool | writeEnabled, | ||
const uint16_t | bytesToTransfer | ||
) |
Generate START signal (I2C-protocol specific signal timing).
moduleBaseAddress | The module base address |
slaveAddress | |
writeEnabled | |
bytesToTransfer |
void I2C_GenerateStop | ( | const I2CModuleAddress | moduleBaseAddress | ) |
Generate STOP signal (I2C-protocol specific signal timing).
moduleBaseAddress | The module base address |
I2COperatingMode I2C_GetOperatingMode | ( | const I2CModuleAddress | moduleBaseAddress | ) |
moduleBaseAddress | The module base address |
uint8_t I2C_GetRxBufferStatus | ( | const I2CModuleAddress | moduleBaseAddress | ) |
RX buffer status.
This read-only field indicates the number of bytes to be transferred from the FIFO at the end of the I2C transfer (when RDR is asserted). It corresponds to the level indication of the RX FIFO (number of written locations).
moduleBaseAddress | The module base address |
uint16_t I2C_GetRxBufferThreshold | ( | const I2CModuleAddress | moduleBaseAddress | ) |
Threshold value for FIFO buffer in RX mode.
moduleBaseAddress | The module base address |
uint8_t I2C_GetTxBufferStatus | ( | const I2CModuleAddress | moduleBaseAddress | ) |
TX buffer status.
This read-only field indicates the number of data bytes still left to be written in the TX FIFO. It is equal with the initial value of I2C_CNT.DCOUNT minus the number of data bytes already written in the TX FIFO through the OCP Interface
moduleBaseAddress | The module base address |
uint16_t I2C_GetTxBufferThreshold | ( | const I2CModuleAddress | moduleBaseAddress | ) |
Threshold value for FIFO buffer in TX mode.
moduleBaseAddress | The module base address |
void I2C_Init | ( | const I2CModuleAddress | moduleBaseAddress, |
const I2CClockRate | clockRateHz, | ||
const uint8_t | deviceAddress | ||
) |
Initialize the I2C module with FIFO buffers.
moduleBaseAddress | The module base address |
clockRateHz | the clock rate in Hz |
deviceAddress | Own I2C address of the I2C module |
bool I2C_IsInterruptEventPending | ( | const I2CModuleAddress | moduleBaseAddress, |
const I2CInterruptEvent | eventFlag | ||
) |
Check if the given interrupt event is pending.
moduleBaseAddress | The module base address |
eventFlag |
uint8_t I2C_ReceiveData | ( | const I2CModuleAddress | moduleBaseAddress | ) |
Receive next byte (use I2C_GetRxBufferStatus to determinate the amount of bytes which can be read)
moduleBaseAddress | The module base address |
void I2C_Reset | ( | const I2CModuleAddress | moduleBaseAddress | ) |
Reset the I2C module.
Receive and transmit FIFOs are cleared and all status bits are set to their default values. All configuration registers are not reset, they keep their initial values
moduleBaseAddress | The module base address |
void I2C_SendData | ( | const I2CModuleAddress | moduleBaseAddress, |
const uint8_t | data | ||
) |
Send the byte.
moduleBaseAddress | The module base address |
data |