iOSのBLEコントローラアプリ「RCBController」とmbed HRM1017を接続し、RCサーボモータを操作するテストプログラムです。
Dependencies: BLE_API_Native_IRC Servo mbed
Fork of BLE_RCBController by
- 古いBLEライブラリを使っているのでプラットフォームは”Nordic nRF51822”を選択してください。
- ライブラリ類はUpdateしないでください。コンパイルエラーになります。
うまく接続できない時は、iPhone/iPadのBluetoothをOFF->ONしてキャッシュをクリアしてみてください。
BLE_API_Native_IRC/hw/nRF51822n/nordic/nrf-sdk/nrf_temp.h@0:8c643bfe55b7, 2014-07-10 (annotated)
- Committer:
- jksoft
- Date:
- Thu Jul 10 14:21:52 2014 +0000
- Revision:
- 0:8c643bfe55b7
??
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jksoft | 0:8c643bfe55b7 | 1 | /* Copyright (c) 2012 Nordic Semiconductor. All Rights Reserved. |
jksoft | 0:8c643bfe55b7 | 2 | * |
jksoft | 0:8c643bfe55b7 | 3 | * The information contained herein is property of Nordic Semiconductor ASA. |
jksoft | 0:8c643bfe55b7 | 4 | * Terms and conditions of usage are described in detail in NORDIC |
jksoft | 0:8c643bfe55b7 | 5 | * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. |
jksoft | 0:8c643bfe55b7 | 6 | * |
jksoft | 0:8c643bfe55b7 | 7 | * Licensees are granted free, non-transferable use of the information. NO |
jksoft | 0:8c643bfe55b7 | 8 | * WARRANTY of ANY KIND is provided. This heading must NOT be removed from |
jksoft | 0:8c643bfe55b7 | 9 | * the file. |
jksoft | 0:8c643bfe55b7 | 10 | * |
jksoft | 0:8c643bfe55b7 | 11 | */ |
jksoft | 0:8c643bfe55b7 | 12 | |
jksoft | 0:8c643bfe55b7 | 13 | #ifndef NRF_TEMP_H__ |
jksoft | 0:8c643bfe55b7 | 14 | #define NRF_TEMP_H__ |
jksoft | 0:8c643bfe55b7 | 15 | |
jksoft | 0:8c643bfe55b7 | 16 | #include "nordic_global.h" |
jksoft | 0:8c643bfe55b7 | 17 | #include "nrf51.h" |
jksoft | 0:8c643bfe55b7 | 18 | |
jksoft | 0:8c643bfe55b7 | 19 | /** |
jksoft | 0:8c643bfe55b7 | 20 | * @defgroup nrf_temperature TEMP (temperature) abstraction |
jksoft | 0:8c643bfe55b7 | 21 | * @{ |
jksoft | 0:8c643bfe55b7 | 22 | * @ingroup nrf_drivers temperature_example |
jksoft | 0:8c643bfe55b7 | 23 | * @brief Temperature module init and read functions. |
jksoft | 0:8c643bfe55b7 | 24 | * |
jksoft | 0:8c643bfe55b7 | 25 | */ |
jksoft | 0:8c643bfe55b7 | 26 | |
jksoft | 0:8c643bfe55b7 | 27 | |
jksoft | 0:8c643bfe55b7 | 28 | |
jksoft | 0:8c643bfe55b7 | 29 | /** |
jksoft | 0:8c643bfe55b7 | 30 | * @brief Function for preparing the temp module for temperature measurement. |
jksoft | 0:8c643bfe55b7 | 31 | * |
jksoft | 0:8c643bfe55b7 | 32 | * This function initializes the TEMP module and writes to the hidden configuration register. |
jksoft | 0:8c643bfe55b7 | 33 | * |
jksoft | 0:8c643bfe55b7 | 34 | * @param none |
jksoft | 0:8c643bfe55b7 | 35 | */ |
jksoft | 0:8c643bfe55b7 | 36 | static __INLINE void nrf_temp_init(void) |
jksoft | 0:8c643bfe55b7 | 37 | { |
jksoft | 0:8c643bfe55b7 | 38 | /**@note Workaround for PAN_028 rev2.0A anomaly 31 - TEMP: Temperature offset value has to be manually loaded to the TEMP module */ |
jksoft | 0:8c643bfe55b7 | 39 | *(uint32_t *) 0x4000C504 = 0; |
jksoft | 0:8c643bfe55b7 | 40 | } |
jksoft | 0:8c643bfe55b7 | 41 | |
jksoft | 0:8c643bfe55b7 | 42 | |
jksoft | 0:8c643bfe55b7 | 43 | |
jksoft | 0:8c643bfe55b7 | 44 | #define MASK_SIGN (0x00000200UL) |
jksoft | 0:8c643bfe55b7 | 45 | #define MASK_SIGN_EXTENSION (0xFFFFFC00UL) |
jksoft | 0:8c643bfe55b7 | 46 | |
jksoft | 0:8c643bfe55b7 | 47 | /** |
jksoft | 0:8c643bfe55b7 | 48 | * @brief Function for reading temperature measurement. |
jksoft | 0:8c643bfe55b7 | 49 | * |
jksoft | 0:8c643bfe55b7 | 50 | * The function reads the 10 bit 2's complement value and transforms it to a 32 bit 2's complement value. |
jksoft | 0:8c643bfe55b7 | 51 | * |
jksoft | 0:8c643bfe55b7 | 52 | * @param none |
jksoft | 0:8c643bfe55b7 | 53 | */ |
jksoft | 0:8c643bfe55b7 | 54 | static __INLINE int32_t nrf_temp_read(void) |
jksoft | 0:8c643bfe55b7 | 55 | { |
jksoft | 0:8c643bfe55b7 | 56 | /**@note Workaround for PAN_028 rev2.0A anomaly 28 - TEMP: Negative measured values are not represented correctly */ |
jksoft | 0:8c643bfe55b7 | 57 | return ((NRF_TEMP->TEMP & MASK_SIGN) != 0) ? (NRF_TEMP->TEMP | MASK_SIGN_EXTENSION) : (NRF_TEMP->TEMP); |
jksoft | 0:8c643bfe55b7 | 58 | } |
jksoft | 0:8c643bfe55b7 | 59 | |
jksoft | 0:8c643bfe55b7 | 60 | /** @} */ |
jksoft | 0:8c643bfe55b7 | 61 | |
jksoft | 0:8c643bfe55b7 | 62 | #endif |