NRF com

Dependencies:   mbed nRF24L01P

Committer:
vmihalcut
Date:
Mon May 27 06:06:31 2013 +0000
Revision:
0:fdfe93cb9255
NRF24L01 receiver

Who changed what in which revision?

UserRevisionLine numberNew contents of line
vmihalcut 0:fdfe93cb9255 1 /* mbed Microcontroller Library
vmihalcut 0:fdfe93cb9255 2 * Copyright (c) 2006-2012 ARM Limited
vmihalcut 0:fdfe93cb9255 3 *
vmihalcut 0:fdfe93cb9255 4 * Permission is hereby granted, free of charge, to any person obtaining a copy
vmihalcut 0:fdfe93cb9255 5 * of this software and associated documentation files (the "Software"), to deal
vmihalcut 0:fdfe93cb9255 6 * in the Software without restriction, including without limitation the rights
vmihalcut 0:fdfe93cb9255 7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
vmihalcut 0:fdfe93cb9255 8 * copies of the Software, and to permit persons to whom the Software is
vmihalcut 0:fdfe93cb9255 9 * furnished to do so, subject to the following conditions:
vmihalcut 0:fdfe93cb9255 10 *
vmihalcut 0:fdfe93cb9255 11 * The above copyright notice and this permission notice shall be included in
vmihalcut 0:fdfe93cb9255 12 * all copies or substantial portions of the Software.
vmihalcut 0:fdfe93cb9255 13 *
vmihalcut 0:fdfe93cb9255 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
vmihalcut 0:fdfe93cb9255 15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
vmihalcut 0:fdfe93cb9255 16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
vmihalcut 0:fdfe93cb9255 17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
vmihalcut 0:fdfe93cb9255 18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
vmihalcut 0:fdfe93cb9255 19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
vmihalcut 0:fdfe93cb9255 20 * SOFTWARE.
vmihalcut 0:fdfe93cb9255 21 */
vmihalcut 0:fdfe93cb9255 22 #ifndef RTOS_TIMER_H
vmihalcut 0:fdfe93cb9255 23 #define RTOS_TIMER_H
vmihalcut 0:fdfe93cb9255 24
vmihalcut 0:fdfe93cb9255 25 #include <stdint.h>
vmihalcut 0:fdfe93cb9255 26 #include "cmsis_os.h"
vmihalcut 0:fdfe93cb9255 27
vmihalcut 0:fdfe93cb9255 28 namespace rtos {
vmihalcut 0:fdfe93cb9255 29
vmihalcut 0:fdfe93cb9255 30 /** The RtosTimer class allow creating and and controlling of timer functions in the system.
vmihalcut 0:fdfe93cb9255 31 A timer function is called when a time period expires whereby both on-shot and
vmihalcut 0:fdfe93cb9255 32 periodic timers are possible. A timer can be started, restarted, or stopped.
vmihalcut 0:fdfe93cb9255 33
vmihalcut 0:fdfe93cb9255 34 Timers are handled in the thread osTimerThread.
vmihalcut 0:fdfe93cb9255 35 Callback functions run under control of this thread and may use CMSIS-RTOS API calls.
vmihalcut 0:fdfe93cb9255 36 */
vmihalcut 0:fdfe93cb9255 37 class RtosTimer {
vmihalcut 0:fdfe93cb9255 38 public:
vmihalcut 0:fdfe93cb9255 39 /** Create and Start timer.
vmihalcut 0:fdfe93cb9255 40 @param task name of the timer call back function.
vmihalcut 0:fdfe93cb9255 41 @param type osTimerOnce for one-shot or osTimerPeriodic for periodic behaviour. (default: osTimerPeriodic)
vmihalcut 0:fdfe93cb9255 42 @param argument argument to the timer call back function. (default: NULL)
vmihalcut 0:fdfe93cb9255 43 */
vmihalcut 0:fdfe93cb9255 44 RtosTimer(void (*task)(void const *argument),
vmihalcut 0:fdfe93cb9255 45 os_timer_type type=osTimerPeriodic,
vmihalcut 0:fdfe93cb9255 46 void *argument=NULL);
vmihalcut 0:fdfe93cb9255 47
vmihalcut 0:fdfe93cb9255 48 /** Stop the timer.
vmihalcut 0:fdfe93cb9255 49 @return status code that indicates the execution status of the function.
vmihalcut 0:fdfe93cb9255 50 */
vmihalcut 0:fdfe93cb9255 51 osStatus stop(void);
vmihalcut 0:fdfe93cb9255 52
vmihalcut 0:fdfe93cb9255 53 /** start a timer.
vmihalcut 0:fdfe93cb9255 54 @param millisec time delay value of the timer.
vmihalcut 0:fdfe93cb9255 55 @return status code that indicates the execution status of the function.
vmihalcut 0:fdfe93cb9255 56 */
vmihalcut 0:fdfe93cb9255 57 osStatus start(uint32_t millisec);
vmihalcut 0:fdfe93cb9255 58
vmihalcut 0:fdfe93cb9255 59 ~RtosTimer();
vmihalcut 0:fdfe93cb9255 60
vmihalcut 0:fdfe93cb9255 61 private:
vmihalcut 0:fdfe93cb9255 62 osTimerId _timer_id;
vmihalcut 0:fdfe93cb9255 63 osTimerDef_t _timer;
vmihalcut 0:fdfe93cb9255 64 #ifdef CMSIS_OS_RTX
vmihalcut 0:fdfe93cb9255 65 uint32_t _timer_data[5];
vmihalcut 0:fdfe93cb9255 66 #endif
vmihalcut 0:fdfe93cb9255 67 };
vmihalcut 0:fdfe93cb9255 68
vmihalcut 0:fdfe93cb9255 69 }
vmihalcut 0:fdfe93cb9255 70
vmihalcut 0:fdfe93cb9255 71 #endif