Go to the source code of this file.
Classes | |
struct | _lpi2c_master_config |
Structure with settings to initialize the LPI2C master module. More... | |
struct | _lpi2c_master_handle |
Driver handle for master non-blocking APIs. More... | |
struct | _lpi2c_master_transfer |
Non-blocking transfer descriptor structure. More... | |
struct | _lpi2c_match_config |
LPI2C master data match configuration structure. More... | |
struct | _lpi2c_slave_config |
Structure with settings to initialize the LPI2C slave module. More... | |
struct | _lpi2c_slave_handle |
LPI2C slave handle structure. More... | |
struct | _lpi2c_slave_transfer |
LPI2C slave transfer structure. More... | |
Typedefs | |
typedef enum _lpi2c_data_match_config_mode | lpi2c_data_match_config_mode_t |
LPI2C master data match configuration modes. More... | |
typedef struct _lpi2c_match_config | lpi2c_data_match_config_t |
LPI2C master data match configuration structure. More... | |
typedef enum _lpi2c_direction | lpi2c_direction_t |
Direction of master and slave transfers. More... | |
typedef enum _lpi2c_host_request_polarity | lpi2c_host_request_polarity_t |
LPI2C master host request pin polarity configuration. More... | |
typedef enum _lpi2c_host_request_source | lpi2c_host_request_source_t |
LPI2C master host request selection. More... | |
typedef struct _lpi2c_master_config | lpi2c_master_config_t |
Structure with settings to initialize the LPI2C master module. More... | |
typedef struct _lpi2c_master_handle | lpi2c_master_handle_t |
typedef enum _lpi2c_master_pin_config | lpi2c_master_pin_config_t |
LPI2C pin configuration. More... | |
typedef void(* | lpi2c_master_transfer_callback_t) (LPI2C_Type *base, lpi2c_master_handle_t *handle, status_t completionStatus, void *userData) |
Master completion callback function pointer type. More... | |
typedef struct _lpi2c_master_transfer | lpi2c_master_transfer_t |
typedef enum _lpi2c_slave_address_match | lpi2c_slave_address_match_t |
LPI2C slave address match options. More... | |
typedef struct _lpi2c_slave_config | lpi2c_slave_config_t |
Structure with settings to initialize the LPI2C slave module. More... | |
typedef struct _lpi2c_slave_handle | lpi2c_slave_handle_t |
typedef void(* | lpi2c_slave_transfer_callback_t) (LPI2C_Type *base, lpi2c_slave_transfer_t *transfer, void *userData) |
Slave event callback function pointer type. More... | |
typedef enum _lpi2c_slave_transfer_event | lpi2c_slave_transfer_event_t |
Set of events sent to the callback for non blocking slave transfers. More... | |
typedef struct _lpi2c_slave_transfer | lpi2c_slave_transfer_t |
LPI2C slave transfer structure. More... | |
Functions | |
Initialization and deinitialization | |
status_t | LPI2C_CheckForBusyBus (LPI2C_Type *base) |
Make sure the bus isn't already busy. More... | |
status_t | LPI2C_MasterCheckAndClearError (LPI2C_Type *base, uint32_t status) |
Convert provided flags to status code, and clear any errors if present. More... | |
void | LPI2C_MasterConfigureDataMatch (LPI2C_Type *base, const lpi2c_data_match_config_t *config) |
Configures LPI2C master data match feature. More... | |
void | LPI2C_MasterDeinit (LPI2C_Type *base) |
Deinitializes the LPI2C master peripheral. More... | |
static void | LPI2C_MasterEnable (LPI2C_Type *base, bool enable) |
Enables or disables the LPI2C module as master. More... | |
void | LPI2C_MasterGetDefaultConfig (lpi2c_master_config_t *masterConfig) |
Provides a default configuration for the LPI2C master peripheral. More... | |
void | LPI2C_MasterInit (LPI2C_Type *base, const lpi2c_master_config_t *masterConfig, uint32_t sourceClock_Hz) |
Initializes the LPI2C master peripheral. More... | |
static void | LPI2C_MasterReset (LPI2C_Type *base) |
Performs a software reset. More... | |
Status | |
static void | LPI2C_MasterClearStatusFlags (LPI2C_Type *base, uint32_t statusMask) |
Clears the LPI2C master status flag state. More... | |
static uint32_t | LPI2C_MasterGetStatusFlags (LPI2C_Type *base) |
Gets the LPI2C master status flags. More... | |
Interrupts | |
static void | LPI2C_MasterDisableInterrupts (LPI2C_Type *base, uint32_t interruptMask) |
Disables the LPI2C master interrupt requests. More... | |
static void | LPI2C_MasterEnableInterrupts (LPI2C_Type *base, uint32_t interruptMask) |
Enables the LPI2C master interrupt requests. More... | |
static uint32_t | LPI2C_MasterGetEnabledInterrupts (LPI2C_Type *base) |
Returns the set of currently enabled LPI2C master interrupt requests. More... | |
DMA control | |
static void | LPI2C_MasterEnableDMA (LPI2C_Type *base, bool enableTx, bool enableRx) |
Enables or disables LPI2C master DMA requests. More... | |
static uint32_t | LPI2C_MasterGetRxFifoAddress (LPI2C_Type *base) |
Gets LPI2C master receive data register address for DMA transfer. More... | |
static uint32_t | LPI2C_MasterGetTxFifoAddress (LPI2C_Type *base) |
Gets LPI2C master transmit data register address for DMA transfer. More... | |
FIFO control | |
static void | LPI2C_MasterGetFifoCounts (LPI2C_Type *base, size_t *rxCount, size_t *txCount) |
Gets the current number of words in the LPI2C master FIFOs. More... | |
static void | LPI2C_MasterSetWatermarks (LPI2C_Type *base, size_t txWords, size_t rxWords) |
Sets the watermarks for LPI2C master FIFOs. More... | |
Bus operations | |
static bool | LPI2C_MasterGetBusIdleState (LPI2C_Type *base) |
Returns whether the bus is idle. More... | |
status_t | LPI2C_MasterReceive (LPI2C_Type *base, void *rxBuff, size_t rxSize) |
Performs a polling receive transfer on the I2C bus. More... | |
static status_t | LPI2C_MasterRepeatedStart (LPI2C_Type *base, uint8_t address, lpi2c_direction_t dir) |
Sends a repeated START signal and slave address on the I2C bus. More... | |
status_t | LPI2C_MasterSend (LPI2C_Type *base, void *txBuff, size_t txSize) |
Performs a polling send transfer on the I2C bus. More... | |
void | LPI2C_MasterSetBaudRate (LPI2C_Type *base, uint32_t sourceClock_Hz, uint32_t baudRate_Hz) |
Sets the I2C bus frequency for master transactions. More... | |
status_t | LPI2C_MasterStart (LPI2C_Type *base, uint8_t address, lpi2c_direction_t dir) |
Sends a START signal and slave address on the I2C bus. More... | |
status_t | LPI2C_MasterStop (LPI2C_Type *base) |
Sends a STOP signal on the I2C bus. More... | |
status_t | LPI2C_MasterTransferBlocking (LPI2C_Type *base, lpi2c_master_transfer_t *transfer) |
Performs a master polling transfer on the I2C bus. More... | |
Non-blocking | |
void | LPI2C_MasterTransferAbort (LPI2C_Type *base, lpi2c_master_handle_t *handle) |
Terminates a non-blocking LPI2C master transmission early. More... | |
void | LPI2C_MasterTransferCreateHandle (LPI2C_Type *base, lpi2c_master_handle_t *handle, lpi2c_master_transfer_callback_t callback, void *userData) |
Creates a new handle for the LPI2C master non-blocking APIs. More... | |
status_t | LPI2C_MasterTransferGetCount (LPI2C_Type *base, lpi2c_master_handle_t *handle, size_t *count) |
Returns number of bytes transferred so far. More... | |
status_t | LPI2C_MasterTransferNonBlocking (LPI2C_Type *base, lpi2c_master_handle_t *handle, lpi2c_master_transfer_t *transfer) |
Performs a non-blocking transaction on the I2C bus. More... | |
IRQ handler | |
void | LPI2C_MasterTransferHandleIRQ (LPI2C_Type *base, lpi2c_master_handle_t *handle) |
Reusable routine to handle master interrupts. More... | |
Slave initialization and deinitialization | |
void | LPI2C_SlaveDeinit (LPI2C_Type *base) |
Deinitializes the LPI2C slave peripheral. More... | |
static void | LPI2C_SlaveEnable (LPI2C_Type *base, bool enable) |
Enables or disables the LPI2C module as slave. More... | |
void | LPI2C_SlaveGetDefaultConfig (lpi2c_slave_config_t *slaveConfig) |
Provides a default configuration for the LPI2C slave peripheral. More... | |
void | LPI2C_SlaveInit (LPI2C_Type *base, const lpi2c_slave_config_t *slaveConfig, uint32_t sourceClock_Hz) |
Initializes the LPI2C slave peripheral. More... | |
static void | LPI2C_SlaveReset (LPI2C_Type *base) |
Performs a software reset of the LPI2C slave peripheral. More... | |
Slave status | |
static void | LPI2C_SlaveClearStatusFlags (LPI2C_Type *base, uint32_t statusMask) |
Clears the LPI2C status flag state. More... | |
static uint32_t | LPI2C_SlaveGetStatusFlags (LPI2C_Type *base) |
Gets the LPI2C slave status flags. More... | |
Slave interrupts | |
static void | LPI2C_SlaveDisableInterrupts (LPI2C_Type *base, uint32_t interruptMask) |
Disables the LPI2C slave interrupt requests. More... | |
static void | LPI2C_SlaveEnableInterrupts (LPI2C_Type *base, uint32_t interruptMask) |
Enables the LPI2C slave interrupt requests. More... | |
static uint32_t | LPI2C_SlaveGetEnabledInterrupts (LPI2C_Type *base) |
Returns the set of currently enabled LPI2C slave interrupt requests. More... | |
Slave DMA control | |
static void | LPI2C_SlaveEnableDMA (LPI2C_Type *base, bool enableAddressValid, bool enableRx, bool enableTx) |
Enables or disables the LPI2C slave peripheral DMA requests. More... | |
Slave bus operations | |
static bool | LPI2C_SlaveGetBusIdleState (LPI2C_Type *base) |
Returns whether the bus is idle. More... | |
static uint32_t | LPI2C_SlaveGetReceivedAddress (LPI2C_Type *base) |
Returns the slave address sent by the I2C master. More... | |
status_t | LPI2C_SlaveReceive (LPI2C_Type *base, void *rxBuff, size_t rxSize, size_t *actualRxSize) |
Performs a polling receive transfer on the I2C bus. More... | |
status_t | LPI2C_SlaveSend (LPI2C_Type *base, void *txBuff, size_t txSize, size_t *actualTxSize) |
Performs a polling send transfer on the I2C bus. More... | |
static void | LPI2C_SlaveTransmitAck (LPI2C_Type *base, bool ackOrNack) |
Transmits either an ACK or NAK on the I2C bus in response to a byte from the master. More... | |
Slave non-blocking | |
void | LPI2C_SlaveTransferAbort (LPI2C_Type *base, lpi2c_slave_handle_t *handle) |
Aborts the slave non-blocking transfers. More... | |
void | LPI2C_SlaveTransferCreateHandle (LPI2C_Type *base, lpi2c_slave_handle_t *handle, lpi2c_slave_transfer_callback_t callback, void *userData) |
Creates a new handle for the LPI2C slave non-blocking APIs. More... | |
status_t | LPI2C_SlaveTransferGetCount (LPI2C_Type *base, lpi2c_slave_handle_t *handle, size_t *count) |
Gets the slave transfer status during a non-blocking transfer. More... | |
status_t | LPI2C_SlaveTransferNonBlocking (LPI2C_Type *base, lpi2c_slave_handle_t *handle, uint32_t eventMask) |
Starts accepting slave transfers. More... | |
Slave IRQ handler | |
void | LPI2C_SlaveTransferHandleIRQ (LPI2C_Type *base, lpi2c_slave_handle_t *handle) |
Reusable routine to handle slave interrupts. More... | |
Driver version | |
enum | { kStatus_LPI2C_Busy = MAKE_STATUS(kStatusGroup_LPI2C, 0), kStatus_LPI2C_Idle = MAKE_STATUS(kStatusGroup_LPI2C, 1), kStatus_LPI2C_Nak = MAKE_STATUS(kStatusGroup_LPI2C, 2), kStatus_LPI2C_FifoError = MAKE_STATUS(kStatusGroup_LPI2C, 3), kStatus_LPI2C_BitError = MAKE_STATUS(kStatusGroup_LPI2C, 4), kStatus_LPI2C_ArbitrationLost = MAKE_STATUS(kStatusGroup_LPI2C, 5), kStatus_LPI2C_PinLowTimeout, kStatus_LPI2C_NoTransferInProgress, kStatus_LPI2C_DmaRequestFail = MAKE_STATUS(kStatusGroup_LPI2C, 8), kStatus_LPI2C_Timeout = MAKE_STATUS(kStatusGroup_LPI2C, 9) } |
LPI2C status return codes. More... | |
#define | FSL_LPI2C_DRIVER_VERSION (MAKE_VERSION(2, 1, 11)) |
LPI2C driver version 2.1.11. More... | |
#define | I2C_RETRY_TIMES 0U /* Define to zero means keep waiting until the flag is assert/deassert. */ |
Retry times for waiting flag. More... | |