LibDriver FM24CLXX
Loading...
Searching...
No Matches
fm24clxx base driver function

fm24clxx base driver modules More...

Collaboration diagram for fm24clxx base driver function:

Data Structures

struct  fm24clxx_handle_s
 fm24clxx handle structure definition More...
struct  fm24clxx_info_s
 fm24clxx information structure definition More...

Typedefs

typedef struct fm24clxx_handle_s fm24clxx_handle_t
 fm24clxx handle structure definition
typedef struct fm24clxx_info_s fm24clxx_info_t
 fm24clxx information structure definition

Enumerations

enum  fm24clxx_t { FM24CL04B = 512 , FM24CL16B = 2048 , FM24CL64B = 8192 }
 fm24clxx type enumeration definition More...
enum  fm24clxx_address_t {
  FM24CLXX_ADDRESS_A000 = 0 , FM24CLXX_ADDRESS_A001 = 1 , FM24CLXX_ADDRESS_A010 = 2 , FM24CLXX_ADDRESS_A011 = 3 ,
  FM24CLXX_ADDRESS_A100 = 4 , FM24CLXX_ADDRESS_A101 = 5 , FM24CLXX_ADDRESS_A110 = 6 , FM24CLXX_ADDRESS_A111 = 7
}
 fm24clxx address enumeration definition More...

Functions

uint8_t fm24clxx_info (fm24clxx_info_t *info)
 get chip's information
uint8_t fm24clxx_init (fm24clxx_handle_t *handle)
 initialize the chip
uint8_t fm24clxx_deinit (fm24clxx_handle_t *handle)
 close the chip
uint8_t fm24clxx_set_type (fm24clxx_handle_t *handle, fm24clxx_t type)
 set the chip type
uint8_t fm24clxx_get_type (fm24clxx_handle_t *handle, fm24clxx_t *type)
 get the chip type
uint8_t fm24clxx_set_addr_pin (fm24clxx_handle_t *handle, fm24clxx_address_t addr_pin)
 set the chip address pin
uint8_t fm24clxx_get_addr_pin (fm24clxx_handle_t *handle, fm24clxx_address_t *addr_pin)
 get the chip address pin
uint8_t fm24clxx_read (fm24clxx_handle_t *handle, uint16_t address, uint8_t *buf, uint16_t len)
 read bytes from the chip
uint8_t fm24clxx_write (fm24clxx_handle_t *handle, uint16_t address, uint8_t *buf, uint16_t len)
 write bytes to the chip

Detailed Description

fm24clxx base driver modules

Typedef Documentation

◆ fm24clxx_handle_t

fm24clxx handle structure definition

◆ fm24clxx_info_t

fm24clxx information structure definition

Enumeration Type Documentation

◆ fm24clxx_address_t

fm24clxx address enumeration definition

Enumerator
FM24CLXX_ADDRESS_A000 

A2A1A0 000

FM24CLXX_ADDRESS_A001 

A2A1A0 001

FM24CLXX_ADDRESS_A010 

A2A1A0 010

FM24CLXX_ADDRESS_A011 

A2A1A0 011

FM24CLXX_ADDRESS_A100 

A2A1A0 100

FM24CLXX_ADDRESS_A101 

A2A1A0 101

FM24CLXX_ADDRESS_A110 

A2A1A0 110

FM24CLXX_ADDRESS_A111 

A2A1A0 111

Definition at line 72 of file driver_fm24clxx.h.

◆ fm24clxx_t

enum fm24clxx_t

fm24clxx type enumeration definition

Enumerator
FM24CL04B 

FM24CL04B type

FM24CL16B 

FM24CL16B type

FM24CL64B 

FM24CL64B type

Definition at line 62 of file driver_fm24clxx.h.

Function Documentation

◆ fm24clxx_deinit()

uint8_t fm24clxx_deinit ( fm24clxx_handle_t * handle)

close the chip

Parameters
[in]*handlepointer to an fm24clxx 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 135 of file driver_fm24clxx.c.

◆ fm24clxx_get_addr_pin()

uint8_t fm24clxx_get_addr_pin ( fm24clxx_handle_t * handle,
fm24clxx_address_t * addr_pin )

get the chip address pin

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

Definition at line 230 of file driver_fm24clxx.c.

◆ fm24clxx_get_type()

uint8_t fm24clxx_get_type ( fm24clxx_handle_t * handle,
fm24clxx_t * type )

get the chip type

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

Definition at line 187 of file driver_fm24clxx.c.

◆ fm24clxx_info()

uint8_t fm24clxx_info ( fm24clxx_info_t * info)

get chip's information

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

Definition at line 457 of file driver_fm24clxx.c.

◆ fm24clxx_init()

uint8_t fm24clxx_init ( fm24clxx_handle_t * handle)

initialize the chip

Parameters
[in]*handlepointer to an fm24clxx 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 61 of file driver_fm24clxx.c.

◆ fm24clxx_read()

uint8_t fm24clxx_read ( fm24clxx_handle_t * handle,
uint16_t address,
uint8_t * buf,
uint16_t len )

read bytes from the chip

Parameters
[in]*handlepointer to an fm24clxx 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 256 of file driver_fm24clxx.c.

◆ fm24clxx_set_addr_pin()

uint8_t fm24clxx_set_addr_pin ( fm24clxx_handle_t * handle,
fm24clxx_address_t addr_pin )

set the chip address pin

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

Definition at line 208 of file driver_fm24clxx.c.

◆ fm24clxx_set_type()

uint8_t fm24clxx_set_type ( fm24clxx_handle_t * handle,
fm24clxx_t type )

set the chip type

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

Definition at line 166 of file driver_fm24clxx.c.

◆ fm24clxx_write()

uint8_t fm24clxx_write ( fm24clxx_handle_t * handle,
uint16_t address,
uint8_t * buf,
uint16_t len )

write bytes to the chip

Parameters
[in]*handlepointer to an fm24clxx 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 359 of file driver_fm24clxx.c.