AllJoyn/Samples/BACnetAdapter/bacnet-stack-0.8.2/ports/xplained/ASF/xmega/drivers/nvm/nvm.c
void nvm_read_device_serial(struct nvm_device_serial *storage)
{
    storage->lotnum0 =
        nvm_read_production_signature_row
        (nvm_get_production_signature_row_offset(LOTNUM0));
    storage->lotnum1 =
        nvm_read_production_signature_row
        (nvm_get_production_signature_row_offset(LOTNUM1));
    storage->lotnum2 =
        nvm_read_production_signature_row
        (nvm_get_production_signature_row_offset(LOTNUM2));
    storage->lotnum3 =
        nvm_read_production_signature_row
        (nvm_get_production_signature_row_offset(LOTNUM3));
    storage->lotnum4 =
        nvm_read_production_signature_row
        (nvm_get_production_signature_row_offset(LOTNUM4));
    storage->lotnum5 =
        nvm_read_production_signature_row
        (nvm_get_production_signature_row_offset(LOTNUM5));

    storage->wafnum =
        nvm_read_production_signature_row
        (nvm_get_production_signature_row_offset(WAFNUM));

    storage->coordx0 =
        nvm_read_production_signature_row
        (nvm_get_production_signature_row_offset(COORDX0));
    storage->coordx1 =
        nvm_read_production_signature_row
        (nvm_get_production_signature_row_offset(COORDX1));
    storage->coordy0 =
        nvm_read_production_signature_row
        (nvm_get_production_signature_row_offset(COORDY0));
    storage->coordy1 =
        nvm_read_production_signature_row
        (nvm_get_production_signature_row_offset(COORDY1));
}
/**
 * \brief Read the device serial
 *
 * This function returns the device serial stored in the device.
 *
 * \note This function is modifying the NVM.CMD register.
 *       If the application are using program space access in interrupts
 *       (__flash pointers in IAR EW or pgm_read_byte in GCC) interrupts
 *       needs to be disabled when running EEPROM access functions. If not
 *       the program space reads will be corrupted.
 *
 * \retval storage Pointer to the structure where to store the device serial
 */
\brief Read the device serial
This function returns the device serial stored in the device.

\note This function is modifying the NVM.CMD register.
If the application are using program space access in interrupts
(__flash pointers in IAR EW or pgm_read_byte in GCC) interrupts
needs to be disabled when running EEPROM access functions. If not
the program space reads will be corrupted.

\retval storage Pointer to the structure where to store the device serial
\ brief Read the device serial This function returns the device serial stored in the device . \ note This function is modifying the NVM . CMD register . If the application are using program space access in interrupts ( __flash pointers in IAR EW or pgm_read_byte in GCC ) interrupts needs to be disabled when running EEPROM access functions . If not the program space reads will be corrupted . \ retval storage Pointer to the structure where to store the device serial
void nvm_read_device_serial(struct nvm_device_serial *storage)
{
    storage->lotnum0 =
        nvm_read_production_signature_row
        (nvm_get_production_signature_row_offset(LOTNUM0));
    storage->lotnum1 =
        nvm_read_production_signature_row
        (nvm_get_production_signature_row_offset(LOTNUM1));
    storage->lotnum2 =
        nvm_read_production_signature_row
        (nvm_get_production_signature_row_offset(LOTNUM2));
    storage->lotnum3 =
        nvm_read_production_signature_row
        (nvm_get_production_signature_row_offset(LOTNUM3));
    storage->lotnum4 =
        nvm_read_production_signature_row
        (nvm_get_production_signature_row_offset(LOTNUM4));
    storage->lotnum5 =
        nvm_read_production_signature_row
        (nvm_get_production_signature_row_offset(LOTNUM5));
    storage->wafnum =
        nvm_read_production_signature_row
        (nvm_get_production_signature_row_offset(WAFNUM));
    storage->coordx0 =
        nvm_read_production_signature_row
        (nvm_get_production_signature_row_offset(COORDX0));
    storage->coordx1 =
        nvm_read_production_signature_row
        (nvm_get_production_signature_row_offset(COORDX1));
    storage->coordy0 =
        nvm_read_production_signature_row
        (nvm_get_production_signature_row_offset(COORDY0));
    storage->coordy1 =
        nvm_read_production_signature_row
        (nvm_get_production_signature_row_offset(COORDY1));
}
void nvm_read_device_serial ( struct nvm_device_serial * storage ) { storage -> lotnum0 = nvm_read_production_signature_row ( nvm_get_production_signature_row_offset ( LOTNUM0 ) ) ; storage -> lotnum1 = nvm_read_production_signature_row ( nvm_get_production_signature_row_offset ( LOTNUM1 ) ) ; storage -> lotnum2 = nvm_read_production_signature_row ( nvm_get_production_signature_row_offset ( LOTNUM2 ) ) ; storage -> lotnum3 = nvm_read_production_signature_row ( nvm_get_production_signature_row_offset ( LOTNUM3 ) ) ; storage -> lotnum4 = nvm_read_production_signature_row ( nvm_get_production_signature_row_offset ( LOTNUM4 ) ) ; storage -> lotnum5 = nvm_read_production_signature_row ( nvm_get_production_signature_row_offset ( LOTNUM5 ) ) ; storage -> wafnum = nvm_read_production_signature_row ( nvm_get_production_signature_row_offset ( WAFNUM ) ) ; storage -> coordx0 = nvm_read_production_signature_row ( nvm_get_production_signature_row_offset ( COORDX0 ) ) ; storage -> coordx1 = nvm_read_production_signature_row ( nvm_get_production_signature_row_offset ( COORDX1 ) ) ; storage -> coordy0 = nvm_read_production_signature_row ( nvm_get_production_signature_row_offset ( COORDY0 ) ) ; storage -> coordy1 = nvm_read_production_signature_row ( nvm_get_production_signature_row_offset ( COORDY1 ) ) ; }
\brief Read the device serial
 This function returns the device serial stored in the device.
\ brief Read the device serial This function returns the device serial stored in the device .