AllJoyn/Samples/BACnetAdapter/bacnet-stack-0.8.2/ports/xplained/ASF/xmega/drivers/nvm/nvm.c
void nvm_eeprom_load_byte_to_buffer(uint8_t byte_addr,
    uint8_t value)
{
    // Wait until NVM is ready
    nvm_wait_until_ready();

    eeprom_enable_mapping();
    *(uint8_t *) (byte_addr + MAPPED_EEPROM_START) = value;
    eeprom_disable_mapping();
}
/**
 * \brief 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.
 *
 * \note 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.
 *
 * \param  byte_addr EEPROM Byte address, between 0 and EEPROM_PAGE_SIZE.
 * \param  value     Byte value to write to buffer.
 */
\brief 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.

\note 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.

\param  byte_addr EEPROM Byte address, between 0 and EEPROM_PAGE_SIZE.
\param  value     Byte value to write to buffer.
\ brief 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 . \ note 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 . \ param byte_addr EEPROM Byte address between 0 and EEPROM_PAGE_SIZE . \ param value Byte value to write to buffer .
void nvm_eeprom_load_byte_to_buffer(uint8_t byte_addr,
    uint8_t value)
{
    nvm_wait_until_ready();
    eeprom_enable_mapping();
    *(uint8_t *) (byte_addr + MAPPED_EEPROM_START) = value;
    eeprom_disable_mapping();
}
void nvm_eeprom_load_byte_to_buffer ( uint8_t byte_addr , uint8_t value ) { nvm_wait_until_ready ( ) ; eeprom_enable_mapping ( ) ; * ( uint8_t * ) ( byte_addr + MAPPED_EEPROM_START ) = value ; eeprom_disable_mapping ( ) ; }
\brief Load single byte into temporary page buffer.
\ brief Load single byte into temporary page buffer .
// Wait until NVM is ready