PropWare  3.0.0.229
C++ objects and CMake build system for Parallax Propeller
eeprom.h
1 #ifndef __EEPROM_H__
2 #define __EEPROM_H__
3 
4 #include <stdint.h>
5 #include <i2c.h>
6 
7 typedef struct {
8  I2C *dev;
9  int address;
10 } EEPROM;
11 
12 typedef struct {
13  EEPROM state;
14  I2C_COGDRIVER dev;
16 
17 typedef struct {
18  EEPROM state;
19  I2C_SIMPLE dev;
21 
22 typedef struct {
23  EEPROM state;
24 } EEPROM_BOOT;
25 
40 EEPROM *eepromOpen(EEPROM_COGDRIVER *eeprom, int scl, int sda, int freq, int address);
41 
56 EEPROM *simple_eepromOpen(EEPROM_SIMPLE *eeprom, int scl, int sda, int address);
57 
68 EEPROM *eepromBootOpen(EEPROM_BOOT *eeprom, int address);
69 
81 void eepromInit(EEPROM *eeprom, I2C *dev, int address);
82 
96 int eepromRead(EEPROM *eeprom, uint32_t address, uint8_t *buffer, int count);
97 
111 int eepromWrite(EEPROM *eeprom, uint32_t address, uint8_t *buffer, int count);
112 
123 int eepromClose(EEPROM *eeprom);
124 
125 #endif
EEPROM_COGDRIVER
Definition: eeprom.h:12
EEPROM
Definition: eeprom.h:7
I2C
Definition: i2c.h:50
EEPROM_BOOT
Definition: eeprom.h:22
i2c.h
Provides Propeller specific functions for I2C.
count
long count(int pin, long duration)
Count number of low to high transitions an external input applies to an I/O pin over a certain period...
Definition: count.c:19
I2C_COGDRIVER
Definition: i2c.h:54
EEPROM_SIMPLE
Definition: eeprom.h:17
I2C_SIMPLE
Definition: i2c.h:60