comdef.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. /**************************************************************************************************
  2. Filename: comdef.h
  3. Revised: $Date: 2009-03-12 16:25:22 -0700 (Thu, 12 Mar 2009) $
  4. Revision: $Revision: 19404 $
  5. Description: Type definitions and macros.
  6. Copyright 2004-2008 Texas Instruments Incorporated. All rights reserved.
  7. IMPORTANT: Your use of this Software is limited to those specific rights
  8. granted under the terms of a software license agreement between the user
  9. who downloaded the software, his/her employer (which must be your employer)
  10. and Texas Instruments Incorporated (the "License"). You may not use this
  11. Software unless you agree to abide by the terms of the License. The License
  12. limits your use, and you acknowledge, that the Software may not be modified,
  13. copied or distributed unless embedded on a Texas Instruments microcontroller
  14. or used solely and exclusively in conjunction with a Texas Instruments radio
  15. frequency transceiver, which is integrated into your product. Other than for
  16. the foregoing purpose, you may not use, reproduce, copy, prepare derivative
  17. works of, modify, distribute, perform, display or sell this Software and/or
  18. its documentation for any purpose.
  19. YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE
  20. PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,
  21. INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE,
  22. NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL
  23. TEXAS INSTRUMENTS OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT,
  24. NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER
  25. LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
  26. INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE
  27. OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT
  28. OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
  29. (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
  30. Should you have any questions regarding your right to use this Software,
  31. contact Texas Instruments Incorporated at www.TI.com.
  32. **************************************************************************************************/
  33. #ifndef COMDEF_H
  34. #define COMDEF_H
  35. #ifdef __cplusplus
  36. extern "C"
  37. {
  38. #endif
  39. /*********************************************************************
  40. * INCLUDES
  41. */
  42. /* HAL */
  43. #include "hal_types.h"
  44. #include "hal_defs.h"
  45. /*********************************************************************
  46. * CONSTANTS
  47. */
  48. #ifndef false
  49. #define false 0
  50. #endif
  51. #ifndef true
  52. #define true 1
  53. #endif
  54. #ifndef CONST
  55. #define CONST const
  56. #endif
  57. #ifndef GENERIC
  58. #define GENERIC
  59. #endif
  60. /*** Generic Status Return Values ***/
  61. #define SUCCESS 0x00
  62. #define FAILURE 0x01
  63. #define INVALIDPARAMETER 0x02
  64. #define INVALID_TASK 0x03
  65. #define MSG_BUFFER_NOT_AVAIL 0x04
  66. #define INVALID_MSG_POINTER 0x05
  67. #define INVALID_EVENT_ID 0x06
  68. #define INVALID_INTERRUPT_ID 0x07
  69. #define NO_TIMER_AVAIL 0x08
  70. #define NV_ITEM_UNINIT 0x09
  71. #define NV_OPER_FAILED 0x0A
  72. #define INVALID_MEM_SIZE 0x0B
  73. #define NV_BAD_ITEM_LEN 0x0C
  74. /*********************************************************************
  75. * TYPEDEFS
  76. */
  77. // Generic Status return
  78. typedef uint8 Status_t;
  79. // Data types
  80. typedef int32 int24;
  81. typedef uint32 uint24;
  82. /*********************************************************************
  83. * Global System Events
  84. */
  85. #define SYS_EVENT_MSG 0x8000 // A message is waiting event
  86. /*********************************************************************
  87. * Global Generic System Messages
  88. */
  89. #define KEY_CHANGE 0xC0 // Key Events
  90. // OSAL System Message IDs/Events Reserved for applications (user applications)
  91. // 0xE0 – 0xFC
  92. /*********************************************************************
  93. * MACROS
  94. */
  95. /*********************************************************************
  96. * GLOBAL VARIABLES
  97. */
  98. /*********************************************************************
  99. * FUNCTIONS
  100. */
  101. /*********************************************************************
  102. *********************************************************************/
  103. #ifdef __cplusplus
  104. }
  105. #endif
  106. #endif /* COMDEF_H */