hci_task.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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. **************************************************************************************************/
  30. #ifndef HCI_TASK_H
  31. #define HCI_TASK_H
  32. #ifdef __cplusplus
  33. extern "C"
  34. {
  35. #endif
  36. /*********************************************************************
  37. * INCLUDES
  38. */
  39. #include "OSAL.h"
  40. #include "hci.h"
  41. #include "uart.h"
  42. #include "hci_host.h"
  43. #include "hal.h" // added by ZJP
  44. /*********************************************************************
  45. * MACROS
  46. */
  47. /*********************************************************************
  48. * CONSTANTS
  49. */
  50. /* UART port */
  51. #define HCI_UART_PORT HAL_UART_PORT_0
  52. #define HCI_UART_BR HAL_UART_BR_38400
  53. #define HCI_UART_FC TRUE
  54. #define HCI_UART_FC_THRESHOLD 48
  55. #define HCI_UART_RX_BUF_SIZE 128
  56. #define HCI_UART_TX_BUF_SIZE 128
  57. #define HCI_UART_IDLE_TIMEOUT 6
  58. #define HCI_UART_INT_ENABLE TRUE
  59. /* HCI Event List */
  60. #define HCI_EVENT_SEND_DATA 0x01
  61. #define HCI_EVENT_SEND_CMD 0x02
  62. #define HCI_HOST_PARSE_EVT 0x04
  63. #define HCI_HOST_INCOMING_EVT 0x08
  64. #define HCI_HOST_INCOMING_DATA 0x10
  65. /* Define the osal queue size for data and cmd */
  66. #define HCI_HOST_MAX_DATAQUEUE_SIZE 20
  67. #define HCI_HOST_MAX_CMDQUEUE_SIZE 20
  68. /*********************************************************************
  69. * TYPEDEFS
  70. */
  71. /*********************************************************************
  72. * GLOBAL VARIABLES
  73. */
  74. osal_msg_q_t HCI_HostDataQueue;
  75. uint8 hciHostNumQueuedData; /* Number of data packets queued */
  76. const uint8 hciHostMaxNumDataQueue; /* Max number of data packets queued */
  77. /*********************************************************************
  78. * FUNCTIONS - API
  79. */
  80. extern Status_t HCI_AddDataQueue( void *buf );
  81. extern Status_t HCI_AddCmdQueue( void *buf );
  82. /*********************************************************************
  83. *********************************************************************/
  84. #ifdef __cplusplus
  85. }
  86. #endif
  87. #endif /* HCI_TASK_H */