at24c32 access library
Functions | Variables
at24c32Write.c File Reference
#include <stdio.h>
#include <errno.h>
#include <stdbool.h>
#include <linux/fs.h>
#include <at24c32.h>
Include dependency graph for at24c32Write.c:

Functions

int at24c32ByteWrite (int fd, unsigned short address, unsigned char data)
 writes a byte to the EEPROM More...
 
int at24c32BlockWrite (int fd, unsigned short address, unsigned short length, unsigned char *data)
 writes a block of data to the EEPROM More...
 

Variables

bool at24c32Debug
 

Detailed Description

Contains functions to write the at24c32 eeprom

Copyright U. Raich Dec. 2016

This program is part of a course on embedded systems held at the University of Cape Coast, Ghana in 2017 It is released under the GNU Public License For details please see https://www.gnu.org/licenses/gpl.html

Function Documentation

int at24c32BlockWrite ( int  fd,
unsigned short  address,
unsigned short  length,
unsigned char *  data 
)

writes a block of data to the EEPROM

Parameters
intfd: the file descriptor returned by a24c32Open
unsignedshort address: the memory address to write to
unsignedshort length: the length of the data array
unsignedchar *data: a pointer to the data that must be written
Returns
0 if successful
a negative error code otherwise
int at24c32ByteWrite ( int  fd,
unsigned short  address,
unsigned char  data 
)

writes a byte to the EEPROM

Parameters
intfd: the file descriptor returned by a24c32Open
unsignedshort address: the memory address to write to
unsignedchar data: the data word to be written
Returns
0 if successful
a negative error code otherwise