[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] read write eeprom WINAVR20050214
From: |
Dave Hansen |
Subject: |
Re: [avr-gcc-list] read write eeprom WINAVR20050214 |
Date: |
Fri, 18 Feb 2005 09:38:04 -0500 |
From: "Royce & Sharal Pereira" <address@hidden>
Hi,
----------------------------------------
On Fri, 18 Feb 2005 10:57:53 +0700, andi
<address@hidden> wrote:
Hi,
I only got command read and write 1 byte eeprom for 255 byte eeprom size
in eeprom.h.
extern uint8_t eeprom_read_byte (const uint8_t *addr);
extern void eeprom_write_byte (uint8_t *addr, uint8_t val);
it's only for eeprom in address lower than 256 byte
------------------------------------------
Actually that's right...I looked in avrlibc docs & I could not find
Actually, that's wrong.
a macro for writing a byte to a 16 bit eeprom address.
Though you can write a byte to an 8 bit addr, and a word to a 16 bit addr.
Or does this feature exist somewhere?
You're getting yourself wrapped around the axle. The library defines the
following (cut and pasted from the docs):
uint8_t eeprom_read_byte (const uint8_t *addr)
uint16_t eeprom_read_word (const uint16_t *addr)
void eeprom_read_block (void *buf, const void *addr, size_t n)
void eeprom_write_byte (uint8_t *addr, uint8_t val)
void eeprom_write_word (uint16_t *addr, uint16_t val)
void eeprom_write_block (const void *buf, void *addr, size_t n)
note that eeprom_read_byte and eeprom_write_byte take (const uint8_t *).
This is a _pointer_ to a byte, not an 8-bit value. Pointers are 16 bits
wide.
Regards,
-=Dave
- [avr-gcc-list] sbi and cbi, (continued)
- Re: [avr-gcc-list] read write eeprom WINAVR20050214, Julius Luukko, 2005/02/18
- Re: [avr-gcc-list] read write eeprom WINAVR20050214, Royce & Sharal Pereira, 2005/02/18
- RE: [avr-gcc-list] read write eeprom WINAVR20050214, Eivind Sivertsen, 2005/02/18
- Re: [avr-gcc-list] read write eeprom WINAVR20050214, E. Weddington, 2005/02/18
- Re: [avr-gcc-list] read write eeprom WINAVR20050214, andi, 2005/02/18
- Re: [avr-gcc-list] read write eeprom WINAVR20050214, Royce & Sharal Pereira, 2005/02/18
- Re: [avr-gcc-list] read write eeprom WINAVR20050214, Joerg Wunsch, 2005/02/19
Re: [avr-gcc-list] read write eeprom WINAVR20050214,
Dave Hansen <=
Re: [avr-gcc-list] read write eeprom WINAVR20050214, Paul Colin Gloster, 2005/02/22