Giter Site home page Giter Site logo

xc8-24xx1025's Introduction

xc8-24xx1025

A 24xx1025 I²C EEPROM driver for XC8.

To use in a project, copy 24xx1025.h and 24xx1025.c in your project, and add :

#include "24xx1025.h"

⚠️IMPORTANT⚠️ You MUST redefine _XTAL_FREQ in 24xx1025.h for the library to work.

api

The following methods are available:

ee24xx1025_open

void ee24xx1025_open(uint32_t frequency);

Initialize the connection with the EEPROM.

  • frequency : the frequency of the I²C clock, in Hz.

ee24xx1025_close

void ee24xx1025_close();

Closes the connection with the EEPROM.

ee24xx1025_currentaddress

void ee24xx1025_currentaddress();

Returns the value of the EEPROM address counter.

ee24xx1025_next

uint8_t ee24xx1025_next(uint8_t i2caddress, uint8_t block);

Returns the data pointed by the address counter. Once it is called, the address counter is incremented. If this call read address n, then next call will read address n+1.

  • i2caddress : the I2C address of the EEPROM. Must be a OR combination of EE24XX1025_A0 and EE24XX1025_A1.
  • block : the EEPROM block that will be read. Must be EE24XX1025_BLOCK0 or EE24XX1025_BLOCK1.

ee24xx1025_read

uint8_t ee24xx1025_read(uint8_t i2caddress, uint8_t block, uint16_t address);

Returns the data at the specified address.

  • i2caddress : the I2C address of the EEPROM. Must be a OR combination of EE24XX1025_A0 and EE24XX1025_A1.
  • block : the EEPROM block that will be read. Must be EE24XX1025_BLOCK0 or EE24XX1025_BLOCK1.
  • address : the EEPROM address of the data. Must be inbetween 0000h and FFFFh.

ee24xx1025_readseq

void ee24xx1025_readseq(uint8_t i2caddress, uint8_t block, uint16_t address, uint8_t* out, uint16_t length);

Sequentially reads a given amount of data from the EEPROM.

  • i2caddress : the I2C address of the EEPROM. Must be a OR combination of EE24XX1025_A0 and EE24XX1025_A1.
  • block : the EEPROM block that will be read. Must be EE24XX1025_BLOCK0 or EE24XX1025_BLOCK1.
  • address : the initial EEPROM address of the data. Must be inbetween 0000h and FFFFh.
  • out : the pointer that will be filled with EEPROM data.
  • length : the total length in bytes of the data that will be read.

ee24xx1025_write

void ee24xx1025_write(uint8_t i2caddress, uint8_t block, uint16_t address, uint8_t data);

Writes the data at the specified address.

  • i2caddress : the I2C address of the EEPROM. Must be a OR combination of EE24XX1025_A0 and EE24XX1025_A1.
  • block : the EEPROM block that will be modified. Must be EE24XX1025_BLOCK0 or EE24XX1025_BLOCK1.
  • address : the EEPROM address of the data. Must be inbetween 0000h and FFFFh.
  • data : the data that'll be written at address.

ee24xx1025_writepage

void ee24xx1025_writepage(uint8_t i2caddress, uint8_t block, uint16_t address, uint8_t* data, uint8_t length);

Writes up to 127 bytes of data at the same time in the EEPROM.

  • i2caddress : the I2C address of the EEPROM. Must be a OR combination of EE24XX1025_A0 and EE24XX1025_A1.
  • block : the EEPROM block that will be modified. Must be EE24XX1025_BLOCK0 or EE24XX1025_BLOCK1.
  • address : the initial EEPROM address of the data. Must be inbetween 0000h and FFFFh.
  • data : the array that will be copied into the EEPROM's memory.
  • length : the total length in bytes of the data that will be written.

xc8-24xx1025's People

Contributors

ilambda avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.