SG RFID nRF51822 fork

Fork of nRF51822 by Nordic Semiconductor

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers bootloader_types.h Source File

bootloader_types.h

Go to the documentation of this file.
00001 /* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved.
00002  *
00003  * The information contained herein is property of Nordic Semiconductor ASA.
00004  * Terms and conditions of usage are described in detail in NORDIC
00005  * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
00006  *
00007  * Licensees are granted free, non-transferable use of the information. NO
00008  * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
00009  * the file.
00010  *
00011  */
00012  
00013 /**@file
00014  *
00015  * @defgroup nrf_bootloader_types Types and definitions.
00016  * @{     
00017  *  
00018  * @ingroup nrf_bootloader
00019  * 
00020  * @brief Bootloader module type and definitions.
00021  */
00022  
00023 #ifndef BOOTLOADER_TYPES_H__
00024 #define BOOTLOADER_TYPES_H__
00025 
00026 #include <stdint.h>
00027 
00028 #define BOOTLOADER_DFU_START 0xB1
00029 
00030 /**@brief DFU Bank state code, which indicates wether the bank contains: A valid image, invalid image, or an erased flash.
00031   */
00032 typedef enum
00033 {
00034     BANK_VALID_APP   = 0x01,
00035     BANK_VALID_SD    = 0xA5,
00036     BANK_VALID_BOOT  = 0xAA,
00037     BANK_ERASED      = 0xFE,
00038     BANK_INVALID_APP = 0xFF,
00039 } bootloader_bank_code_t;
00040 
00041 /**@brief Structure holding bootloader settings for application and bank data.
00042  */
00043 typedef struct
00044 {
00045     bootloader_bank_code_t bank_0;          /**< Variable to store if bank 0 contains a valid application. */
00046     uint16_t               bank_0_crc;      /**< If bank is valid, this field will contain a valid CRC of the total image. */
00047     bootloader_bank_code_t bank_1;          /**< Variable to store if bank 1 has been erased/prepared for new image. Bank 1 is only used in Banked Update scenario. */
00048     uint32_t               bank_0_size;     /**< Size of active image in bank0 if present, otherwise 0. */
00049     uint32_t               sd_image_size;   /**< Size of SoftDevice image in bank0 if bank_0 code is \ref BANK_VALID_SD. */
00050     uint32_t               bl_image_size;   /**< Size of Bootloader image in bank0 if bank_0 code is \ref BANK_VALID_SD. */
00051     uint32_t               app_image_size;  /**< Size of Application image in bank0 if bank_0 code is \ref BANK_VALID_SD. */
00052     uint32_t               sd_image_start;  /**< Location in flash where SoftDevice image is stored for SoftDevice update. */
00053 } bootloader_settings_t;
00054 
00055 #endif // BOOTLOADER_TYPES_H__ 
00056 
00057 /**@} */