Keyboard firmwares for Atmel AVR and Cortex-M
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

rt_TypeDef.h 6.2KB

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