AllJoyn/Samples/BACnetAdapter/bacnet-stack-0.8.2/ports/xplained/ASF/xmega/drivers/nvm/nvm.c
void nvm_flash_read_buffer(flash_addr_t address,
    void *buf,
    uint16_t len)
{
#if (FLASH_SIZE>0x10000)
    uint32_t opt_address = address;
#else
    uint16_t opt_address = (uint16_t) address;
#endif
    nvm_wait_until_ready();
    while (len) {
        *(uint8_t *) buf = nvm_flash_read_byte(opt_address);
        buf = (uint8_t *) buf + 1;
        opt_address++;
        len--;
    }
}
/**
 * \brief Read buffer within the application section
 *
 * \param address	the address to where to read
 * \param buf		pointer to the data
 * \param len		the number of bytes to read
 */
\brief Read buffer within the application section
\param address       the address to where to read
\param buf           pointer to the data
\param len           the number of bytes to read
\ brief Read buffer within the application section \ param address the address to where to read \ param buf pointer to the data \ param len the number of bytes to read
void nvm_flash_read_buffer(flash_addr_t address,
    void *buf,
    uint16_t len)
{
#if (FLASH_SIZE>0x10000)
    uint32_t opt_address = address;
#else
    uint16_t opt_address = (uint16_t) address;
#endif
    nvm_wait_until_ready();
    while (len) {
        *(uint8_t *) buf = nvm_flash_read_byte(opt_address);
        buf = (uint8_t *) buf + 1;
        opt_address++;
        len--;
    }
}
void nvm_flash_read_buffer ( flash_addr_t address , void * buf , uint16_t len ) { #if ( FLASH_SIZE > 0x10000 ) uint32_t opt_address = address ; #else uint16_t opt_address = ( uint16_t ) address ; #endif nvm_wait_until_ready ( ) ; while ( len ) { * ( uint8_t * ) buf = nvm_flash_read_byte ( opt_address ) ; buf = ( uint8_t * ) buf + 1 ; opt_address ++ ; len -- ; } }
\brief Read buffer within the application section
 \param address       the address to where to read
 \param buf           pointer to the data
 \param len           the number of bytes to read
\ brief Read buffer within the application section \ param address the address to where to read \ param buf pointer to the data \ param len the number of bytes to read