1 /**************************************************************************//**
2 * \file cy_ble_stack_pvt.h
3 * \version 3.60
4 *
5 * \brief
6 *  Contains the function prototypes and constants for the HAL section.
7 *
8 * Note:
9 *
10 ********************************************************************************
11 * \copyright
12 * Copyright 2017-2021, Cypress Semiconductor Corporation.  All rights reserved.
13 * You may use this file only in accordance with the license, terms, conditions,
14 * disclaimers, and limitations in the end user license agreement accompanying
15 * the software package with which this file was provided.
16 *******************************************************************************/
17 
18 #ifndef CY_BLE_CY_BLE_STACK_PVT_H
19 #define CY_BLE_CY_BLE_STACK_PVT_H
20 
21 #include "cy_ble_stack.h"
22 #include "cy_sysclk.h"
23 #include "cy_syspm.h"
24 
25 /* C binding of definitions if building with C++ compiler */
26 #ifdef __cplusplus
27 extern "C" {
28 #endif /* __cplusplus */
29 
30 
31 /***************************************
32 * Data Types
33 ***************************************/
34 /**
35  * Structure containing the parameters required for IPC message from controller to Host
36  */
37 typedef struct
38 {
39     /** ID of the message client*/
40     uint8_t     clientID;
41     /** Type of message */
42     uint8_t     pktType;
43     /** Message Interrupt Rel. Mask */
44     uint16_t    intrRelMask;
45     /** Pointer to Data in message */
46     uint32_t    pktDataPointer;
47     /** Meta Data of the message */
48     uint16_t    pktMetaData;
49 
50 }cy_stc_ble_ipc_ctrl_msg;
51 
52 
53 /***************************************
54 *   Function Prototypes
55 ***************************************/
56 
57 cy_en_ble_api_result_t Cy_BLE_ControllerIpcHalSendEnqueue(cy_stc_ble_ipc_ctrl_msg* msg);
58 void Cy_BLE_LlIsrExitLowPowerMode(void);
59 
60 
61 /***************************************
62 *     Stack manager prototypes
63 ***************************************/
64 
65 /* External definitions for BLE Stack ISR handler */
66 extern bool Cy_BLE_HAL_BlessInterruptHandler(void);
67 
68 /* To be used only for HCI_MODE and in Debug mode
69 * where the logger serial port is enabled
70 */
71 extern void Cy_BLE_HAL_UartTxCompltHandler(void);
72 
73 /* To be used only for HCI_MODE */
74 extern void Cy_BLE_HAL_UartRxDataHandler(uint8_t byte);
75 
76 /* To be used only for Host MODE */
77 extern void Cy_BLE_HAL_HciTransportHandler(char_t packet, uint16_t packet_len);
78 
79 /* To be used only for Host UART/Soft HCI Mode */
80 extern void Cy_BLE_HAL_SoftControllerProcessEventsWrapper(void);
81 extern void Cy_BLE_HAL_ControllerEnablePrivacyFeatureWrapper(void);
82 extern void Cy_BLE_HAL_ControllerEnableDleFeatureWrapper(void);
83 extern void Cy_BLE_HAL_ControllerEnablePhyUpdateFeaturWrapper(void);
84 extern cy_en_ble_api_result_t Cy_BLE_HAL_ControllerSetFeatureConfigWrapper(const cy_stc_ble_stack_config_param_t *configParam,uint16_t *featureHeapReq);
85 extern cy_en_ble_lp_mode_t Cy_BLE_HAL_ControllerEnterLPMWrapper(cy_en_ble_lp_mode_t pwrMode);
86 extern cy_en_ble_api_result_t Cy_BLE_HAL_ControllerValidateInputParamsWrapper(const cy_stc_ble_stack_init_info_t *initParam);
87 extern cy_en_ble_api_result_t Cy_BLE_HAL_ControllerGetHeapMemoryWrapper(uint16_t *memorySize);
88 extern cy_en_ble_lp_mode_t Cy_BLE_HAL_ControllerExitLPMWrapper(void);
89 extern cy_en_ble_api_result_t Cy_BLE_HAL_ControllerInitWrapper(cy_stc_ble_stack_init_info_t *initParam);
90 extern void Cy_BLE_HAL_Pilo_InitCalibrationWrapper(void);
91 extern void Cy_BLE_HAL_Pilo_TriggerCalibrationWrapper(void);
92 extern cy_en_ble_api_result_t Cy_BLE_HAL_ControllerGetInternalHeapReqWrapper(uint16_t *memorySize);
93 extern cy_en_ble_api_result_t Cy_BLE_HAL_StackMgr_BleSSInitWrapper(uint8 persistRadioCal);
94 extern cy_en_ble_api_result_t Cy_BLE_HAL_ControllerResetWrapper(void);
95 extern void Cy_BLE_HAL_StackMgr_BleSSShutdownWrapper(void);
96 extern void Cy_BLE_HAL_Pilo_ShutdownCalibrationWrapper(void);
97 extern cy_stc_ble_stack_config_param_t* Cy_BLE_HAL_StackGetConfigPtrWrapper(void);
98 extern void * Cy_BLE_HAL_llf_task_start_routineWrapper(void * args);
99 extern void Cy_BLE_HAL_BT_timer_process_signalsWrapper(void *arg);
100 
101 
102 /***************************************
103 *     Macros
104 ***************************************/
105 #define CY_BLE_INTR_TX_SUCCESS       0x00u
106 #define CY_BLE_INTR_TX_DONE          0x00u
107 #define CY_BLE_INTR_TX_OVERFLOW      0x01u
108 
109 #define CY_BLE_INTR_RX_SUCCESS       0x00u
110 #define CY_BLE_INTR_RX_NOT_EMPTY     0x00u
111 #define CY_BLE_INTR_RX_OVERFLOW      0x01u
112 #define CY_BLE_INTR_RX_FRAME_ERROR   0x02u
113 #define CY_BLE_INTR_RX_PARITY_ERROR  0x04u
114 
115 
116 /* Align buffer size value to 4 */
117 #define CY_BLE_STACK_ALIGN_TO_4(x)      ((((x) & 3u) == 0u) ?    \
118                                         (x) :                    \
119                                         (((x) - ((x) & 3u)) + 4u))
120 #ifdef __cplusplus
121 }
122 #endif /* __cplusplus */
123 #endif /* CY_BLE_CY_BLE_STACK_PVT_H  */
124 
125 /* [] END OF FILE */
126