![]() |
M480 BSP V3.05.006
The Board Support Package for M480 Series
|
Macros | |
#define | UI2C_SET_CONTROL_REG(ui2c, u8Ctrl) |
This macro sets the USCI_I2C protocol control register at one time. More... | |
#define | UI2C_START(ui2c) |
This macro only set START bit to protocol control register of USCI_I2C module. More... | |
#define | UI2C_STOP(ui2c) |
This macro only set STOP bit to the control register of USCI_I2C module. More... | |
#define | UI2C_GET_DATA(ui2c) |
This macro returns the data stored in data register of USCI_I2C module. More... | |
#define | UI2C_SET_DATA(ui2c, u8Data) |
This macro writes the data to data register of USCI_I2C module. More... | |
#define | UI2C_GET_TIMEOUT_FLAG(ui2c) |
This macro returns time-out flag. More... | |
#define | UI2C_GET_WAKEUP_FLAG(ui2c) |
This macro returns wake-up flag. More... | |
#define | UI2C_CLR_WAKEUP_FLAG(ui2c) |
This macro is used to clear USCI_I2C wake-up flag. More... | |
#define | UI2C_DISABLE_10BIT_ADDR_MODE(ui2c) |
This macro disables the USCI_I2C 10-bit address mode. More... | |
#define | UI2C_ENABLE_10BIT_ADDR_MODE(ui2c) |
This macro enables the 10-bit address mode. More... | |
#define | UI2C_GET_PROT_STATUS(ui2c) |
This macro gets USCI_I2C protocol interrupt flag or bus status. More... | |
#define | UI2C_CLR_PROT_INT_FLAG(ui2c, u32IntTypeFlag) |
This macro clears specified protocol interrupt flag. More... | |
#define | UI2C_ENABLE_PROT_INT(ui2c, u32IntSel) |
This macro enables specified protocol interrupt. More... | |
#define | UI2C_DISABLE_PROT_INT(ui2c, u32IntSel) |
This macro disables specified protocol interrupt. More... | |
Functions | |
uint32_t | UI2C_Open (UI2C_T *ui2c, uint32_t u32BusClock) |
This function makes USCI_I2C module be ready and set the wanted bus clock. More... | |
void | UI2C_Close (UI2C_T *ui2c) |
This function closes the USCI_I2C module. More... | |
void | UI2C_ClearTimeoutFlag (UI2C_T *ui2c) |
This function clears the time-out flag. More... | |
void | UI2C_Trigger (UI2C_T *ui2c, uint8_t u8Start, uint8_t u8Stop, uint8_t u8Ptrg, uint8_t u8Ack) |
This function sets the control bit of the USCI_I2C module. More... | |
void | UI2C_DisableInt (UI2C_T *ui2c, uint32_t u32Mask) |
This function disables the interrupt of USCI_I2C module. More... | |
void | UI2C_EnableInt (UI2C_T *ui2c, uint32_t u32Mask) |
This function enables the interrupt of USCI_I2C module. More... | |
uint32_t | UI2C_GetBusClockFreq (UI2C_T *ui2c) |
This function returns the real bus clock of USCI_I2C module. More... | |
uint32_t | UI2C_SetBusClockFreq (UI2C_T *ui2c, uint32_t u32BusClock) |
This function sets bus clock frequency of USCI_I2C module. More... | |
uint32_t | UI2C_GetIntFlag (UI2C_T *ui2c, uint32_t u32Mask) |
This function gets the interrupt flag of USCI_I2C module. More... | |
void | UI2C_ClearIntFlag (UI2C_T *ui2c, uint32_t u32Mask) |
This function clears the interrupt flag of USCI_I2C module. More... | |
uint32_t | UI2C_GetData (UI2C_T *ui2c) |
This function returns the data stored in data register of USCI_I2C module. More... | |
void | UI2C_SetData (UI2C_T *ui2c, uint8_t u8Data) |
This function writes a byte data to data register of USCI_I2C module. More... | |
void | UI2C_SetSlaveAddr (UI2C_T *ui2c, uint8_t u8SlaveNo, uint16_t u16SlaveAddr, uint8_t u8GCMode) |
Configure slave address and enable GC mode. More... | |
void | UI2C_SetSlaveAddrMask (UI2C_T *ui2c, uint8_t u8SlaveNo, uint16_t u16SlaveAddrMask) |
Configure the mask bit of slave address. More... | |
void | UI2C_EnableTimeout (UI2C_T *ui2c, uint32_t u32TimeoutCnt) |
This function enables time-out function and configures timeout counter. More... | |
void | UI2C_DisableTimeout (UI2C_T *ui2c) |
This function disables time-out function. More... | |
void | UI2C_EnableWakeup (UI2C_T *ui2c, uint8_t u8WakeupMode) |
This function enables the wakeup function of USCI_I2C module. More... | |
void | UI2C_DisableWakeup (UI2C_T *ui2c) |
This function disables the wakeup function of USCI_I2C module. More... | |
uint8_t | UI2C_WriteByte (UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t data) |
Write a byte to Slave. More... | |
uint32_t | UI2C_WriteMultiBytes (UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t *data, uint32_t u32wLen) |
Write multi bytes to Slave. More... | |
uint8_t | UI2C_WriteByteOneReg (UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t data) |
Specify a byte register address and write a byte to Slave. More... | |
uint32_t | UI2C_WriteMultiBytesOneReg (UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t *data, uint32_t u32wLen) |
Specify a byte register address and write multi bytes to Slave. More... | |
uint8_t | UI2C_WriteByteTwoRegs (UI2C_T *ui2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t data) |
Specify two bytes register address and Write a byte to Slave. More... | |
uint32_t | UI2C_WriteMultiBytesTwoRegs (UI2C_T *ui2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t *data, uint32_t u32wLen) |
Specify two bytes register address and write multi bytes to Slave. More... | |
uint8_t | UI2C_ReadByte (UI2C_T *ui2c, uint8_t u8SlaveAddr) |
Read a byte from Slave. More... | |
uint32_t | UI2C_ReadMultiBytes (UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t *rdata, uint32_t u32rLen) |
Read multi bytes from Slave. More... | |
uint8_t | UI2C_ReadByteOneReg (UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr) |
Specify a byte register address and read a byte from Slave. More... | |
uint32_t | UI2C_ReadMultiBytesOneReg (UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t *rdata, uint32_t u32rLen) |
Specify a byte register address and read multi bytes from Slave. More... | |
uint8_t | UI2C_ReadByteTwoRegs (UI2C_T *ui2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr) |
Specify two bytes register address and read a byte from Slave. More... | |
uint32_t | UI2C_ReadMultiBytesTwoRegs (UI2C_T *ui2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t *rdata, uint32_t u32rLen) |
Specify two bytes register address and read multi bytes from Slave. More... | |
#define UI2C_CLR_PROT_INT_FLAG | ( | ui2c, | |
u32IntTypeFlag | |||
) |
This macro clears specified protocol interrupt flag.
[in] | ui2c | The pointer of the specified USCI_I2C module. |
[in] | u32IntTypeFlag | Interrupt Type Flag, should be |
To clear interrupt flag when USCI_I2C occurs interrupt and set interrupt flag.
Definition at line 250 of file usci_i2c.h.
#define UI2C_CLR_WAKEUP_FLAG | ( | ui2c | ) |
This macro is used to clear USCI_I2C wake-up flag.
[in] | ui2c | The pointer of the specified USCI_I2C module. |
If USCI_I2C wake-up flag is set, use this macro to clear it.
Definition at line 196 of file usci_i2c.h.
#define UI2C_DISABLE_10BIT_ADDR_MODE | ( | ui2c | ) |
This macro disables the USCI_I2C 10-bit address mode.
[in] | ui2c | The pointer of the specified USCI_I2C module. |
The UI2C_I2C is 7-bit address mode, when disable USCI_I2C 10-bit address match function.
Definition at line 208 of file usci_i2c.h.
#define UI2C_DISABLE_PROT_INT | ( | ui2c, | |
u32IntSel | |||
) |
This macro disables specified protocol interrupt.
[in] | ui2c | The pointer of the specified USCI_I2C module. |
[in] | u32IntSel | Interrupt Type, should be |
Clear specified USCI_I2C protocol interrupt bits to disable interrupt function.
Definition at line 286 of file usci_i2c.h.
#define UI2C_ENABLE_10BIT_ADDR_MODE | ( | ui2c | ) |
This macro enables the 10-bit address mode.
[in] | ui2c | The pointer of the specified USCI_I2C module. |
To enable USCI_I2C 10-bit address match function.
Definition at line 220 of file usci_i2c.h.
#define UI2C_ENABLE_PROT_INT | ( | ui2c, | |
u32IntSel | |||
) |
This macro enables specified protocol interrupt.
[in] | ui2c | The pointer of the specified USCI_I2C module. |
[in] | u32IntSel | Interrupt Type, should be |
Set specified USCI_I2C protocol interrupt bits to enable interrupt function.
Definition at line 268 of file usci_i2c.h.
#define UI2C_GET_DATA | ( | ui2c | ) |
This macro returns the data stored in data register of USCI_I2C module.
[in] | ui2c | The pointer of the specified USCI_I2C module. |
Read a byte data value of UI2C_RXDAT register from USCI_I2C bus
Definition at line 145 of file usci_i2c.h.
#define UI2C_GET_PROT_STATUS | ( | ui2c | ) |
This macro gets USCI_I2C protocol interrupt flag or bus status.
[in] | ui2c | The pointer of the specified USCI_I2C module. |
Read a word data of USCI_I2C PROTSTS register to get USCI_I2C bus Interrupt flags or status.
Definition at line 232 of file usci_i2c.h.
#define UI2C_GET_TIMEOUT_FLAG | ( | ui2c | ) |
This macro returns time-out flag.
[in] | ui2c | The pointer of the specified USCI_I2C module. |
0 | USCI_I2C bus time-out is not happened |
1 | USCI_I2C bus time-out is happened |
USCI_I2C bus occurs time-out event, the time-out flag will be set. If not occurs time-out event, this bit is cleared.
Definition at line 171 of file usci_i2c.h.
#define UI2C_GET_WAKEUP_FLAG | ( | ui2c | ) |
This macro returns wake-up flag.
[in] | ui2c | The pointer of the specified USCI_I2C module. |
0 | Chip is not woken-up from power-down mode |
1 | Chip is woken-up from power-down mode |
USCI_I2C controller wake-up flag will be set when USCI_I2C bus occurs wake-up from deep-sleep.
Definition at line 184 of file usci_i2c.h.
#define UI2C_SET_CONTROL_REG | ( | ui2c, | |
u8Ctrl | |||
) |
This macro sets the USCI_I2C protocol control register at one time.
[in] | ui2c | The pointer of the specified USCI_I2C module. |
[in] | u8Ctrl | Set the register value of USCI_I2C control register. |
Set UI2C_PROTCTL register to control USCI_I2C bus conditions of START, STOP, SI, ACK.
Definition at line 109 of file usci_i2c.h.
#define UI2C_SET_DATA | ( | ui2c, | |
u8Data | |||
) |
This macro writes the data to data register of USCI_I2C module.
[in] | ui2c | The pointer of the specified USCI_I2C module. |
[in] | u8Data | The data which will be written to data register of USCI_I2C module. |
Write a byte data value of UI2C_TXDAT register, then sends address or data to USCI I2C bus
Definition at line 158 of file usci_i2c.h.
#define UI2C_START | ( | ui2c | ) |
This macro only set START bit to protocol control register of USCI_I2C module.
[in] | ui2c | The pointer of the specified USCI_I2C module. |
Set the USCI_I2C bus START condition in UI2C_PROTCTL register.
Definition at line 121 of file usci_i2c.h.
#define UI2C_STOP | ( | ui2c | ) |
This macro only set STOP bit to the control register of USCI_I2C module.
[in] | ui2c | The pointer of the specified USCI_I2C module. |
Set the USCI_I2C bus STOP condition in UI2C_PROTCTL register.
Definition at line 133 of file usci_i2c.h.
void UI2C_ClearIntFlag | ( | UI2C_T * | ui2c, |
uint32_t | u32Mask | ||
) |
This function clears the interrupt flag of USCI_I2C module.
[in] | ui2c | The pointer of the specified USCI_I2C module. |
[in] | u32Mask | The combination of all related interrupt sources. Each bit corresponds to a interrupt source. This parameter decides which interrupt flags will be cleared. It is combination of: |
Use this function to clear USCI_I2C interrupt flag when module occurs interrupt event and set flag.
Definition at line 418 of file usci_i2c.c.
void UI2C_ClearTimeoutFlag | ( | UI2C_T * | ui2c | ) |
This function clears the time-out flag.
[in] | ui2c | The pointer of the specified USCI_I2C module. |
Clear time-out flag when time-out flag is set.
Definition at line 94 of file usci_i2c.c.
void UI2C_Close | ( | UI2C_T * | ui2c | ) |
This function closes the USCI_I2C module.
[in] | ui2c | The pointer of the specified USCI_I2C module. |
Close USCI_I2C protocol function.
Definition at line 79 of file usci_i2c.c.
void UI2C_DisableInt | ( | UI2C_T * | ui2c, |
uint32_t | u32Mask | ||
) |
This function disables the interrupt of USCI_I2C module.
[in] | ui2c | The pointer of the specified USCI_I2C module. |
[in] | u32Mask | The combination of all related interrupt enable bits. Each bit corresponds to an interrupt enable bit. This parameter decides which interrupts will be disabled. It is combination of: |
The function is used to disable USCI_I2C bus interrupt events.
Definition at line 156 of file usci_i2c.c.
void UI2C_DisableTimeout | ( | UI2C_T * | ui2c | ) |
This function disables time-out function.
[in] | ui2c | The pointer of the specified USCI_I2C module. |
To disable USCI_I2C bus time-out function.
Definition at line 569 of file usci_i2c.c.
void UI2C_DisableWakeup | ( | UI2C_T * | ui2c | ) |
This function disables the wakeup function of USCI_I2C module.
[in] | ui2c | The pointer of the specified USCI_I2C module. |
To disable USCI_I2C module wake-up function.
Definition at line 601 of file usci_i2c.c.
void UI2C_EnableInt | ( | UI2C_T * | ui2c, |
uint32_t | u32Mask | ||
) |
This function enables the interrupt of USCI_I2C module.
[in] | ui2c | The pointer of the specified USCI_I2C module. |
[in] | u32Mask | The combination of all related interrupt enable bits. Each bit corresponds to a interrupt enable bit. This parameter decides which interrupts will be enabled. It is combination of: |
The function is used to enable USCI_I2C bus interrupt events.
Definition at line 218 of file usci_i2c.c.
void UI2C_EnableTimeout | ( | UI2C_T * | ui2c, |
uint32_t | u32TimeoutCnt | ||
) |
This function enables time-out function and configures timeout counter.
[in] | ui2c | The pointer of the specified USCI_I2C module. |
[in] | u32TimeoutCnt | Timeout counter. Valid values are between 0~0x3FF |
To enable USCI_I2C bus time-out function and set time-out counter.
Definition at line 554 of file usci_i2c.c.
void UI2C_EnableWakeup | ( | UI2C_T * | ui2c, |
uint8_t | u8WakeupMode | ||
) |
This function enables the wakeup function of USCI_I2C module.
[in] | ui2c | The pointer of the specified USCI_I2C module. |
[in] | u8WakeupMode | The wake-up mode selection. Valid values are: |
To enable USCI_I2C module wake-up function.
Definition at line 587 of file usci_i2c.c.
uint32_t UI2C_GetBusClockFreq | ( | UI2C_T * | ui2c | ) |
This function returns the real bus clock of USCI_I2C module.
[in] | ui2c | The pointer of the specified USCI_I2C module. |
The function returns the actual USCI_I2C module bus clock.
Definition at line 272 of file usci_i2c.c.
uint32_t UI2C_GetData | ( | UI2C_T * | ui2c | ) |
This function returns the data stored in data register of USCI_I2C module.
[in] | ui2c | The pointer of the specified USCI_I2C module. |
To read a byte data from USCI_I2C module receive data register.
Definition at line 472 of file usci_i2c.c.
uint32_t UI2C_GetIntFlag | ( | UI2C_T * | ui2c, |
uint32_t | u32Mask | ||
) |
This function gets the interrupt flag of USCI_I2C module.
[in] | ui2c | The pointer of the specified USCI_I2C module. |
[in] | u32Mask | The combination of all related interrupt sources. Each bit corresponds to a interrupt source. This parameter decides which interrupt flags will be read. It is combination of: |
Use this function to get USCI_I2C interrupt flag when module occurs interrupt event.
Definition at line 343 of file usci_i2c.c.
uint32_t UI2C_Open | ( | UI2C_T * | ui2c, |
uint32_t | u32BusClock | ||
) |
This function makes USCI_I2C module be ready and set the wanted bus clock.
[in] | ui2c | The pointer of the specified USCI_I2C module. |
[in] | u32BusClock | The target bus speed of USCI_I2C module. |
Enable USCI_I2C module and configure USCI_I2C module(bus clock, data format).
Definition at line 34 of file usci_i2c.c.
uint8_t UI2C_ReadByte | ( | UI2C_T * | ui2c, |
uint8_t | u8SlaveAddr | ||
) |
Read a byte from Slave.
[in] | *ui2c | The pointer of the specified USCI_I2C module. |
[in] | u8SlaveAddr | Access Slave address(7-bit) |
The function is used for USCI_I2C Master to read a byte data from Slave.
Definition at line 1092 of file usci_i2c.c.
uint8_t UI2C_ReadByteOneReg | ( | UI2C_T * | ui2c, |
uint8_t | u8SlaveAddr, | ||
uint8_t | u8DataAddr | ||
) |
Specify a byte register address and read a byte from Slave.
[in] | *ui2c | The pointer of the specified USCI_I2C module. |
[in] | u8SlaveAddr | Access Slave address(7-bit) |
[in] | u8DataAddr | Specify a address(1 byte) of data read from |
The function is used for USCI_I2C Master specify a byte address that a data byte read from Slave.
Definition at line 1253 of file usci_i2c.c.
uint8_t UI2C_ReadByteTwoRegs | ( | UI2C_T * | ui2c, |
uint8_t | u8SlaveAddr, | ||
uint16_t | u16DataAddr | ||
) |
Specify two bytes register address and read a byte from Slave.
[in] | *ui2c | The pointer of the specified USCI_I2C module. |
[in] | u8SlaveAddr | Access Slave address(7-bit) |
[in] | u16DataAddr | Specify a address(2 byte) of data read from |
The function is used for USCI_I2C Master specify two bytes address that a data byte read from Slave.
Definition at line 1463 of file usci_i2c.c.
uint32_t UI2C_ReadMultiBytes | ( | UI2C_T * | ui2c, |
uint8_t | u8SlaveAddr, | ||
uint8_t * | rdata, | ||
uint32_t | u32rLen | ||
) |
Read multi bytes from Slave.
[in] | *ui2c | The pointer of the specified USCI_I2C module. |
[in] | u8SlaveAddr | Access Slave address(7-bit) |
[out] | *rdata | Point to array to store data from Slave |
[in] | u32rLen | How many bytes need to read from Slave |
The function is used for USCI_I2C Master to read multi data bytes from Slave.
Definition at line 1170 of file usci_i2c.c.
uint32_t UI2C_ReadMultiBytesOneReg | ( | UI2C_T * | ui2c, |
uint8_t | u8SlaveAddr, | ||
uint8_t | u8DataAddr, | ||
uint8_t * | rdata, | ||
uint32_t | u32rLen | ||
) |
Specify a byte register address and read multi bytes from Slave.
[in] | *ui2c | The pointer of the specified USCI_I2C module. |
[in] | u8SlaveAddr | Access Slave address(7-bit) |
[in] | u8DataAddr | Specify a address (1 bytes) of data read from |
[out] | *rdata | Point to array to store data from Slave |
[in] | u32rLen | How many bytes need to read from Slave |
The function is used for USCI_I2C Master specify a byte address that multi data bytes read from Slave.
Definition at line 1359 of file usci_i2c.c.
uint32_t UI2C_ReadMultiBytesTwoRegs | ( | UI2C_T * | ui2c, |
uint8_t | u8SlaveAddr, | ||
uint16_t | u16DataAddr, | ||
uint8_t * | rdata, | ||
uint32_t | u32rLen | ||
) |
Specify two bytes register address and read multi bytes from Slave.
[in] | *ui2c | The pointer of the specified USCI_I2C module. |
[in] | u8SlaveAddr | Access Slave address(7-bit) |
[in] | u16DataAddr | Specify a address (2 bytes) of data read from |
[out] | *rdata | Point to array to store data from Slave |
[in] | u32rLen | How many bytes need to read from Slave |
The function is used for USCI_I2C Master specify two bytes address that multi data bytes read from Slave.
Definition at line 1576 of file usci_i2c.c.
uint32_t UI2C_SetBusClockFreq | ( | UI2C_T * | ui2c, |
uint32_t | u32BusClock | ||
) |
This function sets bus clock frequency of USCI_I2C module.
[in] | ui2c | The pointer of the specified USCI_I2C module. |
[in] | u32BusClock | The target bus speed of USCI_I2C module. |
Use this function set USCI_I2C bus clock frequency and return actual bus clock.
Definition at line 301 of file usci_i2c.c.
void UI2C_SetData | ( | UI2C_T * | ui2c, |
uint8_t | u8Data | ||
) |
This function writes a byte data to data register of USCI_I2C module.
[in] | ui2c | The pointer of the specified USCI_I2C module. |
[in] | u8Data | The data which will be written to data register of USCI_I2C module. |
To write a byte data to transmit data register to transmit data.
Definition at line 487 of file usci_i2c.c.
void UI2C_SetSlaveAddr | ( | UI2C_T * | ui2c, |
uint8_t | u8SlaveNo, | ||
uint16_t | u16SlaveAddr, | ||
uint8_t | u8GCMode | ||
) |
Configure slave address and enable GC mode.
[in] | ui2c | The pointer of the specified USCI_I2C module. |
[in] | u8SlaveNo | Slave channel number [0/1] |
[in] | u16SlaveAddr | The slave address. |
[in] | u8GCMode | GC mode enable or not. Valid values are: |
To configure USCI_I2C module slave address and GC mode.
Definition at line 506 of file usci_i2c.c.
void UI2C_SetSlaveAddrMask | ( | UI2C_T * | ui2c, |
uint8_t | u8SlaveNo, | ||
uint16_t | u16SlaveAddrMask | ||
) |
Configure the mask bit of slave address.
[in] | ui2c | The pointer of the specified USCI_I2C module. |
[in] | u8SlaveNo | Slave channel number [0/1] |
[in] | u16SlaveAddrMask | The slave address mask. |
To configure USCI_I2C module slave address mask bit.
Definition at line 532 of file usci_i2c.c.
void UI2C_Trigger | ( | UI2C_T * | ui2c, |
uint8_t | u8Start, | ||
uint8_t | u8Stop, | ||
uint8_t | u8Ptrg, | ||
uint8_t | u8Ack | ||
) |
This function sets the control bit of the USCI_I2C module.
[in] | ui2c | The pointer of the specified USCI_I2C module. |
[in] | u8Start | Set START bit to USCI_I2C module. |
[in] | u8Stop | Set STOP bit to USCI_I2C module. |
[in] | u8Ptrg | Set PTRG bit to USCI_I2C module. |
[in] | u8Ack | Set ACK bit to USCI_I2C module. |
The function set USCI_I2C control bit of USCI_I2C bus protocol.
Definition at line 112 of file usci_i2c.c.
uint8_t UI2C_WriteByte | ( | UI2C_T * | ui2c, |
uint8_t | u8SlaveAddr, | ||
uint8_t | data | ||
) |
Write a byte to Slave.
[in] | *ui2c | The pointer of the specified USCI_I2C module. |
[in] | u8SlaveAddr | Access Slave address(7-bit) |
[in] | data | Write a byte data to Slave |
0 | Write data success |
1 | Write data fail, or bus occurs error events |
The function is used for USCI_I2C Master write a byte data to Slave.
Definition at line 620 of file usci_i2c.c.
uint8_t UI2C_WriteByteOneReg | ( | UI2C_T * | ui2c, |
uint8_t | u8SlaveAddr, | ||
uint8_t | u8DataAddr, | ||
uint8_t | data | ||
) |
Specify a byte register address and write a byte to Slave.
[in] | *ui2c | The pointer of the specified USCI_I2C module. |
[in] | u8SlaveAddr | Access Slave address(7-bit) |
[in] | u8DataAddr | Specify a address (1 byte) of data write to |
[in] | data | A byte data to write it to Slave |
0 | Write data success |
1 | Write data fail, or bus occurs error events |
The function is used for USCI_I2C Master specify a address that data write to in Slave.
Definition at line 763 of file usci_i2c.c.
uint8_t UI2C_WriteByteTwoRegs | ( | UI2C_T * | ui2c, |
uint8_t | u8SlaveAddr, | ||
uint16_t | u16DataAddr, | ||
uint8_t | data | ||
) |
Specify two bytes register address and Write a byte to Slave.
[in] | *ui2c | The pointer of the specified USCI_I2C module. |
[in] | u8SlaveAddr | Access Slave address(7-bit) |
[in] | u16DataAddr | Specify a address (2 byte) of data write to |
[in] | data | Write a byte data to Slave |
0 | Write data success |
1 | Write data fail, or bus occurs error events |
The function is used for USCI_I2C Master specify two bytes address that data write to in Slave.
Definition at line 922 of file usci_i2c.c.
uint32_t UI2C_WriteMultiBytes | ( | UI2C_T * | ui2c, |
uint8_t | u8SlaveAddr, | ||
uint8_t * | data, | ||
uint32_t | u32wLen | ||
) |
Write multi bytes to Slave.
[in] | *ui2c | The pointer of the specified USCI_I2C module. |
[in] | u8SlaveAddr | Access Slave address(7-bit) |
[in] | *data | Pointer to array to write data to Slave |
[in] | u32wLen | How many bytes need to write to Slave |
The function is used for USCI_I2C Master write multi bytes data to Slave.
Definition at line 694 of file usci_i2c.c.
uint32_t UI2C_WriteMultiBytesOneReg | ( | UI2C_T * | ui2c, |
uint8_t | u8SlaveAddr, | ||
uint8_t | u8DataAddr, | ||
uint8_t * | data, | ||
uint32_t | u32wLen | ||
) |
Specify a byte register address and write multi bytes to Slave.
[in] | *ui2c | The pointer of the specified USCI_I2C module. |
[in] | u8SlaveAddr | Access Slave address(7-bit) |
[in] | u8DataAddr | Specify a address (1 byte) of data write to |
[in] | *data | Pointer to array to write data to Slave |
[in] | u32wLen | How many bytes need to write to Slave |
The function is used for USCI_I2C Master specify a byte address that multi data bytes write to in Slave.
Definition at line 843 of file usci_i2c.c.
uint32_t UI2C_WriteMultiBytesTwoRegs | ( | UI2C_T * | ui2c, |
uint8_t | u8SlaveAddr, | ||
uint16_t | u16DataAddr, | ||
uint8_t * | data, | ||
uint32_t | u32wLen | ||
) |
Specify two bytes register address and write multi bytes to Slave.
[in] | *ui2c | The pointer of the specified USCI_I2C module. |
[in] | u8SlaveAddr | Access Slave address(7-bit) |
[in] | u16DataAddr | Specify a address (2 bytes) of data write to |
[in] | *data | Pointer to array to write data to Slave |
[in] | u32wLen | How many bytes need to write to Slave |
The function is used for USCI_I2C Master specify a byte address that multi data write to in Slave.
Definition at line 1007 of file usci_i2c.c.