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 Bootloader API.
Vincent Coubard 0:f2542974c862 16 * @{
Vincent Coubard 0:f2542974c862 17 *
Vincent Coubard 0:f2542974c862 18 * @brief Bootloader module interface.
Vincent Coubard 0:f2542974c862 19 */
Vincent Coubard 0:f2542974c862 20
Vincent Coubard 0:f2542974c862 21 #ifndef BOOTLOADER_H__
Vincent Coubard 0:f2542974c862 22 #define BOOTLOADER_H__
Vincent Coubard 0:f2542974c862 23
Vincent Coubard 0:f2542974c862 24 #include <stdbool.h>
Vincent Coubard 0:f2542974c862 25 #include <stdint.h>
Vincent Coubard 0:f2542974c862 26 #include "bootloader_types.h"
vcoubard 1:ebc0e0ef0a11 27 #include <dfu_types.h>
Vincent Coubard 0:f2542974c862 28
Vincent Coubard 0:f2542974c862 29 /**@brief Function for initializing the Bootloader.
Vincent Coubard 0:f2542974c862 30 *
Vincent Coubard 0:f2542974c862 31 * @retval NRF_SUCCESS If bootloader was succesfully initialized.
Vincent Coubard 0:f2542974c862 32 */
Vincent Coubard 0:f2542974c862 33 uint32_t bootloader_init(void);
Vincent Coubard 0:f2542974c862 34
Vincent Coubard 0:f2542974c862 35 /**@brief Function for validating application region in flash.
Vincent Coubard 0:f2542974c862 36 *
Vincent Coubard 0:f2542974c862 37 * @param[in] app_addr Address to the region in flash where the application is stored.
Vincent Coubard 0:f2542974c862 38 *
Vincent Coubard 0:f2542974c862 39 * @retval true If Application region is valid.
Vincent Coubard 0:f2542974c862 40 * @retval false If Application region is not valid.
Vincent Coubard 0:f2542974c862 41 */
Vincent Coubard 0:f2542974c862 42 bool bootloader_app_is_valid(uint32_t app_addr);
Vincent Coubard 0:f2542974c862 43
Vincent Coubard 0:f2542974c862 44 /**@brief Function for starting the Device Firmware Update.
Vincent Coubard 0:f2542974c862 45 *
Vincent Coubard 0:f2542974c862 46 * @retval NRF_SUCCESS If new application image was successfully transferred.
Vincent Coubard 0:f2542974c862 47 */
Vincent Coubard 0:f2542974c862 48 uint32_t bootloader_dfu_start(void);
Vincent Coubard 0:f2542974c862 49
Vincent Coubard 0:f2542974c862 50 /**@brief Function for exiting bootloader and booting into application.
Vincent Coubard 0:f2542974c862 51 *
Vincent Coubard 0:f2542974c862 52 * @details This function will disable SoftDevice and all interrupts before jumping to application.
Vincent Coubard 0:f2542974c862 53 * The SoftDevice vector table base for interrupt forwarding will be set the application
Vincent Coubard 0:f2542974c862 54 * address.
Vincent Coubard 0:f2542974c862 55 *
Vincent Coubard 0:f2542974c862 56 * @param[in] app_addr Address to the region where the application is stored.
Vincent Coubard 0:f2542974c862 57 */
Vincent Coubard 0:f2542974c862 58 void bootloader_app_start(uint32_t app_addr);
Vincent Coubard 0:f2542974c862 59
Vincent Coubard 0:f2542974c862 60 /**@brief Function for retrieving the bootloader settings.
Vincent Coubard 0:f2542974c862 61 *
Vincent Coubard 0:f2542974c862 62 * @param[out] p_settings A copy of the current bootloader settings is returned in the structure
Vincent Coubard 0:f2542974c862 63 * provided.
Vincent Coubard 0:f2542974c862 64 */
Vincent Coubard 0:f2542974c862 65 void bootloader_settings_get(bootloader_settings_t * const p_settings);
Vincent Coubard 0:f2542974c862 66
Vincent Coubard 0:f2542974c862 67 /**@brief Function for processing DFU status update.
Vincent Coubard 0:f2542974c862 68 *
Vincent Coubard 0:f2542974c862 69 * @param[in] update_status DFU update status.
Vincent Coubard 0:f2542974c862 70 */
Vincent Coubard 0:f2542974c862 71 void bootloader_dfu_update_process(dfu_update_status_t update_status);
Vincent Coubard 0:f2542974c862 72
Vincent Coubard 0:f2542974c862 73 /**@brief Function getting state of SoftDevice update in progress.
Vincent Coubard 0:f2542974c862 74 * After a successfull SoftDevice transfer the system restarts in orderto disable SoftDevice
Vincent Coubard 0:f2542974c862 75 * and complete the update.
Vincent Coubard 0:f2542974c862 76 *
Vincent Coubard 0:f2542974c862 77 * @retval true A SoftDevice update is in progress. This indicates that second stage
Vincent Coubard 0:f2542974c862 78 * of a SoftDevice update procedure can be initiated.
Vincent Coubard 0:f2542974c862 79 * @retval false No SoftDevice update is in progress.
Vincent Coubard 0:f2542974c862 80 */
Vincent Coubard 0:f2542974c862 81 bool bootloader_dfu_sd_in_progress(void);
Vincent Coubard 0:f2542974c862 82
Vincent Coubard 0:f2542974c862 83 /**@brief Function for continuing the Device Firmware Update of a SoftDevice.
Vincent Coubard 0:f2542974c862 84 *
Vincent Coubard 0:f2542974c862 85 * @retval NRF_SUCCESS If the final stage of SoftDevice update was successful.
Vincent Coubard 0:f2542974c862 86 */
Vincent Coubard 0:f2542974c862 87 uint32_t bootloader_dfu_sd_update_continue(void);
Vincent Coubard 0:f2542974c862 88
Vincent Coubard 0:f2542974c862 89 /**@brief Function for finalizing the Device Firmware Update of a SoftDevice.
Vincent Coubard 0:f2542974c862 90 *
Vincent Coubard 0:f2542974c862 91 * @retval NRF_SUCCESS If the final stage of SoftDevice update was successful.
Vincent Coubard 0:f2542974c862 92 */
Vincent Coubard 0:f2542974c862 93 uint32_t bootloader_dfu_sd_update_finalize(void);
Vincent Coubard 0:f2542974c862 94
Vincent Coubard 0:f2542974c862 95 #endif // BOOTLOADER_H__
Vincent Coubard 0:f2542974c862 96
vcoubard 1:ebc0e0ef0a11 97 /**@} */