Cefn Hoile / nRF51822

Dependencies:   nrf51-sdk

Dependents:   microbit-dal

Fork of nRF51822 by Lancaster University

Committer:
rgrover1
Date:
Thu Jul 02 09:08:44 2015 +0100
Revision:
361:d2405f5a4853
Parent:
346:14b090482fd2
Child:
362:6fa0d4d555f6
Synchronized with git rev 9f72c4ba
Author: Rohit Grover
Release 0.3.7
=============

This is a minor set of enhancements mostly around reduce our global static
memory footprint.

Enhancements
~~~~~~~~~~~~

* Reduce the maximum number of CHARACTERISTICS and DESCRIPTORS that can be
handled. This has memory implications for static global memory. It should
be possible to re-architect our solution for add_characteristic() to not
require these limits; hopefully we'll get there soon.

* Move nRF51GattServer::getInstance() into a .cpp file; same for nRF51Gap::getInstance().

* Reduce max bonds to managed by device-manager to 4; this has memory implications for static global memory.

* Reduce pStorage command queue size to 2; this has memory implications for static global memory.

* Replace uses of deprecated Gap::addr_type_t with Gap::AddressType_t.

* Some UUID-related types have moved into UUID class. Minor changes were needed to work around build errors.

Bugfixes
~~~~~~~~

* None.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
rgrover1 361:d2405f5a4853 1 /* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved.
rgrover1 361:d2405f5a4853 2 *
rgrover1 361:d2405f5a4853 3 * The information contained herein is property of Nordic Semiconductor ASA.
rgrover1 361:d2405f5a4853 4 * Terms and conditions of usage are described in detail in NORDIC
rgrover1 361:d2405f5a4853 5 * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
rgrover1 361:d2405f5a4853 6 *
rgrover1 361:d2405f5a4853 7 * Licensees are granted free, non-transferable use of the information. NO
rgrover1 361:d2405f5a4853 8 * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
rgrover1 361:d2405f5a4853 9 * the file.
rgrover1 361:d2405f5a4853 10 *
rgrover1 361:d2405f5a4853 11 */
rgrover1 361:d2405f5a4853 12
rgrover1 361:d2405f5a4853 13 /**@file
rgrover1 361:d2405f5a4853 14 *
rgrover1 361:d2405f5a4853 15 * @defgroup nrf_bootloader Bootloader API.
rgrover1 361:d2405f5a4853 16 * @{
rgrover1 361:d2405f5a4853 17 *
rgrover1 361:d2405f5a4853 18 * @brief Bootloader module interface.
rgrover1 361:d2405f5a4853 19 */
rgrover1 361:d2405f5a4853 20
rgrover1 361:d2405f5a4853 21 #ifndef BOOTLOADER_H__
rgrover1 361:d2405f5a4853 22 #define BOOTLOADER_H__
rgrover1 361:d2405f5a4853 23
rgrover1 361:d2405f5a4853 24 #include <stdbool.h>
rgrover1 361:d2405f5a4853 25 #include <stdint.h>
rgrover1 361:d2405f5a4853 26 #include "bootloader_types.h"
rgrover1 361:d2405f5a4853 27 #include "dfu_types.h"
rgrover1 361:d2405f5a4853 28
rgrover1 361:d2405f5a4853 29 /**@brief Function for initializing the Bootloader.
rgrover1 361:d2405f5a4853 30 *
rgrover1 361:d2405f5a4853 31 * @retval NRF_SUCCESS If bootloader was succesfully initialized.
rgrover1 361:d2405f5a4853 32 */
rgrover1 361:d2405f5a4853 33 uint32_t bootloader_init(void);
rgrover1 361:d2405f5a4853 34
rgrover1 361:d2405f5a4853 35 /**@brief Function for validating application region in flash.
rgrover1 361:d2405f5a4853 36 *
rgrover1 361:d2405f5a4853 37 * @param[in] app_addr Address to the region in flash where the application is stored.
rgrover1 361:d2405f5a4853 38 *
rgrover1 361:d2405f5a4853 39 * @retval true If Application region is valid.
rgrover1 361:d2405f5a4853 40 * @retval false If Application region is not valid.
rgrover1 361:d2405f5a4853 41 */
rgrover1 361:d2405f5a4853 42 bool bootloader_app_is_valid(uint32_t app_addr);
rgrover1 361:d2405f5a4853 43
rgrover1 361:d2405f5a4853 44 /**@brief Function for starting the Device Firmware Update.
rgrover1 361:d2405f5a4853 45 *
rgrover1 361:d2405f5a4853 46 * @retval NRF_SUCCESS If new application image was successfully transferred.
rgrover1 361:d2405f5a4853 47 */
rgrover1 361:d2405f5a4853 48 uint32_t bootloader_dfu_start(void);
rgrover1 361:d2405f5a4853 49
rgrover1 361:d2405f5a4853 50 /**@brief Function for exiting bootloader and booting into application.
rgrover1 361:d2405f5a4853 51 *
rgrover1 361:d2405f5a4853 52 * @details This function will disable SoftDevice and all interrupts before jumping to application.
rgrover1 361:d2405f5a4853 53 * The SoftDevice vector table base for interrupt forwarding will be set the application
rgrover1 361:d2405f5a4853 54 * address.
rgrover1 361:d2405f5a4853 55 *
rgrover1 361:d2405f5a4853 56 * @param[in] app_addr Address to the region where the application is stored.
rgrover1 361:d2405f5a4853 57 */
rgrover1 361:d2405f5a4853 58 void bootloader_app_start(uint32_t app_addr);
rgrover1 361:d2405f5a4853 59
rgrover1 361:d2405f5a4853 60 /**@brief Function for retrieving the bootloader settings.
rgrover1 361:d2405f5a4853 61 *
rgrover1 361:d2405f5a4853 62 * @param[out] p_settings A copy of the current bootloader settings is returned in the structure
rgrover1 361:d2405f5a4853 63 * provided.
rgrover1 361:d2405f5a4853 64 */
rgrover1 361:d2405f5a4853 65 void bootloader_settings_get(bootloader_settings_t * const p_settings);
rgrover1 361:d2405f5a4853 66
rgrover1 361:d2405f5a4853 67 /**@brief Function for processing DFU status update.
rgrover1 361:d2405f5a4853 68 *
rgrover1 361:d2405f5a4853 69 * @param[in] update_status DFU update status.
rgrover1 361:d2405f5a4853 70 */
rgrover1 361:d2405f5a4853 71 void bootloader_dfu_update_process(dfu_update_status_t update_status);
rgrover1 361:d2405f5a4853 72
rgrover1 361:d2405f5a4853 73 /**@brief Function getting state of SoftDevice update in progress.
rgrover1 361:d2405f5a4853 74 * After a successfull SoftDevice transfer the system restarts in orderto disable SoftDevice
rgrover1 361:d2405f5a4853 75 * and complete the update.
rgrover1 361:d2405f5a4853 76 *
rgrover1 361:d2405f5a4853 77 * @retval true A SoftDevice update is in progress. This indicates that second stage
rgrover1 361:d2405f5a4853 78 * of a SoftDevice update procedure can be initiated.
rgrover1 361:d2405f5a4853 79 * @retval false No SoftDevice update is in progress.
rgrover1 361:d2405f5a4853 80 */
rgrover1 361:d2405f5a4853 81 bool bootloader_dfu_sd_in_progress(void);
rgrover1 361:d2405f5a4853 82
rgrover1 361:d2405f5a4853 83 /**@brief Function for continuing the Device Firmware Update of a SoftDevice.
rgrover1 361:d2405f5a4853 84 *
rgrover1 361:d2405f5a4853 85 * @retval NRF_SUCCESS If the final stage of SoftDevice update was successful.
rgrover1 361:d2405f5a4853 86 */
rgrover1 361:d2405f5a4853 87 uint32_t bootloader_dfu_sd_update_continue(void);
rgrover1 361:d2405f5a4853 88
rgrover1 361:d2405f5a4853 89 /**@brief Function for finalizing the Device Firmware Update of a SoftDevice.
rgrover1 361:d2405f5a4853 90 *
rgrover1 361:d2405f5a4853 91 * @retval NRF_SUCCESS If the final stage of SoftDevice update was successful.
rgrover1 361:d2405f5a4853 92 */
rgrover1 361:d2405f5a4853 93 uint32_t bootloader_dfu_sd_update_finalize(void);
rgrover1 361:d2405f5a4853 94
rgrover1 361:d2405f5a4853 95 #endif // BOOTLOADER_H__
rgrover1 361:d2405f5a4853 96
rgrover1 361:d2405f5a4853 97 /**@} */