PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
Simple-Libraries
Learn
Examples
Devices
Memory
EEPROM Data.c
1
/*
2
EEPROM Data.c
3
4
Write values and text to the Proepller Chip's dedicated EEPROM, and then
5
read back and display.
6
7
http://learn.parallax.com/propeller-c-tutorials
8
*/
9
10
#include "
simpletools.h
"
// Include simpletools header .
11
12
int
main
(
void
)
// main function
13
{
14
int
addr = 32769;
// Pick EEPROM base address.
15
16
ee_putInt
(42, addr);
// 42 -> EEPROM address 32769
17
int
eeVal =
ee_getInt
(addr);
// EEPROM address 32769 -> eeVal
18
print
(
"myVal = %d\n"
, eeVal);
// Display result
19
20
ee_putStr
(
"hello!\n"
, 8, addr + 4);
// hello!\n -> EEPROM 32773..32780
21
char
s[8];
// Character array to hold string
22
ee_getStr
(s, 8, addr + 4);
// EEPROM 32773..32780 -> s[0]..s[7]
23
print
(
"s = %s"
, s);
// Display s array
24
}
25
ee_getInt
int ee_getInt(int addr)
Get an int value from a certain address in the Propeller Chip's dedicated EEPROM. If you are fetching...
Definition:
eeprom_getInt.c:24
ee_putInt
void ee_putInt(int value, int addr)
Store an int value at a certain address in the Propeller Chip's dedicated EEPROM. An int value occupi...
Definition:
eeprom_putInt.c:24
simpletools.h
This library provides convenient functions for a variety of microcontroller I/O, timing,...
ee_putStr
void ee_putStr(unsigned char *s, int n, int addr)
Store a string of byte values starting at a certain address in the Propeller Chip's dedicated EEPROM.
Definition:
eeprom_putStr.c:25
print
int print(const char *format,...) __attribute__((format(printf
Print format "..." args to the default simple terminal device. The output is limited to 256 bytes.
main
int main(void)
Definition:
GraphicsTest.c:20
ee_getStr
unsigned char * ee_getStr(unsigned char *s, int n, int addr)
Fetch a string of byte values starting at a certain address in Propeller Chip's dedicated EEPROM.
Generated on Fri May 20 2022 16:48:04 for PropWare by
1.8.17