Microchip® Advanced Software Framework

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MEMORY - EEPROM AT24Cxx Series

Driver to access (read and write) AT24Cxx series EEPROM through a TWI interface.

Modules

 

Functions

void at24cxx_init (int32_t fcpu)
 This function will initialize the AT24CXX serial EEPROM. More...
 
uint8_t at24cxx_read_byte (uint16_t byte_address)
 Read single byte from serial EEPROM. More...
 
void at24cxx_read_continuous (uint16_t start_address, uint16_t length, uint8_t *rd_buffer)
 Read bytes continuously from the serial EEPROM. More...
 
void at24cxx_write_byte (uint16_t byte_address, uint8_t byte_value)
 Write single byte to the serial EEPROM. More...
 
void at24cxx_write_continuous (uint16_t start_address, uint16_t length, uint8_t const *wr_buffer)
 Write bytes continuously to the serial EEPROM. More...
 

void at24cxx_init ( int32_t  fcpu)

This function will initialize the AT24CXX serial EEPROM.

Note
Must be called before any of the access functions.
Return values
trueAT24CXX device ready to use.
falseNot able to initialize the AT24CXX device.

References cpu_hz.

Referenced by main().

uint8_t at24cxx_read_byte ( uint16_t  byte_address)

Read single byte from serial EEPROM.

Parameters
[in]byte_addressAddress of byte to read.
[out]read_bytePointer to memory where the read byte will be stored.
Return values
trueByte read successfully.
falseByte could not be read.

References AT24CXX_TWI, AT24CXX_TWI_ADDRESS, data, twi_master_read(), twi_master_write(), twi_package_t, and TWI_SUCCESS.

Referenced by main().

void at24cxx_read_continuous ( uint16_t  start_address,
uint16_t  length,
uint8_t *  rd_buffer 
)

Read bytes continuously from the serial EEPROM.

Parameters
[in]start_addressAddress of first byte to read.
[in]lengthNumber of bytes to read.
[out]rd_bufferPointer to memory where the read bytes will be stored.
Return values
trueBytes read successfully.
falseBytes could not be read.

References AT24CXX_TWI, AT24CXX_TWI_ADDRESS, length, twi_master_read(), twi_master_write(), twi_package_t, and TWI_SUCCESS.

void at24cxx_write_byte ( uint16_t  byte_address,
uint8_t  byte_value 
)

Write single byte to the serial EEPROM.

Parameters
[in]byte_addressAddress of byte to write.
[in]byte_valueValue that will be written to the specified address.
Return values
trueByte written successfully.
falseByte could not be written.

References AT24CXX_TWI, AT24CXX_TWI_ADDRESS, twi_master_write(), twi_package_t, and TWI_SUCCESS.

Referenced by main().

void at24cxx_write_continuous ( uint16_t  start_address,
uint16_t  length,
uint8_t const *  wr_buffer 
)

Write bytes continuously to the serial EEPROM.

Parameters
[in]start_addressAddress of first byte in transaction.
[in]lengthNumber of bytes to write.
[in]wr_bufferPointer to array where the bytes to be written are stored.
Return values
trueBytes written successfully.
falseBytes could not be written.

References AT24CXX_TWI, AT24CXX_TWI_ADDRESS, length, twi_master_write(), twi_package_t, and TWI_SUCCESS.