BLE FOTA APP

Dependencies:   BLE_API mbed

It doesn't work with the default FOTA bootloader. It use NVIC_SystemReset() to enter a bootloader.

Committer:
yihui
Date:
Fri Oct 10 03:36:28 2014 +0000
Revision:
1:a607cd9655d7
use NVIC_SystemReset() to run bootloader

Who changed what in which revision?

UserRevisionLine numberNew contents of line
yihui 1:a607cd9655d7 1 /* Copyright (c) 2012 Nordic Semiconductor. All Rights Reserved.
yihui 1:a607cd9655d7 2 *
yihui 1:a607cd9655d7 3 * The information contained herein is confidential property of Nordic
yihui 1:a607cd9655d7 4 * Semiconductor ASA.Terms and conditions of usage are described in detail
yihui 1:a607cd9655d7 5 * in NORDIC SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
yihui 1:a607cd9655d7 6 *
yihui 1:a607cd9655d7 7 * Licensees are granted free, non-transferable use of the information. NO
yihui 1:a607cd9655d7 8 * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
yihui 1:a607cd9655d7 9 * the file.
yihui 1:a607cd9655d7 10 *
yihui 1:a607cd9655d7 11 * $LastChangedRevision: 13999 $
yihui 1:a607cd9655d7 12 */
yihui 1:a607cd9655d7 13
yihui 1:a607cd9655d7 14 /**
yihui 1:a607cd9655d7 15 * @file
yihui 1:a607cd9655d7 16 * @brief ECB driver API.
yihui 1:a607cd9655d7 17 */
yihui 1:a607cd9655d7 18
yihui 1:a607cd9655d7 19 #ifndef NRF_ECB_H__
yihui 1:a607cd9655d7 20 #define NRF_ECB_H__
yihui 1:a607cd9655d7 21
yihui 1:a607cd9655d7 22 /**
yihui 1:a607cd9655d7 23 * @defgroup nrf_ecb AES ECB encryption
yihui 1:a607cd9655d7 24 * @{
yihui 1:a607cd9655d7 25 * @ingroup nrf_drivers
yihui 1:a607cd9655d7 26 * @brief Driver for the nRF51 AES Electronic Code Book (ECB) peripheral.
yihui 1:a607cd9655d7 27 *
yihui 1:a607cd9655d7 28 * In order to encrypt and decrypt data the peripheral must be powered on
yihui 1:a607cd9655d7 29 * using nrf_ecb_init() and then the key set using nrf_ecb_set_key.
yihui 1:a607cd9655d7 30 */
yihui 1:a607cd9655d7 31
yihui 1:a607cd9655d7 32 #include <stdint.h>
yihui 1:a607cd9655d7 33
yihui 1:a607cd9655d7 34 /**
yihui 1:a607cd9655d7 35 * Initialize and power on the ECB peripheral.
yihui 1:a607cd9655d7 36 *
yihui 1:a607cd9655d7 37 * Allocates memory for the ECBDATAPTR.
yihui 1:a607cd9655d7 38 * @retval true Initialization was successful.
yihui 1:a607cd9655d7 39 * @retval false Powering up failed.
yihui 1:a607cd9655d7 40 */
yihui 1:a607cd9655d7 41 bool nrf_ecb_init(void);
yihui 1:a607cd9655d7 42
yihui 1:a607cd9655d7 43 /**
yihui 1:a607cd9655d7 44 * Encrypt/decrypt 16-byte data using current key.
yihui 1:a607cd9655d7 45 *
yihui 1:a607cd9655d7 46 * The function avoids unnecessary copying of data if the point to the
yihui 1:a607cd9655d7 47 * correct locations in the ECB data structure.
yihui 1:a607cd9655d7 48 *
yihui 1:a607cd9655d7 49 * @param dst Result of encryption/decryption. 16 bytes will be written.
yihui 1:a607cd9655d7 50 * @param src Source with 16-byte data to be encrypted/decrypted.
yihui 1:a607cd9655d7 51 *
yihui 1:a607cd9655d7 52 * @retval true If the encryption operation completed.
yihui 1:a607cd9655d7 53 * @retval false If the encryption operation did not complete.
yihui 1:a607cd9655d7 54 */
yihui 1:a607cd9655d7 55 bool nrf_ecb_crypt(uint8_t * dst, const uint8_t * src);
yihui 1:a607cd9655d7 56
yihui 1:a607cd9655d7 57 /**
yihui 1:a607cd9655d7 58 * Set the key to be used for encryption/decryption.
yihui 1:a607cd9655d7 59 *
yihui 1:a607cd9655d7 60 * @param key Pointer to key. 16 bytes will be read.
yihui 1:a607cd9655d7 61 */
yihui 1:a607cd9655d7 62 void nrf_ecb_set_key(const uint8_t * key);
yihui 1:a607cd9655d7 63
yihui 1:a607cd9655d7 64 #endif // NRF_ECB_H__
yihui 1:a607cd9655d7 65
yihui 1:a607cd9655d7 66 /** @} */