LibDriver AT24CXX  2.0.0
AT24CXX full-featured driver
at24cxx base driver function

at24cxx base driver modules More...

Data Structures

struct  at24cxx_handle_s
 at24cxx handle structure definition More...
 
struct  at24cxx_info_s
 at24cxx information structure definition More...
 

Typedefs

typedef struct at24cxx_handle_s at24cxx_handle_t
 at24cxx handle structure definition More...
 
typedef struct at24cxx_info_s at24cxx_info_t
 at24cxx information structure definition More...
 

Enumerations

enum  at24cxx_t {
  AT24C01 = 128 , AT24C02 = 256 , AT24C04 = 512 , AT24C08 = 1024 ,
  AT24C16 = 2048 , AT24C32 = 4096 , AT24C64 = 8192 , AT24C128 = 16384 ,
  AT24C256 = 32768 , AT24C512 = 65536 , AT24CM01 = 131072 , AT24CM02 = 262144
}
 at24cxx type enumeration definition More...
 
enum  at24cxx_address_t {
  AT24CXX_ADDRESS_A000 = 0 , AT24CXX_ADDRESS_A001 = 1 , AT24CXX_ADDRESS_A010 = 2 , AT24CXX_ADDRESS_A011 = 3 ,
  AT24CXX_ADDRESS_A100 = 4 , AT24CXX_ADDRESS_A101 = 5 , AT24CXX_ADDRESS_A110 = 6 , AT24CXX_ADDRESS_A111 = 7
}
 at24cxx address enumeration definition More...
 

Functions

uint8_t at24cxx_info (at24cxx_info_t *info)
 get chip's information More...
 
uint8_t at24cxx_init (at24cxx_handle_t *handle)
 initialize the chip More...
 
uint8_t at24cxx_deinit (at24cxx_handle_t *handle)
 close the chip More...
 
uint8_t at24cxx_set_type (at24cxx_handle_t *handle, at24cxx_t type)
 set the chip type More...
 
uint8_t at24cxx_get_type (at24cxx_handle_t *handle, at24cxx_t *type)
 get the chip type More...
 
uint8_t at24cxx_set_addr_pin (at24cxx_handle_t *handle, at24cxx_address_t addr_pin)
 set the chip address pin More...
 
uint8_t at24cxx_get_addr_pin (at24cxx_handle_t *handle, at24cxx_address_t *addr_pin)
 get the chip address pin More...
 
uint8_t at24cxx_read (at24cxx_handle_t *handle, uint32_t address, uint8_t *buf, uint16_t len)
 read bytes from the chip More...
 
uint8_t at24cxx_write (at24cxx_handle_t *handle, uint32_t address, uint8_t *buf, uint16_t len)
 write bytes to the chip More...
 

Detailed Description

at24cxx base driver modules

Typedef Documentation

◆ at24cxx_handle_t

at24cxx handle structure definition

◆ at24cxx_info_t

at24cxx information structure definition

Enumeration Type Documentation

◆ at24cxx_address_t

at24cxx address enumeration definition

Enumerator
AT24CXX_ADDRESS_A000 

A2A1A0 000

AT24CXX_ADDRESS_A001 

A2A1A0 001

AT24CXX_ADDRESS_A010 

A2A1A0 010

AT24CXX_ADDRESS_A011 

A2A1A0 011

AT24CXX_ADDRESS_A100 

A2A1A0 100

AT24CXX_ADDRESS_A101 

A2A1A0 101

AT24CXX_ADDRESS_A110 

A2A1A0 110

AT24CXX_ADDRESS_A111 

A2A1A0 111

Definition at line 82 of file driver_at24cxx.h.

◆ at24cxx_t

enum at24cxx_t

at24cxx type enumeration definition

Enumerator
AT24C01 

AT24C01 type

AT24C02 

AT24C02 type

AT24C04 

AT24C04 type

AT24C08 

AT24C08 type

AT24C16 

AT24C16 type

AT24C32 

AT24C32 type

AT24C64 

AT24C64 type

AT24C128 

AT24C128 type

AT24C256 

AT24C256 type

AT24C512 

AT24C512 type

AT24CM01 

AT24CM01 type

AT24CM02 

AT24CM02 type

Definition at line 63 of file driver_at24cxx.h.

Function Documentation

◆ at24cxx_deinit()

uint8_t at24cxx_deinit ( at24cxx_handle_t handle)

close the chip

Parameters
[in]*handlepointer to an at24cxx handle structure
Returns
status code
  • 0 success
  • 1 iic deinit failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 136 of file driver_at24cxx.c.

◆ at24cxx_get_addr_pin()

uint8_t at24cxx_get_addr_pin ( at24cxx_handle_t handle,
at24cxx_address_t addr_pin 
)

get the chip address pin

Parameters
[in]*handlepointer to an at24cxx handle structure
[out]*addr_pinpointer to a chip address pin
Returns
status code
  • 0 success
  • 2 handle is NULL
Note
none

Definition at line 231 of file driver_at24cxx.c.

◆ at24cxx_get_type()

uint8_t at24cxx_get_type ( at24cxx_handle_t handle,
at24cxx_t type 
)

get the chip type

Parameters
[in]*handlepointer to an at24cxx handle structure
[out]*typepointer to a chip type buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
Note
none

Definition at line 188 of file driver_at24cxx.c.

◆ at24cxx_info()

uint8_t at24cxx_info ( at24cxx_info_t info)

get chip's information

Parameters
[out]*infopointer to an at24cxx info structure
Returns
status code
  • 0 success
  • 2 handle is NULL
Note
none

Definition at line 463 of file driver_at24cxx.c.

◆ at24cxx_init()

uint8_t at24cxx_init ( at24cxx_handle_t handle)

initialize the chip

Parameters
[in]*handlepointer to an at24cxx handle structure
Returns
status code
  • 0 success
  • 1 iic initialization failed
  • 2 handle is NULL
  • 3 linked functions is NULL
Note
none

Definition at line 62 of file driver_at24cxx.c.

◆ at24cxx_read()

uint8_t at24cxx_read ( at24cxx_handle_t handle,
uint32_t  address,
uint8_t *  buf,
uint16_t  len 
)

read bytes from the chip

Parameters
[in]*handlepointer to an at24cxx handle structure
[in]addressregister address
[out]*bufpointer to a data buffer
[in]lenbuffer length
Returns
status code
  • 0 success
  • 1 read data failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 end address is over the max address
Note
none

Definition at line 257 of file driver_at24cxx.c.

◆ at24cxx_set_addr_pin()

uint8_t at24cxx_set_addr_pin ( at24cxx_handle_t handle,
at24cxx_address_t  addr_pin 
)

set the chip address pin

Parameters
[in]*handlepointer to an at24cxx handle structure
[in]addr_pinchip address pin
Returns
status code
  • 0 success
  • 2 handle is NULL
Note
none

Definition at line 209 of file driver_at24cxx.c.

◆ at24cxx_set_type()

uint8_t at24cxx_set_type ( at24cxx_handle_t handle,
at24cxx_t  type 
)

set the chip type

Parameters
[in]*handlepointer to an at24cxx handle structure
[in]typechip type
Returns
status code
  • 0 success
  • 2 handle is NULL
Note
none

Definition at line 167 of file driver_at24cxx.c.

◆ at24cxx_write()

uint8_t at24cxx_write ( at24cxx_handle_t handle,
uint32_t  address,
uint8_t *  buf,
uint16_t  len 
)

write bytes to the chip

Parameters
[in]*handlepointer to an at24cxx handle structure
[in]addressregister address
[in]*bufpointer to a data buffer
[in]lenbuffer length
Returns
status code
  • 0 success
  • 1 write data failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 end address is over the max address
Note
none

Definition at line 362 of file driver_at24cxx.c.