Nordic nrf51 sdk sources. Mirrored from https://github.com/ARMmbed/nrf51-sdk.

Dependents:   nRF51822 nRF51822

Committer:
vcoubard
Date:
Thu Apr 07 17:37:40 2016 +0100
Revision:
19:47192cb9def7
Parent:
10:233fefd8162b
Child:
20:a90c48eb1d30
Synchronized with git rev 9251259f
Author: Liyou Zhou
Copy over coresponding files from nordic-sdk 9.0.0

Who changed what in which revision?

UserRevisionLine numberNew contents of line
vcoubard 19:47192cb9def7 1 /* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved.
vcoubard 19:47192cb9def7 2 *
vcoubard 19:47192cb9def7 3 * The information contained herein is property of Nordic Semiconductor ASA.
vcoubard 19:47192cb9def7 4 * Terms and conditions of usage are described in detail in NORDIC
vcoubard 19:47192cb9def7 5 * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
vcoubard 19:47192cb9def7 6 *
vcoubard 19:47192cb9def7 7 * Licensees are granted free, non-transferable use of the information. NO
vcoubard 19:47192cb9def7 8 * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
vcoubard 19:47192cb9def7 9 * the file.
vcoubard 19:47192cb9def7 10 *
Vincent Coubard 0:f2542974c862 11 */
Vincent Coubard 0:f2542974c862 12
Vincent Coubard 0:f2542974c862 13 /**@file
Vincent Coubard 0:f2542974c862 14 *
Vincent Coubard 0:f2542974c862 15 * @defgroup nrf_bootloader_types Types and definitions.
Vincent Coubard 0:f2542974c862 16 * @{
Vincent Coubard 0:f2542974c862 17 *
Vincent Coubard 0:f2542974c862 18 * @ingroup nrf_bootloader
Vincent Coubard 0:f2542974c862 19 *
Vincent Coubard 0:f2542974c862 20 * @brief Bootloader module type and definitions.
Vincent Coubard 0:f2542974c862 21 */
Vincent Coubard 0:f2542974c862 22
Vincent Coubard 0:f2542974c862 23 #ifndef BOOTLOADER_TYPES_H__
Vincent Coubard 0:f2542974c862 24 #define BOOTLOADER_TYPES_H__
Vincent Coubard 0:f2542974c862 25
Vincent Coubard 0:f2542974c862 26 #include <stdint.h>
Vincent Coubard 0:f2542974c862 27
Vincent Coubard 0:f2542974c862 28 #define BOOTLOADER_DFU_START 0xB1
Vincent Coubard 0:f2542974c862 29
Vincent Coubard 0:f2542974c862 30 #define BOOTLOADER_SVC_APP_DATA_PTR_GET 0x02
Vincent Coubard 0:f2542974c862 31
Vincent Coubard 0:f2542974c862 32 /**@brief DFU Bank state code, which indicates wether the bank contains: A valid image, invalid image, or an erased flash.
Vincent Coubard 0:f2542974c862 33 */
Vincent Coubard 0:f2542974c862 34 typedef enum
Vincent Coubard 0:f2542974c862 35 {
Vincent Coubard 0:f2542974c862 36 BANK_VALID_APP = 0x01,
Vincent Coubard 0:f2542974c862 37 BANK_VALID_SD = 0xA5,
Vincent Coubard 0:f2542974c862 38 BANK_VALID_BOOT = 0xAA,
Vincent Coubard 0:f2542974c862 39 BANK_ERASED = 0xFE,
Vincent Coubard 0:f2542974c862 40 BANK_INVALID_APP = 0xFF,
Vincent Coubard 0:f2542974c862 41 } bootloader_bank_code_t;
Vincent Coubard 0:f2542974c862 42
Vincent Coubard 0:f2542974c862 43 /**@brief Structure holding bootloader settings for application and bank data.
Vincent Coubard 0:f2542974c862 44 */
Vincent Coubard 0:f2542974c862 45 typedef struct
Vincent Coubard 0:f2542974c862 46 {
Vincent Coubard 0:f2542974c862 47 bootloader_bank_code_t bank_0; /**< Variable to store if bank 0 contains a valid application. */
Vincent Coubard 0:f2542974c862 48 uint16_t bank_0_crc; /**< If bank is valid, this field will contain a valid CRC of the total image. */
Vincent Coubard 0:f2542974c862 49 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. */
Vincent Coubard 0:f2542974c862 50 uint32_t bank_0_size; /**< Size of active image in bank0 if present, otherwise 0. */
Vincent Coubard 0:f2542974c862 51 uint32_t sd_image_size; /**< Size of SoftDevice image in bank0 if bank_0 code is BANK_VALID_SD. */
Vincent Coubard 0:f2542974c862 52 uint32_t bl_image_size; /**< Size of Bootloader image in bank0 if bank_0 code is BANK_VALID_SD. */
Vincent Coubard 0:f2542974c862 53 uint32_t app_image_size; /**< Size of Application image in bank0 if bank_0 code is BANK_VALID_SD. */
Vincent Coubard 0:f2542974c862 54 uint32_t sd_image_start; /**< Location in flash where SoftDevice image is stored for SoftDevice update. */
Vincent Coubard 0:f2542974c862 55 } bootloader_settings_t;
Vincent Coubard 0:f2542974c862 56
Vincent Coubard 0:f2542974c862 57 #endif // BOOTLOADER_TYPES_H__
Vincent Coubard 0:f2542974c862 58
vcoubard 1:ebc0e0ef0a11 59 /**@} */