ProjetoBB

Dependencies:   F7_Ethernet WebSocketClient mbed mcp3008

Fork of Nucleo_F746ZG_Ethernet by Dieter Graef

Committer:
DieterGraef
Date:
Sat Jun 18 10:49:12 2016 +0000
Revision:
0:f9b6112278fe
Ethernet for the NUCLEO STM32F746 Board Testprogram uses DHCP and NTP to set the clock

Who changed what in which revision?

UserRevisionLine numberNew contents of line
DieterGraef 0:f9b6112278fe 1 /*----------------------------------------------------------------------------
DieterGraef 0:f9b6112278fe 2 * CMSIS-RTOS - RTX
DieterGraef 0:f9b6112278fe 3 *----------------------------------------------------------------------------
DieterGraef 0:f9b6112278fe 4 * Name: RT_TYPEDEF.H
DieterGraef 0:f9b6112278fe 5 * Purpose: Type Definitions
DieterGraef 0:f9b6112278fe 6 * Rev.: V4.79
DieterGraef 0:f9b6112278fe 7 *----------------------------------------------------------------------------
DieterGraef 0:f9b6112278fe 8 *
DieterGraef 0:f9b6112278fe 9 * Copyright (c) 1999-2009 KEIL, 2009-2015 ARM Germany GmbH
DieterGraef 0:f9b6112278fe 10 * All rights reserved.
DieterGraef 0:f9b6112278fe 11 * Redistribution and use in source and binary forms, with or without
DieterGraef 0:f9b6112278fe 12 * modification, are permitted provided that the following conditions are met:
DieterGraef 0:f9b6112278fe 13 * - Redistributions of source code must retain the above copyright
DieterGraef 0:f9b6112278fe 14 * notice, this list of conditions and the following disclaimer.
DieterGraef 0:f9b6112278fe 15 * - Redistributions in binary form must reproduce the above copyright
DieterGraef 0:f9b6112278fe 16 * notice, this list of conditions and the following disclaimer in the
DieterGraef 0:f9b6112278fe 17 * documentation and/or other materials provided with the distribution.
DieterGraef 0:f9b6112278fe 18 * - Neither the name of ARM nor the names of its contributors may be used
DieterGraef 0:f9b6112278fe 19 * to endorse or promote products derived from this software without
DieterGraef 0:f9b6112278fe 20 * specific prior written permission.
DieterGraef 0:f9b6112278fe 21 *
DieterGraef 0:f9b6112278fe 22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
DieterGraef 0:f9b6112278fe 23 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
DieterGraef 0:f9b6112278fe 24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
DieterGraef 0:f9b6112278fe 25 * ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
DieterGraef 0:f9b6112278fe 26 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
DieterGraef 0:f9b6112278fe 27 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
DieterGraef 0:f9b6112278fe 28 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
DieterGraef 0:f9b6112278fe 29 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
DieterGraef 0:f9b6112278fe 30 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
DieterGraef 0:f9b6112278fe 31 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
DieterGraef 0:f9b6112278fe 32 * POSSIBILITY OF SUCH DAMAGE.
DieterGraef 0:f9b6112278fe 33 *---------------------------------------------------------------------------*/
DieterGraef 0:f9b6112278fe 34 #ifndef RT_TYPE_DEF_H
DieterGraef 0:f9b6112278fe 35 #define RT_TYPE_DEF_H
DieterGraef 0:f9b6112278fe 36
DieterGraef 0:f9b6112278fe 37 /* Types */
DieterGraef 0:f9b6112278fe 38 typedef char S8;
DieterGraef 0:f9b6112278fe 39 typedef unsigned char U8;
DieterGraef 0:f9b6112278fe 40 typedef short S16;
DieterGraef 0:f9b6112278fe 41 typedef unsigned short U16;
DieterGraef 0:f9b6112278fe 42 typedef int S32;
DieterGraef 0:f9b6112278fe 43 typedef unsigned int U32;
DieterGraef 0:f9b6112278fe 44 typedef long long S64;
DieterGraef 0:f9b6112278fe 45 typedef unsigned long long U64;
DieterGraef 0:f9b6112278fe 46 typedef unsigned char BIT;
DieterGraef 0:f9b6112278fe 47 typedef unsigned int BOOL;
DieterGraef 0:f9b6112278fe 48 typedef void (*FUNCP)(void);
DieterGraef 0:f9b6112278fe 49
DieterGraef 0:f9b6112278fe 50 typedef U32 OS_TID;
DieterGraef 0:f9b6112278fe 51 typedef void *OS_ID;
DieterGraef 0:f9b6112278fe 52 typedef U32 OS_RESULT;
DieterGraef 0:f9b6112278fe 53
DieterGraef 0:f9b6112278fe 54 typedef struct OS_TCB {
DieterGraef 0:f9b6112278fe 55 /* General part: identical for all implementations. */
DieterGraef 0:f9b6112278fe 56 U8 cb_type; /* Control Block Type */
DieterGraef 0:f9b6112278fe 57 U8 state; /* Task state */
DieterGraef 0:f9b6112278fe 58 U8 prio; /* Execution priority */
DieterGraef 0:f9b6112278fe 59 U8 task_id; /* Task ID value for optimized TCB access */
DieterGraef 0:f9b6112278fe 60 struct OS_TCB *p_lnk; /* Link pointer for ready/sem. wait list */
DieterGraef 0:f9b6112278fe 61 struct OS_TCB *p_rlnk; /* Link pointer for sem./mbx lst backwards */
DieterGraef 0:f9b6112278fe 62 struct OS_TCB *p_dlnk; /* Link pointer for delay list */
DieterGraef 0:f9b6112278fe 63 struct OS_TCB *p_blnk; /* Link pointer for delay list backwards */
DieterGraef 0:f9b6112278fe 64 U16 delta_time; /* Time until time out */
DieterGraef 0:f9b6112278fe 65 U16 interval_time; /* Time interval for periodic waits */
DieterGraef 0:f9b6112278fe 66 U16 events; /* Event flags */
DieterGraef 0:f9b6112278fe 67 U16 waits; /* Wait flags */
DieterGraef 0:f9b6112278fe 68 void **msg; /* Direct message passing when task waits */
DieterGraef 0:f9b6112278fe 69 struct OS_MUCB *p_mlnk; /* Link pointer for mutex owner list */
DieterGraef 0:f9b6112278fe 70 U8 prio_base; /* Base priority */
DieterGraef 0:f9b6112278fe 71
DieterGraef 0:f9b6112278fe 72 /* Hardware dependant part: specific for CM processor */
DieterGraef 0:f9b6112278fe 73 U8 stack_frame; /* Stack frame: 0=Basic, 1=Extended, */
DieterGraef 0:f9b6112278fe 74 U16 reserved; /* Two reserved bytes for alignment */
DieterGraef 0:f9b6112278fe 75 /* (2=VFP/D16 stacked, 4=NEON/D32 stacked) */
DieterGraef 0:f9b6112278fe 76 U32 priv_stack; /* Private stack size, 0= system assigned */
DieterGraef 0:f9b6112278fe 77 U32 tsk_stack; /* Current task Stack pointer (R13) */
DieterGraef 0:f9b6112278fe 78 U32 *stack; /* Pointer to Task Stack memory block */
DieterGraef 0:f9b6112278fe 79
DieterGraef 0:f9b6112278fe 80 /* Task entry point used for uVision debugger */
DieterGraef 0:f9b6112278fe 81 FUNCP ptask; /* Task entry address */
DieterGraef 0:f9b6112278fe 82 } *P_TCB;
DieterGraef 0:f9b6112278fe 83 #define TCB_STACKF 37 /* 'stack_frame' offset */
DieterGraef 0:f9b6112278fe 84 #define TCB_TSTACK 44 /* 'tsk_stack' offset */
DieterGraef 0:f9b6112278fe 85
DieterGraef 0:f9b6112278fe 86 typedef struct OS_PSFE { /* Post Service Fifo Entry */
DieterGraef 0:f9b6112278fe 87 void *id; /* Object Identification */
DieterGraef 0:f9b6112278fe 88 U32 arg; /* Object Argument */
DieterGraef 0:f9b6112278fe 89 } *P_PSFE;
DieterGraef 0:f9b6112278fe 90
DieterGraef 0:f9b6112278fe 91 typedef struct OS_PSQ { /* Post Service Queue */
DieterGraef 0:f9b6112278fe 92 U8 first; /* FIFO Head Index */
DieterGraef 0:f9b6112278fe 93 U8 last; /* FIFO Tail Index */
DieterGraef 0:f9b6112278fe 94 U8 count; /* Number of stored items in FIFO */
DieterGraef 0:f9b6112278fe 95 U8 size; /* FIFO Size */
DieterGraef 0:f9b6112278fe 96 struct OS_PSFE q[1]; /* FIFO Content */
DieterGraef 0:f9b6112278fe 97 } *P_PSQ;
DieterGraef 0:f9b6112278fe 98
DieterGraef 0:f9b6112278fe 99 typedef struct OS_TSK {
DieterGraef 0:f9b6112278fe 100 P_TCB run; /* Current running task */
DieterGraef 0:f9b6112278fe 101 P_TCB new_tsk; /* Scheduled task to run */
DieterGraef 0:f9b6112278fe 102 } *P_TSK;
DieterGraef 0:f9b6112278fe 103
DieterGraef 0:f9b6112278fe 104 typedef struct OS_ROBIN { /* Round Robin Control */
DieterGraef 0:f9b6112278fe 105 P_TCB task; /* Round Robin task */
DieterGraef 0:f9b6112278fe 106 U16 time; /* Round Robin switch time */
DieterGraef 0:f9b6112278fe 107 U16 tout; /* Round Robin timeout */
DieterGraef 0:f9b6112278fe 108 } *P_ROBIN;
DieterGraef 0:f9b6112278fe 109
DieterGraef 0:f9b6112278fe 110 typedef struct OS_XCB {
DieterGraef 0:f9b6112278fe 111 U8 cb_type; /* Control Block Type */
DieterGraef 0:f9b6112278fe 112 struct OS_TCB *p_lnk; /* Link pointer for ready/sem. wait list */
DieterGraef 0:f9b6112278fe 113 struct OS_TCB *p_rlnk; /* Link pointer for sem./mbx lst backwards */
DieterGraef 0:f9b6112278fe 114 struct OS_TCB *p_dlnk; /* Link pointer for delay list */
DieterGraef 0:f9b6112278fe 115 struct OS_TCB *p_blnk; /* Link pointer for delay list backwards */
DieterGraef 0:f9b6112278fe 116 U16 delta_time; /* Time until time out */
DieterGraef 0:f9b6112278fe 117 } *P_XCB;
DieterGraef 0:f9b6112278fe 118
DieterGraef 0:f9b6112278fe 119 typedef struct OS_MCB {
DieterGraef 0:f9b6112278fe 120 U8 cb_type; /* Control Block Type */
DieterGraef 0:f9b6112278fe 121 U8 state; /* State flag variable */
DieterGraef 0:f9b6112278fe 122 U8 isr_st; /* State flag variable for isr functions */
DieterGraef 0:f9b6112278fe 123 struct OS_TCB *p_lnk; /* Chain of tasks waiting for message */
DieterGraef 0:f9b6112278fe 124 U16 first; /* Index of the message list begin */
DieterGraef 0:f9b6112278fe 125 U16 last; /* Index of the message list end */
DieterGraef 0:f9b6112278fe 126 U16 count; /* Actual number of stored messages */
DieterGraef 0:f9b6112278fe 127 U16 size; /* Maximum number of stored messages */
DieterGraef 0:f9b6112278fe 128 void *msg[1]; /* FIFO for Message pointers 1st element */
DieterGraef 0:f9b6112278fe 129 } *P_MCB;
DieterGraef 0:f9b6112278fe 130
DieterGraef 0:f9b6112278fe 131 typedef struct OS_SCB {
DieterGraef 0:f9b6112278fe 132 U8 cb_type; /* Control Block Type */
DieterGraef 0:f9b6112278fe 133 U8 mask; /* Semaphore token mask */
DieterGraef 0:f9b6112278fe 134 U16 tokens; /* Semaphore tokens */
DieterGraef 0:f9b6112278fe 135 struct OS_TCB *p_lnk; /* Chain of tasks waiting for tokens */
DieterGraef 0:f9b6112278fe 136 } *P_SCB;
DieterGraef 0:f9b6112278fe 137
DieterGraef 0:f9b6112278fe 138 typedef struct OS_MUCB {
DieterGraef 0:f9b6112278fe 139 U8 cb_type; /* Control Block Type */
DieterGraef 0:f9b6112278fe 140 U16 level; /* Call nesting level */
DieterGraef 0:f9b6112278fe 141 struct OS_TCB *p_lnk; /* Chain of tasks waiting for mutex */
DieterGraef 0:f9b6112278fe 142 struct OS_TCB *owner; /* Mutex owner task */
DieterGraef 0:f9b6112278fe 143 struct OS_MUCB *p_mlnk; /* Chain of mutexes by owner task */
DieterGraef 0:f9b6112278fe 144 } *P_MUCB;
DieterGraef 0:f9b6112278fe 145
DieterGraef 0:f9b6112278fe 146 typedef struct OS_XTMR {
DieterGraef 0:f9b6112278fe 147 struct OS_TMR *next;
DieterGraef 0:f9b6112278fe 148 U16 tcnt;
DieterGraef 0:f9b6112278fe 149 } *P_XTMR;
DieterGraef 0:f9b6112278fe 150
DieterGraef 0:f9b6112278fe 151 typedef struct OS_TMR {
DieterGraef 0:f9b6112278fe 152 struct OS_TMR *next; /* Link pointer to Next timer */
DieterGraef 0:f9b6112278fe 153 U16 tcnt; /* Timer delay count */
DieterGraef 0:f9b6112278fe 154 U16 info; /* User defined call info */
DieterGraef 0:f9b6112278fe 155 } *P_TMR;
DieterGraef 0:f9b6112278fe 156
DieterGraef 0:f9b6112278fe 157 typedef struct OS_BM {
DieterGraef 0:f9b6112278fe 158 void *free; /* Pointer to first free memory block */
DieterGraef 0:f9b6112278fe 159 void *end; /* Pointer to memory block end */
DieterGraef 0:f9b6112278fe 160 U32 blk_size; /* Memory block size */
DieterGraef 0:f9b6112278fe 161 } *P_BM;
DieterGraef 0:f9b6112278fe 162
DieterGraef 0:f9b6112278fe 163 /* Definitions */
DieterGraef 0:f9b6112278fe 164 #define __TRUE 1U
DieterGraef 0:f9b6112278fe 165 #define __FALSE 0U
DieterGraef 0:f9b6112278fe 166 #define NULL ((void *) 0)
DieterGraef 0:f9b6112278fe 167
DieterGraef 0:f9b6112278fe 168 #endif