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

802_15_4_mac_core.h « inc « core « mac_802_15_4 « STM32_WPAN « ST « Middlewares - github.com/Flipper-Zero/STM32CubeWB.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 58bd979994d0ab894ecab8c1c54c3b7c4c61e3d3 (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
/**
  ******************************************************************************
  * @file    802_15_4_mac_core.h
  * @author  MCD Application Team
  * @brief   This file contains all the defines and structures used for the
  *          communication between the two core M0 and M4.
  *          This file is shared between the code running on M4 and the code
  *          running on M0.
  *
  ******************************************************************************
  * @attention
 *
 * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
 * All rights reserved.</center></h2>
 *
 * This software component is licensed by ST under Ultimate Liberty license
 * SLA0044, the "License"; You may not use this file except in compliance with
 * the License. You may obtain a copy of the License at:
 *                             www.st.com/SLA0044
 *
 ******************************************************************************
 */

#ifndef _INC_802_15_4_MAC_CORE_H_
#define _INC_802_15_4_MAC_CORE_H_

#include <stdint.h>

#include "stm32wbxx_hal.h"
#include "stm32wbxx_hal_def.h"
#include "stm32wbxx_hal_cortex.h"
#include "stm32_wpan_common.h"

#ifdef __cplusplus
extern "C" {
#endif

/* MAC command cmdcode range 0x280 .. 0x3DF = 352 */
#define MAC_802_15_4_CMD_OPCODE_OFFSET 0x280

#define MASK_CMD_CODE_OCF 0x3FF

/* Structure of the messages exchanged between M0 and M4 */
#define OT_CMD_BUFFER_SIZE 20U
typedef struct
{
  uint32_t  ID;
  uint32_t  Size;
  uint32_t  Data[OT_CMD_BUFFER_SIZE];
}MAC_802_15_4_CmdReq_OT_LIKE_t;

typedef PACKED_STRUCT
{
  uint16_t  subEvtCode;
  uint8_t   notPayload[1];
}MAC_802_15_4_Notification_t;

/** @defgroup STM32WB55_MAC_CORE STM32WBxx Proxy MAC 802.15.4 Core
  * @brief           Proxy MAC module allows application to exchange in both ways MAC messages
  *                  between Application and RF Cores.
  *                  On application or network upper layer SAP-MAC primitive call, MAC request is
  *                  interpreted by the Proxy MAC layer and sent to the RF-Core.<br>
  *                  On RF-Core MAC notification, MAC messages are parsed and sent back to the upper
  *                  user implemented layer using user defined callback.
  *
  * @{
  */
/* List of messages sent by the M4 to the M0 */
typedef enum
{
  /*! MAC Message ID to request a MAC association */
  MSG_M4TOM0_MAC_MLME_ASSOCIATE_REQ=0x00,
  /*! MAC Message ID to respond to a previously received MAC Association Indication */
  MSG_M4TOM0_MAC_MLME_ASSOCIATE_RES,
  /*! MAC Message ID to request a MAC Disassociation */
  MSG_M4TOM0_MAC_MLME_DISASSOCIATE_REQ,
  /*! MAC Message ID to retrieve PIB Attibute value */
  MSG_M4TOM0_MAC_MLME_GET_REQ,
  /*! MAC Message ID to perform a GTS request*/
  MSG_M4TOM0_MAC_MLME_GTS_REQ,
  /*! MAC Message ID to respond to a previously received MAC Orphan Indication */
  MSG_M4TOM0_MAC_MLME_ORPHAN_RES,
  /*! MAC Message ID to perform a Reset request*/
  MSG_M4TOM0_MAC_MLME_RESET_REQ,
  /*! MAC Message ID to perform a RX Enable request*/
  MSG_M4TOM0_MAC_MLME_RX_ENABLE_REQ,
  /*! MAC Message ID to perform a RX Scan request*/
  MSG_M4TOM0_MAC_MLME_SCAN_REQ,
  /*! MAC Message ID to setup a MAC/PHY attribute*/
  MSG_M4TOM0_MAC_MLME_SET_REQ,
  /*! MAC Message ID to request a MAC Start*/
  MSG_M4TOM0_MAC_MLME_START_REQ,
  /*! MAC Message ID to request a MAC Synchronization*/
  MSG_M4TOM0_MAC_MLME_SYNC_REQ,
  /*! MAC Message ID to request a MAC Polling*/
  MSG_M4TOM0_MAC_MLME_POLL_REQ,
  /*! MAC Message ID to request a Dynamic Preamble Selection*/
  MSG_M4TOM0_MAC_MLME_DPS_REQ,
  /*! MAC Message ID to request a PHY respond with channel sounding information*/
  MSG_M4TOM0_MAC_MLME_SOUNDING_REQ,
  /*! MAC Message ID to request a PHY respond with RMARKER offset*/
  MSG_M4TOM0_MAC_MLME_CALIBRATE_REQ,
  /*! MAC Message ID to request a MAC data transfer to other device*/
  MSG_M4TOM0_MAC_MCPS_DATA_REQ,
  /*! MAC Message ID to request a purge of the pending MSDU from Transaction Queue*/
  MSG_M4TOM0_MAC_MCPS_PURGE_REQ,
} MAC_802_15_4_MsgIdM4ToM0_t;

/* List of messages sent by the M0 to the M4 */
typedef enum
{
  MSG_M0TOM4_MAC_MLME_ASSOCIATE_CNF=0x00,
  MSG_M0TOM4_MAC_MLME_DISASSOCIATE_CNF,
  MSG_M0TOM4_MAC_MLME_GET_CNF,
  MSG_M0TOM4_MAC_MLME_GTS_CNF,
  MSG_M0TOM4_MAC_MLME_RESET_CNF,
  MSG_M0TOM4_MAC_MLME_RX_ENABLE_CNF,
  MSG_M0TOM4_MAC_MLME_SCAN_CNF,
  MSG_M0TOM4_MAC_MLME_SET_CNF,
  MSG_M0TOM4_MAC_MLME_START_CNF,
  MSG_M0TOM4_MAC_MLME_POLL_CNF,
  MSG_M0TOM4_MAC_MLME_DPS_CNF,
  MSG_M0TOM4_MAC_MLME_SOUNDING_CNF,
  MSG_M0TOM4_MAC_MLME_CALIBRATE_CNF,
  MSG_M0TOM4_MAC_MCPS_DATA_CNF,
  MSG_M0TOM4_MAC_MCPS_PURGE_CNF,
  MSG_M0TOM4_MAC_MLME_ASSOCIATE_IND,
  MSG_M0TOM4_MAC_MLME_DISASSOCIATE_IND,
  MSG_M0TOM4_MAC_MLME_BEACON_NOTIFY_IND,
  MSG_M0TOM4_MAC_MLME_COMM_STATUS_IND,
  MSG_M0TOM4_MAC_MLME_GTS_IND,
  MSG_M0TOM4_MAC_MLME_ORPHAN_IND,
  MSG_M0TOM4_MAC_MLME_SYNC_LOSS_IND,
  MSG_M0TOM4_MAC_MLME_DPS_IND,
  MSG_M0TOM4_MAC_MCPS_DATA_IND,
  MSG_M0TOM4_MAC_MLME_POLL_IND
} MAC_802_15_4_MsgIdM0ToM4_t;

/**
  * @}
  */

/* List of modes available for UART configuration */
typedef enum
{
  SYS_LPUART1_CLI,
  SYS_USART1_CLI,
} Sys_ConfigUart_Enum_t;

/* Gravity error level */
typedef enum
{
  ERR_INTERFACE_FATAL= 1U,
  ERR_INTERFACE_WARNING = 2U
} Error_Interface_Level_Enum_t;


/** @addtogroup STM32WB55_MAC_CORE
 *
 */

/**
  * @brief  This function is used to manage all the callbacks used by the
  *         MAC 802.15.4 interface.
  *
  *         Important Note: This function must be called each time a message
  *         is sent from the M0 to the M4.
  *
  * @param  None
  * @retval None
  */
HAL_StatusTypeDef MAC_802_15_4_CallBack_Processing(void);

/**
  * @}
  */


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

#endif /* _INC_802_15_4_MAC_CORE_H_ */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/