LibDriver GT24CXX
Loading...
Searching...
No Matches
gt24cxx base driver function

gt24cxx base driver modules More...

Collaboration diagram for gt24cxx base driver function:

Data Structures

struct  gt24cxx_handle_s
 gt24cxx handle structure definition More...
struct  gt24cxx_info_s
 gt24cxx information structure definition More...

Typedefs

typedef struct gt24cxx_handle_s gt24cxx_handle_t
 gt24cxx handle structure definition
typedef struct gt24cxx_info_s gt24cxx_info_t
 gt24cxx information structure definition

Enumerations

enum  gt24cxx_t {
  GT24C02 = 256 , GT24C04 = 512 , GT24C08 = 1024 , GT24C16 = 2048 ,
  GT24C32 = 4096 , GT24C64 = 8192 , GT24C128 = 16384 , GT24C256 = 32768 ,
  GT24C512 = 65536 , GT24C1024 = 131072 , GT24C2048 = 262144
}
 gt24cxx type enumeration definition More...
enum  gt24cxx_address_t {
  GT24CXX_ADDRESS_A000 = 0 , GT24CXX_ADDRESS_A001 = 1 , GT24CXX_ADDRESS_A010 = 2 , GT24CXX_ADDRESS_A011 = 3 ,
  GT24CXX_ADDRESS_A100 = 4 , GT24CXX_ADDRESS_A101 = 5 , GT24CXX_ADDRESS_A110 = 6 , GT24CXX_ADDRESS_A111 = 7
}
 gt24cxx address enumeration definition More...

Functions

uint8_t gt24cxx_info (gt24cxx_info_t *info)
 get chip's information
uint8_t gt24cxx_init (gt24cxx_handle_t *handle)
 initialize the chip
uint8_t gt24cxx_deinit (gt24cxx_handle_t *handle)
 close the chip
uint8_t gt24cxx_set_type (gt24cxx_handle_t *handle, gt24cxx_t type)
 set the chip type
uint8_t gt24cxx_get_type (gt24cxx_handle_t *handle, gt24cxx_t *type)
 get the chip type
uint8_t gt24cxx_set_addr_pin (gt24cxx_handle_t *handle, gt24cxx_address_t addr_pin)
 set the chip address pin
uint8_t gt24cxx_get_addr_pin (gt24cxx_handle_t *handle, gt24cxx_address_t *addr_pin)
 get the chip address pin
uint8_t gt24cxx_read (gt24cxx_handle_t *handle, uint32_t address, uint8_t *buf, uint16_t len)
 read bytes from the chip
uint8_t gt24cxx_write (gt24cxx_handle_t *handle, uint32_t address, uint8_t *buf, uint16_t len)
 write bytes to the chip

Detailed Description

gt24cxx base driver modules

Typedef Documentation

◆ gt24cxx_handle_t

gt24cxx handle structure definition

◆ gt24cxx_info_t

gt24cxx information structure definition

Enumeration Type Documentation

◆ gt24cxx_address_t

gt24cxx address enumeration definition

Enumerator
GT24CXX_ADDRESS_A000 

A2A1A0 000

GT24CXX_ADDRESS_A001 

A2A1A0 001

GT24CXX_ADDRESS_A010 

A2A1A0 010

GT24CXX_ADDRESS_A011 

A2A1A0 011

GT24CXX_ADDRESS_A100 

A2A1A0 100

GT24CXX_ADDRESS_A101 

A2A1A0 101

GT24CXX_ADDRESS_A110 

A2A1A0 110

GT24CXX_ADDRESS_A111 

A2A1A0 111

Definition at line 80 of file driver_gt24cxx.h.

◆ gt24cxx_t

enum gt24cxx_t

gt24cxx type enumeration definition

Enumerator
GT24C02 

GT24C02 type

GT24C04 

GT24C04 type

GT24C08 

GT24C08 type

GT24C16 

GT24C16 type

GT24C32 

GT24C32 type

GT24C64 

GT24C64 type

GT24C128 

GT24C128 type

GT24C256 

GT24C256 type

GT24C512 

GT24C512 type

GT24C1024 

GT24C1024 type

GT24C2048 

GT24C2048 type

Definition at line 62 of file driver_gt24cxx.h.

Function Documentation

◆ gt24cxx_deinit()

uint8_t gt24cxx_deinit ( gt24cxx_handle_t * handle)

close the chip

Parameters
[in]*handlepointer to a gt24cxx 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_gt24cxx.c.

◆ gt24cxx_get_addr_pin()

uint8_t gt24cxx_get_addr_pin ( gt24cxx_handle_t * handle,
gt24cxx_address_t * addr_pin )

get the chip address pin

Parameters
[in]*handlepointer to a gt24cxx 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_gt24cxx.c.

◆ gt24cxx_get_type()

uint8_t gt24cxx_get_type ( gt24cxx_handle_t * handle,
gt24cxx_t * type )

get the chip type

Parameters
[in]*handlepointer to a gt24cxx 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_gt24cxx.c.

◆ gt24cxx_info()

uint8_t gt24cxx_info ( gt24cxx_info_t * info)

get chip's information

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

Definition at line 503 of file driver_gt24cxx.c.

◆ gt24cxx_init()

uint8_t gt24cxx_init ( gt24cxx_handle_t * handle)

initialize the chip

Parameters
[in]*handlepointer to a gt24cxx 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_gt24cxx.c.

◆ gt24cxx_read()

uint8_t gt24cxx_read ( gt24cxx_handle_t * handle,
uint32_t address,
uint8_t * buf,
uint16_t len )

read bytes from the chip

Parameters
[in]*handlepointer to a gt24cxx 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_gt24cxx.c.

◆ gt24cxx_set_addr_pin()

uint8_t gt24cxx_set_addr_pin ( gt24cxx_handle_t * handle,
gt24cxx_address_t addr_pin )

set the chip address pin

Parameters
[in]*handlepointer to a gt24cxx 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_gt24cxx.c.

◆ gt24cxx_set_type()

uint8_t gt24cxx_set_type ( gt24cxx_handle_t * handle,
gt24cxx_t type )

set the chip type

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

Definition at line 166 of file driver_gt24cxx.c.

◆ gt24cxx_write()

uint8_t gt24cxx_write ( gt24cxx_handle_t * handle,
uint32_t address,
uint8_t * buf,
uint16_t len )

write bytes to the chip

Parameters
[in]*handlepointer to a gt24cxx 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 312 of file driver_gt24cxx.c.