monoZ docs
I2C

-For monoZ I2C refer MZ_i2c.h file. More...

Functions

MZ_I2C_BTYPE_PTR MZ_I2C_get_base_address (void)
 This function returns the base address of all the I2CS defined in SDK. More...
 
MZ_I2C_BTYPE_PTR MZ_I2C_reference (en_i2c_no i2c_no)
 This function returns the address of the specific I2C. More...
 
mz_error_t MZ_I2C_init (MZ_I2C_INIT_PTR _cfg)
 This function initializes the specific I2C. More...
 
mz_error_t MZ_I2C_register_callback (uint8_t I2C_no, _i2c_api cb)
 This function registers the I2C callback. More...
 
mz_error_t MZ_I2C_register_intr_cb_tx (uint8_t i2c_no, _i2c_api cb)
 This function registers the TX complete callback function for the specific I2C. More...
 
mz_error_t MZ_I2C_register_intr_cb_rx (uint8_t i2c_no, _i2c_api cb)
 This function registers the RX complete callback function for the specific I2C. More...
 
mz_error_t MZ_I2C_Master_Transmit (uint8_t i2c_no, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t Timeout)
 This function is used to transmit data using I2C in interrupt mode. More...
 
mz_error_t MZ_I2C_Master_Receive (uint8_t i2c_no, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t Timeout)
 This function is used to receive data using I2C in interrupt mode. More...
 
mz_error_t MZ_I2C_Master_Transmit_IT (uint8_t i2c_no, uint16_t DevAddress, uint8_t *pData, uint16_t Size)
 This function is used to transmit data using I2C in polling mode. More...
 
mz_error_t MZ_I2C_Master_Receive_IT (uint8_t i2c_no, uint16_t DevAddress, uint8_t *pData, uint16_t Size)
 This function is used to receive data using I2C in interrupt mode. More...
 
void MZ_HAL_I2C_EV_IRQHandler (uint8_t i2c_no)
 This function defines the Global Event Interrupt handler functions of I2C. More...
 
void MZ_HAL_I2C_ER_IRQHandler (uint8_t i2c_no)
 This function defines the Global Error Interrupt handler functions of I2C. More...
 

Detailed Description

-For monoZ I2C refer MZ_i2c.h file.

Function Documentation

◆ MZ_I2C_get_base_address()

MZ_I2C_BTYPE_PTR MZ_I2C_get_base_address ( void  )

This function returns the base address of all the I2CS defined in SDK.

Returns
Base address of I2C

◆ MZ_I2C_reference()

MZ_I2C_BTYPE_PTR MZ_I2C_reference ( en_i2c_no  i2c_no)

This function returns the address of the specific I2C.

Parameters
i2c_noen_i2c_no
Returns
Reference of I2C

◆ MZ_I2C_init()

mz_error_t MZ_I2C_init ( MZ_I2C_INIT_PTR  _cfg)

This function initializes the specific I2C.

Parameters
_cfgMZ_I2C_INIT_PTR
Returns
MZ_OK/MZ_FAIL

◆ MZ_I2C_register_callback()

mz_error_t MZ_I2C_register_callback ( uint8_t  I2C_no,
_i2c_api  cb 
)

This function registers the I2C callback.

Parameters
I2C_nouint8_t
cb_i2c_api
Returns
MZ_OK/MZ_FAIL

◆ MZ_I2C_register_intr_cb_tx()

mz_error_t MZ_I2C_register_intr_cb_tx ( uint8_t  i2c_no,
_i2c_api  cb 
)

This function registers the TX complete callback function for the specific I2C.

Parameters
i2c_nouint8_t
cb_i2c_api
Returns
MZ_OK/MZ_FAIL

◆ MZ_I2C_register_intr_cb_rx()

mz_error_t MZ_I2C_register_intr_cb_rx ( uint8_t  i2c_no,
_i2c_api  cb 
)

This function registers the RX complete callback function for the specific I2C.

Parameters
i2c_nouint8_t
cb_i2c_api
Returns
MZ_OK/MZ_FAIL

◆ MZ_I2C_Master_Transmit()

mz_error_t MZ_I2C_Master_Transmit ( uint8_t  i2c_no,
uint16_t  DevAddress,
uint8_t *  pData,
uint16_t  Size,
uint32_t  Timeout 
)

This function is used to transmit data using I2C in interrupt mode.

Parameters
i2c_nouint8_t
DevAddressuint16_t
*pDatauint8_t
Sizeuint16_t
Timeoutuint32_t
Returns
MZ_OK/MZ_FAIL

◆ MZ_I2C_Master_Receive()

mz_error_t MZ_I2C_Master_Receive ( uint8_t  i2c_no,
uint16_t  DevAddress,
uint8_t *  pData,
uint16_t  Size,
uint32_t  Timeout 
)

This function is used to receive data using I2C in interrupt mode.

Parameters
i2c_nouint8_t
DevAddressuint16_t
*pDatauint8_t
Sizeuint16_t
Timeoutuint32_t
Returns
MZ_OK/MZ_FAIL

◆ MZ_I2C_Master_Transmit_IT()

mz_error_t MZ_I2C_Master_Transmit_IT ( uint8_t  i2c_no,
uint16_t  DevAddress,
uint8_t *  pData,
uint16_t  Size 
)

This function is used to transmit data using I2C in polling mode.

Parameters
i2c_nouint8_t
DevAddressuint16_t
*pDatauint8_t
Sizeuint16_t
Returns
MZ_OK/MZ_FAIL

◆ MZ_I2C_Master_Receive_IT()

mz_error_t MZ_I2C_Master_Receive_IT ( uint8_t  i2c_no,
uint16_t  DevAddress,
uint8_t *  pData,
uint16_t  Size 
)

This function is used to receive data using I2C in interrupt mode.

Parameters
i2c_nouint8_t
DevAddressuint16_t
*pDatauint8_t
Sizeuint16_t
Returns
MZ_OK/MZ_FAIL

◆ MZ_HAL_I2C_EV_IRQHandler()

void MZ_HAL_I2C_EV_IRQHandler ( uint8_t  i2c_no)

This function defines the Global Event Interrupt handler functions of I2C.

Global Interrupt handler function

Parameters
i2c_nouint8_t

◆ MZ_HAL_I2C_ER_IRQHandler()

void MZ_HAL_I2C_ER_IRQHandler ( uint8_t  i2c_no)

This function defines the Global Error Interrupt handler functions of I2C.

Parameters
i2c_nouint8_t