Welcome to mirror list, hosted at ThFree Co, Russian Federation.

app_ffd_mac_802_15_4.h « App « STM32_WPAN « Mac_802_15_4_FFD « Mac_802_15_4 « Applications « P-NUCLEO-WB55.Nucleo « Projects - github.com/Flipper-Zero/STM32CubeWB.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6a770a855543fcdb8c90d52d513631d714abda8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188

/**
  ******************************************************************************
  * @file    app_ffd_mac_802_15_4.h
  * @author  MCD Application Team
  * @brief   Header for FFD MAC 802.15.4 Core Mac Device implementation
  ******************************************************************************
  * @attention
  *
  * Copyright (c) 2019-2021 STMicroelectronics.
  * All rights reserved.
  *
  * This software is licensed under terms that can be found in the LICENSE file
  * in the root directory of this software component.
  * If no LICENSE file comes with this software, it is provided AS-IS.
  *
  ******************************************************************************
  */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef APP_FFD_MAC_802_15_4_H
#define APP_FFD_MAC_802_15_4_H

#ifdef __cplusplus
extern "C" {
#endif

/* ---------------------------------------------------------------------------*/
/* Includes ------------------------------------------------------------------*/
/* ---------------------------------------------------------------------------*/

#include "tl.h"
#include "tl_mac_802_15_4.h"



/* ---------------------------------------------------------------------------*/
/* Exported types and defines ------------------------------------------------*/
/* ---------------------------------------------------------------------------*/


/* FFD MAC_802_15_4 application generic defines */
/*------------------------------------*/
typedef enum
{
  APP_MAC_802_15_4_LIMITED,
  APP_MAC_802_15_4_FULL,
} APP_MAC_802_15_4_InitMode_t;


/* Scheduler types and defines        */
/*------------------------------------*/

  /**
   * This is the list of task id required by the application
   * Each Id shall be in the range 0..31
   */

typedef enum
{
  CFG_TASK_FFD,              /* Init FFD Task - mainly handling FFD Setup */
  CFG_TASK_SERVICE_COORD,    /* FFD Service Task - Handle Service request/response */
  CFG_TASK_DATA_COORD,       /* FFD DATA Task - Handle Service request/response */
  CFG_TASK_MSG_FROM_RF_CORE, 
  CFG_TASK_SYSTEM_HCI_ASYNCH_EVT,
  CFG_TASK_NBR,  /**< Shall be last in the list */
} CFG_IdleTask_Id_t;

typedef enum
{
  CFG_SCH_PRIO_0,
  CFG_SCH_PRIO_1,
  CFG_PRIO_NBR,
} CFG_SCH_Prio_Id_t;

#define TASK_FFD                         (1U << CFG_TASK_FFD)
#define TASK_COORD_SRV                   (1U << CFG_TASK_SERVICE_COORD)
#define TASK_COORD_DATA                  (1U << CFG_TASK_DATA_COORD)
#define TASK_MSG_FROM_RF_CORE            (1U << CFG_TASK_MSG_FROM_RF_CORE)


  /**
   * This is a bit mapping over 32bits listing all events id supported in the application
   */
typedef enum
{
  CFG_EVT_SYSTEM_HCI_CMD_EVT_RESP,
  CFG_EVT_ACK_FROM_RFCore_EVT,
  CFG_EVT_SYNCHRO_BYPASS_IDLE,
  CFG_EVT_DEVICE_RESET_CNF,       /* Device Reset Confirm */
  CFG_EVT_SET_CNF,                /* SET PIB Confirm */
  CFG_EVT_DEVICE_STARTED_CNF,     /* DEVICE STARTED Confirm */
  CFG_EVT_SRV_ASSOC_IND,          /* Association indication */
  CFG_EVT_DATA_DATA_IND,          /* DATA Indication */
  CFG_EVT_DATA_DATA_CNF,          /* DATA Cnf */
} CFG_IdleEvt_Id_t;

#define EVENT_ACK_FROM_RFCore_EVT           (1U << CFG_EVT_ACK_FROM_RFCore_EVT)
#define EVENT_SYNCHRO_BYPASS_IDLE           (1U << CFG_EVT_SYNCHRO_BYPASS_IDLE)

/*Events managed by Setup Task*/
#define EVENT_DEVICE_RESET_CNF          (1U << CFG_EVT_DEVICE_RESET_CNF)
#define EVENT_SET_CNF                   (1U << CFG_EVT_SET_CNF)
#define EVENT_SHORT_ADDR_SET_CNF        (1U << CFG_EVT_SHORT_ADDR_SET_CNF)
#define EVENT_ASSO_PERMIT_SET_CNF       (1U << CFG_EVT_ASSO_PERMIT_SET_CNF)
#define EVENT_DEVICE_STARTED_CNF        (1U << CFG_EVT_DEVICE_STARTED_CNF)
#define EVENT_SET_RX_ON_WHEN_IDLE_CNF   (1U << CFG_EVT_SET_RX_ON_WHEN_IDLE_CNF)

/*Events managed by Srv Task*/
#define EVENT_SET_SRV_ASSOC_IND (1U << CFG_EVT_SRV_ASSOC_IND)
/*Events managed by data Task*/
#define EVENT_SET_SRV_DATA_DATA_IND (1U << CFG_EVT_DATA_DATA_IND)

#define EVENT_DATA_CNF          (1U << CFG_EVT_DATA_DATA_CNF)


typedef enum
{
  CFG_ASSO_PENDING,
  CFG_SRV_SER_REQ_NBR,
} CFG_COORD_Srv_Task_Req_t;

typedef enum
{
  CFG_DATA_PENDING,
  CFG_SRV_DATA_REQ_NBR,
} CFG_COORD_Data_Task_Req_t;

/* Low power types and defines        */
/*------------------------------------*/

/*
 * Supported requester to the MCU Low Power Manager - can be increased up to 32
 * It lists a bit mapping of all users of the Low Power Manager
 */
typedef enum
{
  CFG_LPM_APP,
  CFG_LPM_APP_BLE,
} CFG_LPM_Id_t;

/******************************************************************************
 * OTP manager
 ******************************************************************************/
#define CFG_OTP_BASE_ADDRESS    OTP_AREA_BASE

#define CFG_OTP_END_ADRESS      OTP_AREA_END_ADDR

/* Application errors                 */
/*------------------------------------*/

/*
 *  List of all errors tracked by the Thread application
 *  running on M4. Some of these errors may be fatal
 *  or just warnings
 */
typedef enum
{
  ERR_APPLI_REC_MULTI_MSG_FROM_RFCore,
  ERR_INTERFACE_IPCC_SEND_ACK_TO_RFCore,
} ErrAppliIdEnum_t;

/* ---------------------------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
/* ---------------------------------------------------------------------------*/
void APP_FFD_MAC_802_15_4_Init( APP_MAC_802_15_4_InitMode_t InitMode, TL_CmdPacket_t* pCmdBuffer);

void APP_FFD_MAC_802_15_4_Error(uint32_t ErrId, uint32_t ErrCode);

void APP_FFD_MAC_802_15_4_SetupTask(void);

void APP_FFD_MAC_802_15_4_CoordSrvTask(void);
void APP_FFD_MAC_802_15_4_CoordDataTask(void);

void APP_FFD_Init( void );


void APP_FFD_postMacInfCnfNot(const char * buf);

void APP_FFD_parseClientReqResCmd ( const char * CommandString  );



#ifdef __cplusplus
} /* extern "C" */
#endif

#endif /* __APP_FFD_MAC_802_15_4_H */