MCUXpresso SDK API Reference Manual  Rev 2.12.1
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
I3c_common_driver

Overview

Data Structures

struct  i3c_config_t
 Structure with settings to initialize the I3C module, could both initialize master and slave functionality. More...
 

Functions

uint32_t I3C_GetInstance (I3C_Type *base)
 Get which instance current I3C is used. More...
 
void I3C_GetDefaultConfig (i3c_config_t *config)
 Provides a default configuration for the I3C peripheral, the configuration covers both master functionality and slave functionality. More...
 
void I3C_Init (I3C_Type *base, const i3c_config_t *config, uint32_t sourceClock_Hz)
 Initializes the I3C peripheral. More...
 

Data Structure Documentation

struct i3c_config_t

This structure holds configuration settings for the I3C peripheral. To initialize this structure to reasonable defaults, call the I3C_GetDefaultConfig() function and pass a pointer to your configuration structure instance.

The configuration structure can be made constant so it resides in flash.

Data Fields

i3c_master_enable_t enableMaster
 Enable master mode. More...
 
bool disableTimeout
 Whether to disable timeout to prevent the ERRWARN. More...
 
i3c_master_hkeep_t hKeep
 High keeper mode setting. More...
 
bool enableOpenDrainStop
 Whether to emit open-drain speed STOP. More...
 
bool enableOpenDrainHigh
 Enable Open-Drain High to be 1 PPBAUD count for i3c messages, or 1 ODBAUD. More...
 
i3c_baudrate_hz_t baudRate_Hz
 Desired baud rate settings. More...
 
uint8_t masterDynamicAddress
 Main master dynamic address configuration. More...
 
uint32_t slowClock_Hz
 Slow clock frequency for time control. More...
 
uint32_t maxWriteLength
 Maximum write length. More...
 
uint32_t maxReadLength
 Maximum read length. More...
 
bool enableSlave
 Whether to enable slave. More...
 
uint8_t staticAddr
 Static address. More...
 
uint16_t vendorID
 Device vendor ID(manufacture ID). More...
 
bool enableRandomPart
 Whether to generate random part number, if using random part number, the partNumber variable setting is meaningless. More...
 
uint32_t partNumber
 Device part number info.
 
uint8_t dcr
 Device characteristics register information. More...
 
uint8_t bcr
 Bus characteristics register information. More...
 
uint8_t hdrMode
 Support hdr mode, could be OR logic in enumeration:i3c_hdr_mode_t. More...
 
bool nakAllRequest
 Whether to reply NAK to all requests except broadcast CCC. More...
 
bool ignoreS0S1Error
 Whether to ignore S0/S1 error in SDR mode. More...
 
bool offline
 Whether to wait 60 us of bus quiet or HDR request to ensure slave track SDR mode safely. More...
 
bool matchSlaveStartStop
 Whether to assert start/stop status only the time slave is addressed. More...
 

Field Documentation

i3c_master_enable_t i3c_config_t::enableMaster
bool i3c_config_t::disableTimeout
i3c_master_hkeep_t i3c_config_t::hKeep
bool i3c_config_t::enableOpenDrainStop
bool i3c_config_t::enableOpenDrainHigh
i3c_baudrate_hz_t i3c_config_t::baudRate_Hz
uint8_t i3c_config_t::masterDynamicAddress
uint32_t i3c_config_t::slowClock_Hz
uint32_t i3c_config_t::maxWriteLength
uint32_t i3c_config_t::maxReadLength
bool i3c_config_t::enableSlave
uint8_t i3c_config_t::staticAddr
uint16_t i3c_config_t::vendorID
bool i3c_config_t::enableRandomPart
uint8_t i3c_config_t::dcr
uint8_t i3c_config_t::bcr
uint8_t i3c_config_t::hdrMode
bool i3c_config_t::nakAllRequest
bool i3c_config_t::ignoreS0S1Error
bool i3c_config_t::offline
bool i3c_config_t::matchSlaveStartStop

Function Documentation

uint32_t I3C_GetInstance ( I3C_Type *  base)
Parameters
baseThe I3C peripheral base address.
void I3C_GetDefaultConfig ( i3c_config_t config)

This function provides the following default configuration for I3C:

* config->enableMaster = kI3C_MasterCapable;
* config->disableTimeout = false;
* config->hKeep = kI3C_MasterHighKeeperNone;
* config->enableOpenDrainStop = true;
* config->enableOpenDrainHigh = true;
* config->baudRate_Hz.i2cBaud = 400000U;
* config->baudRate_Hz.i3cPushPullBaud = 12500000U;
* config->baudRate_Hz.i3cOpenDrainBaud = 2500000U;
* config->masterDynamicAddress = 0x0AU;
* config->slowClock_Hz = 1000000U;
* config->enableSlave = true;
* config->vendorID = 0x11BU;
* config->enableRandomPart = false;
* config->partNumber = 0;
* config->dcr = 0;
* config->bcr = 0;
* config->hdrMode = (uint8_t)kI3C_HDRModeDDR;
* config->nakAllRequest = false;
* config->ignoreS0S1Error = false;
* config->offline = false;
* config->matchSlaveStartStop = false;
*

After calling this function, you can override any settings in order to customize the configuration, prior to initializing the common I3C driver with I3C_Init().

Parameters
[out]configUser provided configuration structure for default values. Refer to i3c_config_t.
void I3C_Init ( I3C_Type *  base,
const i3c_config_t config,
uint32_t  sourceClock_Hz 
)

This function enables the peripheral clock and initializes the I3C peripheral as described by the user provided configuration. This will initialize both the master peripheral and slave peripheral so that I3C module could work as pure master, pure slave or secondary master, etc. A software reset is performed prior to configuration.

Parameters
baseThe I3C peripheral base address.
configUser provided peripheral configuration. Use I3C_GetDefaultConfig() to get a set of defaults that you can override.
sourceClock_HzFrequency in Hertz of the I3C functional clock. Used to calculate the baud rate divisors, filter widths, and timeout periods.