AndroidのBLEラジコンプロポアプリ「BLEPropo」と接続し、RCサーボとDCモータを制御するプログラムです。 BLE Nanoで動作を確認しています。 BLEPropo → https://github.com/lipoyang/BLEPropo
BLEを使ったAndroid用ラジコンプロポアプリ「BLEPropo」に対応するBLE Nano用ファームウェアです。
BLEPropoは、GitHubにて公開中。
https://github.com/lipoyang/BLEPropo
ラジコンは、mbed HRM1017とRCサーボやDCモータを組み合わせて作ります。
回路図
/media/uploads/lipoyang/ministeer3.pdf
nRF51822/nordic/nrf-sdk/nrf_ecb.h@5:7f89fca19a9e, 2015-03-14 (annotated)
- Committer:
- lipoyang
- Date:
- Sat Mar 14 12:02:48 2015 +0000
- Revision:
- 5:7f89fca19a9e
-convert nRF51822 library to a folder
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
lipoyang | 5:7f89fca19a9e | 1 | /* Copyright (c) 2012 Nordic Semiconductor. All Rights Reserved. |
lipoyang | 5:7f89fca19a9e | 2 | * |
lipoyang | 5:7f89fca19a9e | 3 | * The information contained herein is confidential property of Nordic |
lipoyang | 5:7f89fca19a9e | 4 | * Semiconductor ASA.Terms and conditions of usage are described in detail |
lipoyang | 5:7f89fca19a9e | 5 | * in NORDIC SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. |
lipoyang | 5:7f89fca19a9e | 6 | * |
lipoyang | 5:7f89fca19a9e | 7 | * Licensees are granted free, non-transferable use of the information. NO |
lipoyang | 5:7f89fca19a9e | 8 | * WARRANTY of ANY KIND is provided. This heading must NOT be removed from |
lipoyang | 5:7f89fca19a9e | 9 | * the file. |
lipoyang | 5:7f89fca19a9e | 10 | * |
lipoyang | 5:7f89fca19a9e | 11 | * $LastChangedRevision: 13999 $ |
lipoyang | 5:7f89fca19a9e | 12 | */ |
lipoyang | 5:7f89fca19a9e | 13 | |
lipoyang | 5:7f89fca19a9e | 14 | /** |
lipoyang | 5:7f89fca19a9e | 15 | * @file |
lipoyang | 5:7f89fca19a9e | 16 | * @brief ECB driver API. |
lipoyang | 5:7f89fca19a9e | 17 | */ |
lipoyang | 5:7f89fca19a9e | 18 | |
lipoyang | 5:7f89fca19a9e | 19 | #ifndef NRF_ECB_H__ |
lipoyang | 5:7f89fca19a9e | 20 | #define NRF_ECB_H__ |
lipoyang | 5:7f89fca19a9e | 21 | |
lipoyang | 5:7f89fca19a9e | 22 | /** |
lipoyang | 5:7f89fca19a9e | 23 | * @defgroup nrf_ecb AES ECB encryption |
lipoyang | 5:7f89fca19a9e | 24 | * @{ |
lipoyang | 5:7f89fca19a9e | 25 | * @ingroup nrf_drivers |
lipoyang | 5:7f89fca19a9e | 26 | * @brief Driver for the nRF51 AES Electronic Code Book (ECB) peripheral. |
lipoyang | 5:7f89fca19a9e | 27 | * |
lipoyang | 5:7f89fca19a9e | 28 | * In order to encrypt and decrypt data the peripheral must be powered on |
lipoyang | 5:7f89fca19a9e | 29 | * using nrf_ecb_init() and then the key set using nrf_ecb_set_key. |
lipoyang | 5:7f89fca19a9e | 30 | */ |
lipoyang | 5:7f89fca19a9e | 31 | |
lipoyang | 5:7f89fca19a9e | 32 | #include <stdint.h> |
lipoyang | 5:7f89fca19a9e | 33 | |
lipoyang | 5:7f89fca19a9e | 34 | /** |
lipoyang | 5:7f89fca19a9e | 35 | * Initialize and power on the ECB peripheral. |
lipoyang | 5:7f89fca19a9e | 36 | * |
lipoyang | 5:7f89fca19a9e | 37 | * Allocates memory for the ECBDATAPTR. |
lipoyang | 5:7f89fca19a9e | 38 | * @retval true Initialization was successful. |
lipoyang | 5:7f89fca19a9e | 39 | * @retval false Powering up failed. |
lipoyang | 5:7f89fca19a9e | 40 | */ |
lipoyang | 5:7f89fca19a9e | 41 | bool nrf_ecb_init(void); |
lipoyang | 5:7f89fca19a9e | 42 | |
lipoyang | 5:7f89fca19a9e | 43 | /** |
lipoyang | 5:7f89fca19a9e | 44 | * Encrypt/decrypt 16-byte data using current key. |
lipoyang | 5:7f89fca19a9e | 45 | * |
lipoyang | 5:7f89fca19a9e | 46 | * The function avoids unnecessary copying of data if the point to the |
lipoyang | 5:7f89fca19a9e | 47 | * correct locations in the ECB data structure. |
lipoyang | 5:7f89fca19a9e | 48 | * |
lipoyang | 5:7f89fca19a9e | 49 | * @param dst Result of encryption/decryption. 16 bytes will be written. |
lipoyang | 5:7f89fca19a9e | 50 | * @param src Source with 16-byte data to be encrypted/decrypted. |
lipoyang | 5:7f89fca19a9e | 51 | * |
lipoyang | 5:7f89fca19a9e | 52 | * @retval true If the encryption operation completed. |
lipoyang | 5:7f89fca19a9e | 53 | * @retval false If the encryption operation did not complete. |
lipoyang | 5:7f89fca19a9e | 54 | */ |
lipoyang | 5:7f89fca19a9e | 55 | bool nrf_ecb_crypt(uint8_t * dst, const uint8_t * src); |
lipoyang | 5:7f89fca19a9e | 56 | |
lipoyang | 5:7f89fca19a9e | 57 | /** |
lipoyang | 5:7f89fca19a9e | 58 | * Set the key to be used for encryption/decryption. |
lipoyang | 5:7f89fca19a9e | 59 | * |
lipoyang | 5:7f89fca19a9e | 60 | * @param key Pointer to key. 16 bytes will be read. |
lipoyang | 5:7f89fca19a9e | 61 | */ |
lipoyang | 5:7f89fca19a9e | 62 | void nrf_ecb_set_key(const uint8_t * key); |
lipoyang | 5:7f89fca19a9e | 63 | |
lipoyang | 5:7f89fca19a9e | 64 | #endif // NRF_ECB_H__ |
lipoyang | 5:7f89fca19a9e | 65 | |
lipoyang | 5:7f89fca19a9e | 66 | /** @} */ |