RTEMS 6.1-rc6
Loading...
Searching...
No Matches
Data Structures | Enumerator | Variables
Flexio_i2c_master

Data Structures

struct  _flexio_i2c_type
 Define FlexIO I2C master access structure typedef. More...
 
struct  _flexio_i2c_master_config
 Define FlexIO I2C master user configuration structure. More...
 
struct  _flexio_i2c_master_transfer
 Define FlexIO I2C master transfer structure. More...
 
struct  _flexio_i2c_master_handle
 Define FlexIO I2C master handle structure. More...
 

Variables

FLEXIO_Type_flexio_i2c_type::flexioBase
 
uint8_t _flexio_i2c_type::SDAPinIndex
 
uint8_t _flexio_i2c_type::SCLPinIndex
 
uint8_t _flexio_i2c_type::shifterIndex [2]
 
uint8_t _flexio_i2c_type::timerIndex [3]
 
uint32_t _flexio_i2c_type::baudrate
 
bool _flexio_i2c_master_config::enableMaster
 
bool _flexio_i2c_master_config::enableInDoze
 
bool _flexio_i2c_master_config::enableInDebug
 
bool _flexio_i2c_master_config::enableFastAccess
 
uint32_t _flexio_i2c_master_config::baudRate_Bps
 
uint32_t _flexio_i2c_master_transfer::flags
 
uint8_t _flexio_i2c_master_transfer::slaveAddress
 
flexio_i2c_direction_t _flexio_i2c_master_transfer::direction
 
uint32_t _flexio_i2c_master_transfer::subaddress
 
uint8_t _flexio_i2c_master_transfer::subaddressSize
 
uint8_t volatile * _flexio_i2c_master_transfer::data
 
volatile size_t _flexio_i2c_master_transfer::dataSize
 
flexio_i2c_master_transfer_t _flexio_i2c_master_handle::transfer
 
size_t _flexio_i2c_master_handle::transferSize
 
uint8_t _flexio_i2c_master_handle::state
 
flexio_i2c_master_transfer_callback_t _flexio_i2c_master_handle::completionCallback
 
void * _flexio_i2c_master_handle::userData
 
bool _flexio_i2c_master_handle::needRestart
 

Driver version

enum  { kStatus_FLEXIO_I2C_Busy = MAKE_STATUS(kStatusGroup_FLEXIO_I2C, 0) , kStatus_FLEXIO_I2C_Idle = MAKE_STATUS(kStatusGroup_FLEXIO_I2C, 1) , kStatus_FLEXIO_I2C_Nak = MAKE_STATUS(kStatusGroup_FLEXIO_I2C, 2) , kStatus_FLEXIO_I2C_Timeout = MAKE_STATUS(kStatusGroup_FLEXIO_I2C, 3) }
 FlexIO I2C transfer status. More...
 
enum  _flexio_i2c_master_interrupt { kFLEXIO_I2C_TxEmptyInterruptEnable = 0x1U , kFLEXIO_I2C_RxFullInterruptEnable = 0x2U }
 Define FlexIO I2C master interrupt mask. More...
 
enum  _flexio_i2c_master_status_flags { kFLEXIO_I2C_TxEmptyFlag = 0x1U , kFLEXIO_I2C_RxFullFlag = 0x2U , kFLEXIO_I2C_ReceiveNakFlag = 0x4U }
 Define FlexIO I2C master status mask. More...
 
enum  _flexio_i2c_direction { kFLEXIO_I2C_Write = 0x0U , kFLEXIO_I2C_Read = 0x1U }
 Direction of master transfer. More...
 
typedef enum _flexio_i2c_direction flexio_i2c_direction_t
 Direction of master transfer.
 
typedef struct _flexio_i2c_type FLEXIO_I2C_Type
 Define FlexIO I2C master access structure typedef.
 
typedef struct _flexio_i2c_master_config flexio_i2c_master_config_t
 Define FlexIO I2C master user configuration structure.
 
typedef struct _flexio_i2c_master_transfer flexio_i2c_master_transfer_t
 Define FlexIO I2C master transfer structure.
 
typedef struct _flexio_i2c_master_handle flexio_i2c_master_handle_t
 FlexIO I2C master handle typedef.
 
typedef void(* flexio_i2c_master_transfer_callback_t) (FLEXIO_I2C_Type *base, flexio_i2c_master_handle_t *handle, status_t status, void *userData)
 FlexIO I2C master transfer callback typedef.
 
#define FSL_FLEXIO_I2C_MASTER_DRIVER_VERSION   (MAKE_VERSION(2, 5, 0))
 
#define I2C_RETRY_TIMES   0U /* Define to zero means keep waiting until the flag is assert/deassert. */
 Retry times for waiting flag.
 

Initialization and deinitialization

status_t FLEXIO_I2C_MasterInit (FLEXIO_I2C_Type *base, flexio_i2c_master_config_t *masterConfig, uint32_t srcClock_Hz)
 Ungates the FlexIO clock, resets the FlexIO module, and configures the FlexIO I2C hardware configuration.
 
void FLEXIO_I2C_MasterDeinit (FLEXIO_I2C_Type *base)
 De-initializes the FlexIO I2C master peripheral. Calling this API Resets the FlexIO I2C master shifer and timer config, module can't work unless the FLEXIO_I2C_MasterInit is called.
 
void FLEXIO_I2C_MasterGetDefaultConfig (flexio_i2c_master_config_t *masterConfig)
 Gets the default configuration to configure the FlexIO module. The configuration can be used directly for calling the FLEXIO_I2C_MasterInit().
 

Status

uint32_t FLEXIO_I2C_MasterGetStatusFlags (FLEXIO_I2C_Type *base)
 Gets the FlexIO I2C master status flags.
 
void FLEXIO_I2C_MasterClearStatusFlags (FLEXIO_I2C_Type *base, uint32_t mask)
 Clears the FlexIO I2C master status flags.
 

Interrupts

void FLEXIO_I2C_MasterEnableInterrupts (FLEXIO_I2C_Type *base, uint32_t mask)
 Enables the FlexIO i2c master interrupt requests.
 
void FLEXIO_I2C_MasterDisableInterrupts (FLEXIO_I2C_Type *base, uint32_t mask)
 Disables the FlexIO I2C master interrupt requests.
 

Bus Operations

void FLEXIO_I2C_MasterSetBaudRate (FLEXIO_I2C_Type *base, uint32_t baudRate_Bps, uint32_t srcClock_Hz)
 Sets the FlexIO I2C master transfer baudrate.
 
void FLEXIO_I2C_MasterStart (FLEXIO_I2C_Type *base, uint8_t address, flexio_i2c_direction_t direction)
 Sends START + 7-bit address to the bus.
 
void FLEXIO_I2C_MasterStop (FLEXIO_I2C_Type *base)
 Sends the stop signal on the bus.
 
void FLEXIO_I2C_MasterRepeatedStart (FLEXIO_I2C_Type *base)
 Sends the repeated start signal on the bus.
 
void FLEXIO_I2C_MasterAbortStop (FLEXIO_I2C_Type *base)
 Sends the stop signal when transfer is still on-going.
 
void FLEXIO_I2C_MasterEnableAck (FLEXIO_I2C_Type *base, bool enable)
 Configures the sent ACK/NAK for the following byte.
 
status_t FLEXIO_I2C_MasterSetTransferCount (FLEXIO_I2C_Type *base, uint16_t count)
 Sets the number of bytes to be transferred from a start signal to a stop signal.
 
status_t FLEXIO_I2C_MasterWriteBlocking (FLEXIO_I2C_Type *base, const uint8_t *txBuff, uint8_t txSize)
 Sends a buffer of data in bytes.
 
status_t FLEXIO_I2C_MasterReadBlocking (FLEXIO_I2C_Type *base, uint8_t *rxBuff, uint8_t rxSize)
 Receives a buffer of bytes.
 
status_t FLEXIO_I2C_MasterTransferBlocking (FLEXIO_I2C_Type *base, flexio_i2c_master_transfer_t *xfer)
 Performs a master polling transfer on the I2C bus.
 

Transactional

status_t FLEXIO_I2C_MasterTransferCreateHandle (FLEXIO_I2C_Type *base, flexio_i2c_master_handle_t *handle, flexio_i2c_master_transfer_callback_t callback, void *userData)
 Initializes the I2C handle which is used in transactional functions.
 
status_t FLEXIO_I2C_MasterTransferNonBlocking (FLEXIO_I2C_Type *base, flexio_i2c_master_handle_t *handle, flexio_i2c_master_transfer_t *xfer)
 Performs a master interrupt non-blocking transfer on the I2C bus.
 
status_t FLEXIO_I2C_MasterTransferGetCount (FLEXIO_I2C_Type *base, flexio_i2c_master_handle_t *handle, size_t *count)
 Gets the master transfer status during a interrupt non-blocking transfer.
 
void FLEXIO_I2C_MasterTransferAbort (FLEXIO_I2C_Type *base, flexio_i2c_master_handle_t *handle)
 Aborts an interrupt non-blocking transfer early.
 
void FLEXIO_I2C_MasterTransferHandleIRQ (void *i2cType, void *i2cHandle)
 Master interrupt handler.
 

Detailed Description

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

FlexIO I2C transfer status.

Enumerator
kStatus_FLEXIO_I2C_Busy 

I2C is busy doing transfer.

kStatus_FLEXIO_I2C_Idle 

I2C is busy doing transfer.

kStatus_FLEXIO_I2C_Nak 

NAK received during transfer.

kStatus_FLEXIO_I2C_Timeout 

Timeout polling status flags.

◆ _flexio_i2c_direction

Direction of master transfer.

Enumerator
kFLEXIO_I2C_Write 

Master send to slave.

kFLEXIO_I2C_Read 

Master receive from slave.

◆ _flexio_i2c_master_interrupt

Define FlexIO I2C master interrupt mask.

Enumerator
kFLEXIO_I2C_TxEmptyInterruptEnable 

Tx buffer empty interrupt enable.

kFLEXIO_I2C_RxFullInterruptEnable 

Rx buffer full interrupt enable.

◆ _flexio_i2c_master_status_flags

Define FlexIO I2C master status mask.

Enumerator
kFLEXIO_I2C_TxEmptyFlag 

Tx shifter empty flag.

kFLEXIO_I2C_RxFullFlag 

Rx shifter full/Transfer complete flag.

kFLEXIO_I2C_ReceiveNakFlag 

Receive NAK flag.

Function Documentation

◆ FLEXIO_I2C_MasterAbortStop()

void FLEXIO_I2C_MasterAbortStop ( FLEXIO_I2C_Type base)

Sends the stop signal when transfer is still on-going.

Parameters
basePointer to FLEXIO_I2C_Type structure.

brief Sends the stop signal when transfer is still on-going.

param base Pointer to FLEXIO_I2C_Type structure.

◆ FLEXIO_I2C_MasterClearStatusFlags()

void FLEXIO_I2C_MasterClearStatusFlags ( FLEXIO_I2C_Type base,
uint32_t  mask 
)

Clears the FlexIO I2C master status flags.

Parameters
basePointer to FLEXIO_I2C_Type structure.
maskStatus flag. The parameter can be any combination of the following values:
  • kFLEXIO_I2C_RxFullFlag
  • kFLEXIO_I2C_ReceiveNakFlag
brief Clears the FlexIO I2C master status flags.

param base Pointer to FLEXIO_I2C_Type structure. param mask Status flag. The parameter can be any combination of the following values: arg kFLEXIO_I2C_RxFullFlag arg kFLEXIO_I2C_ReceiveNakFlag

◆ FLEXIO_I2C_MasterDeinit()

void FLEXIO_I2C_MasterDeinit ( FLEXIO_I2C_Type base)

De-initializes the FlexIO I2C master peripheral. Calling this API Resets the FlexIO I2C master shifer and timer config, module can't work unless the FLEXIO_I2C_MasterInit is called.

Parameters
basepointer to FLEXIO_I2C_Type structure.

brief De-initializes the FlexIO I2C master peripheral. Calling this API Resets the FlexIO I2C master shifer and timer config, module can't work unless the FLEXIO_I2C_MasterInit is called.

param base pointer to FLEXIO_I2C_Type structure.

◆ FLEXIO_I2C_MasterDisableInterrupts()

void FLEXIO_I2C_MasterDisableInterrupts ( FLEXIO_I2C_Type base,
uint32_t  mask 
)

Disables the FlexIO I2C master interrupt requests.

Parameters
basePointer to FLEXIO_I2C_Type structure.
maskInterrupt source.

brief Disables the FlexIO I2C master interrupt requests.

param base Pointer to FLEXIO_I2C_Type structure. param mask Interrupt source.

◆ FLEXIO_I2C_MasterEnableAck()

void FLEXIO_I2C_MasterEnableAck ( FLEXIO_I2C_Type base,
bool  enable 
)

Configures the sent ACK/NAK for the following byte.

Parameters
basePointer to FLEXIO_I2C_Type structure.
enableTrue to configure send ACK, false configure to send NAK.

brief Configures the sent ACK/NAK for the following byte.

param base Pointer to FLEXIO_I2C_Type structure. param enable True to configure send ACK, false configure to send NAK.

◆ FLEXIO_I2C_MasterEnableInterrupts()

void FLEXIO_I2C_MasterEnableInterrupts ( FLEXIO_I2C_Type base,
uint32_t  mask 
)

Enables the FlexIO i2c master interrupt requests.

Parameters
basePointer to FLEXIO_I2C_Type structure.
maskInterrupt source. Currently only one interrupt request source:
  • kFLEXIO_I2C_TransferCompleteInterruptEnable
brief Enables the FlexIO i2c master interrupt requests.

param base Pointer to FLEXIO_I2C_Type structure. param mask Interrupt source. Currently only one interrupt request source: arg kFLEXIO_I2C_TransferCompleteInterruptEnable

◆ FLEXIO_I2C_MasterGetDefaultConfig()

void FLEXIO_I2C_MasterGetDefaultConfig ( flexio_i2c_master_config_t masterConfig)

Gets the default configuration to configure the FlexIO module. The configuration can be used directly for calling the FLEXIO_I2C_MasterInit().

Example:

void FLEXIO_I2C_MasterGetDefaultConfig(flexio_i2c_master_config_t *masterConfig)
Gets the default configuration to configure the FlexIO module. The configuration can be used directly...
Definition: fsl_flexio_i2c_master.c:800
Define FlexIO I2C master user configuration structure.
Definition: fsl_flexio_i2c_master.h:77
Definition: deflate.c:114
Parameters
masterConfigPointer to flexio_i2c_master_config_t structure.

brief Gets the default configuration to configure the FlexIO module. The configuration can be used directly for calling the FLEXIO_I2C_MasterInit().

Example: code flexio_i2c_master_config_t config; FLEXIO_I2C_MasterGetDefaultConfig(&config); endcode param masterConfig Pointer to flexio_i2c_master_config_t structure.

◆ FLEXIO_I2C_MasterGetStatusFlags()

uint32_t FLEXIO_I2C_MasterGetStatusFlags ( FLEXIO_I2C_Type base)

Gets the FlexIO I2C master status flags.

Parameters
basePointer to FLEXIO_I2C_Type structure
Returns
Status flag, use status flag to AND _flexio_i2c_master_status_flags can get the related status.

brief Gets the FlexIO I2C master status flags.

param base Pointer to FLEXIO_I2C_Type structure return Status flag, use status flag to AND _flexio_i2c_master_status_flags can get the related status.

◆ FLEXIO_I2C_MasterInit()

status_t FLEXIO_I2C_MasterInit ( FLEXIO_I2C_Type base,
flexio_i2c_master_config_t masterConfig,
uint32_t  srcClock_Hz 
)

Ungates the FlexIO clock, resets the FlexIO module, and configures the FlexIO I2C hardware configuration.

Example

.flexioBase = FLEXIO,
.SDAPinIndex = 0,
.SCLPinIndex = 1,
.shifterIndex = {0,1},
.timerIndex = {0,1}
};
.enableInDoze = false,
.enableInDebug = true,
.enableFastAccess = false,
.baudRate_Bps = 100000
};
FLEXIO_I2C_MasterInit(base, &config, srcClock_Hz);
status_t FLEXIO_I2C_MasterInit(FLEXIO_I2C_Type *base, flexio_i2c_master_config_t *masterConfig, uint32_t srcClock_Hz)
Ungates the FlexIO clock, resets the FlexIO module, and configures the FlexIO I2C hardware configurat...
Definition: fsl_flexio_i2c_master.c:630
Define FlexIO I2C master access structure typedef.
Definition: fsl_flexio_i2c_master.h:66
Parameters
basePointer to FLEXIO_I2C_Type structure.
masterConfigPointer to flexio_i2c_master_config_t structure.
srcClock_HzFlexIO source clock in Hz.
Return values
kStatus_SuccessInitialization successful
kStatus_InvalidArgumentThe source clock exceed upper range limitation

brief Ungates the FlexIO clock, resets the FlexIO module, and configures the FlexIO I2C hardware configuration.

Example code FLEXIO_I2C_Type base = { .flexioBase = FLEXIO, .SDAPinIndex = 0, .SCLPinIndex = 1, .shifterIndex = {0,1}, .timerIndex = {0,1} }; flexio_i2c_master_config_t config = { .enableInDoze = false, .enableInDebug = true, .enableFastAccess = false, .baudRate_Bps = 100000 }; FLEXIO_I2C_MasterInit(base, &config, srcClock_Hz); endcode

param base Pointer to FLEXIO_I2C_Type structure. param masterConfig Pointer to flexio_i2c_master_config_t structure. param srcClock_Hz FlexIO source clock in Hz. retval kStatus_Success Initialization successful retval kStatus_InvalidArgument The source clock exceed upper range limitation

◆ FLEXIO_I2C_MasterReadBlocking()

status_t FLEXIO_I2C_MasterReadBlocking ( FLEXIO_I2C_Type base,
uint8_t *  rxBuff,
uint8_t  rxSize 
)

Receives a buffer of bytes.

Note
This function blocks via polling until all bytes have been received.
Parameters
basePointer to FLEXIO_I2C_Type structure.
rxBuffThe buffer to store the received bytes.
rxSizeThe number of data bytes to be received.
Return values
kStatus_SuccessSuccessfully read data.
kStatus_FLEXIO_I2C_TimeoutTimeout polling status flags.

brief Receives a buffer of bytes.

note This function blocks via polling until all bytes have been received.

param base Pointer to FLEXIO_I2C_Type structure. param rxBuff The buffer to store the received bytes. param rxSize The number of data bytes to be received. retval kStatus_Success Successfully read data. retval kStatus_FLEXIO_I2C_Timeout Timeout polling status flags.

◆ FLEXIO_I2C_MasterRepeatedStart()

void FLEXIO_I2C_MasterRepeatedStart ( FLEXIO_I2C_Type base)

Sends the repeated start signal on the bus.

Parameters
basePointer to FLEXIO_I2C_Type structure.

brief Sends the repeated start signal on the bus.

param base Pointer to FLEXIO_I2C_Type structure.

◆ FLEXIO_I2C_MasterSetBaudRate()

void FLEXIO_I2C_MasterSetBaudRate ( FLEXIO_I2C_Type base,
uint32_t  baudRate_Bps,
uint32_t  srcClock_Hz 
)

Sets the FlexIO I2C master transfer baudrate.

Parameters
basePointer to FLEXIO_I2C_Type structure
baudRate_Bpsthe baud rate value in HZ
srcClock_Hzsource clock in HZ

brief Sets the FlexIO I2C master transfer baudrate.

param base Pointer to FLEXIO_I2C_Type structure param baudRate_Bps the baud rate value in HZ param srcClock_Hz source clock in HZ

◆ FLEXIO_I2C_MasterSetTransferCount()

status_t FLEXIO_I2C_MasterSetTransferCount ( FLEXIO_I2C_Type base,
uint16_t  count 
)

Sets the number of bytes to be transferred from a start signal to a stop signal.

Note
Call this API before a transfer begins because the timer generates a number of clocks according to the number of bytes that need to be transferred.
Parameters
basePointer to FLEXIO_I2C_Type structure.
countNumber of bytes need to be transferred from a start signal to a re-start/stop signal
Return values
kStatus_SuccessSuccessfully configured the count.
kStatus_InvalidArgumentInput argument is invalid.

brief Sets the number of bytes to be transferred from a start signal to a stop signal.

note Call this API before a transfer begins because the timer generates a number of clocks according to the number of bytes that need to be transferred.

param base Pointer to FLEXIO_I2C_Type structure. param count Number of bytes need to be transferred from a start signal to a re-start/stop signal retval kStatus_Success Successfully configured the count. retval kStatus_InvalidArgument Input argument is invalid.

◆ FLEXIO_I2C_MasterStart()

void FLEXIO_I2C_MasterStart ( FLEXIO_I2C_Type base,
uint8_t  address,
flexio_i2c_direction_t  direction 
)

Sends START + 7-bit address to the bus.

Note
This API should be called when the transfer configuration is ready to send a START signal and 7-bit address to the bus. This is a non-blocking API, which returns directly after the address is put into the data register but the address transfer is not finished on the bus. Ensure that the kFLEXIO_I2C_RxFullFlag status is asserted before calling this API.
Parameters
basePointer to FLEXIO_I2C_Type structure.
address7-bit address.
directiontransfer direction. This parameter is one of the values in flexio_i2c_direction_t:
  • kFLEXIO_I2C_Write: Transmit
  • kFLEXIO_I2C_Read: Receive
brief Sends START + 7-bit address to the bus.

note This API should be called when the transfer configuration is ready to send a START signal and 7-bit address to the bus. This is a non-blocking API, which returns directly after the address is put into the data register but the address transfer is not finished on the bus. Ensure that the kFLEXIO_I2C_RxFullFlag status is asserted before calling this API. param base Pointer to FLEXIO_I2C_Type structure. param address 7-bit address. param direction transfer direction. This parameter is one of the values in flexio_i2c_direction_t: arg kFLEXIO_I2C_Write: Transmit arg kFLEXIO_I2C_Read: Receive

◆ FLEXIO_I2C_MasterStop()

void FLEXIO_I2C_MasterStop ( FLEXIO_I2C_Type base)

Sends the stop signal on the bus.

Parameters
basePointer to FLEXIO_I2C_Type structure.

brief Sends the stop signal on the bus.

param base Pointer to FLEXIO_I2C_Type structure.

◆ FLEXIO_I2C_MasterTransferAbort()

void FLEXIO_I2C_MasterTransferAbort ( FLEXIO_I2C_Type base,
flexio_i2c_master_handle_t handle 
)

Aborts an interrupt non-blocking transfer early.

Note
This API can be called at any time when an interrupt non-blocking transfer initiates to abort the transfer early.
Parameters
basePointer to FLEXIO_I2C_Type structure
handlePointer to flexio_i2c_master_handle_t structure which stores the transfer state

brief Aborts an interrupt non-blocking transfer early.

note This API can be called at any time when an interrupt non-blocking transfer initiates to abort the transfer early.

param base Pointer to FLEXIO_I2C_Type structure param handle Pointer to flexio_i2c_master_handle_t structure which stores the transfer state

◆ FLEXIO_I2C_MasterTransferBlocking()

status_t FLEXIO_I2C_MasterTransferBlocking ( FLEXIO_I2C_Type base,
flexio_i2c_master_transfer_t xfer 
)

Performs a master polling transfer on the I2C bus.

Note
The API does not return until the transfer succeeds or fails due to receiving NAK.
Parameters
basepointer to FLEXIO_I2C_Type structure.
xferpointer to flexio_i2c_master_transfer_t structure.
Returns
status of status_t.

brief Performs a master polling transfer on the I2C bus.

note The API does not return until the transfer succeeds or fails due to receiving NAK.

param base pointer to FLEXIO_I2C_Type structure. param xfer pointer to flexio_i2c_master_transfer_t structure. return status of status_t.

◆ FLEXIO_I2C_MasterTransferCreateHandle()

status_t FLEXIO_I2C_MasterTransferCreateHandle ( FLEXIO_I2C_Type base,
flexio_i2c_master_handle_t handle,
flexio_i2c_master_transfer_callback_t  callback,
void *  userData 
)

Initializes the I2C handle which is used in transactional functions.

Parameters
basePointer to FLEXIO_I2C_Type structure.
handlePointer to flexio_i2c_master_handle_t structure to store the transfer state.
callbackPointer to user callback function.
userDataUser param passed to the callback function.
Return values
kStatus_SuccessSuccessfully create the handle.
kStatus_OutOfRangeThe FlexIO type/handle/isr table out of range.

brief Initializes the I2C handle which is used in transactional functions.

param base Pointer to FLEXIO_I2C_Type structure. param handle Pointer to flexio_i2c_master_handle_t structure to store the transfer state. param callback Pointer to user callback function. param userData User param passed to the callback function. retval kStatus_Success Successfully create the handle. retval kStatus_OutOfRange The FlexIO type/handle/isr table out of range.

◆ FLEXIO_I2C_MasterTransferGetCount()

status_t FLEXIO_I2C_MasterTransferGetCount ( FLEXIO_I2C_Type base,
flexio_i2c_master_handle_t handle,
size_t *  count 
)

Gets the master transfer status during a interrupt non-blocking transfer.

Parameters
basePointer to FLEXIO_I2C_Type structure.
handlePointer to flexio_i2c_master_handle_t structure which stores the transfer state.
countNumber of bytes transferred so far by the non-blocking transaction.
Return values
kStatus_InvalidArgumentcount is Invalid.
kStatus_NoTransferInProgressThere is not a non-blocking transaction currently in progress.
kStatus_SuccessSuccessfully return the count.

brief Gets the master transfer status during a interrupt non-blocking transfer.

param base Pointer to FLEXIO_I2C_Type structure. param handle Pointer to flexio_i2c_master_handle_t structure which stores the transfer state. param count Number of bytes transferred so far by the non-blocking transaction. retval kStatus_InvalidArgument count is Invalid. retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. retval kStatus_Success Successfully return the count.

◆ FLEXIO_I2C_MasterTransferHandleIRQ()

void FLEXIO_I2C_MasterTransferHandleIRQ ( void *  i2cType,
void *  i2cHandle 
)

Master interrupt handler.

Parameters
i2cTypePointer to FLEXIO_I2C_Type structure
i2cHandlePointer to flexio_i2c_master_transfer_t structure

brief Master interrupt handler.

param i2cType Pointer to FLEXIO_I2C_Type structure param i2cHandle Pointer to flexio_i2c_master_transfer_t structure

◆ FLEXIO_I2C_MasterTransferNonBlocking()

status_t FLEXIO_I2C_MasterTransferNonBlocking ( FLEXIO_I2C_Type base,
flexio_i2c_master_handle_t handle,
flexio_i2c_master_transfer_t xfer 
)

Performs a master interrupt non-blocking transfer on the I2C bus.

Note
The API returns immediately after the transfer initiates. Call FLEXIO_I2C_MasterTransferGetCount to poll the transfer status to check whether the transfer is finished. If the return status is not kStatus_FLEXIO_I2C_Busy, the transfer is finished.
Parameters
basePointer to FLEXIO_I2C_Type structure
handlePointer to flexio_i2c_master_handle_t structure which stores the transfer state
xferpointer to flexio_i2c_master_transfer_t structure
Return values
kStatus_SuccessSuccessfully start a transfer.
kStatus_FLEXIO_I2C_BusyFlexIO I2C is not idle, is running another transfer.

brief Performs a master interrupt non-blocking transfer on the I2C bus.

note The API returns immediately after the transfer initiates. Call FLEXIO_I2C_MasterTransferGetCount to poll the transfer status to check whether the transfer is finished. If the return status is not kStatus_FLEXIO_I2C_Busy, the transfer is finished.

param base Pointer to FLEXIO_I2C_Type structure param handle Pointer to flexio_i2c_master_handle_t structure which stores the transfer state param xfer pointer to flexio_i2c_master_transfer_t structure retval kStatus_Success Successfully start a transfer. retval kStatus_FLEXIO_I2C_Busy FlexIO I2C is not idle, is running another transfer.

◆ FLEXIO_I2C_MasterWriteBlocking()

status_t FLEXIO_I2C_MasterWriteBlocking ( FLEXIO_I2C_Type base,
const uint8_t *  txBuff,
uint8_t  txSize 
)

Sends a buffer of data in bytes.

Note
This function blocks via polling until all bytes have been sent.
Parameters
basePointer to FLEXIO_I2C_Type structure.
txBuffThe data bytes to send.
txSizeThe number of data bytes to send.
Return values
kStatus_SuccessSuccessfully write data.
kStatus_FLEXIO_I2C_NakReceive NAK during writing data.
kStatus_FLEXIO_I2C_TimeoutTimeout polling status flags.

brief Sends a buffer of data in bytes.

note This function blocks via polling until all bytes have been sent.

param base Pointer to FLEXIO_I2C_Type structure. param txBuff The data bytes to send. param txSize The number of data bytes to send. retval kStatus_Success Successfully write data. retval kStatus_FLEXIO_I2C_Nak Receive NAK during writing data. retval kStatus_FLEXIO_I2C_Timeout Timeout polling status flags.

Variable Documentation

◆ baudrate

uint32_t _flexio_i2c_type::baudrate

Master transfer baudrate, used to calculate delay time.

◆ baudRate_Bps

uint32_t _flexio_i2c_master_config::baudRate_Bps

Baud rate in Bps.

◆ completionCallback

flexio_i2c_master_transfer_callback_t _flexio_i2c_master_handle::completionCallback

Callback function called at transfer event. Callback function called at transfer event.

◆ data

uint8_t volatile* _flexio_i2c_master_transfer::data

Transfer buffer.

◆ dataSize

volatile size_t _flexio_i2c_master_transfer::dataSize

Transfer size.

◆ direction

flexio_i2c_direction_t _flexio_i2c_master_transfer::direction

Transfer direction, read or write.

◆ enableFastAccess

bool _flexio_i2c_master_config::enableFastAccess

Enable/disable fast access to FlexIO registers, fast access requires the FlexIO clock to be at least twice the frequency of the bus clock.

◆ enableInDebug

bool _flexio_i2c_master_config::enableInDebug

Enable/disable FlexIO operation in debug mode.

◆ enableInDoze

bool _flexio_i2c_master_config::enableInDoze

Enable/disable FlexIO operation in doze mode.

◆ enableMaster

bool _flexio_i2c_master_config::enableMaster

Enables the FlexIO I2C peripheral at initialization time.

◆ flags

uint32_t _flexio_i2c_master_transfer::flags

Transfer flag which controls the transfer, reserved for FlexIO I2C.

◆ flexioBase

FLEXIO_Type* _flexio_i2c_type::flexioBase

FlexIO base pointer.

◆ needRestart

bool _flexio_i2c_master_handle::needRestart

Whether master needs to send re-start signal.

◆ SCLPinIndex

uint8_t _flexio_i2c_type::SCLPinIndex

Pin select for I2C SCL.

◆ SDAPinIndex

uint8_t _flexio_i2c_type::SDAPinIndex

Pin select for I2C SDA.

◆ shifterIndex

uint8_t _flexio_i2c_type::shifterIndex[2]

Shifter index used in FlexIO I2C.

◆ slaveAddress

uint8_t _flexio_i2c_master_transfer::slaveAddress

7-bit slave address.

◆ state

uint8_t _flexio_i2c_master_handle::state

Transfer state maintained during transfer.

◆ subaddress

uint32_t _flexio_i2c_master_transfer::subaddress

Sub address. Transferred MSB first.

◆ subaddressSize

uint8_t _flexio_i2c_master_transfer::subaddressSize

Size of command buffer.

◆ timerIndex

uint8_t _flexio_i2c_type::timerIndex[3]

Timer index used in FlexIO I2C.

◆ transfer

flexio_i2c_master_transfer_t _flexio_i2c_master_handle::transfer

FlexIO I2C master transfer copy.

◆ transferSize

size_t _flexio_i2c_master_handle::transferSize

Total bytes to be transferred.

◆ userData

void* _flexio_i2c_master_handle::userData

Callback parameter passed to callback function.