![]() |
PDL for FM0+
Version1.0
Peripheral Driverl Library for FM0+
|
Go to the source code of this file.
Defines | |
#define | _I2C_PAT24CXX_H_ |
#define | AT24CXX_7BIT_DEVICE_ADDR (0x50u) |
#define | AT24CXX_PAGE_SIZE 8 |
#define | AT24CXX_ADDR_LENGTH 1 |
#define | InitI2cIo(void) {SetPinFunc_SOT1_1();SetPinFunc_SCK1_1();} |
#define | EE_I2C_CH &I2C1 |
Functions | |
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 |
AT24CXX driver file header file
The AT24C02 is tested in the example, make following pin connection first.
-------------------------------------------- | MCU AT24C02 | |------------------------------------------- | Pin Name Pin Count Pin Name | | GND 1 A0 | | GND 2 A1 | | GND 3 A2 | | GND 4 GND | | SOT1_1 5 SDA | | SCK1_1 6 SCL | | - 7 WP | | VCC 8 VCC | --------------------------------------------
History:
Definition in file i2c_at24cxx.h.
#define _I2C_PAT24CXX_H_ |
Definition at line 67 of file i2c_at24cxx.h.