TI BLE-Stack for Bluetooth 4.2 API Documentation  3.01.00.07
simple_np.h
1 /******************************************************************************
2 
3  @file simple_np.h
4 
5  @brief This file contains the Simple Network processor header application for
6  use with the CC2650 Bluetooth Low Energy
7  Protocol Stack.
8 
9  Group: WCS, BTS
10  $Target Device: DEVICES $
11 
12  ******************************************************************************
13  $License: BSD3 2015 $
14  ******************************************************************************
15  $Release Name: PACKAGE NAME $
16  $Release Date: PACKAGE RELEASE DATE $
17  *****************************************************************************/
18 
19 #ifndef SIMPLENP_H
20 #define SIMPLENP_H
21 
22 #ifdef __cplusplus
23 extern "C"
24 {
25 #endif
26 
27 /*********************************************************************
28  * INCLUDES
29  */
30 
31 #include <ti/sysbios/knl/Event.h>
32 
33 /*********************************************************************
34 * EXTERNAL VARIABLES
35 */
36 extern ICall_EntityID snp_selfEntity;
37 
38 /*********************************************************************
39  * CONSTANTS
40  */
41 #define SNP_VERSION 0x0112 //<! Version 1.18
42 
43 // Internal Events for RTOS application
44 #define SNP_ICALL_EVT ICALL_MSG_EVENT_ID // Event_Id_31
45 #define SNP_QUEUE_EVT UTIL_QUEUE_EVENT_ID // Event_Id_30
46 
47 #define SNP_ALL_EVENTS (SNP_ICALL_EVT | SNP_QUEUE_EVT)
48 
49 #define SNP_STATE_CHANGE_EVT 0x0001
50 #define SNP_CHAR_CHANGE_EVT 0x0002
51 #define SNP_CHAR_READ_EVT 0x0004
52 #define SNP_NEW_AP_MSG_EVT 0x0010
53 
54 /*-------------------------------------------------------------------
55 * TYPEDEFS - Initialization and Configuration
56 */
57 
58 // App event passed from profiles.
59 typedef struct
60 {
61  uint8_t event; // Which profile's event
62  uint8_t status; // New status
63  _npiFrame_t *pNpiMsg; // Message Received from the Application processor
64 } snp_Evt_t;
65 
66 /*********************************************************************
67  * MACROS
68  */
69 #ifdef SWO_DEBUG
70 #define ITM_Port32(n) (*((volatile unsigned int *)(CPU_ITM_BASE+4*n)))
72 #endif
73 
74 /*********************************************************************
75  * FUNCTIONS
76  */
77 
78 /*
79  * Task creation function for the Simple Peripheral Network Processor.
80  */
81 extern void SNP_createTask(void);
82 extern void SNP_init(Event_Handle *event);
83 extern void SNP_replyToHost_send(uint8_t type, uint16_t opcode, uint8_t *status,
84  uint16_t sizeParam, uint8_t *param);
85 extern void SNP_replyToHostValue_send(uint8_t type, uint16_t opcode,
86  uint8_t *status, uint16_t sizeParam,
87  uint8_t *param, uint16_t sizeParam2,
88  uint8_t *param2D);
89 void SNP_eventToHost_send(uint16_t event, uint8_t *status, uint16_t sizeParam,
90  uint8_t *param);
91 extern void SNP_stateChangeCB(uint8_t newState);
92 void SNP_enqueueMsg(uint8_t event, uint8_t status);
93 
94 void SNP_processEvents(void);
95 
96 /*********************************************************************
97 *********************************************************************/
98 
99 #ifdef __cplusplus
100 }
101 #endif
102 
103 #endif /* SIMPLENP_H */
uint_least8_t ICall_EntityID
Entity id data type.
Definition: icall.h:449
Copyright 2017, Texas Instruments Incorporated