gdma.h 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  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. /* Type group ----------------------------------------------------------- */
  29. #ifndef __LPC_TYPES_H
  30. #define __LPC_TYPES_H
  31. /* Includes ------------------------------------------------------------------- */
  32. #include <stdint.h>
  33. /** @defgroup LPC_Type_Def Data Types Definitions
  34. * @ingroup LPC177x_8xCMSIS_FwLib_Drivers
  35. * @{
  36. */
  37. /* Public Types --------------------------------------------------------------- */
  38. /** @defgroup LPC_Types_Public_Types Basic Public Data Types
  39. * @{
  40. */
  41. /**
  42. * @brief Boolean Type definition
  43. */
  44. typedef enum {FALSE = 0, TRUE = !FALSE} Bool;
  45. /**
  46. * @brief Flag Status and Interrupt Flag Status type definition
  47. */
  48. typedef enum {RESET = 0, SET = !RESET} FlagStatus, IntStatus, SetState;
  49. #define PARAM_SETSTATE(State) ((State==RESET) || (State==SET))
  50. /**
  51. * @brief Functional State Definition
  52. */
  53. typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState;
  54. #define PARAM_FUNCTIONALSTATE(State) ((State==DISABLE) || (State==ENABLE))
  55. /**
  56. * @ Status type definition
  57. */
  58. typedef enum {ERROR = 0, SUCCESS = !ERROR} Status;
  59. /**
  60. * Read/Write transfer type mode (Block or non-block)
  61. */
  62. typedef enum
  63. {
  64. NONE_BLOCKING = 0, /**< None Blocking type */
  65. BLOCKING, /**< Blocking type */
  66. } TRANSFER_BLOCK_Type;
  67. /** Pointer to Function returning Void (any number of parameters) */
  68. typedef void (*PFV)();
  69. /** Pointer to Function returning int32_t (any number of parameters) */
  70. typedef int32_t(*PFI)();
  71. /**
  72. * @}
  73. */
  74. /* Public Macros -------------------------------------------------------------- */
  75. /** @defgroup LPC_Types_Public_Macros Basic Public Macros
  76. * @{
  77. */
  78. /** _BIT(n) sets the bit at position "n"
  79. * _BIT(n) is intended to be used in "OR" and "AND" expressions:
  80. * e.g., "(_BIT(3) | _BIT(7))".
  81. */
  82. #undef _BIT
  83. /** Set bit macro */
  84. #define _BIT(n) (1<<n)
  85. /** _SBF(f,v) sets the bit field starting at position "f" to value "v".
  86. * _SBF(f,v) is intended to be used in "OR" and "AND" expressions:
  87. * e.g., "((_SBF(5,7) | _SBF(12,0xF)) & 0xFFFF)"
  88. */
  89. #undef _SBF
  90. /* Set bit field macro */
  91. #define _SBF(f,v) (v<<f)
  92. /* _BITMASK constructs a symbol with 'field_width' least significant
  93. * bits set.
  94. * e.g., _BITMASK(5) constructs '0x1F', _BITMASK(16) == 0xFFFF
  95. * The symbol is intended to be used to limit the bit field width
  96. * thusly:
  97. * <a_register> = (any_expression) & _BITMASK(x), where 0 < x <= 32.
  98. * If "any_expression" results in a value that is larger than can be
  99. * contained in 'x' bits, the bits above 'x - 1' are masked off. When
  100. * used with the _SBF example above, the example would be written:
  101. * a_reg = ((_SBF(5,7) | _SBF(12,0xF)) & _BITMASK(16))
  102. * This ensures that the value written to a_reg is no wider than
  103. * 16 bits, and makes the code easier to read and understand.
  104. */
  105. #undef _BITMASK
  106. /* Bitmask creation macro */
  107. #define _BITMASK(field_width) ( _BIT(field_width) - 1)
  108. /* NULL pointer */
  109. #ifndef NULL
  110. #define NULL ((void*) 0)
  111. #endif
  112. /* Number of elements in an array */
  113. #define NELEMENTS(array) (sizeof (array) / sizeof (array[0]))
  114. /* Static data/function define */
  115. #define STATIC static
  116. /* External data/function define */
  117. #define EXTERN extern
  118. #define MAX(a, b) (((a) > (b)) ? (a) : (b))
  119. #define MIN(a, b) (((a) < (b)) ? (a) : (b))
  120. /**
  121. * @}
  122. */
  123. /* Old Type Definition compatibility ------------------------------------------ */
  124. /** @addtogroup LPC_Types_Public_Types LPC_Types Public Types
  125. * @{
  126. */
  127. /** SMA type for character type */
  128. typedef char CHAR;
  129. /** SMA type for 8 bit unsigned value */
  130. typedef uint8_t UNS_8;
  131. /** SMA type for 8 bit signed value */
  132. typedef int8_t INT_8;
  133. /** SMA type for 16 bit unsigned value */
  134. typedef uint16_t UNS_16;
  135. /** SMA type for 16 bit signed value */
  136. typedef int16_t INT_16;
  137. /** SMA type for 32 bit unsigned value */
  138. typedef uint32_t UNS_32;
  139. /** SMA type for 32 bit signed value */
  140. typedef int32_t INT_32;
  141. /** SMA type for 64 bit signed value */
  142. typedef int64_t INT_64;
  143. /** SMA type for 64 bit unsigned value */
  144. typedef uint64_t UNS_64;
  145. /** 32 bit boolean type */
  146. typedef Bool BOOL_32;
  147. /** 16 bit boolean type */
  148. typedef Bool BOOL_16;
  149. /** 8 bit boolean type */
  150. typedef Bool BOOL_8;
  151. /**
  152. * @}
  153. */
  154. #endif /* __LPC_TYPES_H */
  155. /**
  156. * @}
  157. */
  158. /* --------------------------------- End Of File ------------------------------ */