Hanna
Sourcecode Batteriemanagementsystem
Funktionen
eeprom_driver.c-Dateireferenz

XMEGA EEPROM driver source file. Mehr ...

#include "eeprom_driver.h"
Include-Abhängigkeitsdiagramm für eeprom_driver.c:

gehe zum Quellcode dieser Datei

Funktionen

void EEPROM_AtomicWritePage (uint8_t pageAddr)
 Write already loaded page into EEPROM. Mehr ...
 
void EEPROM_EraseAll (void)
 Erase entire EEPROM memory. Mehr ...
 
void EEPROM_ErasePage (uint8_t pageAddr)
 Erase EEPROM page. Mehr ...
 
void EEPROM_FlushBuffer (void)
 Flush temporary EEPROM page buffer. Mehr ...
 
void EEPROM_LoadByte (uint8_t byteAddr, uint8_t value)
 Load single byte into temporary page buffer. Mehr ...
 
void EEPROM_LoadPage (const uint8_t *values)
 Load entire page into temporary EEPROM page buffer. Mehr ...
 
uint8_t EEPROM_ReadByte (uint8_t pageAddr, uint8_t byteAddr)
 Read one byte from EEPROM using IO mapping. Mehr ...
 
uint32_t EEPROM_ReadBytes (uint8_t pageAddr, uint8_t byteAddr, uint8_t len)
 
void EEPROM_SplitWritePage (uint8_t pageAddr)
 Write (without erasing) EEPROM page. Mehr ...
 
void EEPROM_WaitForNVM (void)
 Wait for any NVM access to finish, including EEPROM. Mehr ...
 
void EEPROM_WriteByte (uint8_t pageAddr, uint8_t byteAddr, uint8_t value)
 Write one byte to EEPROM using IO mapping. Mehr ...
 
void EEPROM_WriteBytes (uint8_t pageAddr, uint8_t byteAddr, uint8_t len, uint32_t value)
 

Ausführliche Beschreibung

XMEGA EEPROM driver source file.

This file contains the function implementations for the XMEGA EEPROM driver.

The driver is not intended for size and/or speed critical code, since most functions are just a few lines of code, and the function call overhead would decrease code performance. The driver is intended for rapid prototyping and documentation purposes for getting started with the XMEGA EEPROM module.

For size and/or speed critical code, it is recommended to copy the function contents directly into your application instead of making a function call.

Application note:
AVR1315: Accessing the XMEGA EEPROM
Documentation
For comprehensive code documentation, supported compilers, compiler settings and supported devices see readme.html
Autor
Atmel Corporation: http://www.atmel.com
Support email: avr@a.nosp@m.tmel.nosp@m..com

Revision: 1569 Date: 2008-04-22 13:03:43 +0200 (ti, 22 apr 2008)
Copyright (c) 2008, Atmel Corporation All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. The name of ATMEL may not be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definiert in Datei eeprom_driver.c.

Dokumentation der Funktionen

void EEPROM_AtomicWritePage ( uint8_t  pageAddr)

Write already loaded page into EEPROM.

This function writes the contents of an already loaded EEPROM page buffer into EEPROM memory.

As this is an atomic write, the page in EEPROM will be erased automatically before writing. Note that only the page buffer locations that have been loaded will be used when writing to EEPROM. Page buffer locations that have not been loaded will be left untouched in EEPROM.

Parameter
pageAddrEEPROM Page address, between 0 and EEPROM_SIZE/EEPROM_PAGESIZE

Definiert in Zeile 263 der Datei eeprom_driver.c.

Hier ist ein Graph, der zeigt, was diese Funktion aufruft:

void EEPROM_EraseAll ( void  )

Erase entire EEPROM memory.

This function erases the entire EEPROM memory block to 0xFF.

Definiert in Zeile 337 der Datei eeprom_driver.c.

Hier ist ein Graph, der zeigt, was diese Funktion aufruft:

void EEPROM_ErasePage ( uint8_t  pageAddr)

Erase EEPROM page.

This function erases one EEPROM page, so that every location reads 0xFF.

Parameter
pageAddrEEPROM Page address, between 0 and EEPROM_SIZE/EEPROM_PAGESIZE

Definiert in Zeile 287 der Datei eeprom_driver.c.

Hier ist ein Graph, der zeigt, was diese Funktion aufruft:

void EEPROM_FlushBuffer ( void  )

Flush temporary EEPROM page buffer.

This function flushes the EEPROM page buffers. This function will cancel any ongoing EEPROM page buffer loading operations, if any. This function also works for memory mapped EEPROM access.

Zu beachten
The EEPROM write operations will automatically flush the buffer for you.

Definiert in Zeile 173 der Datei eeprom_driver.c.

Hier ist ein Graph, der zeigt, was diese Funktion aufruft:

Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:

void EEPROM_LoadByte ( uint8_t  byteAddr,
uint8_t  value 
)

Load single byte into temporary page buffer.

This function loads one byte into the temporary EEPROM page buffers. If memory mapped EEPROM is enabled, this function will not work. Make sure that the buffer is flushed before starting to load bytes. Also, if multiple bytes are loaded into the same location, they will be ANDed together, thus 0x55 and 0xAA will result in 0x00 in the buffer.

Zu beachten
Only one page buffer exist, thus only one page can be loaded with data and programmed into one page. If data needs to be written to different pages, the loading and writing needs to be repeated.
Parameter
byteAddrEEPROM Byte address, between 0 and EEPROM_PAGESIZE.
valueByte value to write to buffer.

Definiert in Zeile 201 der Datei eeprom_driver.c.

Hier ist ein Graph, der zeigt, was diese Funktion aufruft:

void EEPROM_LoadPage ( const uint8_t *  values)

Load entire page into temporary EEPROM page buffer.

This function loads an entire EEPROM page from an SRAM buffer to the EEPROM page buffers. If memory mapped EEPROM is enabled, this function will not work. Make sure that the buffer is flushed before starting to load bytes.

Zu beachten
Only the lower part of the address is used to address the buffer. Therefore, no address parameter is needed. In the end, the data is written to the EEPROM page given by the address parameter to the EEPROM write page operation.
Parameter
valuesPointer to SRAM buffer containing an entire page.

Definiert in Zeile 230 der Datei eeprom_driver.c.

Hier ist ein Graph, der zeigt, was diese Funktion aufruft:

uint8_t EEPROM_ReadByte ( uint8_t  pageAddr,
uint8_t  byteAddr 
)

Read one byte from EEPROM using IO mapping.

This function reads one byte from EEPROM using IO-mapped access. If memory mapped EEPROM is enabled, this function will not work.

Parameter
pageAddrEEPROM Page address, between 0 and EEPROM_SIZE/EEPROM_PAGESIZE
byteAddrEEPROM Byte address, between 0 and EEPROM_PAGESIZE.
Rückgabe
Byte value read from EEPROM.

Definiert in Zeile 119 der Datei eeprom_driver.c.

Hier ist ein Graph, der zeigt, was diese Funktion aufruft:

Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:

void EEPROM_SplitWritePage ( uint8_t  pageAddr)

Write (without erasing) EEPROM page.

This function writes the contents of an already loaded EEPROM page buffer into EEPROM memory.

As this is a split write, the page in EEPROM will not be erased before writing.

Parameter
pageAddrEEPROM Page address, between 0 and EEPROM_SIZE/EEPROM_PAGESIZE

Definiert in Zeile 315 der Datei eeprom_driver.c.

Hier ist ein Graph, der zeigt, was diese Funktion aufruft:

void EEPROM_WaitForNVM ( void  )

Wait for any NVM access to finish, including EEPROM.

This function is blcoking and waits for any NVM access to finish, including EEPROM. Use this function before any EEPROM accesses, if you are not certain that any previous operations are finished yet, like an EEPROM write.

Definiert in Zeile 156 der Datei eeprom_driver.c.

Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:

void EEPROM_WriteByte ( uint8_t  pageAddr,
uint8_t  byteAddr,
uint8_t  value 
)

Write one byte to EEPROM using IO mapping.

This function writes one byte to EEPROM using IO-mapped access. If memory mapped EEPROM is enabled, this function will not work. This functiom will cancel all ongoing EEPROM page buffer loading operations, if any.

Parameter
pageAddrEEPROM Page address, between 0 and EEPROM_SIZE/EEPROM_PAGESIZE
byteAddrEEPROM Byte address, between 0 and EEPROM_PAGESIZE.
valueByte value to write to EEPROM.

Definiert in Zeile 72 der Datei eeprom_driver.c.

Hier ist ein Graph, der zeigt, was diese Funktion aufruft:

Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird: