![]() |
PDL for FM0+
Version1.0
Peripheral Driverl Library for FM0+
|
#include "i2c_at24cxx.h"
Go to the source code of this file.
Functions | |
static boolean_t | I2cCheckErrorStatus (void) |
Check the error status of I2C. | |
static en_result_t | I2cStart (uint8_t u8DevAddr) |
Generate I2C start signal and send device address. | |
static en_result_t | I2cRestart (uint8_t u8Addr) |
Generate I2C restart signal and send device address. | |
static en_result_t | I2cSendData (uint8_t *pu8Data, uint8_t u8Size) |
Sene I2C data. | |
static en_result_t | I2cRead (uint8_t *pRxData, uint8_t u8Size) |
Read I2C data. | |
static en_result_t | I2cStop (void) |
Generate I2C stop signal. | |
en_result_t | At24cxx_Init (void) |
Initialize AT24CXX. | |
en_result_t | At24cxx_ByteWrite (uint8_t u8DevAddr, uint16_t u16Addr, uint8_t u8Data) |
Write byte at a certain address of AT24CXX. | |
en_result_t | At24cxx_PageWrite (uint8_t u8DevAddr, uint16_t u16PageAddr, uint8_t *pu8Data, uint8_t u8Size) |
Write a page bytes at a page address of AT24CXX. | |
en_result_t | At24cxx_CurrentAddrRead (uint8_t u8DevAddr, uint8_t *pu8CurData) |
Read the data of current data address of AT24CXX. | |
en_result_t | At24cxx_RandomRead (uint8_t u8DevAddr, uint16_t u16Addr, uint8_t *pu8Data) |
Read a byte data of ramdon data address of AT24CXX. | |
en_result_t | At24cxx_SequentialRead (uint8_t u8DevAddr, uint8_t *pu8Data, uint8_t u8Size) |
Read data bytes following by random read or current address read. | |
void | At24cxx_Delayms (uint32_t u32Cnt) |
ms delay function |
A detailed description is available at Module description
History:
Definition in file i2c_polling_at24cxx.c.
static boolean_t I2cCheckErrorStatus | ( | void | ) | [static] |
Check the error status of I2C.
TRUE | No error |
FALSE | I2C error occurs |
Definition at line 80 of file i2c_polling_at24cxx.c.
References EE_I2C_CH, FALSE, I2cBusErr, I2cOverrunError, Mfs_I2c_GetStatus(), and TRUE.
Referenced by I2cRead(), I2cRestart(), I2cSendData(), and I2cStart().
static en_result_t I2cRead | ( | uint8_t * | pRxData, |
uint8_t | u8Size | ||
) | [static] |
Read I2C data.
[out] | pRxData | Pointer to data address |
[in] | u8Size | Data size |
Ok | I2C read normally |
Error | I2C NACK, bus error, overrun error |
Definition at line 258 of file i2c_polling_at24cxx.c.
References EE_I2C_CH, Error, I2cAck, I2cCheckErrorStatus(), I2cNAck, I2cRxFull, I2cRxTxInt, Mfs_I2c_ClrStatus(), Mfs_I2c_ConfigAck(), Mfs_I2c_GetStatus(), Mfs_I2c_ReceiveData(), Ok, and TRUE.
Referenced by At24cxx_CurrentAddrRead(), At24cxx_RandomRead(), and At24cxx_SequentialRead().
static en_result_t I2cRestart | ( | uint8_t | u8Addr | ) | [static] |
Generate I2C restart signal and send device address.
[in] | u8Addr | Device address |
Ok | I2C restart normally |
ErrorTimeout | I2C timeout |
Error | Other errors |
Definition at line 155 of file i2c_polling_at24cxx.c.
References EE_I2C_CH, Error, ErrorTimeout, I2cAck, I2cCheckErrorStatus(), I2cNAck, I2cRxTxInt, Mfs_I2c_ConfigAck(), Mfs_I2c_GenerateRestart(), Mfs_I2c_GetAck(), Mfs_I2c_GetStatus(), Mfs_I2c_SendData(), Ok, and TRUE.
Referenced by At24cxx_RandomRead().
static en_result_t I2cSendData | ( | uint8_t * | pu8Data, |
uint8_t | u8Size | ||
) | [static] |
Sene I2C data.
[in] | pu8Data | Pointer to data address |
[in] | u8Size | Data size |
Ok | I2C data send normally |
Error | I2C NACK, bus error, overrun error |
Definition at line 204 of file i2c_polling_at24cxx.c.
References EE_I2C_CH, Error, I2cCheckErrorStatus(), I2cNAck, I2cRxTxInt, I2cTxEmpty, Mfs_I2c_ClrStatus(), Mfs_I2c_GetAck(), Mfs_I2c_GetStatus(), Mfs_I2c_SendData(), Ok, and TRUE.
Referenced by At24cxx_ByteWrite(), At24cxx_PageWrite(), and At24cxx_RandomRead().
static en_result_t I2cStart | ( | uint8_t | u8DevAddr | ) | [static] |
Generate I2C start signal and send device address.
[in] | u8DevAddr | Device address |
Ok | I2C start normally |
ErrorTimeout | I2C timeout |
Error | Other errors |
Definition at line 106 of file i2c_polling_at24cxx.c.
References EE_I2C_CH, Error, ErrorTimeout, I2cAck, I2cCheckErrorStatus(), I2cNAck, I2cRxTxInt, Mfs_I2c_ConfigAck(), Mfs_I2c_GenerateStart(), Mfs_I2c_GetAck(), Mfs_I2c_GetStatus(), Mfs_I2c_SendData(), Ok, and TRUE.
Referenced by At24cxx_ByteWrite(), At24cxx_CurrentAddrRead(), At24cxx_PageWrite(), At24cxx_RandomRead(), and At24cxx_SequentialRead().
static en_result_t I2cStop | ( | void | ) | [static] |
Generate I2C stop signal.
Ok | I2C stop normally |
ErrorTimeout | I2C timeout |
Error | Other errors |
Definition at line 319 of file i2c_polling_at24cxx.c.
References EE_I2C_CH, Error, ErrorTimeout, I2cBusErr, I2cRxTxInt, I2cStopDetect, Mfs_I2c_ClrStatus(), Mfs_I2c_GenerateStop(), Mfs_I2c_GetStatus(), Ok, and TRUE.
Referenced by At24cxx_ByteWrite(), At24cxx_CurrentAddrRead(), At24cxx_PageWrite(), At24cxx_RandomRead(), and At24cxx_SequentialRead().