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_nvmc.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: 17685 $ |
lipoyang | 5:7f89fca19a9e | 12 | */ |
lipoyang | 5:7f89fca19a9e | 13 | |
lipoyang | 5:7f89fca19a9e | 14 | /** |
lipoyang | 5:7f89fca19a9e | 15 | * @file |
lipoyang | 5:7f89fca19a9e | 16 | * @brief NMVC driver API. |
lipoyang | 5:7f89fca19a9e | 17 | */ |
lipoyang | 5:7f89fca19a9e | 18 | |
lipoyang | 5:7f89fca19a9e | 19 | #ifndef NRF_NVMC_H__ |
lipoyang | 5:7f89fca19a9e | 20 | #define NRF_NVMC_H__ |
lipoyang | 5:7f89fca19a9e | 21 | |
lipoyang | 5:7f89fca19a9e | 22 | #include <stdint.h> |
lipoyang | 5:7f89fca19a9e | 23 | |
lipoyang | 5:7f89fca19a9e | 24 | |
lipoyang | 5:7f89fca19a9e | 25 | /** |
lipoyang | 5:7f89fca19a9e | 26 | * @defgroup nrf_nvmc Non-volatile memory controller |
lipoyang | 5:7f89fca19a9e | 27 | * @{ |
lipoyang | 5:7f89fca19a9e | 28 | * @ingroup nrf_drivers |
lipoyang | 5:7f89fca19a9e | 29 | * @brief Driver for the nRF51 NVMC peripheral. |
lipoyang | 5:7f89fca19a9e | 30 | * |
lipoyang | 5:7f89fca19a9e | 31 | * This driver allows writing to the non-volatile memory (NVM) regions |
lipoyang | 5:7f89fca19a9e | 32 | * of the nRF51. In order to write to NVM the controller must be powered |
lipoyang | 5:7f89fca19a9e | 33 | * on and the relevant page must be erased. |
lipoyang | 5:7f89fca19a9e | 34 | * |
lipoyang | 5:7f89fca19a9e | 35 | */ |
lipoyang | 5:7f89fca19a9e | 36 | |
lipoyang | 5:7f89fca19a9e | 37 | |
lipoyang | 5:7f89fca19a9e | 38 | /** |
lipoyang | 5:7f89fca19a9e | 39 | * @brief Erase a page in flash. This is required before writing to any |
lipoyang | 5:7f89fca19a9e | 40 | * address in the page. |
lipoyang | 5:7f89fca19a9e | 41 | * |
lipoyang | 5:7f89fca19a9e | 42 | * @param address Start address of the page. |
lipoyang | 5:7f89fca19a9e | 43 | */ |
lipoyang | 5:7f89fca19a9e | 44 | void nrf_nvmc_page_erase(uint32_t address); |
lipoyang | 5:7f89fca19a9e | 45 | |
lipoyang | 5:7f89fca19a9e | 46 | |
lipoyang | 5:7f89fca19a9e | 47 | /** |
lipoyang | 5:7f89fca19a9e | 48 | * @brief Write a single byte to flash. |
lipoyang | 5:7f89fca19a9e | 49 | * |
lipoyang | 5:7f89fca19a9e | 50 | * The function reads the word containing the byte, and then |
lipoyang | 5:7f89fca19a9e | 51 | * rewrites the entire word. |
lipoyang | 5:7f89fca19a9e | 52 | * |
lipoyang | 5:7f89fca19a9e | 53 | * @param address Address to write to. |
lipoyang | 5:7f89fca19a9e | 54 | * @param value Value to write. |
lipoyang | 5:7f89fca19a9e | 55 | */ |
lipoyang | 5:7f89fca19a9e | 56 | void nrf_nvmc_write_byte(uint32_t address , uint8_t value); |
lipoyang | 5:7f89fca19a9e | 57 | |
lipoyang | 5:7f89fca19a9e | 58 | |
lipoyang | 5:7f89fca19a9e | 59 | /** |
lipoyang | 5:7f89fca19a9e | 60 | * @brief Write a 32-bit word to flash. |
lipoyang | 5:7f89fca19a9e | 61 | * @param address Address to write to. |
lipoyang | 5:7f89fca19a9e | 62 | * @param value Value to write. |
lipoyang | 5:7f89fca19a9e | 63 | */ |
lipoyang | 5:7f89fca19a9e | 64 | void nrf_nvmc_write_word(uint32_t address, uint32_t value); |
lipoyang | 5:7f89fca19a9e | 65 | |
lipoyang | 5:7f89fca19a9e | 66 | |
lipoyang | 5:7f89fca19a9e | 67 | /** |
lipoyang | 5:7f89fca19a9e | 68 | * @brief Write consecutive bytes to flash. |
lipoyang | 5:7f89fca19a9e | 69 | * |
lipoyang | 5:7f89fca19a9e | 70 | * @param address Address to write to. |
lipoyang | 5:7f89fca19a9e | 71 | * @param src Pointer to data to copy from. |
lipoyang | 5:7f89fca19a9e | 72 | * @param num_bytes Number of bytes in src to write. |
lipoyang | 5:7f89fca19a9e | 73 | */ |
lipoyang | 5:7f89fca19a9e | 74 | void nrf_nvmc_write_bytes(uint32_t address, const uint8_t * src, uint32_t num_bytes); |
lipoyang | 5:7f89fca19a9e | 75 | |
lipoyang | 5:7f89fca19a9e | 76 | |
lipoyang | 5:7f89fca19a9e | 77 | /** |
lipoyang | 5:7f89fca19a9e | 78 | @ @brief Write consecutive words to flash. |
lipoyang | 5:7f89fca19a9e | 79 | * |
lipoyang | 5:7f89fca19a9e | 80 | * @param address Address to write to. |
lipoyang | 5:7f89fca19a9e | 81 | * @param src Pointer to data to copy from. |
lipoyang | 5:7f89fca19a9e | 82 | * @param num_words Number of bytes in src to write. |
lipoyang | 5:7f89fca19a9e | 83 | */ |
lipoyang | 5:7f89fca19a9e | 84 | void nrf_nvmc_write_words(uint32_t address, const uint32_t * src, uint32_t num_words); |
lipoyang | 5:7f89fca19a9e | 85 | |
lipoyang | 5:7f89fca19a9e | 86 | |
lipoyang | 5:7f89fca19a9e | 87 | #endif // NRF_NVMC_H__ |
lipoyang | 5:7f89fca19a9e | 88 | /** @} */ |
lipoyang | 5:7f89fca19a9e | 89 | |
lipoyang | 5:7f89fca19a9e | 90 |