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/s110/nrf_svc.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 | #ifndef NRF_SVC__ |
lipoyang | 5:7f89fca19a9e | 2 | #define NRF_SVC__ |
lipoyang | 5:7f89fca19a9e | 3 | |
lipoyang | 5:7f89fca19a9e | 4 | #ifdef SVCALL_AS_NORMAL_FUNCTION |
lipoyang | 5:7f89fca19a9e | 5 | #define SVCALL(number, return_type, signature) return_type signature |
lipoyang | 5:7f89fca19a9e | 6 | #else |
lipoyang | 5:7f89fca19a9e | 7 | |
lipoyang | 5:7f89fca19a9e | 8 | #ifndef SVCALL |
lipoyang | 5:7f89fca19a9e | 9 | #if defined (__CC_ARM) |
lipoyang | 5:7f89fca19a9e | 10 | #define SVCALL(number, return_type, signature) return_type __svc(number) signature |
lipoyang | 5:7f89fca19a9e | 11 | #elif defined (__GNUC__) |
lipoyang | 5:7f89fca19a9e | 12 | #define SVCALL(number, return_type, signature) \ |
lipoyang | 5:7f89fca19a9e | 13 | _Pragma("GCC diagnostic ignored \"-Wreturn-type\"") \ |
lipoyang | 5:7f89fca19a9e | 14 | _Pragma("GCC diagnostic ignored \"-Wunused-function\"") \ |
lipoyang | 5:7f89fca19a9e | 15 | __attribute__((naked)) static return_type signature \ |
lipoyang | 5:7f89fca19a9e | 16 | { \ |
lipoyang | 5:7f89fca19a9e | 17 | __asm( \ |
lipoyang | 5:7f89fca19a9e | 18 | "svc %0\n" \ |
lipoyang | 5:7f89fca19a9e | 19 | "bx r14" : : "I" ((uint32_t)number) : "r0" \ |
lipoyang | 5:7f89fca19a9e | 20 | ); \ |
lipoyang | 5:7f89fca19a9e | 21 | } |
lipoyang | 5:7f89fca19a9e | 22 | #elif defined (__ICCARM__) |
lipoyang | 5:7f89fca19a9e | 23 | #define PRAGMA(x) _Pragma(#x) |
lipoyang | 5:7f89fca19a9e | 24 | #define SVCALL(number, return_type, signature) \ |
lipoyang | 5:7f89fca19a9e | 25 | PRAGMA(swi_number = number) \ |
lipoyang | 5:7f89fca19a9e | 26 | __swi return_type signature; |
lipoyang | 5:7f89fca19a9e | 27 | #else |
lipoyang | 5:7f89fca19a9e | 28 | #define SVCALL(number, return_type, signature) return_type signature |
lipoyang | 5:7f89fca19a9e | 29 | #endif |
lipoyang | 5:7f89fca19a9e | 30 | #endif // SVCALL |
lipoyang | 5:7f89fca19a9e | 31 | |
lipoyang | 5:7f89fca19a9e | 32 | #endif // SVCALL_AS_NORMAL_FUNCTION |
lipoyang | 5:7f89fca19a9e | 33 | #endif // NRF_SVC__ |