PDL for FM0+  Version1.0
Peripheral Driverl Library for FM0+
C:/pdl_v10/library/utility/at24cxx/i2c_at24cxx.h File Reference
#include "pdl_user.h"
#include "at24cxx_config.h"
#include "mfs\mfs.h"
#include "gpio\gpio.h"
Include dependency graph for i2c_at24cxx.h:
This graph shows which files directly or indirectly include this file:

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

Detailed Description

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:

  • 2014-03-10 1.0 Edison Zhang First release version.

Definition in file i2c_at24cxx.h.


Define Documentation

Definition at line 67 of file i2c_at24cxx.h.