comdef.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. /**************************************************************************************************
  2. Phyplus Microelectronics Limited confidential and proprietary.
  3. All rights reserved.
  4. IMPORTANT: All rights of this software belong to Phyplus Microelectronics
  5. Limited ("Phyplus"). Your use of this Software is limited to those
  6. specific rights granted under the terms of the business contract, the
  7. confidential agreement, the non-disclosure agreement and any other forms
  8. of agreements as a customer or a partner of Phyplus. You may not use this
  9. Software unless you agree to abide by the terms of these agreements.
  10. You acknowledge that the Software may not be modified, copied,
  11. distributed or disclosed unless embedded on a Phyplus Bluetooth Low Energy
  12. (BLE) integrated circuit, either as a product or is integrated into your
  13. products. Other than for the aforementioned purposes, you may not use,
  14. reproduce, copy, prepare derivative works of, modify, distribute, perform,
  15. display or sell this Software and/or its documentation for any purposes.
  16. YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE
  17. PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,
  18. INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE,
  19. NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL
  20. PHYPLUS OR ITS SUBSIDIARIES BE LIABLE OR OBLIGATED UNDER CONTRACT,
  21. NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER
  22. LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
  23. INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE
  24. OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT
  25. OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
  26. (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
  27. **************************************************************************************************/
  28. /**************************************************************************************************
  29. Filename: comdef.h
  30. Revised:
  31. Revision:
  32. Description: Type definitions and macros.
  33. **************************************************************************************************/
  34. #ifndef COMDEF_H
  35. #define COMDEF_H
  36. #ifdef __cplusplus
  37. extern "C"
  38. {
  39. #endif
  40. /*********************************************************************
  41. * INCLUDES
  42. */
  43. //#include "precompile_cfg.h"
  44. /* HAL */
  45. #include "types.h"
  46. #include "hal_defs.h"
  47. //#include "log.h"
  48. /*********************************************************************
  49. * Lint Keywords
  50. */
  51. #define VOID (void)
  52. #define NULL_OK
  53. #define INP
  54. #define OUTP
  55. #define UNUSED
  56. #define ONLY
  57. #define READONLY
  58. #define SHARED
  59. #define KEEP
  60. #define RELAX
  61. /*********************************************************************
  62. * CONSTANTS
  63. */
  64. #ifndef false
  65. #define false 0
  66. #endif
  67. #ifndef true
  68. #define true 1
  69. #endif
  70. #ifndef CONST
  71. #define CONST const
  72. #endif
  73. #ifndef GENERIC
  74. #define GENERIC
  75. #endif
  76. /*** Generic Status Return Values ***/
  77. #define SUCCESS 0x00
  78. #define FAILURE 0x01
  79. #define INVALIDPARAMETER 0x02
  80. #define INVALID_TASK 0x03
  81. #define MSG_BUFFER_NOT_AVAIL 0x04
  82. #define INVALID_MSG_POINTER 0x05
  83. #define INVALID_EVENT_ID 0x06
  84. #define INVALID_INTERRUPT_ID 0x07
  85. #define NO_TIMER_AVAIL 0x08
  86. #define NV_ITEM_UNINIT 0x09
  87. #define NV_OPER_FAILED 0x0A
  88. #define INVALID_MEM_SIZE 0x0B
  89. #define NV_BAD_ITEM_LEN 0x0C
  90. /*********************************************************************
  91. * TYPEDEFS
  92. */
  93. // Generic Status return
  94. typedef uint8 Status_t;
  95. // Data types
  96. typedef int32 int24;
  97. typedef uint32 uint24;
  98. /*********************************************************************
  99. * Global System Events
  100. */
  101. #define SYS_EVENT_MSG 0x8000 // A message is waiting event
  102. /*********************************************************************
  103. * Global Generic System Messages
  104. */
  105. #define KEY_CHANGE 0xC0 // Key Events
  106. // OSAL System Message IDs/Events Reserved for applications (user applications)
  107. // 0xE0 – 0xFC
  108. /*********************************************************************
  109. * MACROS
  110. */
  111. /*********************************************************************
  112. * GLOBAL VARIABLES
  113. */
  114. /*********************************************************************
  115. * FUNCTIONS
  116. */
  117. /*********************************************************************
  118. *********************************************************************/
  119. #ifdef __cplusplus
  120. }
  121. #endif
  122. #endif /* COMDEF_H */