Giter Site home page Giter Site logo

majid-derhambakhsh / i2c-eeprom Goto Github PK

View Code? Open in Web Editor NEW
17.0 1.0 4.0 3.49 MB

Driver for using Serial EEPROM Products (AT24C family) in AVR-ARM microcontrollers.

C 100.00%
stm32 avr i2c-bus memory eeprom eeprom-memory i2c-eeprom at24cxx at24c02 at24c04

i2c-eeprom's Introduction

Banner

i2c-eeprom

Driver for using Serial EEPROM Products (AT24C family) in AVR-ARM microcontrollers.

Version : 0.0.1

  • Type : Embedded Software.

  • Support : All C/C++ compiler.

  • Program Language : C

  • Properties :

Initialization and de-initialization functions:

I2C_Memory_Init();

Operation functions:

I2C_MemoryIsReady(uint16_t time_out);  
I2C_Memory_SingleWrite(uint32_t address,uint8_t udata,uint16_t time_out);  
I2C_Memory_BurstWrite(uint32_t address,uint8_t *udata,uint32_t size,uint16_t time_out);  
I2C_Memory_SingleRead(uint32_t address,uint8_t *udata,uint16_t time_out);  
I2C_Memory_BurstRead(uint32_t address,uint8_t *udata,uint32_t size,uint16_t time_out);  
I2C_Memory_Erase(uint32_t address,uint32_t quantity,uint16_t time_out);  

Macros:

#define _ChipCode  
#define _MEMORY_Ax_PIN_STATE 
#define _WP_DISABLE  
#define _WRITE_PROTECT_PORT  
#define _WRITE_PROTECT_PIN  

How to use this library

The I2C Memory library can be used as follows:

1. Add .h and source file in project.

2. Config Chipset in 'i2c_memory_conf.h' header, for example:

  • Options:

    #define _AT24C04 // Chipset code
    
    #define _MEMORY_A0_PIN_STATE 0  // Address pin 0 state
    #define _MEMORY_A1_PIN_STATE 1  // Address pin 1 state
    #define _MEMORY_A2_PIN_STATE 0  // Address pin 2 state
    
    #define _WP_DISABLE  // Write Protect disable macro
    
    #define _WRITE_PROTECT_PORT  GPIOA  // Connected Port for 'Write Protect'
    #define _WRITE_PROTECT_PIN   9      // Connected Pin for 'Write Protect'
    

3. Config I2C and initialize it.

4. Using initialize methods for initialize hardware and chipset, for example:

I2C_Memory_Init();

5. Using operation methods, for example:

int main(void)
{
   
   I2C_Memory_Init();   // Initialize
      
   while()
   {
     I2C_Memory_SingleWrite(0, 'a', 100);
     
     if (I2C_MemoryIsReady(100) == 0)
     {
       // Memory error
     }
     
   }
}
   

Supported Chipset:

  • AT24 Series
  • AT25 Series

Developer: Majid Derhambakhsh

i2c-eeprom's People

Contributors

majid-derhambakhsh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

i2c-eeprom's Issues

How transfer data from PC to EEPROM

Hello!

I2C EEPROM ICs are very popular. Thank you for your code.

There is another interesting open source project about How transfer data from PC to EEPROM IC. I think it is great idea to add information about this project to description of repo.

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.