iOSのBLEコントローラアプリ「RCBController」と接続し、コントローラの操作を取得するサンプルプログラムです。 mbed HRM1017で動作を確認しています。 2014.08.20時点でのBLEライブラリに対応しました。
Fork of BLE_RCBController by
nRF51822/nordic/nrf-sdk/nrf_nvmc.h@1:48f6e08a3ac2, 2014-08-20 (annotated)
- Committer:
- jksoft
- Date:
- Wed Aug 20 13:24:20 2014 +0000
- Revision:
- 1:48f6e08a3ac2
2014.08.20?????BLE?????????????; ???mbed?????????????????; mbed HRM1017; Nordic nRF51822
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jksoft | 1:48f6e08a3ac2 | 1 | /* Copyright (c) 2012 Nordic Semiconductor. All Rights Reserved. |
jksoft | 1:48f6e08a3ac2 | 2 | * |
jksoft | 1:48f6e08a3ac2 | 3 | * The information contained herein is confidential property of Nordic |
jksoft | 1:48f6e08a3ac2 | 4 | * Semiconductor ASA.Terms and conditions of usage are described in detail |
jksoft | 1:48f6e08a3ac2 | 5 | * in NORDIC SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. |
jksoft | 1:48f6e08a3ac2 | 6 | * |
jksoft | 1:48f6e08a3ac2 | 7 | * Licensees are granted free, non-transferable use of the information. NO |
jksoft | 1:48f6e08a3ac2 | 8 | * WARRANTY of ANY KIND is provided. This heading must NOT be removed from |
jksoft | 1:48f6e08a3ac2 | 9 | * the file. |
jksoft | 1:48f6e08a3ac2 | 10 | * |
jksoft | 1:48f6e08a3ac2 | 11 | * $LastChangedRevision: 17685 $ |
jksoft | 1:48f6e08a3ac2 | 12 | */ |
jksoft | 1:48f6e08a3ac2 | 13 | |
jksoft | 1:48f6e08a3ac2 | 14 | /** |
jksoft | 1:48f6e08a3ac2 | 15 | * @file |
jksoft | 1:48f6e08a3ac2 | 16 | * @brief NMVC driver API. |
jksoft | 1:48f6e08a3ac2 | 17 | */ |
jksoft | 1:48f6e08a3ac2 | 18 | |
jksoft | 1:48f6e08a3ac2 | 19 | #ifndef NRF_NVMC_H__ |
jksoft | 1:48f6e08a3ac2 | 20 | #define NRF_NVMC_H__ |
jksoft | 1:48f6e08a3ac2 | 21 | |
jksoft | 1:48f6e08a3ac2 | 22 | #include <stdint.h> |
jksoft | 1:48f6e08a3ac2 | 23 | |
jksoft | 1:48f6e08a3ac2 | 24 | |
jksoft | 1:48f6e08a3ac2 | 25 | /** |
jksoft | 1:48f6e08a3ac2 | 26 | * @defgroup nrf_nvmc Non-volatile memory controller |
jksoft | 1:48f6e08a3ac2 | 27 | * @{ |
jksoft | 1:48f6e08a3ac2 | 28 | * @ingroup nrf_drivers |
jksoft | 1:48f6e08a3ac2 | 29 | * @brief Driver for the nRF51 NVMC peripheral. |
jksoft | 1:48f6e08a3ac2 | 30 | * |
jksoft | 1:48f6e08a3ac2 | 31 | * This driver allows writing to the non-volatile memory (NVM) regions |
jksoft | 1:48f6e08a3ac2 | 32 | * of the nRF51. In order to write to NVM the controller must be powered |
jksoft | 1:48f6e08a3ac2 | 33 | * on and the relevant page must be erased. |
jksoft | 1:48f6e08a3ac2 | 34 | * |
jksoft | 1:48f6e08a3ac2 | 35 | */ |
jksoft | 1:48f6e08a3ac2 | 36 | |
jksoft | 1:48f6e08a3ac2 | 37 | |
jksoft | 1:48f6e08a3ac2 | 38 | /** |
jksoft | 1:48f6e08a3ac2 | 39 | * @brief Erase a page in flash. This is required before writing to any |
jksoft | 1:48f6e08a3ac2 | 40 | * address in the page. |
jksoft | 1:48f6e08a3ac2 | 41 | * |
jksoft | 1:48f6e08a3ac2 | 42 | * @param address Start address of the page. |
jksoft | 1:48f6e08a3ac2 | 43 | */ |
jksoft | 1:48f6e08a3ac2 | 44 | void nrf_nvmc_page_erase(uint32_t address); |
jksoft | 1:48f6e08a3ac2 | 45 | |
jksoft | 1:48f6e08a3ac2 | 46 | |
jksoft | 1:48f6e08a3ac2 | 47 | /** |
jksoft | 1:48f6e08a3ac2 | 48 | * @brief Write a single byte to flash. |
jksoft | 1:48f6e08a3ac2 | 49 | * |
jksoft | 1:48f6e08a3ac2 | 50 | * The function reads the word containing the byte, and then |
jksoft | 1:48f6e08a3ac2 | 51 | * rewrites the entire word. |
jksoft | 1:48f6e08a3ac2 | 52 | * |
jksoft | 1:48f6e08a3ac2 | 53 | * @param address Address to write to. |
jksoft | 1:48f6e08a3ac2 | 54 | * @param value Value to write. |
jksoft | 1:48f6e08a3ac2 | 55 | */ |
jksoft | 1:48f6e08a3ac2 | 56 | void nrf_nvmc_write_byte(uint32_t address , uint8_t value); |
jksoft | 1:48f6e08a3ac2 | 57 | |
jksoft | 1:48f6e08a3ac2 | 58 | |
jksoft | 1:48f6e08a3ac2 | 59 | /** |
jksoft | 1:48f6e08a3ac2 | 60 | * @brief Write a 32-bit word to flash. |
jksoft | 1:48f6e08a3ac2 | 61 | * @param address Address to write to. |
jksoft | 1:48f6e08a3ac2 | 62 | * @param value Value to write. |
jksoft | 1:48f6e08a3ac2 | 63 | */ |
jksoft | 1:48f6e08a3ac2 | 64 | void nrf_nvmc_write_word(uint32_t address, uint32_t value); |
jksoft | 1:48f6e08a3ac2 | 65 | |
jksoft | 1:48f6e08a3ac2 | 66 | |
jksoft | 1:48f6e08a3ac2 | 67 | /** |
jksoft | 1:48f6e08a3ac2 | 68 | * @brief Write consecutive bytes to flash. |
jksoft | 1:48f6e08a3ac2 | 69 | * |
jksoft | 1:48f6e08a3ac2 | 70 | * @param address Address to write to. |
jksoft | 1:48f6e08a3ac2 | 71 | * @param src Pointer to data to copy from. |
jksoft | 1:48f6e08a3ac2 | 72 | * @param num_bytes Number of bytes in src to write. |
jksoft | 1:48f6e08a3ac2 | 73 | */ |
jksoft | 1:48f6e08a3ac2 | 74 | void nrf_nvmc_write_bytes(uint32_t address, const uint8_t * src, uint32_t num_bytes); |
jksoft | 1:48f6e08a3ac2 | 75 | |
jksoft | 1:48f6e08a3ac2 | 76 | |
jksoft | 1:48f6e08a3ac2 | 77 | /** |
jksoft | 1:48f6e08a3ac2 | 78 | @ @brief Write consecutive words to flash. |
jksoft | 1:48f6e08a3ac2 | 79 | * |
jksoft | 1:48f6e08a3ac2 | 80 | * @param address Address to write to. |
jksoft | 1:48f6e08a3ac2 | 81 | * @param src Pointer to data to copy from. |
jksoft | 1:48f6e08a3ac2 | 82 | * @param num_words Number of bytes in src to write. |
jksoft | 1:48f6e08a3ac2 | 83 | */ |
jksoft | 1:48f6e08a3ac2 | 84 | void nrf_nvmc_write_words(uint32_t address, const uint32_t * src, uint32_t num_words); |
jksoft | 1:48f6e08a3ac2 | 85 | |
jksoft | 1:48f6e08a3ac2 | 86 | |
jksoft | 1:48f6e08a3ac2 | 87 | #endif // NRF_NVMC_H__ |
jksoft | 1:48f6e08a3ac2 | 88 | /** @} */ |
jksoft | 1:48f6e08a3ac2 | 89 | |
jksoft | 1:48f6e08a3ac2 | 90 |