Classes | |
struct | ReadyInterrupt |
The EEPROM Ready interrupt generates a constant interrupt when the write access time has elapsed. More... | |
Namespaces | |
namespace | Internal |
Only for library's internal use. | |
Functions | |
static bool | IsWritingFlash () |
static void | WaitWhileWritingFlash () |
static void | WriteOperation () |
bool | MoveNext () |
Increments current address unless it is pointing to the last byte in EEPROM memory. | |
void | Write (uint8_t data) |
Writes data to previously set address. It must not be interrupted by another request to read or write. | |
void | Write (uint16_t address, uint8_t data) |
Writes data to given address. It must not be interrupted by another request to read or write. | |
bool | IsWriting () |
Returns true if writing proccess is taking place. | |
void | WaitWhileWriting () |
Blocks while writing proccess is present. | |
void | SetAddressUnsafe (uint16_t address) |
Tries to set address even if previous writing operation has not finished. | |
void | SetAddress (uint16_t address) |
Waits for previous writing operation to finish, then sets address. | |
uint16_t | GetAddress () |
Returns current address. | |
uint8_t | Read () |
Read one byte from previously set (current) address. | |
uint8_t | Read (uint16_t address) |
Read one byte from given address. | |
template<typename T> | |
bool | Save (T data) |
Saves data to EEPROM to the current address. | |
template<typename T> | |
bool | Load (T &data) |
Reads data from EEPROM from the current address. | |
template<typename T> | |
bool | SaveArray (T *data, uint16_t elementsCount) |
Save array of data to previously set address. | |
template<typename T> | |
bool | LoadArray (T *data, uint16_t elementsCount) |
Load array of data from previously set address. |
uint16_t AVRCpp::EEPROM::GetAddress | ( | ) | [inline] |
bool AVRCpp::EEPROM::IsWriting | ( | ) | [inline] |
static bool AVRCpp::EEPROM::IsWritingFlash | ( | ) | [inline, static] |
bool AVRCpp::EEPROM::Load | ( | T & | data | ) | [inline] |
bool AVRCpp::EEPROM::LoadArray | ( | T * | data, | |
uint16_t | elementsCount | |||
) | [inline] |
bool AVRCpp::EEPROM::MoveNext | ( | ) |
Increments current address unless it is pointing to the last byte in EEPROM memory.
Definition at line 58 of file EEPROM.cpp.
00059 { 00060 if (EEAR < EEPROM_SIZE - 1) 00061 { 00062 WaitWhileWriting(); 00063 EEAR++; 00064 00065 return true; 00066 } 00067 00068 return false; 00069 00070 } // MoveNext
Read one byte from given address.
Definition at line 148 of file EEPROM.h.
00149 { 00150 SetAddress(address); 00151 00152 SetBits<_EECR>(_EERE); 00153 00154 return EEDR; 00155 00156 } // Read 2
uint8_t AVRCpp::EEPROM::Read | ( | ) | [inline] |
Read one byte from previously set (current) address.
Definition at line 137 of file EEPROM.h.
00138 { 00139 WaitWhileWriting(); 00140 00141 SetBits<_EECR>(_EERE); 00142 00143 return EEDR; 00144 00145 } // Read 1
bool AVRCpp::EEPROM::Save | ( | T | data | ) | [inline] |
bool AVRCpp::EEPROM::SaveArray | ( | T * | data, | |
uint16_t | elementsCount | |||
) | [inline] |
void AVRCpp::EEPROM::SetAddress | ( | uint16_t | address | ) | [inline] |
Waits for previous writing operation to finish, then sets address.
Definition at line 126 of file EEPROM.h.
00126 { WaitWhileWriting(); SetAddressUnsafe(address); }
void AVRCpp::EEPROM::SetAddressUnsafe | ( | uint16_t | address | ) | [inline] |
void AVRCpp::EEPROM::WaitWhileWriting | ( | ) | [inline] |
static void AVRCpp::EEPROM::WaitWhileWritingFlash | ( | ) | [inline, static] |
Writes data to given address. It must not be interrupted by another request to read or write.
Definition at line 86 of file EEPROM.cpp.
00087 { 00088 WaitWhileWriting(); 00089 00090 WaitWhileWritingFlash(); 00091 00092 SetAddressUnsafe(address); 00093 00094 EEDR = data; 00095 00096 WriteOperation(); 00097 00098 } // Write 2
void AVRCpp::EEPROM::Write | ( | uint8_t | data | ) |
Writes data to previously set address. It must not be interrupted by another request to read or write.
Definition at line 73 of file EEPROM.cpp.
00074 { 00075 WaitWhileWriting(); 00076 00077 WaitWhileWritingFlash(); 00078 00079 EEDR = data; 00080 00081 WriteOperation(); 00082 00083 } // Write 1
static void AVRCpp::EEPROM::WriteOperation | ( | ) | [static] |
Definition at line 41 of file EEPROM.cpp.
00042 { 00043 // Save SREG_I bit. 00044 uint8_t savedSREG = SREG; 00045 00046 // __EEPE__ must be set immediately after setting __EEMPE__ 00047 GlobalInterrupts::Disable(); 00048 00049 SetBits<_EECR>(__EEMPE__); 00050 SetBits<_EECR>(__EEPE__); 00051 00052 // Restore the interrupt bit in Status Register 00053 SREG = savedSREG; 00054 00055 } // WriteOperation
MTÜ TTÜ Robotiklubi |