Loading...
Searching...
No Matches
at24cxxx.h File Reference

Device driver interface for AT24CXXX EEPROM units. More...

Detailed Description

Device driver interface for AT24CXXX EEPROM units.

Author
Fabian Hüßler fabia.nosp@m.n.hu.nosp@m.essle.nosp@m.r@ov.nosp@m.gu.de

Definition in file at24cxxx.h.

#include <stdint.h>
#include "periph/gpio.h"
#include "periph/i2c.h"
+ Include dependency graph for at24cxxx.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  at24cxxx_params
 Struct that holds initialization parameters. More...
 
struct  at24cxxx_t
 Struct that represents an AT24CXXX device. More...
 

Typedefs

typedef struct at24cxxx_params at24cxxx_params_t
 Struct that holds initialization parameters.
 

Enumerations

enum  { AT24CXXX_OK , AT24CXXX_I2C_ERROR }
 Return values. More...
 

Functions

int at24cxxx_init (at24cxxx_t *dev, const at24cxxx_params_t *params)
 Initialize an AT24CXXX device handle with AT24CXXX parameters.
 
int at24cxxx_read_byte (const at24cxxx_t *dev, uint32_t pos, void *dest)
 Read a byte at a given position pos.
 
int at24cxxx_read (const at24cxxx_t *dev, uint32_t pos, void *data, size_t len)
 Sequentially read len bytes from a given position pos.
 
int at24cxxx_write_byte (const at24cxxx_t *dev, uint32_t pos, uint8_t data)
 Write a byte at a given position pos.
 
int at24cxxx_write (const at24cxxx_t *dev, uint32_t pos, const void *data, size_t len)
 Sequentially write len bytes from a given position pos.
 
int at24cxxx_set (const at24cxxx_t *dev, uint32_t pos, uint8_t val, size_t len)
 Set len bytes from a given position pos to the value val.
 
int at24cxxx_clear (const at24cxxx_t *dev, uint32_t pos, size_t len)
 Set len bytes from position pos to AT24CXXX_CLEAR_BYTE.
 
int at24cxxx_erase (const at24cxxx_t *dev)
 Set the entire EEPROM memory to AT24CXXX_CLEAR_BYTE.
 
int at24cxxx_enable_write_protect (const at24cxxx_t *dev)
 Enable write protection.
 
int at24cxxx_disable_write_protect (const at24cxxx_t *dev)
 Disable write protection.