monoZ docs
MZ_i2c.h File Reference

This file contains all the functionalities for I2C protocol. More...

#include "MZ_public.h"
#include "MZ_error_handler.h"
#include "MZ_i2c.h"

Go to the source code of this file.

Data Structures

struct  MZ_I2CX
 Structure for monoZ I2C events. More...
 
struct  st_i2c_intr
 Structure for I2C interrupts. More...
 

Macros

#define I2C_MAX_COUNT_SIZE   I2C_MAX_COUNT
 

Typedefs

typedef _mz_fp _i2c_api
 use _i2c_api as monoZ function pointer More...
 
typedef MZ_I2CX MZ_I2C_BTYPE
 [TODO] More...
 
typedef MZ_I2CXMZ_I2C_BTYPE_PTR
 [TODO] More...
 

Enumerations

enum  en_i2c_no { _I2C2 , _I2C4 , I2C_MAX_COUNT }
 Enumeration for monoZ I2C Enable or disable the I2C instance. 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

This file contains all the functionalities for I2C protocol.

Date
Jun 8, 2021
Author
Mahendra

Definition in file MZ_i2c.h.

Macro Definition Documentation

◆ I2C_MAX_COUNT_SIZE

#define I2C_MAX_COUNT_SIZE   I2C_MAX_COUNT

[TODO]

Definition at line 39 of file MZ_i2c.h.

Typedef Documentation

◆ _i2c_api

use _i2c_api as monoZ function pointer

Definition at line 45 of file MZ_i2c.h.

◆ MZ_I2C_BTYPE

[TODO]

Definition at line 88 of file MZ_i2c.h.

◆ MZ_I2C_BTYPE_PTR

[TODO]

Definition at line 94 of file MZ_i2c.h.

Enumeration Type Documentation

◆ en_i2c_no

enum en_i2c_no

Enumeration for monoZ I2C Enable or disable the I2C instance.

Enumerator
_I2C2 

i2c2 is enable

_I2C4 

i2c4 is enable

I2C_MAX_COUNT 

i2c maximum count

Definition at line 22 of file MZ_i2c.h.