AndroidのBLEラジコンプロポアプリ「BLEPropo」と接続し、RCサーボとDCモータを制御するプログラムです。 mbed HRM1017で動作を確認しています。 BLEPropo → https://github.com/lipoyang/BLEPropo

Dependencies:   BLE_API mbed

Fork of BLE_RCBController2 by Junichi Katsu

BLEを使ったAndroid用ラジコンプロポアプリ「BLEPropo」に対応するmbed HRM1017用ファームウェアです。
BLEPropoは、GitHubにて公開中。
https://github.com/lipoyang/BLEPropo
/media/uploads/lipoyang/blepropo_ui.png
ラジコンは、mbed HRM1017とRCサーボやDCモータを組み合わせて作ります。
/media/uploads/lipoyang/ble_wiring.png

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?

UserRevisionLine numberNew contents of line
jksoft 1:48f6e08a3ac2 1 /* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved.
jksoft 1:48f6e08a3ac2 2 *
jksoft 1:48f6e08a3ac2 3 * The information contained herein is property of Nordic Semiconductor ASA.
jksoft 1:48f6e08a3ac2 4 * Terms and conditions of usage are described in detail in NORDIC
jksoft 1:48f6e08a3ac2 5 * 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 */
jksoft 1:48f6e08a3ac2 12
jksoft 1:48f6e08a3ac2 13 /** @cond To make doxygen skip this file */
jksoft 1:48f6e08a3ac2 14
jksoft 1:48f6e08a3ac2 15 /** @file
jksoft 1:48f6e08a3ac2 16 * This header contains defines with respect persistent storage that are specific to
jksoft 1:48f6e08a3ac2 17 * persistent storage implementation and application use case.
jksoft 1:48f6e08a3ac2 18 */
jksoft 1:48f6e08a3ac2 19 #ifndef PSTORAGE_PL_H__
jksoft 1:48f6e08a3ac2 20 #define PSTORAGE_PL_H__
jksoft 1:48f6e08a3ac2 21
jksoft 1:48f6e08a3ac2 22 #include <stdint.h>
jksoft 1:48f6e08a3ac2 23 #include "nordic_global.h"
jksoft 1:48f6e08a3ac2 24
jksoft 1:48f6e08a3ac2 25 #ifdef __cplusplus
jksoft 1:48f6e08a3ac2 26 extern "C" {
jksoft 1:48f6e08a3ac2 27 #endif // #ifdef __cplusplus
jksoft 1:48f6e08a3ac2 28
jksoft 1:48f6e08a3ac2 29 #define PSTORAGE_FLASH_PAGE_SIZE ((uint16_t)NRF_FICR->CODEPAGESIZE) /**< Size of one flash page. */
jksoft 1:48f6e08a3ac2 30 #define PSTORAGE_FLASH_EMPTY_MASK 0xFFFFFFFF /**< Bit mask that defines an empty address in flash. */
jksoft 1:48f6e08a3ac2 31
jksoft 1:48f6e08a3ac2 32 #define PSTORAGE_FLASH_PAGE_END \
jksoft 1:48f6e08a3ac2 33 ((NRF_UICR->BOOTLOADERADDR != PSTORAGE_FLASH_EMPTY_MASK) \
jksoft 1:48f6e08a3ac2 34 ? (NRF_UICR->BOOTLOADERADDR / PSTORAGE_FLASH_PAGE_SIZE) \
jksoft 1:48f6e08a3ac2 35 : NRF_FICR->CODESIZE)
jksoft 1:48f6e08a3ac2 36
jksoft 1:48f6e08a3ac2 37
jksoft 1:48f6e08a3ac2 38 #define PSTORAGE_MAX_APPLICATIONS 2 /**< Maximum number of applications that can be registered with the module, configurable based on system requirements. */
jksoft 1:48f6e08a3ac2 39 #define PSTORAGE_MIN_BLOCK_SIZE 0x0010 /**< Minimum size of block that can be registered with the module. Should be configured based on system requirements, recommendation is not have this value to be at least size of word. */
jksoft 1:48f6e08a3ac2 40
jksoft 1:48f6e08a3ac2 41 #define PSTORAGE_DATA_START_ADDR ((PSTORAGE_FLASH_PAGE_END - PSTORAGE_MAX_APPLICATIONS) \
jksoft 1:48f6e08a3ac2 42 * PSTORAGE_FLASH_PAGE_SIZE) /**< Start address for persistent data, configurable according to system requirements. */
jksoft 1:48f6e08a3ac2 43 #define PSTORAGE_DATA_END_ADDR (PSTORAGE_FLASH_PAGE_END * PSTORAGE_FLASH_PAGE_SIZE) /**< End address for persistent data, configurable according to system requirements. */
jksoft 1:48f6e08a3ac2 44
jksoft 1:48f6e08a3ac2 45 #define PSTORAGE_MAX_BLOCK_SIZE PSTORAGE_FLASH_PAGE_SIZE /**< Maximum size of block that can be registered with the module. Should be configured based on system requirements. And should be greater than or equal to the minimum size. */
jksoft 1:48f6e08a3ac2 46 #define PSTORAGE_CMD_QUEUE_SIZE 30 /**< Maximum number of flash access commands that can be maintained by the module for all applications. Configurable. */
jksoft 1:48f6e08a3ac2 47
jksoft 1:48f6e08a3ac2 48
jksoft 1:48f6e08a3ac2 49 /** Abstracts persistently memory block identifier. */
jksoft 1:48f6e08a3ac2 50 typedef uint32_t pstorage_block_t;
jksoft 1:48f6e08a3ac2 51
jksoft 1:48f6e08a3ac2 52 typedef struct
jksoft 1:48f6e08a3ac2 53 {
jksoft 1:48f6e08a3ac2 54 uint32_t module_id; /**< Module ID.*/
jksoft 1:48f6e08a3ac2 55 pstorage_block_t block_id; /**< Block ID.*/
jksoft 1:48f6e08a3ac2 56 } pstorage_handle_t;
jksoft 1:48f6e08a3ac2 57
jksoft 1:48f6e08a3ac2 58 typedef uint16_t pstorage_size_t; /** Size of length and offset fields. */
jksoft 1:48f6e08a3ac2 59
jksoft 1:48f6e08a3ac2 60 /**@brief Handles Flash Access Result Events. To be called in the system event dispatcher of the application. */
jksoft 1:48f6e08a3ac2 61 void pstorage_sys_event_handler (uint32_t sys_evt);
jksoft 1:48f6e08a3ac2 62
jksoft 1:48f6e08a3ac2 63 #ifdef __cplusplus
jksoft 1:48f6e08a3ac2 64 }
jksoft 1:48f6e08a3ac2 65 #endif // #ifdef __cplusplus
jksoft 1:48f6e08a3ac2 66
jksoft 1:48f6e08a3ac2 67 #endif // PSTORAGE_PL_H__
jksoft 1:48f6e08a3ac2 68
jksoft 1:48f6e08a3ac2 69 /** @} */
jksoft 1:48f6e08a3ac2 70 /** @endcond */