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 /*----------------------------------------------------------------------------
vmihalcut 0:fdfe93cb9255 2 * RL-ARM - RTX
vmihalcut 0:fdfe93cb9255 3 *----------------------------------------------------------------------------
vmihalcut 0:fdfe93cb9255 4 * Name: RT_TYPEDEF.H
vmihalcut 0:fdfe93cb9255 5 * Purpose: Type Definitions
vmihalcut 0:fdfe93cb9255 6 * Rev.: V4.60
vmihalcut 0:fdfe93cb9255 7 *----------------------------------------------------------------------------
vmihalcut 0:fdfe93cb9255 8 *
vmihalcut 0:fdfe93cb9255 9 * Copyright (c) 1999-2009 KEIL, 2009-2012 ARM Germany GmbH
vmihalcut 0:fdfe93cb9255 10 * All rights reserved.
vmihalcut 0:fdfe93cb9255 11 * Redistribution and use in source and binary forms, with or without
vmihalcut 0:fdfe93cb9255 12 * modification, are permitted provided that the following conditions are met:
vmihalcut 0:fdfe93cb9255 13 * - Redistributions of source code must retain the above copyright
vmihalcut 0:fdfe93cb9255 14 * notice, this list of conditions and the following disclaimer.
vmihalcut 0:fdfe93cb9255 15 * - Redistributions in binary form must reproduce the above copyright
vmihalcut 0:fdfe93cb9255 16 * notice, this list of conditions and the following disclaimer in the
vmihalcut 0:fdfe93cb9255 17 * documentation and/or other materials provided with the distribution.
vmihalcut 0:fdfe93cb9255 18 * - Neither the name of ARM nor the names of its contributors may be used
vmihalcut 0:fdfe93cb9255 19 * to endorse or promote products derived from this software without
vmihalcut 0:fdfe93cb9255 20 * specific prior written permission.
vmihalcut 0:fdfe93cb9255 21 *
vmihalcut 0:fdfe93cb9255 22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
vmihalcut 0:fdfe93cb9255 23 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
vmihalcut 0:fdfe93cb9255 24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
vmihalcut 0:fdfe93cb9255 25 * ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
vmihalcut 0:fdfe93cb9255 26 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
vmihalcut 0:fdfe93cb9255 27 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
vmihalcut 0:fdfe93cb9255 28 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
vmihalcut 0:fdfe93cb9255 29 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
vmihalcut 0:fdfe93cb9255 30 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
vmihalcut 0:fdfe93cb9255 31 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
vmihalcut 0:fdfe93cb9255 32 * POSSIBILITY OF SUCH DAMAGE.
vmihalcut 0:fdfe93cb9255 33 *---------------------------------------------------------------------------*/
vmihalcut 0:fdfe93cb9255 34 #ifndef RT_TYPE_DEF_H
vmihalcut 0:fdfe93cb9255 35 #define RT_TYPE_DEF_H
vmihalcut 0:fdfe93cb9255 36
vmihalcut 0:fdfe93cb9255 37 #include "os_tcb.h"
vmihalcut 0:fdfe93cb9255 38
vmihalcut 0:fdfe93cb9255 39 typedef U32 OS_TID;
vmihalcut 0:fdfe93cb9255 40 typedef void *OS_ID;
vmihalcut 0:fdfe93cb9255 41 typedef U32 OS_RESULT;
vmihalcut 0:fdfe93cb9255 42
vmihalcut 0:fdfe93cb9255 43 #define TCB_STACKF 32 /* 'stack_frame' offset */
vmihalcut 0:fdfe93cb9255 44 #define TCB_TSTACK 36 /* 'tsk_stack' offset */
vmihalcut 0:fdfe93cb9255 45
vmihalcut 0:fdfe93cb9255 46 typedef struct OS_PSFE { /* Post Service Fifo Entry */
vmihalcut 0:fdfe93cb9255 47 void *id; /* Object Identification */
vmihalcut 0:fdfe93cb9255 48 U32 arg; /* Object Argument */
vmihalcut 0:fdfe93cb9255 49 } *P_PSFE;
vmihalcut 0:fdfe93cb9255 50
vmihalcut 0:fdfe93cb9255 51 typedef struct OS_PSQ { /* Post Service Queue */
vmihalcut 0:fdfe93cb9255 52 U8 first; /* FIFO Head Index */
vmihalcut 0:fdfe93cb9255 53 U8 last; /* FIFO Tail Index */
vmihalcut 0:fdfe93cb9255 54 U8 count; /* Number of stored items in FIFO */
vmihalcut 0:fdfe93cb9255 55 U8 size; /* FIFO Size */
vmihalcut 0:fdfe93cb9255 56 struct OS_PSFE q[1]; /* FIFO Content */
vmihalcut 0:fdfe93cb9255 57 } *P_PSQ;
vmihalcut 0:fdfe93cb9255 58
vmihalcut 0:fdfe93cb9255 59 typedef struct OS_TSK {
vmihalcut 0:fdfe93cb9255 60 P_TCB run; /* Current running task */
vmihalcut 0:fdfe93cb9255 61 P_TCB new_tsk; /* Scheduled task to run */
vmihalcut 0:fdfe93cb9255 62 } *P_TSK;
vmihalcut 0:fdfe93cb9255 63
vmihalcut 0:fdfe93cb9255 64 typedef struct OS_ROBIN { /* Round Robin Control */
vmihalcut 0:fdfe93cb9255 65 P_TCB task; /* Round Robin task */
vmihalcut 0:fdfe93cb9255 66 U16 time; /* Round Robin switch time */
vmihalcut 0:fdfe93cb9255 67 U16 tout; /* Round Robin timeout */
vmihalcut 0:fdfe93cb9255 68 } *P_ROBIN;
vmihalcut 0:fdfe93cb9255 69
vmihalcut 0:fdfe93cb9255 70 typedef struct OS_XCB {
vmihalcut 0:fdfe93cb9255 71 U8 cb_type; /* Control Block Type */
vmihalcut 0:fdfe93cb9255 72 struct OS_TCB *p_lnk; /* Link pointer for ready/sem. wait list */
vmihalcut 0:fdfe93cb9255 73 struct OS_TCB *p_rlnk; /* Link pointer for sem./mbx lst backwards */
vmihalcut 0:fdfe93cb9255 74 struct OS_TCB *p_dlnk; /* Link pointer for delay list */
vmihalcut 0:fdfe93cb9255 75 struct OS_TCB *p_blnk; /* Link pointer for delay list backwards */
vmihalcut 0:fdfe93cb9255 76 U16 delta_time; /* Time until time out */
vmihalcut 0:fdfe93cb9255 77 } *P_XCB;
vmihalcut 0:fdfe93cb9255 78
vmihalcut 0:fdfe93cb9255 79 typedef struct OS_MCB {
vmihalcut 0:fdfe93cb9255 80 U8 cb_type; /* Control Block Type */
vmihalcut 0:fdfe93cb9255 81 U8 state; /* State flag variable */
vmihalcut 0:fdfe93cb9255 82 U8 isr_st; /* State flag variable for isr functions */
vmihalcut 0:fdfe93cb9255 83 struct OS_TCB *p_lnk; /* Chain of tasks waiting for message */
vmihalcut 0:fdfe93cb9255 84 U16 first; /* Index of the message list begin */
vmihalcut 0:fdfe93cb9255 85 U16 last; /* Index of the message list end */
vmihalcut 0:fdfe93cb9255 86 U16 count; /* Actual number of stored messages */
vmihalcut 0:fdfe93cb9255 87 U16 size; /* Maximum number of stored messages */
vmihalcut 0:fdfe93cb9255 88 void *msg[1]; /* FIFO for Message pointers 1st element */
vmihalcut 0:fdfe93cb9255 89 } *P_MCB;
vmihalcut 0:fdfe93cb9255 90
vmihalcut 0:fdfe93cb9255 91 typedef struct OS_SCB {
vmihalcut 0:fdfe93cb9255 92 U8 cb_type; /* Control Block Type */
vmihalcut 0:fdfe93cb9255 93 U8 mask; /* Semaphore token mask */
vmihalcut 0:fdfe93cb9255 94 U16 tokens; /* Semaphore tokens */
vmihalcut 0:fdfe93cb9255 95 struct OS_TCB *p_lnk; /* Chain of tasks waiting for tokens */
vmihalcut 0:fdfe93cb9255 96 } *P_SCB;
vmihalcut 0:fdfe93cb9255 97
vmihalcut 0:fdfe93cb9255 98 typedef struct OS_MUCB {
vmihalcut 0:fdfe93cb9255 99 U8 cb_type; /* Control Block Type */
vmihalcut 0:fdfe93cb9255 100 U8 prio; /* Owner task default priority */
vmihalcut 0:fdfe93cb9255 101 U16 level; /* Call nesting level */
vmihalcut 0:fdfe93cb9255 102 struct OS_TCB *p_lnk; /* Chain of tasks waiting for mutex */
vmihalcut 0:fdfe93cb9255 103 struct OS_TCB *owner; /* Mutex owner task */
vmihalcut 0:fdfe93cb9255 104 } *P_MUCB;
vmihalcut 0:fdfe93cb9255 105
vmihalcut 0:fdfe93cb9255 106 typedef struct OS_XTMR {
vmihalcut 0:fdfe93cb9255 107 struct OS_TMR *next;
vmihalcut 0:fdfe93cb9255 108 U16 tcnt;
vmihalcut 0:fdfe93cb9255 109 } *P_XTMR;
vmihalcut 0:fdfe93cb9255 110
vmihalcut 0:fdfe93cb9255 111 typedef struct OS_TMR {
vmihalcut 0:fdfe93cb9255 112 struct OS_TMR *next; /* Link pointer to Next timer */
vmihalcut 0:fdfe93cb9255 113 U16 tcnt; /* Timer delay count */
vmihalcut 0:fdfe93cb9255 114 U16 info; /* User defined call info */
vmihalcut 0:fdfe93cb9255 115 } *P_TMR;
vmihalcut 0:fdfe93cb9255 116
vmihalcut 0:fdfe93cb9255 117 typedef struct OS_BM {
vmihalcut 0:fdfe93cb9255 118 void *free; /* Pointer to first free memory block */
vmihalcut 0:fdfe93cb9255 119 void *end; /* Pointer to memory block end */
vmihalcut 0:fdfe93cb9255 120 U32 blk_size; /* Memory block size */
vmihalcut 0:fdfe93cb9255 121 } *P_BM;
vmihalcut 0:fdfe93cb9255 122
vmihalcut 0:fdfe93cb9255 123 /* Definitions */
vmihalcut 0:fdfe93cb9255 124 #define __TRUE 1
vmihalcut 0:fdfe93cb9255 125 #define __FALSE 0
vmihalcut 0:fdfe93cb9255 126 #define NULL ((void *) 0)
vmihalcut 0:fdfe93cb9255 127
vmihalcut 0:fdfe93cb9255 128 #endif