Initial snapshot: Aliro applet, harness, Nucleo NFC10A1 reader port

Three components, all bench-validated to varying depths:

- applet/: CSA Aliro v1.0 Java Card applet for J3R180. AUTH0 + AUTH1
  expedited-standard flow end-to-end green via PC/SC bench reader
  (aliro-bench-test). Userland AES-256-GCM and HMAC-SHA-256 layered
  on top of J3R180's primitives because the card lacks both natively.
  P-256 curve params seeded explicitly per J3R180's quirk.

- harness/: Python orchestrator (aliro-trustgen, aliro-personalize,
  aliro-bench-test) for trust-bundle generation, card personalization
  via PersonalizationApplet, and PC/SC AUTH0+AUTH1 transactions. 126
  pytest cases passing.

- reader/STM32CubeExpansion_ALIRO_V1_0_0/: ST X-CUBE-ALIRO V1.0.0
  with our NFC10A1 port (NUCLEO-U545RE-Q + X-NUCLEO-NFC10A1, ST25R200
  shared with NFC09A1). nfc10-only/ project, NFC10A1 BSP shim,
  ALIRO_TRUST_OVERRIDE include into vendor's provisioning.c, and an
  ALIRO_APDU_TRACE wrapper around demoTransceiveBlocking. Boots,
  detects the J3R180, completes SELECT + AUTH0; AUTH1 currently fails
  with RFAL ERR_PROTO (0xB) — under investigation, see
  docs/plans/2026-04-20-nucleo-nfc10a1-port.md and bench-notes/.

Excluded: x-cube-aliro.zip vendor archive, harness/.venv, build dirs,
generated aliro_trust.h (contains private reader scalar), all PEMs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-02 10:17:46 -07:00
commit 782074f6ae
8786 changed files with 2902373 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<title>Release Notes for STM32 Aliro Middleware</title>
<style type="text/css">
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
</style>
<link rel="stylesheet" href="_htmresc/mini-st_2020.css" />
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
<![endif]-->
<link rel="icon" type="image/x-icon" href="./_htmresc/favicon.png" />
</head>
<body>
<div class="row">
<div class="col-sm-12 col-lg-4">
<center>
<h1 id="release-notes-for">Release Notes for</h1>
<h1 id="stm32-middleware-aliro"><mark>STM32 Middleware Aliro</mark></h1>
<p>Copyright © 2025 STMicroelectronics<br />
</p>
<a href="https://www.st.com" class="logo"><img src="_htmresc/st_logo_2020.png" alt="ST logo" /></a>
</center>
<h1 id="purpose">Purpose</h1>
<p>Aliro Middleware supporting CSA Aliro access control protocol</p>
</div>
<div class="col-sm-12 col-lg-8">
<h1 id="update-history">Update History</h1>
<div class="collapse">
<input type="checkbox" id="collapse-section1" checked aria-hidden="true"> <label for="collapse-section1" aria-hidden="false">V1.0.0 / 01-December-2025</label>
<div>
<h2 id="main-changes-8">Main Changes</h2>
<p>First official release</p>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200"><g fill="#13254a"><path d="M100 .212C44.868.212 0 44.889 0 99.788c0 55.132 44.868 100 100 100s100-44.868 100-100C200 44.889 155.132.212 100 .212zm0 181.164c-44.974 0-81.587-36.614-81.587-81.587 0-44.762 36.614-81.164 81.587-81.164 44.995 0 81.587 36.402 81.587 81.164 0 44.973-36.592 81.587-81.587 81.587z" style="fill: #e6007e;"/><path d="M141.1 88.127h-29.439V58.688c0-6.392-5.185-11.598-11.598-11.598-6.413 0-11.619 5.206-11.619 11.598v29.439H58.476c-6.392 0-11.598 5.185-11.598 11.598 0 6.413 5.206 11.619 11.598 11.619h29.968v29.968c0 6.392 5.206 11.598 11.619 11.598 6.413 0 11.598-5.206 11.598-11.598v-29.968H141.1c6.392 0 11.598-5.206 11.598-11.619 0-6.413-5.206-11.598-11.598-11.598z" style="fill: #e6007e;"/></g></svg>

After

Width:  |  Height:  |  Size: 832 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 KiB

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200"><g fill="#03234b"><path d="M170.934 64.569l-.04-.055-29.049 40.038-.057.079h14.867a59.366 59.366 0 0 1-1.488 15.615c-1.158 5.318-3.807 13.448-9.848 21.977-2.766 4.118-6.375 7.726-9.208 10.408-3.426 2.857-7.461 6.095-12 8.376-8.121 4.568-17.881 7.138-28.225 7.432-10.907.248-20.201-2.61-26.072-5.052-8.283-3.479-14.111-7.807-16.85-10.078-1.254-.956-2.25-1.907-3.057-2.676a28.662 28.662 0 0 0-1.157-1.069 158.874 158.874 0 0 0-1.479-1.362l-4.435-3.956 3.569 4.81.183.243c.2.263.548.722 1.048 1.389.276.334.579.747.93 1.226l.008.01c.689.939 1.546 2.107 2.664 3.322 3 3.536 8.178 8.801 15.808 13.801 5.969 3.866 15.672 8.901 28.001 10.935a79.05 79.05 0 0 0 12.485.998c7.97 0 15.651-1.228 22.828-3.649 6.366-1.877 12.192-4.981 17.053-7.771 6.16-3.936 10.817-7.586 14.654-11.488 8.084-7.899 14.884-17.913 19.15-28.199 3.259-7.594 5.456-15.727 6.529-24.175l.055-.425.083-.641H200l-29.066-40.063zM58.159 99.232l-12.655.563c-.097-.881-.159-1.986-.227-3.474a59.184 59.184 0 0 1 1.446-16.56c1.157-5.316 3.804-13.444 9.848-21.977 2.168-3.228 5.009-6.44 9.208-10.415 3.41-2.849 7.432-6.08 12.005-8.375 8.114-4.568 17.87-7.138 28.213-7.432 10.9-.25 20.196 2.607 26.072 5.045 8.258 3.473 14.105 7.812 16.857 10.091 1.257.951 2.253 1.904 3.057 2.673l.017.016c.43.411.801.766 1.136 1.051.475.438.841.777 1.091 1.01l.138.128.248.229 4.04 3.613-3.165-4.456c-.058-.083-.312-.417-.73-.971l-.507-.67a28.922 28.922 0 0 1-.901-1.192l-.02-.027c-.69-.945-1.548-2.121-2.677-3.346-3.002-3.537-8.182-8.803-15.813-13.801-5.964-3.865-15.662-8.9-27.997-10.935-8.484-1.363-21.496-2.009-35.313 2.651-6.355 1.88-12.186 4.983-17.054 7.772-6.163 3.944-10.82 7.595-14.654 11.488-8.079 7.894-14.882 17.909-19.155 28.2-3.268 7.624-5.463 15.757-6.523 24.173-.436 3.281-.642 5.421-.664 6.926L0 101.831l30.683 38.727.042.053 27.38-41.298.054-.081z" style="fill: #e6007e;"/></g></svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 392 KiB

View File

@@ -0,0 +1,769 @@
/**
******************************************************************************
* @file : ACWG_Security.h
* @brief : Header for ACWG_Security.c file.
* This file contains the public declarations for the ACWG Security module.
******************************************************************************
* @attention
*
* Copyright (c) 2025 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 _ACWG_Security_H_
#define _ACWG_Security_H_
#ifdef __cplusplus
extern "C" {
#endif
/** @addtogroup ACWG_SECURITY
* @{
*/
/* Includes ------------------------------------------------------------------*/
#include <stdint.h>
#include <sm_crypto.h>
#include "ACWG_build_info.h"
#include "ACWG_version.h"
/** @addtogroup ACWG_security_Exported_Constants
* @{
*/
/* Exported constants --------------------------------------------------------*/
#define AUTH_EXP_TRANS_PROT_VERSION ((uint16_t)0x0100)
/**
* @brief Maximum length in bytes for endpoint property TLV.
*/
#define AUTH_ENDPOINT_PROP_TLV_MAX_LEN_BYTES ((uint32_t)64)
/**
* @brief Maximum length in bytes for private mailbox data subset.
* @todo Update this value as needed.
*/
#define AUTH_PRIV_MAILBOX_DATA_SUBSET_MAX_LEN_BYTES ((uint32_t)8) // Todo : update
/**
* @brief Length in bytes of a public key.
*/
#define AUTH_PUBKEY_LEN_BYTES ((uint32_t)64)
/**
* @brief Length in bytes of a transaction ID.
*/
#define AUTH_TRANS_ID_LEN_BYTES ((uint32_t)16)
/**
* @brief Length in bytes of a reader group ID.
*/
#define AUTH_READER_GROUP_ID_LEN_BYTES ((uint32_t)16)
/**
* @brief Length in bytes of a reader group sub ID.
*/
#define AUTH_READER_GROUP_SUB_ID_LEN_BYTES ((uint32_t)16)
/**
* @brief Length in bytes of a keyslot.
*/
#define AUTH_KEYSLOT_LEN_BYTES ((uint32_t)8)
/**
* @brief Length in bytes of a cryptogram session key.
*/
#define AUTH_CRYPTOGRAM_SK_LEN_BYTES ((uint32_t)32)
/**
* @brief Length in bytes of a cryptogram.
*/
#define AUTH_CRYPTOGRAM_LEN_BYTES ((uint32_t)64)
/**
* @brief Maximum payload length in bytes.
*/
#define AUTH_MAX_PAYLOAD_LEN_BYTES ((uint32_t)256)
/**
* @brief Length in bytes of a persistent key.
*/
#define AUTH_PERSISTENT_KEY_LEN_BYTES ((uint32_t)32)
/**
* @brief Length in bytes of an exchange session key.
*/
#define AUTH_EXCH_SK_LEN_BYTES ((uint32_t)32)
/**
* @brief Length in bytes of a step-up session key.
*/
#define AUTH_STEPUP_SK_LEN_BYTES ((uint32_t)32)
/**
* @brief Length in bytes of a BLE session key.
*/
#define AUTH_BLESK_LEN_BYTES ((uint32_t)32)
/**
* @brief Length in bytes of a uRSK key.
*/
#define AUTH_URSK_LEN_BYTES ((uint32_t)32)
/**
* @brief Maximum length in bytes for reader extension.
*/
#define AUTH_READER_EXT_MAX_LEN_BYTES ((uint32_t)128)
/**
* @brief Maximum length in bytes for endpoint extension.
*/
#define AUTH_ENDPOINT_EXT_MAX_LEN_BYTES ((uint32_t)128)
/**
* @brief Maximum number of persistent keys stored.
*/
#define AUTH_MAX_PERSISTENT_KEYS_STORED ((uint32_t)2)
/**
* @brief Maximum number of keyslots stored.
*/
#define AUTH_MAX_KEYSLOTS_STORED ((uint32_t)2)
/**
* @brief Length in bytes of credential signature time.
*/
#define AUTH_CRED_SIG_TIME_LEN_BYTES ((uint32_t)20)
/**
* @brief Length in bytes of revocation signature time.
*/
#define AUTH_REVOC_SIG_TIME_LEN_BYTES ((uint32_t)20)
/**
* @brief Length in bytes of signaling bitmap.
*/
#define AUTH_SIGNALING_BITMAP_LEN_BYTES ((uint32_t)2)
/**
* @brief Length in bytes of salt type.
*/
#define AUTH_SALT_TYPE_BYTES_LEN ((uint32_t)12)
/**
* @brief Maximum length in bytes for salt.
*/
#define AUTH_SALT_MAX_LEN_BYTES ((uint32_t)(\
(AUTH_PUBKEY_LEN_BYTES / 2) + \
AUTH_SALT_TYPE_BYTES_LEN + \
AUTH_READER_GROUP_ID_LEN_BYTES + AUTH_READER_GROUP_SUB_ID_LEN_BYTES + \
1 + \
1 + \
1 + \
2 + \
(AUTH_PUBKEY_LEN_BYTES / 2) + \
AUTH_TRANS_ID_LEN_BYTES + \
2 + \
AUTH_ENDPOINT_PROP_TLV_MAX_LEN_BYTES + \
2 + \
(AUTH_PUBKEY_LEN_BYTES / 2) \
))
/**
* @brief Length in bytes of info.
*/
#define AUTH_INFO_LEN_BYTES ((uint32_t)AUTH_PUBKEY_LEN_BYTES)
/**
* @brief Command parameter for AUTH1 (endpoint public key expected in auth1 response).
*/
#define AUTH1_CMD_PARAM ((uint8_t)1) // endpoint public key expected in auth1 response
/**
* @brief Length in bytes of AUTH1 authentication data.
*/
#define AUTH1_AUTH_DATA_LEN_BYTES (2 + AUTH_READER_GROUP_ID_LEN_BYTES + AUTH_READER_GROUP_SUB_ID_LEN_BYTES +\
2 + (AUTH_PUBKEY_LEN_BYTES / 2) +\
2 + (AUTH_PUBKEY_LEN_BYTES / 2) +\
2 + AUTH_TRANS_ID_LEN_BYTES +\
2 + 4)
/**
* @brief Mask for expected fast command parameters.
*/
#define CMD_PARAMS_EXP_FAST_MASK ((uint8_t)0x1)
/**
* @brief Length in bytes of KDH.
*/
#define KDH_LEN_BYTES ((uint32_t)32)
/**
* @brief UWB configuration identifier attribute ID.
*/
#define UWB_CONFIGURATION_IDENTIFIER_ID ((uint8_t) 0)
/**
* @brief Pulse shape combo attribute ID.
*/
#define PULSE_SHAPE_COMBO_ID ((uint8_t) 1)
/**
* @brief UWB session identifier attribute ID.
*/
#define UWB_SESSION_IDENTIFIER_ID ((uint8_t) 2)
/**
* @brief Channel bitmask attribute ID.
*/
#define CHANNEL_BITMASK_ID ((uint8_t) 3)
/**
* @brief RAN multiplier attribute ID.
*/
#define RAN_MULTIPLIER_ID ((uint8_t) 4)
/**
* @brief Slot bitmask attribute ID.
*/
#define SLOT_BITMASK_ID ((uint8_t) 5)
/**
* @brief Sync code index bitmask attribute ID.
*/
#define SYNC_CODE_INDEX_BITMASK_ID ((uint8_t) 6)
/**
* @brief Sync code index attribute ID.
*/
#define SYNC_CODE_INDEX_ID ((uint8_t) 7)
/**
* @brief Hopping configuration bitmask attribute ID.
*/
#define HOPPING_CONFIGURATION_BITMASK_ID ((uint8_t) 8)
/**
* @brief Number of chaps per slot attribute ID.
*/
#define NUMBER_CHAPS_PER_SLOT_ID ((uint8_t) 9)
/**
* @brief Number of responder nodes attribute ID.
*/
#define NUMBER_RESPONDERS_NODES_ID ((uint8_t) 10)
/**
* @brief Number of slots per round attribute ID.
*/
#define NUMBER_SLOTS_PER_ROUND_ID ((uint8_t) 11)
/**
* @brief STS index0 attribute ID.
*/
#define STS_INDEX0_ID ((uint8_t) 12)
/**
* @brief UWB time0 attribute ID.
*/
#define UWB_TIME0_ID ((uint8_t) 13)
/**
* @brief Hop mode key attribute ID.
*/
#define HOP_MODE_KEY_ID ((uint8_t) 14)
/**
* @brief MAC mode attribute ID.
*/
#define MAC_MODE_ID ((uint8_t) 15)
/**
* @brief Vendor specific attribute ID.
*/
#define VENDOR_SPECIFIC_ID ((uint8_t) 16)
/**
* @brief Status attribute ID.
*/
#define STATUS_ID ((uint8_t) 17)
/**
* @brief Length in bytes of UWB configuration identifier (2 x m).
*/
#define UWB_CONFIGURATION_IDENTIFIER_LEN_BYTES ((uint8_t)2) // 2 x m
/**
* @brief Length in bytes of UWB session identifier.
*/
#define UWB_SESSION_IDENTIFIER_LEN_BYTES ((uint8_t)4)
/**
* @brief Length in bytes of sync code index bitmask.
*/
#define SYNC_CODE_INDEX_BITMASK_LEN_BYTES ((uint8_t)4)
/**
* @brief Length in bytes of STS index0.
*/
#define STS_INDEX0_LEN_BYTES ((uint8_t)4)
/**
* @brief Length in bytes of UWB time0.
*/
#define UWB_TIME0_LEN_BYTES ((uint8_t)8)
/**
* @brief Length in bytes of hop mode key.
*/
#define HOP_MODE_KEY_LEN_BYTES ((uint8_t)4)
/**
* @brief Length in bytes of vendor specific field 1 (3 + Attribute Value Len).
*/
#define VENDOR_SPECIFIC_LEN_BYTES1 ((uint8_t)3 + 5) // 3 + Attribute Value Len
/**
* @brief Length in bytes of vendor specific field 2 (3 + Attribute Value Len).
*/
#define VENDOR_SPECIFIC_LEN_BYTES2 ((uint8_t)3 + 5) // 3 + Attribute Value Len
/**
* @brief Length in bytes of vendor specific field 3 (3 + Attribute Value Len).
*/
#define VENDOR_SPECIFIC_LEN_BYTES3 ((uint8_t)3 + 5) // 3 + Attribute Value Len
/**
* @brief Length in bytes of vendor specific field 4 (3 + Attribute Value Len).
*/
#define VENDOR_SPECIFIC_LEN_BYTES4 ((uint8_t)3 + 5) // 3 + Attribute Value Len
/**
* @}
*/
/** @addtogroup ACWG_security_Exported_Types
* @{
*/
/* Exported types ------------------------------------------------------------*/
/**
* @brief Status codes for ACWG Security operations.
*/
typedef enum ACWG_Status {
ACWG_OK = 0x764E8BAC, /**< Operation successful */
ACWG_Error_Generic = 0x0abedead, /**< Generic error */
ACWG_Error_FastTransFailed, /**< Fast transaction failed */
ACWG_Error_Parsing, /**< Parsing error */
ACWG_Error_ShortBuf, /**< Buffer too short */
ACWG_Error_Crypto_KeyGen, /**< Cryptographic key generation error */
ACWG_Error_Crypto_TransIDGen, /**< Transaction ID generation error */
ACWG_Error_Crypto_ECDH, /**< ECDH cryptographic error */
ACWG_Error_Crypto_Derivation, /**< Key derivation error */
ACWG_Error_Crypto_EncryptDecrypt, /**< Encryption/Decryption error */
ACWG_Error_Crypto_Hash, /**< Hashing error */
ACWG_Error_Crypto_SigGen, /**< Signature generation error */
ACWG_Error_Crypto_SigVerif, /**< Signature verification error */
ACWG_Error_HW, /**< Hardware error */
ACWG_Error_WrongState, /**< Wrong state error */
ACWG_Error_KeyslotNotFound, /**< Keyslot not found */
ACWG_Error_Parsing_NoKeyslot, /**< Parsing error: no keyslot */
ACWG_Error_Parsing_NoPublicKey /**< Parsing error: no public key */
} ACWG_Status_t;
/**
* @brief Transaction state machine for ACWG Security.
*/
typedef enum transactionState {
invalid = 0, /**< Invalid state */
selectDone, /**< SELECT command completed */
auth0StdDone, /**< AUTH0 standard completed */
auth0FastDone, /**< AUTH0 fast transaction completed */
auth1Done, /**< AUTH1 completed successfully */
inStepUp, /**< In step-up phase */
failed /**< Transaction failed */
} transactionState_t;
/**
* @brief Initialization parameters for an ACWG session context.
*/
typedef struct ACWG_SessionContextInit {
uint8_t cmdParams; /**< Command parameters */
uint8_t useKeyslot; /**< Use keyslot flag */
uint8_t useExchange; /**< Use exchange flag */
uint8_t useLoadCert; /**< Use load certificate flag */
uint8_t useStepUp; /**< Use step-up flag */
uint8_t RESERVED0; /**< Reserved */
uint8_t RESERVED1; /**< Reserved */
uint8_t RESERVED2; /**< Reserved */
uint8_t RESERVED3; /**< Reserved */
uint8_t NotVerifyKey; /**< Do not verify key flag */
uint8_t interface; /**< Interface type (0xc3 for Bluetooth, 0x5e for NFC) */
uint8_t authPolicy; /**< Authentication policy */
uint8_t readerID[AUTH_READER_GROUP_ID_LEN_BYTES + AUTH_READER_GROUP_SUB_ID_LEN_BYTES]; /**< Reader ID */
uint16_t expTransProtVer; /**< Expected transaction protocol version */
uint8_t *readerExt; /**< Pointer to reader extension data */
uint32_t readerExtSize; /**< Size of reader extension data */
uint32_t lockStatus; /**< Lock status */
} ACWG_SessionContextInit_t ;
/**
* @brief UWB (Ultra-Wideband) context for ACWG session.
*/
typedef struct ACWG_UWB_Context {
uint8_t UWB_Configuration_Identifier[UWB_CONFIGURATION_IDENTIFIER_LEN_BYTES]; /**< UWB configuration identifier */
uint8_t Pulse_Shape_Combo; /**< Pulse shape combo */
uint8_t UWB_Session_Identifier[UWB_SESSION_IDENTIFIER_LEN_BYTES]; /**< UWB session identifier */
uint8_t Channel_Bitmask; /**< Channel bitmask */
uint8_t RAN_Multiplier; /**< RAN multiplier */
uint8_t Slot_Bitmask; /**< Slot bitmask */
uint8_t SYNC_Code_Index_Bitmask[SYNC_CODE_INDEX_BITMASK_LEN_BYTES]; /**< Sync code index bitmask */
uint8_t SYNC_Code_Index; /**< Sync code index */
uint8_t Hopping_Configuration_Bitmask; /**< Hopping configuration bitmask */
uint8_t Number_Chaps_per_Slot; /**< Number of chaps per slot */
uint8_t Number_Responders_Nodes; /**< Number of responder nodes */
uint8_t Number_Slots_per_Round; /**< Number of slots per round */
uint8_t STS_Index0[STS_INDEX0_LEN_BYTES]; /**< STS index0 */
uint8_t UWB_Time0[UWB_TIME0_LEN_BYTES]; /**< UWB time0 */
uint8_t HOP_Mode_Key[HOP_MODE_KEY_LEN_BYTES]; /**< Hop mode key */
uint8_t MAC_Mode; /**< MAC mode */
uint8_t Vendor_Specific1[VENDOR_SPECIFIC_LEN_BYTES1]; /**< Vendor specific field 1 */
uint8_t Vendor_Specific2[VENDOR_SPECIFIC_LEN_BYTES2]; /**< Vendor specific field 2 */
uint8_t Vendor_Specific3[VENDOR_SPECIFIC_LEN_BYTES3]; /**< Vendor specific field 3 */
uint8_t Vendor_Specific4[VENDOR_SPECIFIC_LEN_BYTES4]; /**< Vendor specific field 4 */
uint8_t Vendor_Specific1_len; /**< Length of vendor specific field 1 */
uint8_t Vendor_Specific2_len; /**< Length of vendor specific field 2 */
uint8_t Vendor_Specific3_len; /**< Length of vendor specific field 3 */
uint8_t Vendor_Specific4_len; /**< Length of vendor specific field 4 */
uint8_t Status; /**< Status */
} ACWG_UWB_Context_t ;
/**
* @brief Session context for ACWG Security operations.
*/
typedef struct ACWG_SessionContext {
ACWG_SessionContextInit_t init; /**< Initialization parameters */
ACWG_UWB_Context_t uwb_ctx; /**< UWB context */
uint32_t expDeviceCounter; /**< Expected device counter */
uint32_t expReaderCounter; /**< Expected reader counter */
uint32_t stepUpDeviceCounter; /**< Step-up device counter */
uint32_t stepUpReaderCounter; /**< Step-up reader counter */
uint32_t bleDeviceCounter; /**< BLE device counter */
uint32_t bleReaderCounter; /**< BLE reader counter */
uint8_t transId[AUTH_TRANS_ID_LEN_BYTES]; /**< Transaction ID */
uint8_t readerEPub[AUTH_PUBKEY_LEN_BYTES]; /**< Reader ephemeral public key */
uint8_t endpointEPub[AUTH_PUBKEY_LEN_BYTES]; /**< Endpoint ephemeral public key */
uint8_t endpointPub[AUTH_PUBKEY_LEN_BYTES]; /**< Endpoint public key */
transactionState_t transState; /**< Current transaction state */
transactionState_t stateBeforeStepUp; /**< State before step-up */
uint8_t cryptogramSK[AUTH_CRYPTOGRAM_SK_LEN_BYTES]; /**< Cryptogram session key */
uint8_t expSKReader[AUTH_EXCH_SK_LEN_BYTES]; /**< Exchange session key (reader) */
uint8_t expSKDevice[AUTH_EXCH_SK_LEN_BYTES]; /**< Exchange session key (device) */
uint8_t bleSK[AUTH_BLESK_LEN_BYTES]; /**< BLE session key */
uint8_t bleSKReader[AUTH_BLESK_LEN_BYTES]; /**< BLE session key (reader) */
uint8_t bleSKDevice[AUTH_BLESK_LEN_BYTES]; /**< BLE session key (device) */
uint8_t uRSK[AUTH_URSK_LEN_BYTES]; /**< uRSK key */
uint8_t stepUpSK[AUTH_STEPUP_SK_LEN_BYTES]; /**< Step-up session key */
uint8_t stepUpSKReader[AUTH_STEPUP_SK_LEN_BYTES]; /**< Step-up session key (reader) */
uint8_t stepUpSKDevice[AUTH_STEPUP_SK_LEN_BYTES]; /**< Step-up session key (device) */
uint8_t kPersistent[AUTH_PERSISTENT_KEY_LEN_BYTES]; /**< Persistent key */
uint8_t endpointExt[AUTH_ENDPOINT_EXT_MAX_LEN_BYTES]; /**< Endpoint extension */
uint32_t endpointExtSize; /**< Endpoint extension size */
uint8_t *endpointPropTLV; /**< Pointer to endpoint property TLV */
uint32_t endpointPropTLVSize; /**< Size of endpoint property TLV */
uint8_t authData[AUTH1_AUTH_DATA_LEN_BYTES]; /**< AUTH1 authentication data */
uint8_t signalingBitmap[AUTH_SIGNALING_BITMAP_LEN_BYTES]; /**< Signaling bitmap */
uint8_t kdh[KDH_LEN_BYTES]; /**< KDH key */
uint32_t lockActionRequest; /**< Lock action request */
uint8_t salt[AUTH_SALT_MAX_LEN_BYTES]; /**< Salt */
uint8_t info[AUTH_INFO_LEN_BYTES + AUTH_READER_EXT_MAX_LEN_BYTES + AUTH_ENDPOINT_EXT_MAX_LEN_BYTES]; /**< Info */
} ACWG_SessionContext_t;
/**
* @brief Structure for persistent keys storage.
*/
typedef struct ACWG_PersistentKeys {
uint8_t endpointPubK[AUTH_PUBKEY_LEN_BYTES]; /**< Endpoint public key */
uint8_t kPersistent[AUTH_PERSISTENT_KEY_LEN_BYTES]; /**< Persistent key */
} persistentKeys_t;
/**
* @brief Structure for keyslot storage.
*/
typedef struct ACWG_Keyslot {
uint8_t slot[AUTH_KEYSLOT_LEN_BYTES]; /**< Keyslot */
uint8_t publicKey[AUTH_PUBKEY_LEN_BYTES]; /**< Public key */
} keyslot_t;
/**
* @}
*/
/** @addtogroup ACWG_security_Exported_Variables
* @{
*/
/* Exported variables ------------------------------------------------------------*/
const ACWG_build_info_t* ACWG_SecurityGetVersion(void);
/**
* @}
*/
/** @addtogroup ACWG_security_Exported_Functions
* @{
*/
/* Exported functions ------------------------------------------------------- */
/**
* @brief Initializes the ACWG session context.
*
* @param context Pointer to the session context structure.
* @return ACWG_Status_t Status code indicating success or error type.
*/
ACWG_Status_t ACWG_initSessionContext(ACWG_SessionContext_t *context);
/**
* @brief Processes the SELECT command completion.
*
* @param context Pointer to the session context structure.
* @return ACWG_Status_t Status code indicating success or error type.
*/
ACWG_Status_t ACWG_selectDone(ACWG_SessionContext_t *context);
/**
* @brief Prepares an ephemeral keypair and generates a transaction ID for the session.
*
* @param context Pointer to the session context structure.
* @return ACWG_Status_t Status code indicating success or error type.
*/
ACWG_Status_t ACWG_prepareEphemeralKeypairAndTransactionId(ACWG_SessionContext_t *context);
/**
* @brief Generates the AUTH0 command payload.
*
* @param context Pointer to the session context structure.
* @param payload Pointer to the buffer where the payload will be written.
* @param payloadSize Pointer to the variable that will receive the payload size.
* @return ACWG_Status_t Status code indicating success or error type.
*/
ACWG_Status_t ACWG_generateAUTH0CommandPayload(ACWG_SessionContext_t *context, uint8_t *payload, uint32_t *payloadSize);
/**
* @brief Processes the AUTH0 response payload.
*
* @param context Pointer to the session context structure.
* @param payload Pointer to the received payload buffer.
* @param payloadSize Size of the received payload.
* @return ACWG_Status_t Status code indicating success or error type.
*/
ACWG_Status_t ACWG_processAUTH0ResponsePayload(ACWG_SessionContext_t *context, uint8_t *payload, uint32_t payloadSize);
/**
* @brief Generates the LOADCERT command payload.
*
* @param context Pointer to the session context structure.
* @param payload Pointer to the buffer where the payload will be written.
* @param payloadSize Pointer to the variable that will receive the payload size.
* @return ACWG_Status_t Status code indicating success or error type.
*/
ACWG_Status_t ACWG_generateLOADCERTCommandPayload(ACWG_SessionContext_t *context, uint8_t *payload, uint32_t *payloadSize);
/**
* @brief Generates the AUTH1 command payload.
*
* @param context Pointer to the session context structure.
* @param payload Pointer to the buffer where the payload will be written.
* @param payloadSize Pointer to the variable that will receive the payload size.
* @return ACWG_Status_t Status code indicating success or error type.
*/
ACWG_Status_t ACWG_generateAUTH1CommandPayload(ACWG_SessionContext_t *context, uint8_t *payload, uint32_t *payloadSize);
/**
* @brief Computes the KDH and volatile keys for the session.
*
* @param context Pointer to the session context structure.
* @return ACWG_Status_t Status code indicating success or error type.
*/
ACWG_Status_t ACWG_computeKDHandVolatileKeys(ACWG_SessionContext_t *context);
/**
* @brief Derives persistent keys for the session.
*
* @param context Pointer to the session context structure.
* @return ACWG_Status_t Status code indicating success or error type.
*/
ACWG_Status_t ACWG_derivePersistentKeys(ACWG_SessionContext_t *context);
/**
* @brief Processes the AUTH1 response payload.
*
* @param context Pointer to the session context structure.
* @param payload Pointer to the received payload buffer.
* @param payloadSize Size of the received payload.
* @return ACWG_Status_t Status code indicating success or error type.
*/
ACWG_Status_t ACWG_processAUTH1ResponsePayload(ACWG_SessionContext_t *context, uint8_t *payload, uint32_t payloadSize);
/**
* @brief Generates the Exchange command payload.
*
* @param context Pointer to the session context structure.
* @param input Pointer to the input buffer.
* @param inputSize Size of the input buffer.
* @param payload Pointer to the buffer where the payload will be written.
* @param payloadSize Pointer to the variable that will receive the payload size.
* @return ACWG_Status_t Status code indicating success or error type.
*/
ACWG_Status_t ACWG_generateExchangeCommandPayload(ACWG_SessionContext_t *context, uint8_t *input, uint32_t inputSize, uint8_t *payload, uint32_t *payloadSize);
/**
* @brief Processes the Exchange response payload.
*
* @param context Pointer to the session context structure.
* @param payload Pointer to the received payload buffer.
* @param payloadSize Size of the received payload.
* @param outputSize Pointer to the variable that will receive the output size.
* @return ACWG_Status_t Status code indicating success or error type.
*/
ACWG_Status_t ACWG_processExchangeResponsePayload(ACWG_SessionContext_t *context, uint8_t *payload, uint32_t payloadSize, uint32_t *outputSize);
/**
* @brief Initializes a BLE encrypted session.
*
* @param context Pointer to the session context structure.
* @param versions Pointer to the versions buffer.
* @param versionsSize Size of the versions buffer.
* @return ACWG_Status_t Status code indicating success or error type.
*/
ACWG_Status_t ACWG_initBLEEncryptedSession(ACWG_SessionContext_t *context, uint8_t * versions, uint32_t versionsSize);
/**
* @brief Encrypts data for BLE communication.
*
* @param context Pointer to the session context structure.
* @param protocolHeader Protocol header byte.
* @param msgID Message ID byte.
* @param input Pointer to the input buffer.
* @param inputSize Size of the input buffer.
* @param output Pointer to the buffer where the encrypted data will be written.
* @param outputSize Pointer to the variable that will receive the output size.
* @return ACWG_Status_t Status code indicating success or error type.
*/
ACWG_Status_t ACWG_encryptBle(ACWG_SessionContext_t *context, uint8_t protocolHeader, uint8_t msgID, uint8_t *input, uint32_t inputSize, uint8_t *output, uint32_t *outputSize);
/**
* @brief Decrypts data received over BLE communication.
*
* @param context Pointer to the session context structure.
* @param protocolHeader Protocol header byte.
* @param msgID Message ID byte.
* @param input Pointer to the input buffer.
* @param inputSize Size of the input buffer.
* @param output Pointer to the buffer where the decrypted data will be written.
* @param outputSize Pointer to the variable that will receive the output size.
* @return ACWG_Status_t Status code indicating success or error type.
*/
ACWG_Status_t ACWG_decryptBle(ACWG_SessionContext_t *context, uint8_t protocolHeader, uint8_t msgID, uint8_t *input, uint32_t inputSize, uint8_t *output, uint32_t *outputSize);
/**
* @brief Generates the Envelope command payload.
*
* @param context Pointer to the session context structure.
* @param input Pointer to the input buffer.
* @param inputSize Size of the input buffer.
* @param payload Pointer to the buffer where the payload will be written.
* @param payloadSize Pointer to the variable that will receive the payload size.
* @return ACWG_Status_t Status code indicating success or error type.
*/
ACWG_Status_t ACWG_generateEnvelopeCommandPayload(ACWG_SessionContext_t *context, uint8_t *input, uint32_t inputSize, uint8_t *payload, uint32_t *payloadSize);
/**
* @brief Gets the response payload for a GET command.
*
* @param context Pointer to the session context structure.
* @param payload Pointer to the received payload buffer.
* @param payloadSize Size of the received payload.
* @param outputSize Pointer to the variable that will receive the output size.
* @return ACWG_Status_t Status code indicating success or error type.
*/
ACWG_Status_t ACWG_getGetResponsePayload(ACWG_SessionContext_t *context, uint8_t *payload, uint32_t payloadSize, uint32_t *outputSize);
/**
* @brief Enters the step-up phase in the session context.
*
* @param context Pointer to the session context structure.
* @return ACWG_Status_t Status code indicating success or error type.
*/
ACWG_Status_t ACWG_enterStepUp(ACWG_SessionContext_t *context);
/**
* @brief Exits the step-up phase in the session context.
*
* @param context Pointer to the session context structure.
* @return ACWG_Status_t Status code indicating success or error type.
*/
ACWG_Status_t ACWG_exitStepUp(ACWG_SessionContext_t *context);
/**
* @brief Generates the M1 command payload.
*
* @param context Pointer to the session context structure.
* @param payload Pointer to the buffer where the payload will be written.
* @param payloadSize Pointer to the variable that will receive the payload size.
* @return ACWG_Status_t Status code indicating success or error type.
*/
ACWG_Status_t ACWG_generateM1CommandPayload(ACWG_SessionContext_t *context, uint8_t *payload, uint32_t *payloadSize);
/**
* @brief Processes the M2 payload.
*
* @param context Pointer to the session context structure.
* @param payload Pointer to the received payload buffer.
* @param payloadSize Size of the received payload.
* @return ACWG_Status_t Status code indicating success or error type.
*/
ACWG_Status_t ACWG_processM2Payload(ACWG_SessionContext_t *context, uint8_t *payload, uint32_t payloadSize);
/**
* @brief Generates the M3 command payload.
*
* @param context Pointer to the session context structure.
* @param payload Pointer to the buffer where the payload will be written.
* @param payloadSize Pointer to the variable that will receive the payload size.
* @return ACWG_Status_t Status code indicating success or error type.
*/
ACWG_Status_t ACWG_generateM3CommandPayload(ACWG_SessionContext_t *context, uint8_t *payload, uint32_t *payloadSize);
/**
* @brief Processes the M4 payload.
*
* @param context Pointer to the session context structure.
* @param payload Pointer to the received payload buffer.
* @param payloadSize Size of the received payload.
* @return ACWG_Status_t Status code indicating success or error type.
*/
ACWG_Status_t ACWG_processM4Payload(ACWG_SessionContext_t *context, uint8_t *payload, uint32_t payloadSize);
extern void PrintBufferHex(const char *pstr, const uint8_t *pBuf, const uint32_t nSize);
/**
* @}
*/
/**
* @}
*/
#ifdef __cplusplus
}
#endif
#endif /* _ACWG_SECURITY_H_ */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@@ -0,0 +1,102 @@
/**
******************************************************************************
* @file : ACWG_build_info.h
* @brief : Header for ACWG build information.
* This file contains public declarations for library build info.
******************************************************************************
* @attention
*
* Copyright (c) 2025 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 _ACWG_BUILD_INFO_H_
#define _ACWG_BUILD_INFO_H_
#ifdef __cplusplus
extern "C" {
#endif
/** @addtogroup ACWG_SECURITY
* @{
*/
/* Includes ------------------------------------------------------------------*/
#include <stdint.h>
/** @addtogroup ACWG_build_info_Exported_Constants
* @{
*/
/* Exported constants --------------------------------------------------------*/
#define ACWG_BI_FW_DESCRIPTION_LEN 24
/**
* @brief Length of the firmware description string in the build info structure.
*/
#define ACWG_BI_VERSION 1
/**
* @brief Version of the ACWG build info structure.
*/
#define ACWG_ALIRO_SPEC_VERSION_MAJ 0
/**
* @brief Major version number of the Aliro specification.
*/
#define ACWG_ALIRO_SPEC_VERSION_MIN 9
/**
* @brief Minor version number of the Aliro specification.
*/
#define ACWG_ALIRO_SPEC_VERSION_SUBMIN 5
/**
* @brief Subminor version number of the Aliro specification.
*/
/**
* @}
*/
/** @addtogroup ACWG_build_info_Exported_Types
* @{
*/
/* Exported types ------------------------------------------------------------*/
/**
* @brief Various info about the firmware build
*
* The build info are put at a specific address in flash (e.g. 0x0200), so that we can easily recover it with an
* external application which would read the flash.
*/
typedef struct ACWG_build_info_s {
uint8_t magic_cookie[4]; //!< A magic cookie that external application could easily read: 'A', 'C', 'W', 'G'
uint8_t build_info_version; //!< Version of this structure, e.g. @ref MBI_VERSION
uint8_t ver_major; //!< Major version number of the acwg
uint8_t ver_minor; //!< Minor version number of the acwg
uint8_t ver_subminor; //!< Subminor version number of the acwg
// char revision[32]; //!< git version at the build time, based on hash
char date[12]; //!< Build date, e.g. "Jan 1 1970"
char time[12]; //!< Build time, e.g. "01:00:00"
uint8_t aliro_spec_major; //!< Major version number of the Aliro spec.
uint8_t aliro_spec_minor; //!< Minor version number of the Aliro spec.
uint8_t aliro_spec_subminor; //!< Subminor version number of the Aliro spec.
char fw_description[ACWG_BI_FW_DESCRIPTION_LEN]; //!< Name of the firmware
}ACWG_build_info_t;
/**
* @}
*/
/**
* @}
*/
#ifdef __cplusplus
}
#endif
#endif /* _ACWG_BUILD_INFO_H_ */

View File

@@ -0,0 +1,67 @@
/**
******************************************************************************
* @file : ACWG_version.h
* @brief : Header for ACWG_version.c file.
* This file defines version for the ACWG Security Middleware.
******************************************************************************
* @attention
*
* Copyright (c) 2025 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 _ACWG_VERSION_H_
#define _ACWG_VERSION_H_
#ifdef __cplusplus
extern "C" {
#endif
/** @addtogroup ACWG_SECURITY
* @{
*/
/** @addtogroup ACWG_version_Exported_Constants
* @{
*/
/* Exported constants --------------------------------------------------------*/
/**
* @def ACWG_VERSION_MAJ
* @brief Major version number of the ACWG Security Middleware.
*/
#define ACWG_VERSION_MAJ 0
/**
* @def ACWG_VERSION_MIN
* @brief Minor version number of the ACWG Security Middleware.
*/
#define ACWG_VERSION_MIN 3
/**
* @def ACWG_VERSION_SUBMIN
* @brief Sub-minor version number of the ACWG Security Middleware.
*/
#define ACWG_VERSION_SUBMIN 4
/**
* @}
*/
/**
* @}
*/
#ifdef __cplusplus
}
#endif
#endif /* _ACWG_VERSION_H_ */

View File

@@ -0,0 +1,78 @@
#include "ACWG_Security.h"
#include <string.h>
#include "main.h"
#define TMP_BUF_SIZE ((uint32_t)512)
static uint8_t buf[TMP_BUF_SIZE];
const uint8_t TEST_auth0Command[] = {0x41, 0x1, 0x0, 0x42, 0x1, 0x1, 0x5c, 0x2, 0x1, 0x0, 0x87, 0x41, 0x4, 0x96, 0x96, 0xaf, 0xe3, 0x3d, 0xe5, 0x8b, 0x7d, 0x32, 0x53, 0xd1, 0xcb, 0xa8, 0x6d, 0x14, 0x14, 0x7c, 0x16, 0xd4, 0x55, 0xe8, 0xa2, 0x73, 0x73, 0xb3, 0x8d, 0x45, 0x4a, 0xf2, 0x1b, 0x70, 0xe7, 0x5e, 0x13, 0xeb, 0xc6, 0xd5, 0x57, 0x43, 0xba, 0x6a, 0x6f, 0xfc, 0x4e, 0xd3, 0x7a, 0x55, 0x51, 0x5a, 0x93, 0x46, 0xfd, 0xae, 0x31, 0x1f, 0x60, 0xbe, 0x30, 0x42, 0x1f, 0xa6, 0xdc, 0x61, 0xc5, 0x4c, 0x10, 0x41, 0x65, 0xa8, 0x36, 0x67, 0xad, 0xa, 0xf5, 0xab, 0x11, 0x52, 0x47, 0x42, 0x48, 0x22, 0xe0, 0x4d, 0x20, 0x0, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee,
0xff, 0xff, 0xee, 0xdd, 0xcc, 0xbb, 0xaa, 0x99, 0x88, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11, 0x0, 0x0};
const uint8_t TEST_auth0Response[] = { 0x86, 0x41, 0x4, 0x5d, 0x75, 0xab, 0x60, 0x13, 0x6a, 0x2c, 0x54, 0xff, 0x27, 0xb7, 0x99, 0xee, 0x15, 0x7f, 0x3f, 0x33, 0x29, 0x43, 0x5c, 0xd, 0xf6, 0x8, 0xde, 0x90, 0x4c, 0x92, 0xa, 0xc2, 0x9f, 0x72, 0xbd, 0x42, 0x74, 0xc2, 0xed, 0xc8, 0x10, 0xa9, 0x3e, 0x24, 0xb, 0xf5, 0xd6, 0x39, 0x4a, 0x92, 0xc9, 0x76, 0x6b, 0x69, 0xb, 0x2b, 0xf5, 0x12, 0x8a, 0xe7, 0xd, 0x6e, 0x29, 0x25, 0x7e, 0xa7, 0x86, 0x90, 0x0};
const uint8_t TEST_auth1CommandWithoutSignature[] = { 0x41, 0x1, 0x1, 0x9e, 0x40};
const uint8_t TEST_auth1Response[] = { 0xca, 0xae, 0x47, 0x70, 0x21, 0x7a, 0xe5, 0x1f, 0xb1, 0x23, 0x3d, 0x35, 0xdf, 0x9f, 0xe1, 0x33, 0x25, 0x44, 0xab, 0xa2, 0x53, 0xb1, 0x38, 0x8f, 0x42, 0x2b, 0x72, 0xd,
0x54, 0x6f, 0x82, 0x8f, 0xcb, 0x85, 0xb3, 0xda, 0x5b, 0x27, 0xf9, 0x15, 0x70, 0xd9, 0x9b, 0xa2, 0xb0, 0x5c, 0x6c, 0x53, 0x70, 0x64, 0xc2, 0xc5, 0x7f, 0xc0, 0x6, 0xa6, 0x82, 0x50, 0xc7, 0x9a, 0x26, 0xd, 0xcd, 0xa8, 0xd, 0x9a, 0xba, 0x17, 0x25, 0x3b, 0xc1, 0xf5, 0x18, 0x51, 0xfd, 0xa5, 0x8f, 0x8e, 0xf7, 0xb, 0x27, 0x96, 0x53, 0x77, 0x2a, 0x2b, 0x2a, 0xb, 0xab, 0x4f, 0xc5, 0x33, 0xd6, 0xd0, 0x35, 0x99, 0x59, 0xc9, 0x94, 0x20, 0xa1, 0x27, 0xf8, 0xb, 0x89, 0x19, 0x8a, 0x3b, 0x4, 0x51, 0x9, 0xec, 0xfe, 0x70, 0x4d, 0x0, 0x7d, 0x45, 0xf2, 0x65,
0x70, 0x3c, 0xde, 0xe7, 0x49, 0x57, 0x18, 0x22, 0x1, 0x64, 0x58, 0xea, 0x1c, 0x7a, 0xf3, 0x3a, 0x63, 0x93, 0xdd, 0x1b, 0x10, 0x6f, 0x5e, 0x1a, 0x29, 0xfd, 0xc, 0x3e, 0xbd, 0x36, 0xde, 0x4e};
uint32_t ACWG_Security_Test(void)
{
ACWG_Status_t ret = ACWG_Error;
ACWG_SessionContextInit_t init = {
.isFast = 0,
.transCode = 1, // Unlock
.readerID = {0x0, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff,
0xff, 0xee, 0xdd, 0xcc, 0xbb, 0xaa, 0x99, 0x88, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11, 0x0},
};
ACWG_SessionContext_t context = {
.init = init
};
uint32_t size = TMP_BUF_SIZE;
ret = ACWG_initSessionContext(&context);
if (ret != ACWG_OK)
return 1;
DBG_PRINTF("ACWG_generateAUTH0CommandPayload()\r\n");
ret = ACWG_generateAUTH0CommandPayload(&context, buf, &size);
if (ret != ACWG_OK)
return 1;
DBG_PRINTF("ACWG_generateAUTH0CommandPayload() - OK\r\n");
DBG_PRINTF("Generated AUTH0CommandPayload is:\r\n");
DBG_PRINTF_HEX(buf, sizeof(buf));
DBG_PRINTF("\r\n");
#ifdef TEST
if (memcmp(TEST_auth0Command, buf, sizeof(TEST_auth0Command)))
return 1;
DBG_PRINTF("Generated auth0Command TEST OK\r\n");
#endif // TEST
size = sizeof(TEST_auth0Response);
memcpy(buf, TEST_auth0Response, size);
DBG_PRINTF("ACWG_processAUTH0ResponsePayload()\r\n");
ret = ACWG_processAUTH0ResponsePayload(&context, buf, size);
if (ret != ACWG_OK)
return 1;
DBG_PRINTF("ACWG_processAUTH0ResponsePayload() - OK\r\n");
DBG_PRINTF("ACWG_generateAUTH1CommandPayload()\r\n");
size = TMP_BUF_SIZE;
ret = ACWG_generateAUTH1CommandPayload(&context, buf, &size);
if (ret != ACWG_OK)
return 1;
DBG_PRINTF("ACWG_generateAUTH1CommandPayload() - OK\r\n");
DBG_PRINTF("Generated AUTH1CommandPayload is:\r\n");
DBG_PRINTF_HEX(buf, sizeof(buf));
DBG_PRINTF("\r\n");
#ifdef TEST
if (memcmp(TEST_auth1CommandWithoutSignature, buf, sizeof(TEST_auth1CommandWithoutSignature)))
return 1;
DBG_PRINTF("Generated auth1Command TEST OK\r\n");
#endif // TEST
size = sizeof(TEST_auth1Response);
memcpy(buf, TEST_auth1Response, size);
DBG_PRINTF("ACWG_processAUTH1ResponsePayload()\r\n");
ret = ACWG_processAUTH1ResponsePayload(&context, buf, size);
if (ret != ACWG_OK)
return 1;
DBG_PRINTF("ACWG_processAUTH1ResponsePayload() - OK\r\n");
return 0;
}

View File

@@ -0,0 +1,3 @@
#Ignore modules added by the repo script
utilities
thread/openthread/stack

View File

@@ -0,0 +1,119 @@
## Overview
This Software Bill Of Material (SBOM) lists the software components of this
software package, including the copyright owner and license terms for each
component.
__SOFTWARE BILL OF MATERIALS__
Component | Copyright | License
--------- | ----------------------------------------------------------------- | -------
Bluetooth Low Energy | STMicroelectronics | SLA
Linklayer | Synopsys, Inc, STMicroelectronics | SLA
MAC | Synopsys, Inc, STMicroelectronics | SLA
OpenThread stack | The OpenThread Authors | BSD-3-Clause
Zigbee | Exegin Technologies Limited, STMicroelectronics, Dr Brian Gladman | SLA
__Notes:__ If the license is an open source license, then you can access the
terms at [www.opensource.org](https://opensource.org/). Otherwise, the full
license terms are below. If a component is not listed in the SBOM, then the SLA
shall apply unless other terms are clearly stated in the package.
This software component is provided to you as part of a software package and
applicable license terms are in the Package_license file. If you received this
software component outside of a package or without applicable license terms,
the terms of the SLA0044 license shall apply and are fully reproduced below:
SLA0044 Rev6/October 2025
## Software license agreement
### __ULTIMATE LIBERTY SOFTWARE LICENSE AGREEMENT__
BY CLICKING ON THE "I ACCEPT" BUTTON OR BY UNZIPPING, INSTALLING, COPYING,
DOWNLOADING, ACCESSING OR OTHERWISE USING THIS SOFTWARE OR ANY PART THEREOF,
INCLUDING ANY RELATED DOCUMENTATION (collectively the “SOFTWARE”)
FROM STMICROELECTRONICS INTERNATIONAL N.V, SWISS BRANCH AND/OR
ITS AFFILIATED COMPANIES (collectively “STMICROELECTRONICS”),
YOU (hereinafter referred also to as “THE RECIPIENT”), ON BEHALF OF YOURSELF,
OR ON BEHALF OF ANY ENTITY BY WHICH YOU ARE EMPLOYED AND/OR ENGAGED,
AGREE TO BE BOUND BY THIS AGREEMENT.
Under STMICROELECTRONICS intellectual property rights, the redistribution,
reproduction and use in source and binary forms of the SOFTWARE or any part
thereof, with or without modification, are permitted provided that the following
conditions are met:
1. Redistribution of source code (modified or not) must retain any copyright
notice accompanying the SOFTWARE, this list of conditions and the disclaimer below.
2. Redistributions in binary form, except as embedded into a processing unit device
manufactured by or for STMicroelectronics or a software update for any such device,
must reproduce the accompanying copyright notice, this list of conditions,
and the below disclaimer in capital type, in the documentation and/or
other materials provided with the distribution.
3. Neither the name of STMicroelectronics nor the names of other contributors
to the SOFTWARE may be used to endorse or promote products derived
from the SOFTWARE or part thereof without specific written permission.
4. The SOFTWARE or any part thereof, including modifications and/or
derivative works of the SOFTWARE, must be used and execute solely
and exclusively on or in combination with a processing unit device
manufactured by or for STMicroelectronics.
5. No use, reproduction or redistribution of the SOFTWARE partially
or totally may be done in any manner that would subject the SOFTWARE
to any Open Source Terms. “Open Source Terms” shall mean
any open source license which requires as part of distribution
of software that the source code of such software is distributed
therewith or otherwise made available, or open source license
that substantially complies with the Open Source definition specified
at www.opensource.org and any other comparable open source license
such as for example GNU General Public License (GPL),
Eclipse Public License (EPL), Apache Software License, BSD license
or MIT license.
6. STMicroelectronics has no obligation to provide any maintenance,
support or updates for the SOFTWARE.
7. The SOFTWARE is and will remain the exclusive property of
STMicroelectronics and its licensors. The RECIPIENT will not take
any action that jeopardizes STMicroelectronics and its
licensors' proprietary rights or acquire any rights in the SOFTWARE,
except the limited rights specified hereunder.
8. The RECIPIENT shall comply with all applicable laws and regulations
affecting the use of the SOFTWARE or any part thereof including
any applicable export control law or regulation.
9. Redistribution and use of the SOFTWARE or any part thereof other
than as permitted under this AGREEMENT is void and will automatically
terminate RECIPIENTs rights under this AGREEMENT.
10. The RECIPIENT shall be solely liable to determine and verify that
the SOFTWARE is fit for the RECIPIENT intended use, environment or
application and comply with all regulatory, safety and security
related requirements concerning any use.
DISCLAIMER:
THE SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING,BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY RIGHTS, ARE
DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW.
IN NO EVENT SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
EXCEPT AS EXPRESSLY PERMITTED HEREUNDER, NO LICENSE OR OTHER RIGHTS,
WHETHER EXPRESS OR IMPLIED, ARE GRANTED UNDER ANY PATENT OR OTHER INTELLECTUAL
PROPERTY RIGHTS OF STMICROELECTRONICS OR ANY THIRD PARTY.

View File

@@ -0,0 +1,122 @@
###################
Overview
###################
This Software Bill Of Material (SBOM) lists the sub-modules of STM32WPAN software component,
including the copyright owner and license terms for each sub-module.
__SOFTWARE BILL OF MATERIALS__
< Component | Copyright | License >
< --------- | ----------------------------------------------------------------- | ------- >
< Bluetooth Low Energy | STMicroelectronics | SLA >
< Linklayer | Synopsys, Inc, STMicroelectronics | SLA >
< MAC | Synopsys, Inc, STMicroelectronics | SLA >
< OpenThread stack | The OpenThread Authors | BSD-3-Clause >
< Zigbee | Exegin Technologies Limited, STMicroelectronics, Dr Brian Gladman | SLA >
__Notes:__ If the license is an open source license, then you can access the
terms at [www.opensource.org](https://opensource.org/). Otherwise, the full
license terms are below. If a component is not listed in the SBOM, then the SLA
shall apply unless other terms are clearly stated in the package.
################################################
__SLA Software License Agreement__
################################################
This software component is provided to you as part of a software package and
applicable license terms are in the Package_license file. If you received this
software component outside of a package or without applicable license terms,
the terms of the SLA0044 license shall apply and are fully reproduced below:
SLA0044 Rev6/October 2025
Software license agreement
ULTIMATE LIBERTY SOFTWARE LICENSE AGREEMENT
BY CLICKING ON THE "I ACCEPT" BUTTON OR BY UNZIPPING, INSTALLING, COPYING,
DOWNLOADING, ACCESSING OR OTHERWISE USING THIS SOFTWARE OR ANY PART THEREOF,
INCLUDING ANY RELATED DOCUMENTATION (collectively the “SOFTWARE”)
FROM STMICROELECTRONICS INTERNATIONAL N.V, SWISS BRANCH AND/OR
ITS AFFILIATED COMPANIES (collectively “STMICROELECTRONICS”),
YOU (hereinafter referred also to as “THE RECIPIENT”), ON BEHALF OF YOURSELF,
OR ON BEHALF OF ANY ENTITY BY WHICH YOU ARE EMPLOYED AND/OR ENGAGED,
AGREE TO BE BOUND BY THIS AGREEMENT.
Under STMICROELECTRONICS intellectual property rights, the redistribution,
reproduction and use in source and binary forms of the SOFTWARE or any part
thereof, with or without modification, are permitted provided that the following
conditions are met:
1. Redistribution of source code (modified or not) must retain any copyright
notice accompanying the SOFTWARE, this list of conditions and the disclaimer below.
2. Redistributions in binary form, except as embedded into a processing unit device
manufactured by or for STMicroelectronics or a software update for any such device,
must reproduce the accompanying copyright notice, this list of conditions,
and the below disclaimer in capital type, in the documentation and/or
other materials provided with the distribution.
3. Neither the name of STMicroelectronics nor the names of other contributors
to the SOFTWARE may be used to endorse or promote products derived
from the SOFTWARE or part thereof without specific written permission.
4. The SOFTWARE or any part thereof, including modifications and/or
derivative works of the SOFTWARE, must be used and execute solely
and exclusively on or in combination with a processing unit device
manufactured by or for STMicroelectronics.
5. No use, reproduction or redistribution of the SOFTWARE partially
or totally may be done in any manner that would subject the SOFTWARE
to any Open Source Terms. “Open Source Terms” shall mean
any open source license which requires as part of distribution
of software that the source code of such software is distributed
therewith or otherwise made available, or open source license
that substantially complies with the Open Source definition specified
at www.opensource.org and any other comparable open source license
such as for example GNU General Public License (GPL),
Eclipse Public License (EPL), Apache Software License, BSD license
or MIT license.
6. STMicroelectronics has no obligation to provide any maintenance,
support or updates for the SOFTWARE.
7. The SOFTWARE is and will remain the exclusive property of
STMicroelectronics and its licensors. The RECIPIENT will not take
any action that jeopardizes STMicroelectronics and its
licensors' proprietary rights or acquire any rights in the SOFTWARE,
except the limited rights specified hereunder.
8. The RECIPIENT shall comply with all applicable laws and regulations
affecting the use of the SOFTWARE or any part thereof including
any applicable export control law or regulation.
9. Redistribution and use of the SOFTWARE or any part thereof other
than as permitted under this AGREEMENT is void and will automatically
terminate RECIPIENTs rights under this AGREEMENT.
10. The RECIPIENT shall be solely liable to determine and verify that
the SOFTWARE is fit for the RECIPIENT intended use, environment or
application and comply with all regulatory, safety and security
related requirements concerning any use.
DISCLAIMER:
THE SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING,BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY RIGHTS, ARE
DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW.
IN NO EVENT SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
EXCEPT AS EXPRESSLY PERMITTED HEREUNDER, NO LICENSE OR OTHER RIGHTS,
WHETHER EXPRESS OR IMPLIED, ARE GRANTED UNDER ANY PATENT OR OTHER INTELLECTUAL
PROPERTY RIGHTS OF STMICROELECTRONICS OR ANY THIRD PARTY.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200"><g fill="#13254a"><path d="M100 .212C44.868.212 0 44.889 0 99.788c0 55.132 44.868 100 100 100s100-44.868 100-100C200 44.889 155.132.212 100 .212zm0 181.164c-44.974 0-81.587-36.614-81.587-81.587 0-44.762 36.614-81.164 81.587-81.164 44.995 0 81.587 36.402 81.587 81.164 0 44.973-36.592 81.587-81.587 81.587z" style="fill: #e6007e;"/><path d="M141.1 88.127h-29.439V58.688c0-6.392-5.185-11.598-11.598-11.598-6.413 0-11.619 5.206-11.619 11.598v29.439H58.476c-6.392 0-11.598 5.185-11.598 11.598 0 6.413 5.206 11.619 11.598 11.619h29.968v29.968c0 6.392 5.206 11.598 11.619 11.598 6.413 0 11.598-5.206 11.598-11.598v-29.968H141.1c6.392 0 11.598-5.206 11.598-11.619 0-6.413-5.206-11.598-11.598-11.598z" style="fill: #e6007e;"/></g></svg>

After

Width:  |  Height:  |  Size: 832 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 KiB

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200"><g fill="#03234b"><path d="M170.934 64.569l-.04-.055-29.049 40.038-.057.079h14.867a59.366 59.366 0 0 1-1.488 15.615c-1.158 5.318-3.807 13.448-9.848 21.977-2.766 4.118-6.375 7.726-9.208 10.408-3.426 2.857-7.461 6.095-12 8.376-8.121 4.568-17.881 7.138-28.225 7.432-10.907.248-20.201-2.61-26.072-5.052-8.283-3.479-14.111-7.807-16.85-10.078-1.254-.956-2.25-1.907-3.057-2.676a28.662 28.662 0 0 0-1.157-1.069 158.874 158.874 0 0 0-1.479-1.362l-4.435-3.956 3.569 4.81.183.243c.2.263.548.722 1.048 1.389.276.334.579.747.93 1.226l.008.01c.689.939 1.546 2.107 2.664 3.322 3 3.536 8.178 8.801 15.808 13.801 5.969 3.866 15.672 8.901 28.001 10.935a79.05 79.05 0 0 0 12.485.998c7.97 0 15.651-1.228 22.828-3.649 6.366-1.877 12.192-4.981 17.053-7.771 6.16-3.936 10.817-7.586 14.654-11.488 8.084-7.899 14.884-17.913 19.15-28.199 3.259-7.594 5.456-15.727 6.529-24.175l.055-.425.083-.641H200l-29.066-40.063zM58.159 99.232l-12.655.563c-.097-.881-.159-1.986-.227-3.474a59.184 59.184 0 0 1 1.446-16.56c1.157-5.316 3.804-13.444 9.848-21.977 2.168-3.228 5.009-6.44 9.208-10.415 3.41-2.849 7.432-6.08 12.005-8.375 8.114-4.568 17.87-7.138 28.213-7.432 10.9-.25 20.196 2.607 26.072 5.045 8.258 3.473 14.105 7.812 16.857 10.091 1.257.951 2.253 1.904 3.057 2.673l.017.016c.43.411.801.766 1.136 1.051.475.438.841.777 1.091 1.01l.138.128.248.229 4.04 3.613-3.165-4.456c-.058-.083-.312-.417-.73-.971l-.507-.67a28.922 28.922 0 0 1-.901-1.192l-.02-.027c-.69-.945-1.548-2.121-2.677-3.346-3.002-3.537-8.182-8.803-15.813-13.801-5.964-3.865-15.662-8.9-27.997-10.935-8.484-1.363-21.496-2.009-35.313 2.651-6.355 1.88-12.186 4.983-17.054 7.772-6.163 3.944-10.82 7.595-14.654 11.488-8.079 7.894-14.882 17.909-19.155 28.2-3.268 7.624-5.463 15.757-6.523 24.173-.436 3.281-.642 5.421-.664 6.926L0 101.831l30.683 38.727.042.053 27.38-41.298.054-.081z" style="fill: #e6007e;"/></g></svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 392 KiB

View File

@@ -0,0 +1,139 @@
/*****************************************************************************
* @file ble_gen_aci.h
* @brief STM32WBA BLE API (GEN_ACI)
* Auto-generated file: do not edit!
*****************************************************************************
* @attention
*
* Copyright (c) 2018-2025 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.
*
*****************************************************************************
*/
#ifndef BLE_GEN_ACI_H__
#define BLE_GEN_ACI_H__
#include "auto/ble_types.h"
/**
* @brief ACI_RESET
* This command resets the BLE stack (Host and LE Controller).
*
* @param Mode ACI reset mode.
* Values:
* - 0x00: Reset without BLE stack options change
* - 0x01: Reset with BLE stack option changes
* @param Options New BLE stack options to set at ACI reset (a bit set to 1
* means that the corresponding optional feature is activated).
* Flags:
* - 0x00000001: LL only mode
* - 0x00000002: No service change description
* - 0x00000004: Device Name is read-only
* - 0x00000008: Support of Extended Advertising
* - 0x00000020: Reduced GATT database in NVM
* - 0x00000040: Support of GATT caching
* - 0x00000080: Support of LE Power Class 1 (flag not available in RCP
* mode)
* - 0x00000100: Appearance is writable
* - 0x00000200: Support of Enhanced ATT
* @return Value indicating success or error code.
*/
tBleStatus aci_reset( uint8_t Mode,
uint32_t Options );
/**
* @brief ACI_GET_INFORMATION
* This command reads the local ACI information.
*
* @param[out] Version BLE stack version.
* @param[out] Options Current BLE stack options (a bit set to 1 means that the
* corresponding optional feature is activated).
* Flags:
* - 0x00000001: LL only mode
* - 0x00000002: No service change description
* - 0x00000004: Device Name is read-only
* - 0x00000008: Support of Extended Advertising
* - 0x00000020: Reduced GATT database in NVM
* - 0x00000040: Support of GATT caching
* - 0x00000080: Support of LE Power Class 1 (flag not available in RCP
* mode)
* - 0x00000100: Appearance is writable
* - 0x00000200: Support of Enhanced ATT
* @param[out] Debug_Info BLE stack debug information.
* @return Value indicating success or error code.
*/
tBleStatus aci_get_information( uint32_t* Version,
uint32_t* Options,
uint32_t* Debug_Info );
/**
* @brief ACI_WRITE_CONFIG_DATA
* This command writes a value to a configure data structure. It is useful to
* setup directly some parameters for the BLE stack.
* Refer to Annex for details on the different parameters that can be
* configured.
*
* @param Offset Offset of the element in the configuration data structure
* which has to be written.
* Values:
* - 0x00: CONFIG_DATA_PUBLIC_ADDRESS_OFFSET;
* Bluetooth public address; 6 bytes
* - 0x08: CONFIG_DATA_ER_OFFSET;
* Encryption root key; 16 bytes
* - 0x18: CONFIG_DATA_IR_OFFSET;
* Identity root key; 16 bytes
* - 0x2E: CONFIG_DATA_RANDOM_ADDRESS_OFFSET;
* Static Random Address; 6 bytes
* - 0x34: CONFIG_DATA_GAP_ADD_REC_NBR_OFFSET;
* GAP service additional record number; 1 byte
* - 0x35: CONFIG_DATA_SC_KEY_TYPE_OFFSET;
* Secure Connections key type; 1 byte
* - 0xB0: CONFIG_DATA_SMP_MODE_OFFSET;
* SMP mode; 1 byte
* - 0xC2: CONFIG_DATA_LL_RSSI_GOLDEN_RANGE_OFFSET;
* LL RSSI golden range; 2 bytes
* - 0xC4: CONFIG_DATA_LL_RX_ACL_CTRL_OFFSET;
* LL RX ACL control; 2 bytes
* @param Length Length of data to be written
* @param Value Data to be written
* @return Value indicating success or error code.
*/
tBleStatus aci_write_config_data( uint8_t Offset,
uint8_t Length,
const uint8_t* Value );
/**
* @brief ACI_READ_CONFIG_DATA
* This command requests the value in the configure data structure. The number
* of read bytes changes for different Offset.
*
* @param Offset Offset of the element in the configuration data structure
* which has to be read.
* Values:
* - 0x00: CONFIG_DATA_PUBLIC_ADDRESS_OFFSET;
* Bluetooth public address; 6 bytes
* - 0x08: CONFIG_DATA_ER_OFFSET;
* Encryption root key used to derive LTK (legacy) and CSRK; 16 bytes
* - 0x18: CONFIG_DATA_IR_OFFSET
* Identity root key used to derive DHK (legacy) and IRK; 16 bytes
* - 0x2E: CONFIG_DATA_RANDOM_ADDRESS_OFFSET;
* Static Random Address; 6 bytes
* - 0xC2: CONFIG_DATA_LL_RSSI_GOLDEN_RANGE_OFFSET;
* LL RSSI golden range (two 8-bit signed values in dBm - byte #0 is
* the lower value, byte #1 is the upper value); 2 bytes
* @param[out] Data_Length Length of Data in octets
* @param[out] Data Data field associated with Offset parameter
* @return Value indicating success or error code.
*/
tBleStatus aci_read_config_data( uint8_t Offset,
uint8_t* Data_Length,
uint8_t* Data );
#endif /* BLE_GEN_ACI_H__ */

View File

@@ -0,0 +1,352 @@
/*****************************************************************************
* @file ble_hal_aci.h
* @brief STM32WBA BLE API (HAL_ACI)
* Auto-generated file: do not edit!
*****************************************************************************
* @attention
*
* Copyright (c) 2018-2025 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.
*
*****************************************************************************
*/
#ifndef BLE_HAL_ACI_H__
#define BLE_HAL_ACI_H__
#include "auto/ble_types.h"
/**
* @brief ACI_HAL_WRITE_CONFIG_DATA
* This command writes a value to a configure data structure. It is useful to
* setup directly some parameters for the BLE stack.
* Refer to Annex for details on the different parameters that can be
* configured.
* Note: this command is an alias of ACI_WRITE_CONFIG_DATA.
*
* @param Offset Offset of the element in the configuration data structure
* which has to be written.
* Values:
* - 0x00: CONFIG_DATA_PUBLIC_ADDRESS_OFFSET;
* Bluetooth public address; 6 bytes
* - 0x08: CONFIG_DATA_ER_OFFSET;
* Encryption root key; 16 bytes
* - 0x18: CONFIG_DATA_IR_OFFSET;
* Identity root key; 16 bytes
* - 0x2E: CONFIG_DATA_RANDOM_ADDRESS_OFFSET;
* Static Random Address; 6 bytes
* - 0x34: CONFIG_DATA_GAP_ADD_REC_NBR_OFFSET;
* GAP service additional record number; 1 byte
* - 0x35: CONFIG_DATA_SC_KEY_TYPE_OFFSET;
* Secure Connections key type; 1 byte
* - 0xB0: CONFIG_DATA_SMP_MODE_OFFSET;
* SMP mode; 1 byte
* - 0xC2: CONFIG_DATA_LL_RSSI_GOLDEN_RANGE_OFFSET;
* LL RSSI golden range; 2 bytes
* - 0xC4: CONFIG_DATA_LL_RX_ACL_CTRL_OFFSET;
* LL RX ACL control; 2 bytes
* @param Length Length of data to be written
* @param Value Data to be written
* @return Value indicating success or error code.
*/
tBleStatus aci_hal_write_config_data( uint8_t Offset,
uint8_t Length,
const uint8_t* Value );
/**
* @brief ACI_HAL_READ_CONFIG_DATA
* This command requests the value in the configure data structure. The number
* of read bytes changes for different Offset.
* Note: this command is an alias of ACI_READ_CONFIG_DATA.
*
* @param Offset Offset of the element in the configuration data structure
* which has to be read.
* Values:
* - 0x00: CONFIG_DATA_PUBLIC_ADDRESS_OFFSET;
* Bluetooth public address; 6 bytes
* - 0x08: CONFIG_DATA_ER_OFFSET;
* Encryption root key used to derive LTK (legacy) and CSRK; 16 bytes
* - 0x18: CONFIG_DATA_IR_OFFSET
* Identity root key used to derive DHK (legacy) and IRK; 16 bytes
* - 0x2E: CONFIG_DATA_RANDOM_ADDRESS_OFFSET;
* Static Random Address; 6 bytes
* - 0xC2: CONFIG_DATA_LL_RSSI_GOLDEN_RANGE_OFFSET;
* LL RSSI golden range (two 8-bit signed values in dBm - byte #0 is
* the lower value, byte #1 is the upper value); 2 bytes
* @param[out] Data_Length Length of Data in octets
* @param[out] Data Data field associated with Offset parameter
* @return Value indicating success or error code.
*/
tBleStatus aci_hal_read_config_data( uint8_t Offset,
uint8_t* Data_Length,
uint8_t* Data );
/**
* @brief ACI_HAL_SET_TX_POWER_LEVEL
* This command sets the TX power level of the device. By controlling the PA
* level, that determines the output power level (dBm) at the IC pin.
* When the system starts up or reboots, the default TX power level is used,
* which is the maximum value. Once this command is given, the output power
* changes instantly, regardless if there is BLE communication going on or not.
* For example, for debugging purpose, the device can be set to advertise all
* the time. By using this command, one can then observe the evolution of the
* TX signal strength.
* The system keeps the last received TX power level from the command, i.e. the
* 2nd command overwrites the previous TX power level. The new TX power level
* remains until another ACI_HAL_SET_TX_POWER_LEVEL command, or the system
* reboots. However, note that the advertising extensions commands allow, per
* advertising set, to override the value of TX power determined by
* ACI_HAL_SET_TX_POWER_LEVEL command (e.g. see ACI_GAP_ADV_SET_CONFIGURATION).
* Refer to Annex for the dBm corresponding values of PA_Level parameter.
*
* @param En_High_Power Enable High Power mode - Deprecated and ignored
* Values:
* - 0x00: Standard Power
* - 0x01: High Power
* @param PA_Level Power amplifier output level.
* Values:
* - 0x00 ... 0x23
* @return Value indicating success or error code.
*/
tBleStatus aci_hal_set_tx_power_level( uint8_t En_High_Power,
uint8_t PA_Level );
/**
* @brief ACI_HAL_LE_TX_TEST_PACKET_NUMBER
* This command returns the number of packets sent in Direct Test Mode.
* When the Direct TX test is started, a 16-bit counter is used to count how
* many packets have been transmitted.
* This command can be used to check how many packets have been sent during the
* Direct TX test.
* The counter starts from 0 and counts upwards. The counter can wrap and start
* from 0 again. The counter is not cleared until the next Direct TX test
* starts.
*
* @param[out] Number_Of_Packets Number of packets sent during the last Direct
* TX test.
* @return Value indicating success or error code.
*/
tBleStatus aci_hal_le_tx_test_packet_number( uint32_t* Number_Of_Packets );
/**
* @brief ACI_HAL_TONE_START
* This command starts a carrier frequency, i.e. a tone, on a specific channel.
* The frequency sine wave at the specific channel may be used for debugging
* purpose only. The channel ID is a parameter from 0x00 to 0x27 for the 40 BLE
* channels, e.g. 0x00 for 2.402 GHz, 0x01 for 2.404 GHz etc.
* This command should not be used when normal BLE activities are ongoing.
* The tone should be stopped by ACI_HAL_TONE_STOP command.
*
* @param RF_Channel BLE Channel ID, from 0x00 to 0x27 meaning (2.402 +
* 0.002*0xXX) GHz
* Device will continuously emit 0s, that means that the tone will be at
* the channel center frequency minus the maximum frequency deviation
* (250 kHz).
* Values:
* - 0x00 ... 0x27
* @param Freq_offset Frequency Offset for tone channel
* Values:
* - 0x00 ... 0xFF
* @return Value indicating success or error code.
*/
tBleStatus aci_hal_tone_start( uint8_t RF_Channel,
uint8_t Freq_offset );
/**
* @brief ACI_HAL_TONE_STOP
* This command is used to stop the previously started ACI_HAL_TONE_START
* command.
*
* @return Value indicating success or error code.
*/
tBleStatus aci_hal_tone_stop( void );
/**
* @brief ACI_HAL_SET_RADIO_ACTIVITY_MASK
* This command set the bitmask associated to
* ACI_HAL_END_OF_RADIO_ACTIVITY_EVENT.
* Only the radio activities enabled in the mask will be reported to
* application by ACI_HAL_END_OF_RADIO_ACTIVITY_EVENT
*
* @param Radio_Activity_Mask Bitmask of radio events
* Flags:
* - 0x0001: Idle
* - 0x0002: Advertising
* - 0x0004: Peripheral connection
* - 0x0008: Scanning
* - 0x0020: Central connection
* - 0x0040: TX test mode
* - 0x0080: RX test mode
* - 0x0200: Periodic advertising
* - 0x0400: Periodic sync
* - 0x0800: Iso broadcast
* - 0x1000: Iso sync
* - 0x2000: Iso peripheral connection
* - 0x4000: Iso central connection
* @return Value indicating success or error code.
*/
tBleStatus aci_hal_set_radio_activity_mask( uint16_t Radio_Activity_Mask );
/**
* @brief ACI_HAL_SET_EVENT_MASK
* This command is used to enable/disable the generation of HAL events. If the
* bit in the Event_Mask is set to a one, then the event associated with that
* bit will be enabled.
*
* @param Event_Mask ACI HAL event mask. Default: 0x00000000.
* Flags:
* - 0x00000000: No events specified (Default)
* - 0x00000002: ACI_HAL_SYNC_EVENT
* @return Value indicating success or error code.
*/
tBleStatus aci_hal_set_event_mask( uint32_t Event_Mask );
/**
* @brief ACI_HAL_GET_LINK_STATUS_V2
* This command returns the status of the BLE links managed by the device.
*
* @param[out] Link_Status Array of link status (up to 20 links plus 2 ISO
* streams). Each link status is 1 byte.
* Values:
* - 0x00: Idle
* - 0x01: Advertising
* - 0x02: Peripheral connection
* - 0x03: Scanning
* - 0x05: Central connection
* - 0x06: TX test mode
* - 0x07: RX test mode
* - 0x09: Periodic advertising
* - 0x0A: Periodic sync
* - 0x0B: Iso broadcast
* - 0x0C: Iso sync
* - 0x0D: Iso peripheral connection
* - 0x0E: Iso central connection
* @param[out] Link_Connection_Handle Array of connection handles (2 bytes).
* Valid only if the corresponding link status is "connected"
* @return Value indicating success or error code.
*/
tBleStatus aci_hal_get_link_status_v2( uint8_t* Link_Status,
uint16_t* Link_Connection_Handle );
/**
* @brief ACI_HAL_SET_PERIPHERAL_LATENCY
* This command is used to disable/enable the Peripheral latency feature during
* a connection. Note that, by default, the Peripheral latency is enabled at
* connection time.
*
* @param Enable Enable/disable Peripheral latency.
* Values:
* - 0x00: Peripheral latency is disabled
* - 0x01: Peripheral latency is enabled
* @return Value indicating success or error code.
*/
tBleStatus aci_hal_set_peripheral_latency( uint8_t Enable );
/**
* @brief ACI_HAL_SET_SYNC_EVENT_CONFIG
* This command is used to configure ACI_HAL_SYNC_EVENT.
*
* @param Group_Id Identifier of the CIG or BIG.
* Values:
* - 0x00 ... 0xEF
* @param Enable_Sync Enable or disable generation of sync event.
* Values:
* - 0x00 ... 0x01
* @param Enable_Cb_Trigger Enable or disable generation of calibration signal.
* Values:
* - 0x00 ... 0x01
* @param Trigger_Source Identify trigger source (CIG or BIG).
* Values:
* - 0x00: CIG
* - 0x01: BIG
* @return Value indicating success or error code.
*/
tBleStatus aci_hal_set_sync_event_config( uint8_t Group_Id,
uint8_t Enable_Sync,
uint8_t Enable_Cb_Trigger,
uint8_t Trigger_Source );
/**
* @brief ACI_HAL_READ_RSSI
* This command returns the value of the RSSI.
* Note: in Direct Test Mode, the RSSI can only be read when the test has ended
* (after LE Test End command).
*
* @param[out] RSSI RSSI (signed integer).
* Units: dBm.
* Values:
* - 127: RSSI not available
* - -127 ... 20
* @return Value indicating success or error code.
*/
tBleStatus aci_hal_read_rssi( uint8_t* RSSI );
/**
* @brief ACI_HAL_CONTINUOUS_TX_START
* This command starts the continuous transmit test mode.
*
* @param RF_Channel Index of the BLE RF channel used for test mode.
* Values:
* - 0x00 ... 0x27
* @param PHY PHY used for test mode.
* Values:
* - 0x01: LE 1M PHY
* - 0x02: LE 2M PHY
* @param Pattern Data pattern used for test mode.
* Values:
* - 0x00: Pseudo-Random bit sequence 9
* - 0x01: Pattern of alternating bits '11110000'
* - 0x02: Pattern of alternating bits '10101010'
* - 0x03: Pseudo-Random bit sequence 15
* - 0x04: Pattern of All '1' bits
* - 0x05: Pattern of All '0' bits
* - 0x06: Pattern of alternating bits '00001111'
* - 0x07: Pattern of alternating bits '0101'
* @return Value indicating success or error code.
*/
tBleStatus aci_hal_continuous_tx_start( uint8_t RF_Channel,
uint8_t PHY,
uint8_t Pattern );
/**
* @brief ACI_HAL_EAD_ENCRYPT_DECRYPT
* This command encrypts or decrypts data following the Encrypted Advertising
* Data scheme.
* When encryption mode is selected, In_Data shall only contain the Payload
* field to encrypt. The command adds the Randomizer and MIC fields in the
* result. The result data length (Out_Data_Length) is equal to the input
* length plus 9.
* When decryption mode is selected, In_Data shall contain the full Encrypted
* Data (Randomizer + Payload + MIC). The result data length (Out_Data_Length)
* is equal to the input length minus 9.
* If the decryption fails, the returned status is BLE_STATUS_FAILED, otherwise
* it is BLE_STATUS_SUCCESS.
*
* @param Mode EAD operation mode: encryption or decryption.
* Values:
* - 0x00: Encryption
* - 0x01: Decryption
* @param Key Session key used for EAD operation (in Little Endian format).
* @param IV Initialization vector used for EAD operation (in Little Endian
* format).
* @param In_Data_Length Length of input data
* @param In_Data Input data
* @param[out] Out_Data_Length Length of result data
* @param[out] Out_Data Result data
* @return Value indicating success or error code.
*/
tBleStatus aci_hal_ead_encrypt_decrypt( uint8_t Mode,
const uint8_t* Key,
const uint8_t* IV,
uint16_t In_Data_Length,
const uint8_t* In_Data,
uint16_t* Out_Data_Length,
uint8_t* Out_Data );
#endif /* BLE_HAL_ACI_H__ */

View File

@@ -0,0 +1,304 @@
/*****************************************************************************
* @file ble_l2cap_aci.h
* @brief STM32WBA BLE API (L2CAP_ACI)
* Auto-generated file: do not edit!
*****************************************************************************
* @attention
*
* Copyright (c) 2018-2025 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.
*
*****************************************************************************
*/
#ifndef BLE_L2CAP_ACI_H__
#define BLE_L2CAP_ACI_H__
#include "auto/ble_types.h"
/**
* @brief ACI_L2CAP_CONNECTION_PARAMETER_UPDATE_REQ
* Sends an L2CAP connection parameter update request from the Peripheral to
* the Central.
* An ACI_L2CAP_CONNECTION_UPDATE_RESP_EVENT event is raised when the Central
* responds to the request (accepts or rejects).
*
* @param Connection_Handle Connection handle for which the command applies.
* Values:
* - 0x0000 ... 0x0EFF
* @param Conn_Interval_Min Minimum value for the connection event interval.
* Time = N * 1.25 ms.
* Values:
* - 0x0006 (7.50 ms) ... 0x0C80 (4000.00 ms)
* @param Conn_Interval_Max Maximum value for the connection event interval.
* Time = N * 1.25 ms.
* Values:
* - 0x0006 (7.50 ms) ... 0x0C80 (4000.00 ms)
* @param Latency Maximum Peripheral latency for the connection in number of
* connection events.
* Values:
* - 0x0000 ... 0x01F3
* @param Timeout_Multiplier Defines connection timeout parameter in the
* following manner: Timeout Multiplier * 10ms.
* @return Value indicating success or error code.
*/
tBleStatus aci_l2cap_connection_parameter_update_req( uint16_t Connection_Handle,
uint16_t Conn_Interval_Min,
uint16_t Conn_Interval_Max,
uint16_t Latency,
uint16_t Timeout_Multiplier );
/**
* @brief ACI_L2CAP_CONNECTION_PARAMETER_UPDATE_RESP
* Accepts or rejects a connection update. This command should be sent in
* response to an ACI_L2CAP_CONNECTION_UPDATE_REQ_EVENT event from the
* controller. The accept parameter has to be set if the connection parameters
* given in the event are acceptable.
*
* @param Connection_Handle Connection handle for which the command applies.
* Values:
* - 0x0000 ... 0x0EFF
* @param Conn_Interval_Min Minimum value for the connection event interval.
* Time = N * 1.25 ms.
* Values:
* - 0x0006 (7.50 ms) ... 0x0C80 (4000.00 ms)
* @param Conn_Interval_Max Maximum value for the connection event interval.
* Time = N * 1.25 ms.
* Values:
* - 0x0006 (7.50 ms) ... 0x0C80 (4000.00 ms)
* @param Latency Maximum Peripheral latency for the connection in number of
* connection events.
* Values:
* - 0x0000 ... 0x01F3
* @param Timeout_Multiplier Defines connection timeout parameter in the
* following manner: Timeout Multiplier * 10ms.
* @param Minimum_CE_Length Information parameter about the minimum length of
* connection needed for this LE connection.
* Time = N * 0.625 ms.
* Values:
* - 0x0000 (0.000 ms) ... 0xFFFF (40959.375 ms)
* @param Maximum_CE_Length Information parameter about the maximum length of
* connection needed for this LE connection.
* Time = N * 0.625 ms.
* Values:
* - 0x0000 (0.000 ms) ... 0xFFFF (40959.375 ms)
* @param Identifier Received identifier.
* @param Accept Specify if connection update parameters are acceptable or not.
* Values:
* - 0x00: Reject
* - 0x01: Accept
* @return Value indicating success or error code.
*/
tBleStatus aci_l2cap_connection_parameter_update_resp( uint16_t Connection_Handle,
uint16_t Conn_Interval_Min,
uint16_t Conn_Interval_Max,
uint16_t Latency,
uint16_t Timeout_Multiplier,
uint16_t Minimum_CE_Length,
uint16_t Maximum_CE_Length,
uint8_t Identifier,
uint8_t Accept );
/**
* @brief ACI_L2CAP_COC_CONNECT
* This command sends a Credit Based Connection Request packet on the specified
* connection. See Core Specification [Vol 3, Part A].
*
* @param Connection_Handle Connection handle for which the command applies.
* Values:
* - 0x0000 ... 0x0EFF
* @param SPSM Simplified Protocol/Service Multiplexer.
* Values:
* - 0x0001 ... 0x00FF
* @param MTU Maximum Transmission Unit.
* Values:
* - 23 ... 65535
* - 64 ... 246: for Enhanced ATT
* @param MPS Maximum payload size (in octets).
* Values:
* - 23 ... 248
* - 64 ... 248: for Enhanced ATT
* @param Initial_Credits Number of K-frames that can be received on the
* created channel(s) by the L2CAP layer entity sending this packet.
* Values:
* - 0 ... 65535
* @param Channel_Number Number of channels to be created. If this parameter is
* set to 0, it requests the creation of one LE credit based connection-
* oriented channel. Otherwise, it requests the creation of one or more
* enhanced credit based connection-oriented channels.
* Values:
* - 0 ... 5
* @return Value indicating success or error code.
*/
tBleStatus aci_l2cap_coc_connect( uint16_t Connection_Handle,
uint16_t SPSM,
uint16_t MTU,
uint16_t MPS,
uint16_t Initial_Credits,
uint8_t Channel_Number );
/**
* @brief ACI_L2CAP_COC_CONNECT_CONFIRM
* This command sends a Credit Based Connection Response packet. It must be
* used upon receipt of a connection request through an
* ACI_L2CAP_COC_CONNECT_EVENT event.
* By setting the Result parameter to 0x0000, the application can accept all
* connections or only some. In this case, the number of accepted connections
* depends on the Max_Channel_Number parameter. Note that if some connections
* are refused, the Result parameter is automatically modified by the BLE
* stack.
* By setting the Result parameter to a non-zero value, the application can
* refuse all connections. The Result value shall then be one of the
* "Connection refused" or "All connections refused" values.
* See Core Specification [Vol 3, Part A].
*
* @param Connection_Handle Connection handle for which the command applies.
* Values:
* - 0x0000 ... 0x0EFF
* @param MTU Maximum Transmission Unit.
* Values:
* - 23 ... 65535
* - 64 ... 246: for Enhanced ATT
* @param MPS Maximum payload size (in octets).
* Values:
* - 23 ... 248
* - 64 ... 248: for Enhanced ATT
* @param Initial_Credits Number of K-frames that can be received on the
* created channel(s) by the L2CAP layer entity sending this packet.
* Values:
* - 0 ... 65535
* @param Result Indicates the outcome of the request. See Core Specification
* [Vol 3, Part A, Table 4.16] for LE credit based connection-oriented
* channels, or [Vol 3, Part A, Table 4.17] for enhanced credit based
* connection-oriented channels.
* Values:
* - 0x0000 ... 0x000F
* @param Max_Channel_Number Indicates the maximum number of channels that can
* be created.
* Values:
* - 0x01 ... 0x05
* @param[out] Channel_Number Number of created channels. It is the length of
* Channel_Index_List.
* Values:
* - 0 ... 5
* @param[out] Channel_Index_List List of channel indexes for which the
* primitive applies.
* @return Value indicating success or error code.
*/
tBleStatus aci_l2cap_coc_connect_confirm( uint16_t Connection_Handle,
uint16_t MTU,
uint16_t MPS,
uint16_t Initial_Credits,
uint16_t Result,
uint8_t Max_Channel_Number,
uint8_t* Channel_Number,
uint8_t* Channel_Index_List );
/**
* @brief ACI_L2CAP_COC_RECONF
* This command sends a Credit Based Reconfigure Request packet on the
* specified connection. See Core Specification [Vol 3, Part A].
*
* @param Connection_Handle Connection handle for which the command applies.
* Values:
* - 0x0000 ... 0x0EFF
* @param MTU Maximum Transmission Unit.
* Values:
* - 23 ... 65535
* - 64 ... 246: for Enhanced ATT
* @param MPS Maximum payload size (in octets).
* Values:
* - 23 ... 248
* - 64 ... 248: for Enhanced ATT
* @param Channel_Number Number of created channels. It is the length of
* Channel_Index_List.
* Values:
* - 1 ... 5
* @param Channel_Index_List List of channel indexes for which the primitive
* applies.
* @return Value indicating success or error code.
*/
tBleStatus aci_l2cap_coc_reconf( uint16_t Connection_Handle,
uint16_t MTU,
uint16_t MPS,
uint8_t Channel_Number,
const uint8_t* Channel_Index_List );
/**
* @brief ACI_L2CAP_COC_RECONF_CONFIRM
* This command sends a Credit Based Reconfigure Response packet. It must be
* used upon receipt of a Credit Based Reconfigure Request through an
* ACI_L2CAP_COC_RECONF_EVENT event. A Result value of 0x0000 indicates success
* while a non-zero value indicates the request is refused.
* See Core Specification [Vol 3, Part A].
*
* @param Connection_Handle Connection handle for which the command applies.
* Values:
* - 0x0000 ... 0x0EFF
* @param Result Indicates the outcome of the request. See Core Specification
* [Vol 3, Part A, Table 4.18].
* Values:
* - 0x0000 ... 0x0004
* @return Value indicating success or error code.
*/
tBleStatus aci_l2cap_coc_reconf_confirm( uint16_t Connection_Handle,
uint16_t Result );
/**
* @brief ACI_L2CAP_COC_DISCONNECT
* This command sends a Disconnection Request signaling packet on the specified
* connection-oriented channel. See Core Specification [Vol 3, Part A].
* The ACI_L2CAP_COC_DISCONNECT_EVENT event is received when the disconnection
* of the channel is effective.
*
* @param Channel_Index Index of the connection-oriented channel for which the
* primitive applies.
* @return Value indicating success or error code.
*/
tBleStatus aci_l2cap_coc_disconnect( uint8_t Channel_Index );
/**
* @brief ACI_L2CAP_COC_FLOW_CONTROL
* This command sends a Flow Control Credit signaling packet on the specified
* connection-oriented channel. See Core Specification [Vol 3, Part A].
*
* @param Channel_Index Index of the connection-oriented channel for which the
* primitive applies.
* @param Credits Number of credits the receiving device can increment,
* corresponding to the number of K-frames that can be sent to the peer
* device sending the Flow Control Credit packet.
* Values:
* - 1 ... 65535
* @return Value indicating success or error code.
*/
tBleStatus aci_l2cap_coc_flow_control( uint8_t Channel_Index,
uint16_t Credits );
/**
* @brief ACI_L2CAP_COC_TX_DATA
* This command sends a K-frame packet on the specified connection-oriented
* channel. See Core Specification [Vol 3, Part A].
* Note: for the first K-frame of the SDU, the Information data shall contain
* the L2CAP SDU Length coded on two octets followed by the K-frame information
* payload. For the next K-frames of the SDU, the Information data shall only
* contain the K-frame information payload.
* The Length value must not exceed (BLE_CMD_MAX_PARAM_LEN - 3) i.e. 252 for
* BLE_CMD_MAX_PARAM_LEN default value.
*
* @param Channel_Index Index of the connection-oriented channel for which the
* primitive applies.
* @param Length Length of Data (in octets)
* @param Data Information data
* @return Value indicating success or error code.
*/
tBleStatus aci_l2cap_coc_tx_data( uint8_t Channel_Index,
uint16_t Length,
const uint8_t* Data );
#endif /* BLE_L2CAP_ACI_H__ */

View File

@@ -0,0 +1,200 @@
/*****************************************************************************
* @file ble_vs_codes.h
* @brief STM32WBA BLE API (vendor specific event codes)
* Auto-generated file: do not edit!
*****************************************************************************
* @attention
*
* Copyright (c) 2018-2025 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.
*
*****************************************************************************
*/
#ifndef BLE_VS_CODES_H__
#define BLE_VS_CODES_H__
/* Vendor specific codes of ACI General events
*/
/* ACI_WARNING_EVENT code */
#define ACI_WARNING_VSEVT_CODE 0x0006U
/* Vendor specific codes of ACI GAP events
*/
/* ACI_GAP_LIMITED_DISCOVERABLE_EVENT code */
#define ACI_GAP_LIMITED_DISCOVERABLE_VSEVT_CODE 0x0400U
/* ACI_GAP_PAIRING_COMPLETE_EVENT code */
#define ACI_GAP_PAIRING_COMPLETE_VSEVT_CODE 0x0401U
/* ACI_GAP_PASS_KEY_REQ_EVENT code */
#define ACI_GAP_PASS_KEY_REQ_VSEVT_CODE 0x0402U
/* ACI_GAP_AUTHORIZATION_REQ_EVENT code */
#define ACI_GAP_AUTHORIZATION_REQ_VSEVT_CODE 0x0403U
/* ACI_GAP_BOND_LOST_EVENT code */
#define ACI_GAP_BOND_LOST_VSEVT_CODE 0x0405U
/* ACI_GAP_PROC_COMPLETE_EVENT code */
#define ACI_GAP_PROC_COMPLETE_VSEVT_CODE 0x0407U
/* ACI_GAP_ADDR_NOT_RESOLVED_EVENT code */
#define ACI_GAP_ADDR_NOT_RESOLVED_VSEVT_CODE 0x0408U
/* ACI_GAP_NUMERIC_COMPARISON_VALUE_EVENT code */
#define ACI_GAP_NUMERIC_COMPARISON_VALUE_VSEVT_CODE 0x0409U
/* ACI_GAP_KEYPRESS_NOTIFICATION_EVENT code */
#define ACI_GAP_KEYPRESS_NOTIFICATION_VSEVT_CODE 0x040AU
/* ACI_GAP_PAIRING_REQUEST_EVENT code */
#define ACI_GAP_PAIRING_REQUEST_VSEVT_CODE 0x040BU
/* Vendor specific codes of ACI GATT/ATT events
*/
/* ACI_GATT_ATTRIBUTE_MODIFIED_EVENT code */
#define ACI_GATT_ATTRIBUTE_MODIFIED_VSEVT_CODE 0x0C01U
/* ACI_GATT_PROC_TIMEOUT_EVENT code */
#define ACI_GATT_PROC_TIMEOUT_VSEVT_CODE 0x0C02U
/* ACI_ATT_EXCHANGE_MTU_RESP_EVENT code */
#define ACI_ATT_EXCHANGE_MTU_RESP_VSEVT_CODE 0x0C03U
/* ACI_ATT_FIND_INFO_RESP_EVENT code */
#define ACI_ATT_FIND_INFO_RESP_VSEVT_CODE 0x0C04U
/* ACI_ATT_FIND_BY_TYPE_VALUE_RESP_EVENT code */
#define ACI_ATT_FIND_BY_TYPE_VALUE_RESP_VSEVT_CODE 0x0C05U
/* ACI_ATT_READ_BY_TYPE_RESP_EVENT code */
#define ACI_ATT_READ_BY_TYPE_RESP_VSEVT_CODE 0x0C06U
/* ACI_ATT_READ_RESP_EVENT code */
#define ACI_ATT_READ_RESP_VSEVT_CODE 0x0C07U
/* ACI_ATT_READ_BLOB_RESP_EVENT code */
#define ACI_ATT_READ_BLOB_RESP_VSEVT_CODE 0x0C08U
/* ACI_ATT_READ_MULTIPLE_RESP_EVENT code */
#define ACI_ATT_READ_MULTIPLE_RESP_VSEVT_CODE 0x0C09U
/* ACI_ATT_READ_BY_GROUP_TYPE_RESP_EVENT code */
#define ACI_ATT_READ_BY_GROUP_TYPE_RESP_VSEVT_CODE 0x0C0AU
/* ACI_ATT_PREPARE_WRITE_RESP_EVENT code */
#define ACI_ATT_PREPARE_WRITE_RESP_VSEVT_CODE 0x0C0CU
/* ACI_ATT_EXEC_WRITE_RESP_EVENT code */
#define ACI_ATT_EXEC_WRITE_RESP_VSEVT_CODE 0x0C0DU
/* ACI_GATT_INDICATION_EVENT code */
#define ACI_GATT_INDICATION_VSEVT_CODE 0x0C0EU
/* ACI_GATT_NOTIFICATION_EVENT code */
#define ACI_GATT_NOTIFICATION_VSEVT_CODE 0x0C0FU
/* ACI_GATT_PROC_COMPLETE_EVENT code */
#define ACI_GATT_PROC_COMPLETE_VSEVT_CODE 0x0C10U
/* ACI_GATT_ERROR_RESP_EVENT code */
#define ACI_GATT_ERROR_RESP_VSEVT_CODE 0x0C11U
/* ACI_GATT_DISC_READ_CHAR_BY_UUID_RESP_EVENT code */
#define ACI_GATT_DISC_READ_CHAR_BY_UUID_RESP_VSEVT_CODE 0x0C12U
/* ACI_GATT_WRITE_PERMIT_REQ_EVENT code */
#define ACI_GATT_WRITE_PERMIT_REQ_VSEVT_CODE 0x0C13U
/* ACI_GATT_READ_PERMIT_REQ_EVENT code */
#define ACI_GATT_READ_PERMIT_REQ_VSEVT_CODE 0x0C14U
/* ACI_GATT_READ_MULTI_PERMIT_REQ_EVENT code */
#define ACI_GATT_READ_MULTI_PERMIT_REQ_VSEVT_CODE 0x0C15U
/* ACI_GATT_TX_POOL_AVAILABLE_EVENT code */
#define ACI_GATT_TX_POOL_AVAILABLE_VSEVT_CODE 0x0C16U
/* ACI_GATT_SERVER_CONFIRMATION_EVENT code */
#define ACI_GATT_SERVER_CONFIRMATION_VSEVT_CODE 0x0C17U
/* ACI_GATT_PREPARE_WRITE_PERMIT_REQ_EVENT code */
#define ACI_GATT_PREPARE_WRITE_PERMIT_REQ_VSEVT_CODE 0x0C18U
/* ACI_GATT_EATT_BEARER_EVENT code */
#define ACI_GATT_EATT_BEARER_VSEVT_CODE 0x0C19U
/* ACI_GATT_MULT_NOTIFICATION_EVENT code */
#define ACI_GATT_MULT_NOTIFICATION_VSEVT_CODE 0x0C1AU
/* ACI_GATT_NOTIFICATION_COMPLETE_EVENT code */
#define ACI_GATT_NOTIFICATION_COMPLETE_VSEVT_CODE 0x0C1BU
/* ACI_GATT_READ_EXT_EVENT code */
#define ACI_GATT_READ_EXT_VSEVT_CODE 0x0C1DU
/* ACI_GATT_INDICATION_EXT_EVENT code */
#define ACI_GATT_INDICATION_EXT_VSEVT_CODE 0x0C1EU
/* ACI_GATT_NOTIFICATION_EXT_EVENT code */
#define ACI_GATT_NOTIFICATION_EXT_VSEVT_CODE 0x0C1FU
/* Vendor specific codes of ACI L2CAP events
*/
/* ACI_L2CAP_CONNECTION_UPDATE_RESP_EVENT code */
#define ACI_L2CAP_CONNECTION_UPDATE_RESP_VSEVT_CODE 0x0800U
/* ACI_L2CAP_PROC_TIMEOUT_EVENT code */
#define ACI_L2CAP_PROC_TIMEOUT_VSEVT_CODE 0x0801U
/* ACI_L2CAP_CONNECTION_UPDATE_REQ_EVENT code */
#define ACI_L2CAP_CONNECTION_UPDATE_REQ_VSEVT_CODE 0x0802U
/* ACI_L2CAP_COMMAND_REJECT_EVENT code */
#define ACI_L2CAP_COMMAND_REJECT_VSEVT_CODE 0x080AU
/* ACI_L2CAP_COC_CONNECT_EVENT code */
#define ACI_L2CAP_COC_CONNECT_VSEVT_CODE 0x0810U
/* ACI_L2CAP_COC_CONNECT_CONFIRM_EVENT code */
#define ACI_L2CAP_COC_CONNECT_CONFIRM_VSEVT_CODE 0x0811U
/* ACI_L2CAP_COC_RECONF_EVENT code */
#define ACI_L2CAP_COC_RECONF_VSEVT_CODE 0x0812U
/* ACI_L2CAP_COC_RECONF_CONFIRM_EVENT code */
#define ACI_L2CAP_COC_RECONF_CONFIRM_VSEVT_CODE 0x0813U
/* ACI_L2CAP_COC_DISCONNECT_EVENT code */
#define ACI_L2CAP_COC_DISCONNECT_VSEVT_CODE 0x0814U
/* ACI_L2CAP_COC_FLOW_CONTROL_EVENT code */
#define ACI_L2CAP_COC_FLOW_CONTROL_VSEVT_CODE 0x0815U
/* ACI_L2CAP_COC_RX_DATA_EVENT code */
#define ACI_L2CAP_COC_RX_DATA_VSEVT_CODE 0x0816U
/* ACI_L2CAP_COC_TX_POOL_AVAILABLE_EVENT code */
#define ACI_L2CAP_COC_TX_POOL_AVAILABLE_VSEVT_CODE 0x0817U
/* Vendor specific codes of ACI HAL events
*/
/* ACI_HAL_END_OF_RADIO_ACTIVITY_EVENT code */
#define ACI_HAL_END_OF_RADIO_ACTIVITY_VSEVT_CODE 0x1804U
/* ACI_HAL_SYNC_EVENT code */
#define ACI_HAL_SYNC_VSEVT_CODE 0x1808U
#endif /* BLE_VS_CODES_H__ */

View File

@@ -0,0 +1,168 @@
/*****************************************************************************
* @file ble_bufsize.h
*
* @brief Definition of BLE stack buffers size
*****************************************************************************
* @attention
*
* Copyright (c) 2018-2025 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.
*
*****************************************************************************
*/
#ifndef BLE_BUFSIZE_H__
#define BLE_BUFSIZE_H__
/*
* BLE_DEFAULT_ATT_MTU: minimum MTU value that GATT must support.
*/
#define BLE_DEFAULT_ATT_MTU 23
/*
* BLE_DEFAULT_MAX_ATT_SIZE: maximum attribute size.
*/
#define BLE_DEFAULT_MAX_ATT_SIZE 512
/*
* BLE_PREP_WRITE_X_ATT: compute how many Prepare Write Request are needed to
* write a characteristic with size 'max_att' when the used ATT_MTU value is
* equal to BLE_DEFAULT_ATT_MTU (23).
*/
#define BLE_PREP_WRITE_X_ATT(max_att) \
(DIVC(max_att, BLE_DEFAULT_ATT_MTU - 5) * 2)
/*
* BLE_DEFAULT_PREP_WRITE_LIST_SIZE: default minimum Prepare Write List size.
*/
#define BLE_DEFAULT_PREP_WRITE_LIST_SIZE \
BLE_PREP_WRITE_X_ATT(BLE_DEFAULT_MAX_ATT_SIZE)
/*
* BLE_MEM_BLOCK_X_MTU: compute how many memory blocks are needed to compose
* an ATT packet with ATT_MTU=mtu.
*/
#define BLE_MEM_BLOCK_SIZE 32
#if (BLE_STACK_PERIPHERAL_ONLY || BLE_STACK_BASIC_FEATURES)
#define BLE_MEM_BLOCK_X_PTX(n_link) 0
#else
#define BLE_MEM_BLOCK_X_PTX(n_link) (n_link)
#endif
#define BLE_MEM_BLOCK_X_TX(mtu) \
(DIVC((mtu) + 4U, BLE_MEM_BLOCK_SIZE) + 1)
#define BLE_MEM_BLOCK_X_RX(mtu, n_link) \
((DIVC((mtu) + 4U, BLE_MEM_BLOCK_SIZE) + 2U) * (n_link) + 1)
#define BLE_MEM_BLOCK_X_MTU(mtu, n_link) \
(BLE_MEM_BLOCK_X_TX(mtu) + BLE_MEM_BLOCK_X_PTX(n_link) + \
BLE_MEM_BLOCK_X_RX(mtu, n_link))
/*
* BLE_MBLOCKS_SECURE_CONNECTIONS: minimum number of blocks required for
* secure connections
*/
#define BLE_MBLOCKS_SECURE_CONNECTIONS 4
/*
* BLE_MBLOCKS_CALC: minimum number of buffers needed by the stack.
* This is the minimum racomanded value and depends on:
* - pw: size of Prepare Write List
* - mtu: ATT_MTU size
* - n_link: maximum number of simultaneous connections
*/
#define BLE_MBLOCKS_CALC(pw, mtu, n_link) \
((pw) + MAX(BLE_MEM_BLOCK_X_MTU(mtu, n_link), \
BLE_MBLOCKS_SECURE_CONNECTIONS))
/*
* BLE_FIXED_BUFFER_SIZE_BYTES:
* A part of the RAM, is dynamically allocated by initializing all the pointers
* defined in a global context variable "mem_alloc_ctx_p".
* This initialization is made in the Dynamic_allocator functions, which
* assign a portion of RAM given by the external application to the above
* mentioned "global pointers".
*
* The size of this Dynamic RAM is made of 2 main components:
* - a part that is parameters-dependent (num of links, GATT buffers, ...),
* and which value is made explicit by the following macro;
* - a part, that may be considered "fixed", i.e. independent from the above
* mentioned parameters.
*/
#if (BLE_STACK_PERIPHERAL_ONLY)
#define BLE_FIXED_BUFFER_SIZE_BYTES 4 /* Peripheral Only */
#elif (BLE_STACK_BASIC_FEATURES)
#define BLE_FIXED_BUFFER_SIZE_BYTES 4 /* Basic Features */
#else
#define BLE_FIXED_BUFFER_SIZE_BYTES 272 /* Full stack / AF / Basic Plus */
#endif
/*
* BLE_PER_LINK_SIZE_BYTES: additional memory size used per link
*/
#if (BLE_STACK_PERIPHERAL_ONLY)
#define BLE_PER_LINK_SIZE_BYTES 148 /* Peripheral Only */
#elif (BLE_STACK_BASIC_FEATURES)
#define BLE_PER_LINK_SIZE_BYTES 176 /* Basic Features */
#else
#define BLE_PER_LINK_SIZE_BYTES 192 /* Full stack / AF / Basic Plus */
#endif
/*
* BLE_PER_ADD_BEARER_SIZE_BYTES: additional memory size used per add. bearer
*/
#if (BLE_STACK_PERIPHERAL_ONLY || BLE_STACK_BASIC_FEATURES)
#define BLE_PER_ADD_BEARER_SIZE_BYTES 0 /* Peripheral Only / BF */
#else
#define BLE_PER_ADD_BEARER_SIZE_BYTES 40 /* Full stack / AF / Basic Plus */
#endif
/*
* BLE_TOTAL_BUFFER_SIZE: this macro returns the amount of memory, in bytes,
* needed for the storage of data structures (except GATT database elements)
* whose size depends on the number of supported connections.
*
* @param n_link: Maximum number of simultaneous connections that the device
* will support. Valid values are from 1 to 20.
*
* @param mblocks_count: Number of memory blocks allocated for packets.
*
* @param n_add_bearer: Number of additional EATT bearers
*/
#define BLE_TOTAL_BUFFER_SIZE(n_link, mblocks_count, n_add_bearer) \
(16 + BLE_FIXED_BUFFER_SIZE_BYTES + \
(BLE_PER_LINK_SIZE_BYTES * (n_link)) + \
(BLE_PER_ADD_BEARER_SIZE_BYTES * (n_add_bearer)) + \
((BLE_MEM_BLOCK_SIZE + 8) * (mblocks_count)))
/*
* BLE_TOTAL_BUFFER_SIZE_GATT: this macro returns the amount of memory,
* in bytes, needed for the storage of GATT database elements.
*
* @param num_gatt_attributes: Maximum number of Attributes (i.e. the number
* of characteristic + the number of characteristic values + the number of
* descriptors, excluding the services) that can be stored in the GATT
* database. Note that certain characteristics and relative descriptors are
* added automatically during device initialization so this parameters should
* be 9 plus the number of user Attributes
*
* @param num_gatt_services: Maximum number of Services that can be stored in
* the GATT database. Note that the GAP and GATT services are automatically
* added so this parameter should be 2 plus the number of user services
*
* @param att_value_array_size: Size of the storage area for Attribute values.
*/
#define BLE_TOTAL_BUFFER_SIZE_GATT(num_gatt_attributes, num_gatt_services, att_value_array_size) \
(((((att_value_array_size) - 1) | 3) + 1) + \
(40 * (num_gatt_attributes)) + (48 * (num_gatt_services)))
#endif /* BLE_BUFSIZE_H__ */

View File

@@ -0,0 +1,127 @@
/*****************************************************************************
* @file ble_codec.h
*
* @brief This file contains the interface of the BLE stack regarding audio
* codec.
*****************************************************************************
* @attention
*
* Copyright (c) 2018-2025 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.
*
*****************************************************************************
*/
#ifndef BLE_CODEC_H__
#define BLE_CODEC_H__
#include <stdint.h>
/* Definition of Setup_Iso_Data_Path_Params */
typedef __PACKED_STRUCT hci_le_setup_iso_data_path_params
{
uint8_t Big_Handle;
uint16_t Connection_Handle;
uint8_t Data_Path_Direction;
uint8_t Data_Path_ID;
uint8_t Codec_ID[5];
uint8_t Controller_Delay[3];
uint8_t Codec_Configuration_Length;
uint8_t* pCodec_Configuration;
} hci_le_setup_iso_data_path_params;
/* Audio codec functions called by the BLE stack
*/
uint8_t BLE_CodecInit( void );
uint8_t BLE_ConfigureDataPath( uint8_t data_path_direction,
uint8_t data_pathID,
uint8_t vendor_specific_config_length,
const uint8_t* vendor_specific_config );
uint8_t BLE_ReadLocalSupportedCodecs( uint8_t* num_supported_std_codecs,
uint8_t* std_codec,
uint8_t* num_Supported_vs_Codecs,
uint8_t* vs_Codec );
uint8_t BLE_ReadLocalSupportedCodecCapabilities(
const uint8_t* codecID,
uint8_t logical_transport_type,
uint8_t direction,
uint8_t* num_codec_capabilities,
uint8_t* codec_capability );
uint8_t BLE_ReadLocalSupportedControllerDelay(
const uint8_t* codec_id,
uint8_t logical_transport_type,
uint8_t direction,
uint8_t codec_configuration_length,
const uint8_t* codec_configuration,
uint8_t* min_controller_delay,
uint8_t* max_controller_delay );
uint8_t BLE_SetupIsoDataPath( uint16_t connection_handle,
hci_le_setup_iso_data_path_params*
iso_command_params );
uint8_t BLE_RemoveIsoDataPath( uint16_t connection_handle,
uint8_t direction);
uint8_t BLE_SendIsoDataOutToCodec( uint16_t iso_connection_handle,
uint8_t pb_flag,
uint8_t ts_flag,
uint32_t timestamp,
uint16_t PSN,
uint8_t packet_status_flag,
uint16_t iso_data_load_length,
uint32_t* iso_data );
uint8_t BLE_SendIsoDataInToCodec( uint16_t iso_connection_handle,
uint8_t pb_flag,
uint8_t ts_flag,
uint32_t timestamp,
uint16_t PSN,
uint16_t iso_data_load_length,
uint16_t total_sdu_len,
uint8_t* iso_data );
void BLE_LeSyncEvent( uint8_t group_id,
uint32_t next_anchor_point,
uint32_t time_stamp,
uint32_t next_sdu_delivery_timeout );
void BLE_IsochronousGroupEvent( uint16_t opcode,
uint8_t status,
uint8_t big_handle,
uint8_t cig_id,
uint16_t iso_interval,
uint8_t num_connection_handles,
uint16_t* connection_handle,
uint8_t* transport_latency_C_to_P,
uint8_t* transport_latency_P_to_C );
/* Audio codec functions exported by the BLE stack
*/
uint8_t BLE_SendIsoDataToLinkLayer( uint16_t iso_connection_handle,
uint8_t pb_flag,
uint8_t ts_flag,
uint32_t timestamp,
uint16_t PSN,
uint16_t iso_data_load_length,
uint16_t total_sdu_len,
uint8_t* iso_data );
void BLE_ResendIsoDataOutToCodec( uint16_t iso_connection_handle );
void BLE_CalibrationCallback( uint32_t timestamp );
void BLE_SynchronizationAudioClock( void );
#endif /* BLE_CODEC_H__ */

View File

@@ -0,0 +1,61 @@
/*****************************************************************************
* @file ble_const.h
*
* @brief This file contains the definitions which are compiler dependent.
*****************************************************************************
* @attention
*
* Copyright (c) 2018-2025 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.
*
*****************************************************************************
*/
#ifndef BLE_CONST_H__
#define BLE_CONST_H__
#include <stdint.h>
#include <string.h>
#include "ble_std.h"
#include "ble_defs.h"
/* Default BLE variant
*/
#ifndef BLE_STACK_ADVANCED_FEATURES
#define BLE_STACK_ADVANCED_FEATURES 0
#endif
#ifndef BLE_STACK_BASIC_PLUS
#define BLE_STACK_BASIC_PLUS 0
#endif
#ifndef BLE_STACK_BASIC_FEATURES
#define BLE_STACK_BASIC_FEATURES 0
#endif
#ifndef BLE_STACK_PERIPHERAL_ONLY
#define BLE_STACK_PERIPHERAL_ONLY 0
#endif
#ifndef BLE_STACK_LL_ONLY
#define BLE_STACK_LL_ONLY 0
#endif
/* Defintion to determine BLE Host stack presence */
#define BLE_HOST_PRESENT (!BLE_STACK_LL_ONLY)
/* Defintion to determine if all features are present */
#define BLE_ALL (!(BLE_STACK_ADVANCED_FEATURES || BLE_STACK_BASIC_PLUS || \
BLE_STACK_BASIC_FEATURES || BLE_STACK_PERIPHERAL_ONLY))
/* Maximum parameter size of BLE commands.
*/
#define BLE_CMD_MAX_PARAM_LEN HCI_COMMAND_MAX_PARAM_LEN
/* Maximum parameter size of BLE responses/events.
*/
#define BLE_EVT_MAX_PARAM_LEN HCI_EVENT_MAX_PARAM_LEN
#endif /* BLE_CONST_H__ */

View File

@@ -0,0 +1,43 @@
/*****************************************************************************
* @file ble_core.h
*
* @brief This file contains the definitions for BLE stack
*****************************************************************************
* @attention
*
* Copyright (c) 2018-2025 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.
*
*****************************************************************************
*/
#ifndef BLE_CORE_H__
#define BLE_CORE_H__
/* BLE standard definitions */
#include "ble_std.h"
/* BLE stack API definitions */
#include "ble_defs.h"
#include "auto/ble_vs_codes.h"
#include "auto/ble_gen_aci.h"
#include "auto/ble_gap_aci.h"
#include "auto/ble_gatt_aci.h"
#include "auto/ble_l2cap_aci.h"
#include "auto/ble_hal_aci.h"
#include "auto/ble_hci_le.h"
#include "auto/ble_events.h"
/* BLE stack buffer size definitions */
#include "ble_bufsize.h"
/* BLE stack legacy definitions */
#include "ble_legacy.h"
#endif /* BLE_CORE_H__ */

View File

@@ -0,0 +1,510 @@
/*****************************************************************************
* @file ble_defs.h
*
* @brief This file contains definitions used for BLE Stack interface.
*****************************************************************************
* @attention
*
* Copyright (c) 2018-2025 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.
*
*****************************************************************************
*/
#ifndef BLE_DEFS_H__
#define BLE_DEFS_H__
/* ------------------------------------------------------------------------- */
/* Status codes */
/* Returned when the command has completed with success
*/
#define BLE_STATUS_SUCCESS 0x00U
/* The remote device in in the Blacklist and the pairing operation it requested
* cannot be performed.
*/
#define BLE_STATUS_DEV_IN_BLACKLIST 0x59U
/* CSRK not found during validation of an incoming signed packet
*/
#define BLE_STATUS_CSRK_NOT_FOUND 0x5AU
/* IRK not found (Currently not used)
*/
#define BLE_STATUS_IRK_NOT_FOUND 0x5BU
/* A search for a specific remote device was unsuccessful because no entry
* exists either into NVM Database or in volatile database.
*/
#define BLE_STATUS_DEV_NOT_FOUND 0x5CU
/* The remote device is not bonded, and no operations related to bonded devices
* may be performed (e.g. writing Gatt Client data).
*/
#define BLE_STATUS_DEV_NOT_BONDED 0x5EU
/* The attribute handle is invalid.
*/
#define BLE_STATUS_INVALID_HANDLE 0x60U
/* There aren't sufficient Attributes handles available for allocation during
* creation of Services, Characteristics or Descriptors.
*/
#define BLE_STATUS_OUT_OF_HANDLE 0x61U
/* The requested GATT operation is not allowed in this context/status or using
* the provided parameters.
* This is a specific GATT error, different from generic Not Allowed error,
* because it refers to specific GATT specifications/rules.
*/
#define BLE_STATUS_INVALID_OPERATION 0x62U
/* The requested operation failed for a temporary lack of resources
* (e.g. packet pool or timers), but it may be retried later when resources may
* become available (packets or timers may have been released by other
* consumers).
*/
#define BLE_STATUS_INSUFFICIENT_RESOURCES 0x64U
/* Notification/Indication can't be sent to the requested remote device because
* it doesn't satisfy the needed security permission.
*/
#define BLE_STATUS_SEC_PERMISSION_ERROR 0x65U
/* The address of the device could not be resolved using the IRK stored\n
*/
#define BLE_STATUS_ADDRESS_NOT_RESOLVED 0x70U
/* Returned when no valid slots are available
* (e.g. when there are no available state machines).
*/
#define BLE_STATUS_NO_VALID_SLOT 0x82U
/* The only slot available is not long enough to satisfy scan window request.
*/
#define BLE_STATUS_SCAN_WINDOW_SHORT 0x83U
/* Returned when the maximum requested interval to be allocated is shorter
* then the current anchor period and there is no submultiple for the
* current anchor period that is between the minimum and the maximum requested
* intervals.
*/
#define BLE_STATUS_NEW_INTERVAL_FAILED 0x84U
/* Returned when the maximum requested interval to be allocated is greater
* than the current anchor period and there is no multiple of the anchor
* period that is between the minimum and the maximum requested intervals.
*/
#define BLE_STATUS_INTERVAL_TOO_LARGE 0x85U
/* Returned when the current anchor period or a new one can be found that
* is compatible to the interval range requested by the new slot but the
* maximum available length that can be allocated is less than the minimum
* requested slot length.
*/
#define BLE_STATUS_LENGTH_FAILED 0x86U
/* The Host failed while performing the requested operation.
*/
#define BLE_STATUS_FAILED 0x91U
/* Invalid parameters in Host commands
*/
#define BLE_STATUS_INVALID_PARAMS 0x92U
/* The Host is already processing another request received in advance.
*/
#define BLE_STATUS_BUSY 0x93U
/* The operation requested cannot be completed immediately by the Host
* (usually because of lack of resources).
* The operation is generally put on hold by the caller and it's usually
* retried on later time.
*/
#define BLE_STATUS_PENDING 0x95U
/* The requested operation violates the logic of the called layer/function or
* the format of the data to be processed during the operation.
*/
#define BLE_STATUS_ERROR 0x97U
/* The requested operation failed because of lack of memory.
* Out of memory shall be returned for situations where memory will never
* become available again (e.g. ATT database)
*/
#define BLE_STATUS_OUT_OF_MEMORY 0x98U
/* Returned when a timeout occurs at BLE application interface
*/
#define BLE_STATUS_TIMEOUT 0xFFU
/* ------------------------------------------------------------------------- */
/* BLE stack options (Options)
* (ACI_RESET)
*/
#define BLE_OPTIONS_LL_ONLY 0x00000001UL
#define BLE_OPTIONS_NO_SVC_CHANGE_DESC 0x00000002UL
#define BLE_OPTIONS_DEV_NAME_READ_ONLY 0x00000004UL
#define BLE_OPTIONS_EXTENDED_ADV 0x00000008UL
#define BLE_OPTIONS_CS_ALGO_2 0x00000010UL
#define BLE_OPTIONS_REDUCED_DB_IN_NVM 0x00000020UL
#define BLE_OPTIONS_GATT_CACHING 0x00000040UL
#define BLE_OPTIONS_POWER_CLASS_1 0x00000080UL
#define BLE_OPTIONS_APPEARANCE_WRITABLE 0x00000100UL
#define BLE_OPTIONS_ENHANCED_ATT 0x00000200UL
/* ------------------------------------------------------------------------- */
/* Characteristic value lengths
*/
#define DEVICE_NAME_CHARACTERISTIC_LEN 8
#define APPEARANCE_CHARACTERISTIC_LEN 2
#define PERIPHERAL_PRIVACY_CHARACTERISTIC_LEN 1
#define RECONNECTION_ADDR_CHARACTERISTIC_LEN 6
#define PERIPHERAL_PREF_CONN_PARAMS_CHARACTERISTIC_LEN 8
/* Adv. lengths
*/
#define MAX_ADV_DATA_LEN 31
#define BD_ADDR_SIZE 6
/* Privacy flag values
*/
#define PRIVACY_DISABLED 0x00
#define PRIVACY_ENABLED 0x02
/* Intervals in terms of 625 micro sec
*/
#define DIR_CONN_ADV_INT_MIN 0x190U /* 250 ms */
#define DIR_CONN_ADV_INT_MAX 0x320U /* 500 ms */
#define UNDIR_CONN_ADV_INT_MIN 0x800U /* 1.28 s */
#define UNDIR_CONN_ADV_INT_MAX 0x1000U /* 2.56 s */
#define LIM_DISC_ADV_INT_MIN 0x190U /* 250 ms */
#define LIM_DISC_ADV_INT_MAX 0x320U /* 500 ms */
#define GEN_DISC_ADV_INT_MIN 0x800U /* 1.28 s */
#define GEN_DISC_ADV_INT_MAX 0x1000U /* 2.56 s */
/* GAP Roles
*/
#define GAP_PERIPHERAL_ROLE 0x01U
#define GAP_BROADCASTER_ROLE 0x02U
#define GAP_CENTRAL_ROLE 0x04U
#define GAP_OBSERVER_ROLE 0x08U
/* GAP procedure codes
* Procedure codes for ACI_GAP_PROC_COMPLETE_EVENT event
* and ACI_GAP_TERMINATE_GAP_PROC command.
*/
#define GAP_LIMITED_DISCOVERY_PROC 0x01U
#define GAP_GENERAL_DISCOVERY_PROC 0x02U
#define GAP_PERIODIC_ADVERTISING_CONNECTION_PROC 0x04U
#define GAP_AUTO_CONNECTION_ESTABLISHMENT_PROC 0x08U
#define GAP_GENERAL_CONNECTION_ESTABLISHMENT_PROC 0x10U
#define GAP_SELECTIVE_CONNECTION_ESTABLISHMENT_PROC 0x20U
#define GAP_DIRECT_CONNECTION_ESTABLISHMENT_PROC 0x40U
#define GAP_OBSERVATION_PROC 0x80U
/* GAP Address Type
*/
#define GAP_PUBLIC_ADDR 0x00U
#define GAP_STATIC_RANDOM_ADDR 0x01U
#define GAP_RESOLVABLE_PRIVATE_ADDR 0x02U
#define GAP_NON_RESOLVABLE_PRIVATE_ADDR 0x03U
/* Bitmap definitions for Mode of ACI_GAP_ADD_DEVICES_TO_LIST
*/
#define GAP_ADD_DEV_MODE_RESOLVING_LIST_ONLY 0x00U
#define GAP_ADD_DEV_MODE_CLEAR 0x01U
#define GAP_ADD_DEV_MODE_FILTER_ACC_LIST_ONLY 0x02U
#define GAP_ADD_DEV_MODE_BOTH_LISTS 0x04U
/* ------------------------------------------------------------------------- */
/* IO capabilities
* (ACI_GAP_SET_IO_CAPABILITY)
*/
#define IO_CAP_DISPLAY_ONLY 0x00U
#define IO_CAP_DISPLAY_YES_NO 0x01U
#define IO_CAP_KEYBOARD_ONLY 0x02U
#define IO_CAP_NO_INPUT_NO_OUTPUT 0x03U
#define IO_CAP_KEYBOARD_DISPLAY 0x04U
/* Bonding mode
* (ACI_GAP_SET_AUTHENTICATION_REQUIREMENT)
*/
#define NO_BONDING 0x00U
#define BONDING 0x01U
/* MITM protection
* (ACI_GAP_SET_AUTHENTICATION_REQUIREMENT)
*/
#define MITM_PROTECTION_NOT_REQUIRED 0x00U
#define MITM_PROTECTION_REQUIRED_AS_MANDATORY 0x01U
#define MITM_PROTECTION_REQUIRED_AS_OPTIONAL 0x02U
/* LE Secure Connections support
* (ACI_GAP_SET_AUTHENTICATION_REQUIREMENT)
*/
#define SC_PAIRING_UNSUPPORTED 0x00U
#define SC_PAIRING_OPTIONAL 0x01U
#define SC_PAIRING_ONLY 0x02U
/* Keypress notification support
* (ACI_GAP_SET_AUTHENTICATION_REQUIREMENT)
*/
#define KEYPRESS_NOT_SUPPORTED 0x00U
#define KEYPRESS_SUPPORTED 0x01U
/* Use fixed pin
* (ACI_GAP_SET_AUTHENTICATION_REQUIREMENT)
*/
#define USE_FIXED_PIN_FOR_PAIRING_ALLOWED 0x00U
#define USE_FIXED_PIN_FOR_PAIRING_FORBIDDEN 0x01U
/* Authorization requirements
* (ACI_GAP_SET_AUTHORIZATION_REQUIREMENT)
*/
#define AUTHORIZATION_NOT_REQUIRED 0x00U
#define AUTHORIZATION_REQUIRED 0x01U
/* Connection authorization response
* (ACI_GAP_AUTHORIZATION_RESP)
*/
#define CONNECTION_AUTHORIZED 0x01U
#define CONNECTION_REJECTED 0x02U
/* SMP pairing status
* (ACI_GAP_PAIRING_COMPLETE_EVENT)
*/
#define SMP_PAIRING_STATUS_SUCCESS 0x00U
#define SMP_PAIRING_STATUS_SMP_TIMEOUT 0x01U
#define SMP_PAIRING_STATUS_PAIRING_FAILED 0x02U
#define SMP_PAIRING_STATUS_ENCRYPT_FAILED 0x03U
/* SMP pairing failed reason code
* (ACI_GAP_PAIRING_COMPLETE_EVENT)
*/
#define REASON_PASSKEY_ENTRY_FAILED 0x01U
#define REASON_OOB_NOT_AVAILABLE 0x02U
#define REASON_AUTHENTICATION_REQ 0x03U
#define REASON_CONFIRM_VALUE_FAILED 0x04U
#define REASON_PAIRING_NOT_SUPPORTED 0x05U
#define REASON_ENCRYPTION_KEY_SIZE 0x06U
#define REASON_COMMAND_NOT_SUPPORTED 0x07U
#define REASON_UNSPECIFIED_REASON 0x08U
#define REASON_REPEATED_ATTEMPTS 0x09U
#define REASON_INVALID_PARAMETERS 0x0AU
#define REASON_DHKEY_CHECK_FAILED 0x0BU
#define REASON_NUM_COMPARISON_FAILED 0x0CU
#define REASON_KEY_REJECTED 0x0FU
#define REASON_BUSY 0x10U
/* Passkey input type detected
* (ACI_GAP_PASSKEY_INPUT)
*/
#define PASSKEY_ENTRY_STARTED 0x00U
#define PASSKEY_DIGIT_ENTERED 0x01U
#define PASSKEY_DIGIT_ERASED 0x02U
#define PASSKEY_CLEARED 0x03U
#define PASSKEY_ENTRY_COMPLETED 0x04U
/* Numeric Comparison Confirm Value
* (ACI_GAP_NUMERIC_COMPARISON_VALUE_CONFIRM_YESNO)
*/
#define NUMERIC_COMPARISON_CONFIRM_NO 0x00U
#define NUMERIC_COMPARISON_CONFIRM_YES 0x01U
/* OOB Device Type
* (ACI_GAP_SET_OOB_DATA)
*/
#define OOB_DEVICE_TYPE_LOCAL 0x00U
#define OOB_DEVICE_TYPE_REMOTE 0x01U
/* OOB Data Type
* (ACI_GAP_GET_OOB_DATA, ACI_GAP_SET_OOB_DATA)
*/
#define OOB_DATA_TYPE_LP_TK 0x00U
#define OOB_DATA_TYPE_SC_RANDOM 0x01U
#define OOB_DATA_TYPE_SC_CONFIRM 0x02U
/* ------------------------------------------------------------------------- */
/* Access permissions for an attribute
*/
#define ATTR_NO_ACCESS 0x00U
#define ATTR_ACCESS_READ_ONLY 0x01U
#define ATTR_ACCESS_WRITE_REQ_ONLY 0x02U
#define ATTR_ACCESS_READ_WRITE 0x03U
#define ATTR_ACCESS_WRITE_WITHOUT_RESPONSE 0x04U
#define ATTR_ACCESS_SIGNED_WRITE_ALLOWED 0x08U
#define ATTR_ACCESS_WRITE_ANY 0x0EU
#define ATTR_ACCESS_ANY 0x0FU
/* Characteristic properties
*/
#define CHAR_PROP_NONE 0x00U
#define CHAR_PROP_BROADCAST 0x01U
#define CHAR_PROP_READ 0x02U
#define CHAR_PROP_WRITE_WITHOUT_RESP 0x04U
#define CHAR_PROP_WRITE 0x08U
#define CHAR_PROP_NOTIFY 0x10u
#define CHAR_PROP_INDICATE 0x20U
#define CHAR_PROP_SIGNED_WRITE 0x40U
#define CHAR_PROP_EXT 0x80U
/* Security permissions for an attribute
*/
#define ATTR_PERMISSION_NONE 0x00U /* No security. */
#define ATTR_PERMISSION_AUTHEN_READ 0x01U /* Need authentication to read */
#define ATTR_PERMISSION_AUTHOR_READ 0x02U /* Need authorization to read */
#define ATTR_PERMISSION_ENCRY_READ 0x04U /* Need encryption to read */
#define ATTR_PERMISSION_AUTHEN_WRITE 0x08U /* Need authentication to write */
#define ATTR_PERMISSION_AUTHOR_WRITE 0x10U /* Need authorization to write */
#define ATTR_PERMISSION_ENCRY_WRITE 0x20U /* Need encryption to write */
#define ATTR_PERMISSION_SC_READ 0x40U /* Need SC to read */
#define ATTR_PERMISSION_SC_WRITE 0x80U /* Need SC tto write */
/* Type of UUID (16 bit or 128 bit)
*/
#define UUID_TYPE_16 0x01U
#define UUID_TYPE_128 0x02U
/* Type of service (primary or secondary)
*/
#define PRIMARY_SERVICE 0x01U
#define SECONDARY_SERVICE 0x02U
/* Gatt Event Mask
* Type of event generated by GATT server
* See aci_gatt_add_char.
*/
#define GATT_DONT_NOTIFY_EVENTS 0x00U
#define GATT_NOTIFY_ATTRIBUTE_WRITE 0x01U
#define GATT_NOTIFY_WRITE_REQ_AND_WAIT_FOR_APPL_RESP 0x02U
#define GATT_NOTIFY_READ_REQ_AND_WAIT_FOR_APPL_RESP 0x04U
#define GATT_NOTIFY_NOTIFICATION_COMPLETION 0x08U
/* Type of characteristic length (see ACI_GATT_ADD_CHAR)
*/
#define CHAR_VALUE_LEN_CONSTANT 0x00
#define CHAR_VALUE_LEN_VARIABLE 0x01
/* Encryption key size
*/
#define MIN_ENCRY_KEY_SIZE 7
#define MAX_ENCRY_KEY_SIZE 16
/* Format
*/
#define FORMAT_UINT8 0x04U
#define FORMAT_UINT16 0x06U
#define FORMAT_SINT16 0x0EU
#define FORMAT_SINT24 0x0FU
/* Unit
*/
#define UNIT_UNITLESS 0x2700
#define UNIT_TEMP_CELSIUS 0x272F
#define UNIT_PRESSURE_BAR 0x2780
/* Update_Type definitions for ACI_GATT_UPDATE_CHAR_VALUE_EXT
*/
#define GATT_CHAR_UPDATE_LOCAL_ONLY 0x00U
#define GATT_CHAR_UPDATE_SEND_NOTIFICATION 0x01U
#define GATT_CHAR_UPDATE_SEND_INDICATION 0x02U
/* ------------------------------------------------------------------------- */
/* Advertising Type
*/
#define ADV_IND 0
#define ADV_DIRECT_IND 1
#define ADV_SCAN_IND 2
#define ADV_NONCONN_IND 3
#define ADV_DIRECT_IND_LDC 4
#define SCAN_RSP 4
/* Advertising channels
*/
#define ADV_CH_37 0x01
#define ADV_CH_38 0x02
#define ADV_CH_39 0x04
/* ------------------------------------------------------------------------- */
/* Definitions for Radio_Activity_Mask
* (ACI_HAL_SET_RADIO_ACTIVITY_MASK)
*/
#define RADIO_ACT_MASK_IDLE 0x0001U
#define RADIO_ACT_MASK_ADVERTISING 0x0002U
#define RADIO_ACT_MASK_PERIPH_CONNECT 0x0004U
#define RADIO_ACT_MASK_SCANNING 0x0008U
#define RADIO_ACT_MASK_CENTR_CONNECT 0x0020U
#define RADIO_ACT_MASK_TX_TEST 0x0040U
#define RADIO_ACT_MASK_RX_TEST 0x0080U
#define RADIO_ACT_MASK_PERIOD_ADVERTISING 0x0200U
#define RADIO_ACT_MASK_PERIOD_SYNC 0x0400U
#define RADIO_ACT_MASK_ISO_BROADCAST 0x0800U
#define RADIO_ACT_MASK_ISO_SYNC 0x1000U
#define RADIO_ACT_MASK_ISO_PERIPH_CONNECT 0x2000U
#define RADIO_ACT_MASK_ISO_CENTR_CONNECT 0x4000U
/* ------------------------------------------------------------------------- */
/* Definitions for Warning_Type
* (ACI_WARNING_EVENT)
*/
#define WARNING_L2CAP_RECOMBINATION_FAILURE 0x01U
#define WARNING_GATT_UNEXPECTED_PEER_MESSAGE 0x02U
#define WARNING_NVM_ALMOST_FULL 0x03U
#define WARNING_COC_RX_DATA_LENGTH_TOO_LARGE 0x04U
#define WARNING_COC_ALREADY_ASSIGNED_DCID 0x05U
#define WARNING_SMP_UNEXPECTED_LTK_REQUEST 0x06U
#define WARNING_GATT_BEARER_NOT_ALLOCATED 0x07U
/* ------------------------------------------------------------------------- */
/* Offset for configuration values (see ACI_HAL_WRITE_CONFIG_DATA)
*/
#define CONFIG_DATA_PUBLIC_ADDRESS_OFFSET 0x00U
#define CONFIG_DATA_ER_OFFSET 0x08U
#define CONFIG_DATA_IR_OFFSET 0x18U
#define CONFIG_DATA_RANDOM_ADDRESS_OFFSET 0x2EU
#define CONFIG_DATA_GAP_ADD_REC_NBR_OFFSET 0x34U
#define CONFIG_DATA_SC_KEY_TYPE_OFFSET 0x35U
#define CONFIG_DATA_SMP_MODE_OFFSET 0xB0U
#define CONFIG_DATA_LL_SCAN_CHAN_MAP_OFFSET 0xC0U
#define CONFIG_DATA_LL_BG_SCAN_MODE_OFFSET 0xC1U
#define CONFIG_DATA_LL_RSSI_GOLDEN_RANGE_OFFSET 0xC2U
#define CONFIG_DATA_LL_RPA_MODE_OFFSET 0xC3U
#define CONFIG_DATA_LL_RX_ACL_CTRL_OFFSET 0xC4U
#define CONFIG_DATA_LL_MAX_DATA_EXT_OFFSET 0xD1U
/* Length for configuration values (see ACI_HAL_WRITE_CONFIG_DATA)
*/
#define CONFIG_DATA_PUBLIC_ADDRESS_LEN 6
#define CONFIG_DATA_ER_LEN 16
#define CONFIG_DATA_IR_LEN 16
#define CONFIG_DATA_RANDOM_ADDRESS_LEN 6
#define CONFIG_DATA_GAP_ADD_REC_NBR_LEN 1
#define CONFIG_DATA_SC_KEY_TYPE_LEN 1
#define CONFIG_DATA_SMP_MODE_LEN 1
#define CONFIG_DATA_LL_SCAN_CHAN_MAP_LEN 1
#define CONFIG_DATA_LL_BG_SCAN_MODE_LEN 1
#define CONFIG_DATA_LL_RSSI_GOLDEN_RANGE_LEN 2
#define CONFIG_DATA_LL_RPA_MODE_LEN 1
#define CONFIG_DATA_LL_RX_ACL_CTRL_LEN 2
#define CONFIG_DATA_LL_MAX_DATA_EXT_LEN 8
/* ------------------------------------------------------------------------- */
#endif /* BLE_DEFS_H__ */

View File

@@ -0,0 +1,347 @@
/*****************************************************************************
* @file ble_legacy.h
*
* @brief This file contains legacy definitions used for BLE.
*****************************************************************************
* @attention
*
* Copyright (c) 2018-2025 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.
*
*****************************************************************************
*/
#ifndef BLE_LEGACY_H__
#define BLE_LEGACY_H__
/* Various obsolete definitions
*/
#define PERIPHERAL_PRIVACY_FLAG_UUID 0x2A02U
#define RECONNECTION_ADDR_UUID 0x2A03U
#define OOB_AUTH_DATA_ABSENT 0x00U
#define OOB_AUTH_DATA_PRESENT 0x01U
#define BLE_STATUS_SEC_DB_FULL 0x5DU
#define BLE_STATUS_INSUFFICIENT_ENC_KEYSIZE 0x5FU
#define BLE_STATUS_CHARAC_ALREADY_EXISTS 0x63U
#define GAP_NAME_DISCOVERY_PROC 0x04U
#define MITM_PROTECTION_REQUIRED 0x01U
#define HCI_VENDOR_SPECIFIC_DEBUG_EVT_CODE 0xFFU
/* Deprecated names for ACI/HCI commands and events
*/
#define hci_le_read_local_supported_features \
hci_le_read_local_supported_features_page_0
#define hci_le_read_remote_features \
hci_le_read_remote_features_page_0
#define aci_gap_configure_whitelist \
aci_gap_configure_filter_accept_list
#define aci_gap_slave_security_req \
aci_gap_peripheral_security_req
#define aci_hal_set_slave_latency \
aci_hal_set_peripheral_latency
#define aci_gap_slave_security_initiated_event \
aci_gap_peripheral_security_initiated_event
typedef __PACKED_STRUCT
{
/**
* Identity address type
* Values:
* - 0x00: Public Identity Address
* - 0x01: Random (static) Identity Address
*/
uint8_t Peer_Identity_Address_Type;
/**
* Public or Random (static) Identity Address of the peer device
*/
uint8_t Peer_Identity_Address[6];
} Identity_Entry_t;
#define Whitelist_Entry_t \
Peer_Entry_t
#define Whitelist_Identity_Entry_t \
Identity_Entry_t
#define HCI_LE_READ_REMOTE_FEATURES_COMPLETE_SUBEVT_CODE \
HCI_LE_READ_REMOTE_FEATURES_PAGE_0_COMPLETE_SUBEVT_CODE
#define hci_le_read_remote_features_complete_event_rp0 \
hci_le_read_remote_features_page_0_complete_event_rp0
#define ACI_HAL_FW_ERROR_VSEVT_CODE \
ACI_WARNING_VSEVT_CODE
#define ACI_HAL_WARNING_VSEVT_CODE \
ACI_WARNING_VSEVT_CODE
typedef __PACKED_STRUCT
{
uint8_t FW_Error_Type;
uint8_t Data_Length;
uint8_t Data[(BLE_EVT_MAX_PARAM_LEN - 2) - 2];
} aci_hal_fw_error_event_rp0;
#define aci_hal_warning_event_rp0 \
aci_warning_event_rp0
#define aci_hal_warning_event \
aci_warning_event
/* Other deprecated names
*/
#define HCI_ADV_FILTER_WHITELIST_SCAN \
HCI_ADV_FILTER_ACC_LIST_USED_FOR_SCAN
#define HCI_ADV_FILTER_WHITELIST_CONNECT \
HCI_ADV_FILTER_ACC_LIST_USED_FOR_CONNECT
#define HCI_ADV_FILTER_WHITELIST_SCAN_CONNECT \
HCI_ADV_FILTER_ACC_LIST_USED_FOR_ALL
#define NO_WHITE_LIST_USE \
HCI_ADV_FILTER_NO
#define WHITE_LIST_FOR_ONLY_SCAN \
HCI_ADV_FILTER_ACC_LIST_USED_FOR_SCAN
#define WHITE_LIST_FOR_ONLY_CONN \
HCI_ADV_FILTER_ACC_LIST_USED_FOR_CONNECT
#define WHITE_LIST_FOR_ALL \
HCI_ADV_FILTER_ACC_LIST_USED_FOR_ALL
#define HCI_SCAN_FILTER_WHITELIST \
HCI_SCAN_FILTER_ACC_LIST_USED
#define HCI_SCAN_FILTER_NO_EVEN_RPA \
HCI_SCAN_FILTER_NO_EXT
#define HCI_SCAN_FILTER_WHITELIST_BUT_RPA \
HCI_SCAN_FILTER_ACC_LIST_USED_EXT
#define HCI_INIT_FILTER_WHITELIST \
HCI_INIT_FILTER_ACC_LIST_USED
#define AD_TYPE_SLAVE_CONN_INTERVAL \
AD_TYPE_PERIPHERAL_CONN_INTERVAL
#define OOB_NOT_AVAILABLE REASON_OOB_NOT_AVAILABLE
#define AUTH_REQ_CANNOT_BE_MET REASON_AUTHENTICATION_REQ
#define CONFIRM_VALUE_FAILED REASON_CONFIRM_VALUE_FAILED
#define PAIRING_NOT_SUPPORTED REASON_PAIRING_NOT_SUPPORTED
#define INSUFF_ENCRYPTION_KEY_SIZE REASON_ENCRYPTION_KEY_SIZE
#define CMD_NOT_SUPPORTED REASON_COMMAND_NOT_SUPPORTED
#define UNSPECIFIED_REASON REASON_UNSPECIFIED_REASON
#define VERY_EARLY_NEXT_ATTEMPT REASON_REPEATED_ATTEMPTS
#define SM_INVALID_PARAMS REASON_INVALID_PARAMETERS
#define SMP_SC_DHKEY_CHECK_FAILED REASON_DHKEY_CHECK_FAILED
#define SMP_SC_NUMCOMPARISON_FAILED REASON_NUM_COMPARISON_FAILED
#define CONFIG_DATA_PUBADDR_OFFSET CONFIG_DATA_PUBLIC_ADDRESS_OFFSET
#define CONFIG_DATA_PUBADDR_LEN CONFIG_DATA_PUBLIC_ADDRESS_LEN
#define FW_L2CAP_RECOMBINATION_ERROR 0x01U
#define FW_GATT_UNEXPECTED_PEER_MESSAGE 0x02U
#define FW_NVM_LEVEL_WARNING 0x03U
#define FW_COC_RX_DATA_LENGTH_TOO_LARGE 0x04U
#define FW_ECOC_CONN_RSP_ALREADY_ASSIGNED_DCID 0x05U
/* Deprecated commands
*/
#define aci_gatt_read_long_char_desc\
aci_gatt_read_long_char_value
#define aci_gatt_read_char_desc \
aci_gatt_read_char_value
#define aci_gatt_write_long_char_desc \
aci_gatt_write_long_char_value
#define aci_gatt_write_char_desc \
aci_gatt_write_char_value
#define aci_gatt_write_resp \
aci_gatt_permit_write
/**
* @brief ACI_GAP_RESOLVE_PRIVATE_ADDR
* This command tries to resolve the address provided with the IRKs present in
* its database. If the address is resolved successfully with any one of the
* IRKs present in the database, it returns success and also the corresponding
* public/static random address stored with the IRK in the database.
*
* @param Address Address to be resolved
* @param[out] Actual_Address The public or static random address of the peer
* device, distributed during pairing phase.
* @return Value indicating success or error code.
*/
__STATIC_INLINE
tBleStatus aci_gap_resolve_private_addr( const uint8_t* Address,
uint8_t* Actual_Address )
{
uint8_t type;
return aci_gap_check_bonded_device( 1, Address, &type, Actual_Address );
}
/**
* @brief ACI_GAP_IS_DEVICE_BONDED
* The command finds whether the device, whose address is specified in the
* command, is present in the bonding table. If the device is found, the
* command returns "Success".
* Note: the specified address can be a RPA. In this case, even if privacy is
* not enabled, this address is resolved to check the presence of the peer
* device in the bonding table.
*
* @param Peer_Address_Type The address type of the peer device.
* Values:
* - 0x00: Public Device Address
* - 0x01: Random Device Address
* @param Peer_Address Public Device Address or Random Device Address of the
* peer device
* @return Value indicating success or error code.
*/
__STATIC_INLINE
tBleStatus aci_gap_is_device_bonded( uint8_t Peer_Address_Type,
const uint8_t* Peer_Address )
{
uint8_t type, address[6];
return aci_gap_check_bonded_device( Peer_Address_Type, Peer_Address,
&type, address );
}
/**
* @brief ACI_GAP_ADD_DEVICES_TO_RESOLVING_LIST
* This command is used to add devices to the list of address translations
* used to resolve Resolvable Private Addresses in the Controller.
*
* @param Num_of_Resolving_list_Entries Number of devices that have to be added
* to the list.
* @param Identity_Entry See @ref Identity_Entry_t
* @param Clear_Resolving_List Clear the resolving list
* Values:
* - 0x00: Do not clear
* - 0x01: Clear before adding
* @return Value indicating success or error code.
*/
__STATIC_INLINE
tBleStatus aci_gap_add_devices_to_resolving_list( uint8_t Num_of_Resolving_list_Entries,
const Identity_Entry_t* Identity_Entry,
uint8_t Clear_Resolving_List )
{
return aci_gap_add_devices_to_list( Num_of_Resolving_list_Entries,
(const List_Entry_t*)Identity_Entry,
Clear_Resolving_List );
}
/**
* @brief ACI_HAL_GET_FW_BUILD_NUMBER
* This command returns the build number associated with the firmware version
* currently running
*
* @param[out] Build_Number Build number of the firmware.
* @return Value indicating success or error code.
*/
__STATIC_INLINE
tBleStatus aci_hal_get_fw_build_number( uint16_t* Build_Number )
{
uint32_t version[2], options[1], debug_info[3];
tBleStatus status = aci_get_information( version, options, debug_info );
*Build_Number = (uint16_t)(version[1] >> 16);
return status;
}
/**
* @brief ACI_HAL_GET_PM_DEBUG_INFO_V2
* This command is used to retrieve TX, RX and total buffer count allocated for
* ACL packets.
*
* @param[out] Allocated_For_TX MBlocks allocated for TXing
* @param[out] Allocated_For_RX MBlocks allocated for RXing
* @param[out] Allocated_MBlocks Overall allocated MBlocks
* @return Value indicating success or error code.
*/
__STATIC_INLINE
tBleStatus aci_hal_get_pm_debug_info_v2( uint16_t* Allocated_For_TX,
uint16_t* Allocated_For_RX,
uint16_t* Allocated_MBlocks )
{
uint32_t version[2], options[1], debug_info[3];
tBleStatus status = aci_get_information( version, options, debug_info );
*Allocated_For_TX = ((((uint16_t*)debug_info)[2]) +
(((uint16_t*)debug_info)[3]));
*Allocated_For_RX = (((uint16_t*)debug_info)[1]);
*Allocated_MBlocks = (*Allocated_For_TX) + (*Allocated_For_RX);
return status;
}
/**
* @brief ACI_GATT_ALLOW_READ
* Allow the GATT server to send a response to a read request from a client.
* The application has to send this command when it receives the
* ACI_GATT_READ_PERMIT_REQ_EVENT or ACI_GATT_READ_MULTI_PERMIT_REQ_EVENT. This
* command indicates to the stack that the response can be sent to the client.
* So if the application wishes to update any of the attributes before they are
* read by the client, it must update the characteristic values using the
* ACI_GATT_UPDATE_CHAR_VALUE and then give this command. The application
* should perform the required operations within 30 seconds. Otherwise the GATT
* procedure will be timeout.
*
* @param Connection_Handle Specifies the ATT bearer for which the command
* applies.
* Values:
* - 0x0000 ... 0x0EFF: Unenhanced ATT bearer (the parameter is the
* connection handle)
* - 0xEA00 ... 0xEA3F: Enhanced ATT bearer (the LSB-byte of the
* parameter is the connection-oriented channel index)
* @return Value indicating success or error code.
*/
__STATIC_INLINE
tBleStatus aci_gatt_allow_read( uint16_t Connection_Handle )
{
return aci_gatt_permit_read( Connection_Handle, 0, 0, 0 );
}
/**
* @brief ACI_GATT_DENY_READ
* This command is used to deny the GATT server to send a response to a read
* request from a client.
* The application may send this command when it receives the
* ACI_GATT_READ_PERMIT_REQ_EVENT or ACI_GATT_READ_MULTI_PERMIT_REQ_EVENT.
* This command indicates to the stack that the client is not allowed to read
* the requested characteristic due to e.g. application restrictions.
* The Error code shall be either 0x08 (Insufficient Authorization) or a value
* in the range 0x80-0x9F (Application Error).
* The application should issue the ACI_GATT_DENY_READ or ACI_GATT_ALLOW_READ
* command within 30 seconds from the reception of the
* ACI_GATT_READ_PERMIT_REQ_EVENT or ACI_GATT_READ_MULTI_PERMIT_REQ_EVENT
* events; otherwise the GATT procedure issues a timeout.
*
* @param Connection_Handle Specifies the ATT bearer for which the command
* applies.
* Values:
* - 0x0000 ... 0x0EFF: Unenhanced ATT bearer (the parameter is the
* connection handle)
* - 0xEA00 ... 0xEA3F: Enhanced ATT bearer (the LSB-byte of the
* parameter is the connection-oriented channel index)
* @param Error_Code Error code for the command
* Values:
* - 0x08: Insufficient Authorization
* - 0x80 ... 0x9F: Application Error
* @return Value indicating success or error code.
*/
__STATIC_INLINE
tBleStatus aci_gatt_deny_read( uint16_t Connection_Handle,
uint8_t Error_Code )
{
return aci_gatt_permit_read( Connection_Handle, 1, Error_Code, 0 );
}
#endif /* BLE_LEGACY_H__ */

View File

@@ -0,0 +1,387 @@
/******************************************************************************
* @file ble_std.h
*
* @brief BLE standard definitions
******************************************************************************
* @attention
*
* Copyright (c) 2018-2025 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.
*
*****************************************************************************
*/
#ifndef BLE_STD_H__
#define BLE_STD_H__
/* HCI packet type */
#define HCI_COMMAND_PKT_TYPE 0x01U
#define HCI_ACLDATA_PKT_TYPE 0x02U
#define HCI_EVENT_PKT_TYPE 0x04U
#define HCI_ISODATA_PKT_TYPE 0x05U
/* HCI packet header size */
#define HCI_COMMAND_HDR_SIZE 4
#define HCI_ACLDATA_HDR_SIZE 5
#define HCI_EVENT_HDR_SIZE 3
#define HCI_ISODATA_HDR_SIZE 5
/* HCI parameters length */
#define HCI_COMMAND_MAX_PARAM_LEN 255
#define HCI_ACLDATA_MAX_DATA_LEN 251 /* LE_ACL_Data_Packet_Length */
#define HCI_EVENT_MAX_PARAM_LEN 255
#define HCI_ISODATA_MAX_DATA_LEN 300 /* ISO_Data_Packet_Length */
/* HCI packet maximum size */
#define HCI_COMMAND_PKT_MAX_SIZE \
(HCI_COMMAND_HDR_SIZE + HCI_COMMAND_MAX_PARAM_LEN)
#define HCI_ACLDATA_PKT_MAX_SIZE \
(HCI_ACLDATA_HDR_SIZE + HCI_ACLDATA_MAX_DATA_LEN)
#define HCI_EVENT_PKT_MAX_SIZE \
(HCI_EVENT_HDR_SIZE + HCI_EVENT_MAX_PARAM_LEN)
#define HCI_ISODATA_PKT_MAX_SIZE \
(HCI_ISODATA_HDR_SIZE + HCI_ISODATA_MAX_DATA_LEN)
/* HCI event code */
#define HCI_DISCONNECTION_COMPLETE_EVT_CODE 0x05U
#define HCI_ENCRYPTION_CHANGE_EVT_CODE 0x08U
#define HCI_READ_REMOTE_VERSION_INFORMATION_COMPLETE_EVT_CODE 0x0CU
#define HCI_COMMAND_COMPLETE_EVT_CODE 0x0EU
#define HCI_COMMAND_STATUS_EVT_CODE 0x0FU
#define HCI_HARDWARE_ERROR_EVT_CODE 0x10U
#define HCI_NUMBER_OF_COMPLETED_PACKETS_EVT_CODE 0x13U
#define HCI_DATA_BUFFER_OVERFLOW_EVT_CODE 0x1AU
#define HCI_ENCRYPTION_KEY_REFRESH_COMPLETE_EVT_CODE 0x30U
#define HCI_LE_META_EVT_CODE 0x3EU
#define HCI_AUTHENTICATED_PAYLOAD_TIMEOUT_EXPIRED_EVT_CODE 0x57U
#define HCI_VENDOR_SPECIFIC_EVT_CODE 0xFFU
/* HCI LE subevent code */
#define HCI_LE_CONNECTION_COMPLETE_SUBEVT_CODE 0x01U
#define HCI_LE_ADVERTISING_REPORT_SUBEVT_CODE 0x02U
#define HCI_LE_CONNECTION_UPDATE_COMPLETE_SUBEVT_CODE 0x03U
#define HCI_LE_READ_REMOTE_FEATURES_PAGE_0_COMPLETE_SUBEVT_CODE 0x04U
#define HCI_LE_LONG_TERM_KEY_REQUEST_SUBEVT_CODE 0x05U
#define HCI_LE_REMOTE_CONNECTION_PARAMETER_REQUEST_SUBEVT_CODE 0x06U
#define HCI_LE_DATA_LENGTH_CHANGE_SUBEVT_CODE 0x07U
#define HCI_LE_READ_LOCAL_P256_PUBLIC_KEY_COMPLETE_SUBEVT_CODE 0x08U
#define HCI_LE_GENERATE_DHKEY_COMPLETE_SUBEVT_CODE 0x09U
#define HCI_LE_ENHANCED_CONNECTION_COMPLETE_SUBEVT_CODE 0x0AU
#define HCI_LE_DIRECTED_ADVERTISING_REPORT_SUBEVT_CODE 0x0BU
#define HCI_LE_PHY_UPDATE_COMPLETE_SUBEVT_CODE 0x0CU
#define HCI_LE_EXTENDED_ADVERTISING_REPORT_SUBEVT_CODE 0x0DU
#define HCI_LE_PERIODIC_ADVERTISING_SYNC_ESTABLISHED_SUBEVT_CODE 0x0EU
#define HCI_LE_PERIODIC_ADVERTISING_REPORT_SUBEVT_CODE 0x0FU
#define HCI_LE_PERIODIC_ADVERTISING_SYNC_LOST_SUBEVT_CODE 0x10U
#define HCI_LE_SCAN_TIMEOUT_SUBEVT_CODE 0x11U
#define HCI_LE_ADVERTISING_SET_TERMINATED_SUBEVT_CODE 0x12U
#define HCI_LE_SCAN_REQUEST_RECEIVED_SUBEVT_CODE 0x13U
#define HCI_LE_CHANNEL_SELECTION_ALGORITHM_SUBEVT_CODE 0x14U
#define HCI_LE_CONNECTIONLESS_IQ_REPORT_SUBEVT_CODE 0x15U
#define HCI_LE_CONNECTION_IQ_REPORT_SUBEVT_CODE 0x16U
#define HCI_LE_CTE_REQUEST_FAILED_SUBEVT_CODE 0x17U
#define HCI_LE_PERIODIC_ADVERTISING_SYNC_TRANSFER_RECEIVED_SUBEVT_CODE 0x18U
#define HCI_LE_CIS_ESTABLISHED_SUBEVT_CODE 0x19U
#define HCI_LE_CIS_REQUEST_SUBEVT_CODE 0x1AU
#define HCI_LE_CREATE_BIG_COMPLETE_SUBEVT_CODE 0x1BU
#define HCI_LE_TERMINATE_BIG_COMPLETE_SUBEVT_CODE 0x1CU
#define HCI_LE_BIG_SYNC_ESTABLISHED_SUBEVT_CODE 0x1DU
#define HCI_LE_BIG_SYNC_LOST_SUBEVT_CODE 0x1EU
#define HCI_LE_REQUEST_PEER_SCA_COMPLETE_SUBEVT_CODE 0x1FU
#define HCI_LE_PATH_LOSS_THRESHOLD_SUBEVT_CODE 0x20U
#define HCI_LE_TRANSMIT_POWER_REPORTING_SUBEVT_CODE 0x21U
#define HCI_LE_BIGINFO_ADVERTISING_REPORT_SUBEVT_CODE 0x22U
#define HCI_LE_SUBRATE_CHANGE_SUBEVT_CODE 0x23U
#define HCI_LE_PERIODIC_ADVERTISING_SYNC_ESTABLISHED_V2_SUBEVT_CODE 0x24U
#define HCI_LE_PERIODIC_ADVERTISING_REPORT_V2_SUBEVT_CODE 0x25U
#define HCI_LE_PERIODIC_ADVERTISING_SYNC_TRANSFER_RECEIVED_V2_SUBEVT_CODE 0x26U
#define HCI_LE_PERIODIC_ADVERTISING_SUBEVENT_DATA_REQUEST_SUBEVT_CODE 0x27U
#define HCI_LE_PERIODIC_ADVERTISING_RESPONSE_REPORT_SUBEVT_CODE 0x28U
#define HCI_LE_ENHANCED_CONNECTION_COMPLETE_V2_SUBEVT_CODE 0x29U
#define HCI_LE_CIS_ESTABLISHED_V2_SUBEVT_CODE 0x2AU
#define HCI_LE_READ_ALL_REMOTE_FEATURES_COMPLETE_SUBEVT_CODE 0x2BU
#define HCI_LE_CS_READ_REMOTE_SUPPORTED_CAPABILITIES_COMPLETE_SUBEVT_CODE 0x2CU
#define HCI_LE_CS_READ_REMOTE_FAE_TABLE_COMPLETE_SUBEVT_CODE 0x2DU
#define HCI_LE_CS_SECURITY_ENABLE_COMPLETE_SUBEVT_CODE 0x2EU
#define HCI_LE_CS_CONFIG_COMPLETE_SUBEVT_CODE 0x2FU
#define HCI_LE_CS_PROCEDURE_ENABLE_COMPLETE_SUBEVT_CODE 0x30U
#define HCI_LE_CS_SUBEVENT_RESULT_SUBEVT_CODE 0x31U
#define HCI_LE_CS_SUBEVENT_RESULT_CONTINUE_SUBEVT_CODE 0x32U
#define HCI_LE_CS_TEST_END_COMPLETE_SUBEVT_CODE 0x33U
#define HCI_LE_MONITORED_ADVERTISERS_REPORT_SUBEVT_CODE 0x34U
#define HCI_LE_FRAME_SPACE_UPDATE_COMPLETE_SUBEVT_CODE 0x35U
/* HCI error code */
#define HCI_SUCCESS_ERR_CODE 0x00U
#define HCI_UNKNOWN_HCI_COMMAND_ERR_CODE 0x01U
#define HCI_UNKNOWN_CONNECTION_IDENTIFIER_ERR_CODE 0x02U
#define HCI_HARDWARE_FAILURE_ERR_CODE 0x03U
#define HCI_AUTHENTICATION_FAILURE_ERR_CODE 0x05U
#define HCI_PIN_OR_KEY_MISSING_ERR_CODE 0x06U
#define HCI_MEMORY_CAPACITY_EXCEEDED_ERR_CODE 0x07U
#define HCI_CONNECTION_TIMEOUT_ERR_CODE 0x08U
#define HCI_CONNECTION_LIMIT_EXCEEDED_ERR_CODE 0x09U
#define HCI_CONNECTION_ALREADY_EXISTS_ERR_CODE 0x0BU
#define HCI_COMMAND_DISALLOWED_ERR_CODE 0x0CU
#define HCI_UNSUPPORTED_FEATURE_OR_PARAMETER_VALUE_ERR_CODE 0x11U
#define HCI_INVALID_HCI_COMMAND_PARAMETERS_ERR_CODE 0x12U
#define HCI_REMOTE_USER_TERMINATED_CONNECTION_ERR_CODE 0x13U
#define HCI_REMOTE_TERMINATED_CONNECTION_DUE_TO_LOW_RESOURCES_ERR_CODE 0x14U
#define HCI_REMOTE_TERMINATED_CONNECTION_DUE_TO_POWER_OFF_ERR_CODE 0x15U
#define HCI_CONNECTION_TERMINATED_BY_LOCAL_HOST_ERR_CODE 0x16U
#define HCI_UNSUPPORTED_REMOTE_FEATURE_ERR_CODE 0x1AU
#define HCI_INVALID_LL_PARAMETERS_ERR_CODE 0x1EU
#define HCI_UNSPECIFIED_ERROR_ERR_CODE 0x1FU
#define HCI_UNSUPPORTED_LL_PARAMETER_VALUE_ERR_CODE 0x20U
#define HCI_LL_RESPONSE_TIMEOUT_ERR_CODE 0x22U
#define HCI_LL_PROCEDURE_COLLISION_ERR_CODE 0x23U
#define HCI_LMP_PDU_NOT_ALLOWED_ERR_CODE 0x24U
#define HCI_INSTANT_PASSED_ERR_CODE 0x28U
#define HCI_DIFFERENT_TRANSACTION_COLLISION_ERR_CODE 0x2AU
#define HCI_PARAMETER_OUT_OF_MANDATORY_RANGE_ERR_CODE 0x30U
#define HCI_HOST_BUSY_PAIRING_ERR_CODE 0x38U
#define HCI_CONTROLLER_BUSY_ERR_CODE 0x3AU
#define HCI_UNACCEPTABLE_CONNECTION_PARAMETERS_ERR_CODE 0x3BU
#define HCI_ADVERTISING_TIMEOUT_ERR_CODE 0x3CU
#define HCI_CONNECTION_TERMINATED_DUE_TO_MIC_FAILURE_ERR_CODE 0x3DU
#define HCI_CONNECTION_FAILED_TO_BE_ESTABLISHED_ERR_CODE 0x3EU
#define HCI_UNKNOWN_ADVERTISING_IDENTIFIER_ERR_CODE 0x42U
#define HCI_ADVERTISING_LIMIT_REACHED_ERR_CODE 0x43U
#define HCI_PACKET_TOO_LONG_ERR_CODE 0x45U
/* HCI_LE_Set_Advertising_Parameters: Advertising_Type */
#define HCI_ADV_TYPE_ADV_IND 0x00U
#define HCI_ADV_TYPE_ADV_DIRECT_IND_HDC 0x01U
#define HCI_ADV_TYPE_ADV_SCAN_IND 0x02U
#define HCI_ADV_TYPE_ADV_NONCONN_IND 0x03U
#define HCI_ADV_TYPE_ADV_DIRECT_IND_LDC 0x04U
/* HCI_LE_Set_Advertising_Parameters: Advertising_Filter_Policy */
#define HCI_ADV_FILTER_NO 0x00U
#define HCI_ADV_FILTER_ACC_LIST_USED_FOR_SCAN 0x01U
#define HCI_ADV_FILTER_ACC_LIST_USED_FOR_CONNECT 0x02U
#define HCI_ADV_FILTER_ACC_LIST_USED_FOR_ALL 0x03U
/* HCI_LE_Set_[Advertising/Scan]_Parameters: Own_Address_Type */
#define HCI_OWN_ADDR_TYPE_PUBLIC 0x00U
#define HCI_OWN_ADDR_TYPE_RANDOM 0x01U
#define HCI_OWN_ADDR_TYPE_RP_OR_PUBLIC 0x02U
#define HCI_OWN_ADDR_TYPE_RP_OR_RANDOM 0x03U
/* HCI_LE_Set_Scan_Parameters: LE_Scan_Type */
#define HCI_SCAN_TYPE_PASSIVE 0x00U
#define HCI_SCAN_TYPE_ACTIVE 0x01U
/* HCI_LE_Set_Scan_Parameters: Scanning_Filter_Policy */
#define HCI_SCAN_FILTER_NO 0x00U
#define HCI_SCAN_FILTER_ACC_LIST_USED 0x01U
#define HCI_SCAN_FILTER_NO_EXT 0x02U
#define HCI_SCAN_FILTER_ACC_LIST_USED_EXT 0x03U
/* HCI_LE_Create_Connection: Initiator_Filter_Policy */
#define HCI_INIT_FILTER_NO 0x00U
#define HCI_INIT_FILTER_ACC_LIST_USED 0x01U
/* HCI_LE_Read_PHY: TX_PHY */
#define HCI_TX_PHY_LE_1M 0x01U
#define HCI_TX_PHY_LE_2M 0x02U
#define HCI_TX_PHY_LE_CODED 0x03U
/* HCI_LE_Read_PHY: RX_PHY */
#define HCI_RX_PHY_LE_1M 0x01U
#define HCI_RX_PHY_LE_2M 0x02U
#define HCI_RX_PHY_LE_CODED 0x03U
/* HCI_LE_Set_PHY: ALL_PHYS */
#define HCI_ALL_PHYS_TX_NO_PREF 0x01U
#define HCI_ALL_PHYS_RX_NO_PREF 0x02U
/* HCI_LE_Set_PHY: TX_PHYS */
#define HCI_TX_PHYS_LE_1M_PREF 0x01U
#define HCI_TX_PHYS_LE_2M_PREF 0x02U
#define HCI_TX_PHYS_LE_CODED_PREF 0x04U
/* HCI_LE_Set_PHY: RX_PHYS */
#define HCI_RX_PHYS_LE_1M_PREF 0x01U
#define HCI_RX_PHYS_LE_2M_PREF 0x02U
#define HCI_RX_PHYS_LE_CODED_PREF 0x04U
/* HCI_LE_Set_Extended_Advertising_Parameters: Advertising_Event_Properties */
#define HCI_ADV_EVENT_PROP_CONNECTABLE 0x0001U
#define HCI_ADV_EVENT_PROP_SCANNABLE 0x0002U
#define HCI_ADV_EVENT_PROP_DIRECTED 0x0004U
#define HCI_ADV_EVENT_PROP_HDC_DIRECTED 0x0008U
#define HCI_ADV_EVENT_PROP_LEGACY 0x0010U
#define HCI_ADV_EVENT_PROP_ANONYMOUS 0x0020U
#define HCI_ADV_EVENT_PROP_TXPOWER_INC 0x0040U
/* HCI_LE_Set_Extended_Advertising_Parameters: Primary_Advertising_PHY */
#define HCI_PRIMARY_ADV_PHY_LE_1M 0x01U
#define HCI_PRIMARY_ADV_PHY_LE_CODED 0x03U
/* HCI_LE_Set_Extended_Advertising_Data: Operation */
#define HCI_SET_ADV_DATA_OPERATION_INTERMEDIATE 0x00U
#define HCI_SET_ADV_DATA_OPERATION_FIRST 0x01U
#define HCI_SET_ADV_DATA_OPERATION_LAST 0x02U
#define HCI_SET_ADV_DATA_OPERATION_COMPLETE 0x03U
#define HCI_SET_ADV_DATA_OPERATION_UNCHANGED 0x04U
/* HCI_LE_Advertising_Report: Event_Type */
#define HCI_ADV_EVT_TYPE_ADV_IND 0x00U
#define HCI_ADV_EVT_TYPE_ADV_DIRECT_IND 0x01U
#define HCI_ADV_EVT_TYPE_ADV_SCAN_IND 0x02U
#define HCI_ADV_EVT_TYPE_ADV_NONCONN_IND 0x03U
#define HCI_ADV_EVT_TYPE_SCAN_RSP 0x04U
/* HCI_LE_Set_Extended_Scan_Parameters: Scanning_PHYs */
#define HCI_SCANNING_PHYS_LE_1M 0x01U
#define HCI_SCANNING_PHYS_LE_CODED 0x04U
/* HCI_LE_Extended_Create_Connection: Initiating_PHYs */
#define HCI_INIT_PHYS_SCAN_CONN_LE_1M 0x01U
#define HCI_INIT_PHYS_CONN_LE_2M 0x02U
#define HCI_INIT_PHYS_SCAN_CONN_LE_CODED 0x04U
/* HCI_LE_Receiver_Test/HCI_LE_Transmitter_Test [v2]: PHY */
#define HCI_TEST_PHY_LE_1M 0x01U
#define HCI_TEST_PHY_LE_2M 0x02U
/* HCI_LE_Connection_Complete/HCI_LE_Enhanced_Connection_Complete: Role */
#define HCI_ROLE_CENTRAL 0x00U
#define HCI_ROLE_PERIPHERAL 0x01U
/* HCI_LE_Set_Privacy_Mode: Privacy_Mode */
#define HCI_PRIV_MODE_NETWORK 0x00U
#define HCI_PRIV_MODE_DEVICE 0x01U
/* Bluetooth Core Specification versions
*/
#define BLE_CORE_5_2 11
#define BLE_CORE_5_3 12
#define BLE_CORE_5_4 13
#define BLE_CORE_6_0 14
#define BLE_CORE_6_1 15
/* AD types for advertising data and scan response data
*/
#define AD_TYPE_FLAGS 0x01U
#define AD_TYPE_16_BIT_SERV_UUID 0x02U
#define AD_TYPE_16_BIT_SERV_UUID_CMPLT_LIST 0x03U
#define AD_TYPE_32_BIT_SERV_UUID 0x04U
#define AD_TYPE_32_BIT_SERV_UUID_CMPLT_LIST 0x05U
#define AD_TYPE_128_BIT_SERV_UUID 0x06U
#define AD_TYPE_128_BIT_SERV_UUID_CMPLT_LIST 0x07U
#define AD_TYPE_SHORTENED_LOCAL_NAME 0x08U
#define AD_TYPE_COMPLETE_LOCAL_NAME 0x09U
#define AD_TYPE_TX_POWER_LEVEL 0x0AU
#define AD_TYPE_CLASS_OF_DEVICE 0x0DU
#define AD_TYPE_SEC_MGR_TK_VALUE 0x10U
#define AD_TYPE_SEC_MGR_OOB_FLAGS 0x11U
#define AD_TYPE_PERIPHERAL_CONN_INTERVAL 0x12U
#define AD_TYPE_SERV_SOLICIT_16_BIT_UUID_LIST 0x14U
#define AD_TYPE_SERV_SOLICIT_128_BIT_UUID_LIST 0x15U
#define AD_TYPE_SERVICE_DATA 0x16U
#define AD_TYPE_APPEARANCE 0x19U
#define AD_TYPE_ADVERTISING_INTERVAL 0x1AU
#define AD_TYPE_LE_ROLE 0x1CU
#define AD_TYPE_SERV_SOLICIT_32_BIT_UUID_LIST 0x1FU
#define AD_TYPE_URI 0x24U
#define AD_TYPE_MANUFACTURER_SPECIFIC_DATA 0xFFU
/* Flag bits for Flags AD Type
*/
#define FLAG_BIT_LE_LIMITED_DISCOVERABLE_MODE 0x01U
#define FLAG_BIT_LE_GENERAL_DISCOVERABLE_MODE 0x02U
#define FLAG_BIT_BR_EDR_NOT_SUPPORTED 0x04U
#define FLAG_BIT_LE_BR_EDR_CONTROLLER 0x08U
#define FLAG_BIT_LE_BR_EDR_HOST 0x10U
/* Appearance values
*/
#define GAP_APPEARANCE_UNKNOWN 0x0000
#define GAP_APPEARANCE_GENERIC_PHONE 0x0040
#define GAP_APPEARANCE_GENERIC_COMPUTER 0x0080
#define GAP_APPEARANCE_GENERIC_WATCH 0x00C0
#define GAP_APPEARANCE_WATCH_SPORT_WATCH 0x00C1
#define GAP_APPEARANCE_GENERIC_CLOCK 0x0100
#define GAP_APPEARANCE_GENERIC_DISPLAY 0x0140
#define GAP_APPEARANCE_GENERIC_REMOTE_CONTROL 0x0180
#define GAP_APPEARANCE_GENERIC_EYE_GLASSES 0x01C0
#define GAP_APPEARANCE_GENERIC_TAG 0x0200
#define GAP_APPEARANCE_GENERIC_KEYRING 0x0240
#define GAP_APPEARANCE_GENERIC_MEDIA_PLAYER 0x0280
#define GAP_APPEARANCE_GENERIC_BARCODE_SCANNER 0x02C0
#define GAP_APPEARANCE_GENERIC_THERMOMETER 0x0300
#define GAP_APPEARANCE_THERMOMETER_EAR 0x0301
#define GAP_APPEARANCE_GENERIC_HEART_RATE_SENSOR 0x0340
#define GAP_APPEARANCE_HEART_RATE_SENSOR_HEART_RATE_BELT 0x0341
#define GAP_APPEARANCE_GENERIC_BLOOD_PRESSURE 0x0380
#define GAP_APPEARANCE_BLOOD_PRESSURE_ARM 0x0381
#define GAP_APPEARANCE_BLOOD_PRESSURE_WRIST 0x0382
#define GAP_APPEARANCE_HUMAN_INTERFACE_DEVICE 0x03C0
#define GAP_APPEARANCE_KEYBOARD 0x03C1
#define GAP_APPEARANCE_MOUSE 0x03C2
#define GAP_APPEARANCE_JOYSTICK 0x03C3
#define GAP_APPEARANCE_GAMEPAD 0x03C4
#define GAP_APPEARANCE_DIGITIZER_TABLET 0x03C5
#define GAP_APPEARANCE_CARD_READER 0x03C6
#define GAP_APPEARANCE_DIGITAL_PEN 0x03C7
#define GAP_APPEARANCE_BARCODE_SCANNER 0x03C8
#define GAP_APPEARANCE_GENERIC_GLUCOSE_METER 0x0400
#define GAP_APPEARANCE_GENERIC_RUNNING_WALKING_SENSOR 0x0440
#define GAP_APPEARANCE_RUNNING_WALKING_IN_SHOE 0x0441
#define GAP_APPEARANCE_RUNNING_WALKING_ON_SHOE 0x0442
#define GAP_APPEARANCE_RUNNING_WALKING_ON_HIP 0x0443
#define GAP_APPEARANCE_GENERIC_CYCLING 0x0480
#define GAP_APPEARANCE_CYCLING_CYCLING_COMPUTER 0x0481
#define GAP_APPEARANCE_CYCLING_SPEED_SENSOR 0x0482
#define GAP_APPEARANCE_CYCLING_CADENCE_SENSOR 0x0483
#define GAP_APPEARANCE_CYCLING_POWER_SENSOR 0x0484
#define GAP_APPEARANCE_CYCLING_SPEED_AND_CADENCE_SENSOR 0x0485
#define GAP_APPEARANCE_GENERIC_PULSE_OXYMETER 0x0C40
#define GAP_APPEARANCE_FINGERTIP 0x0C41
#define GAP_APPEARANCE_WRIST_WORN 0x0C42
#define GAP_APPEARANCE_GENERIC_WEIGHT_SCALE 0x0C80
#define GAP_APPEARANCE_GENERIC_OUTDOOR_SPORT_ACTIVITY 0x1440
#define GAP_APPEARANCE_LOCATION_DISPLAY_DEVICE 0x1441
#define GAP_APPEARANCE_LOCATION_AND_NAVIGATION_DISPLAY_DEVICE 0x1442
#define GAP_APPEARANCE_LOCATION_POD 0x1443
#define GAP_APPEARANCE_LOCATION_AND_NAVIGATION_POD 0x1444
#define GAP_APPEARANCE_GENERIC_ENVIRONMENTAL_SENSOR 0x1640
/* GATT UUIDs
*/
#define GATT_SERVICE_UUID 0x1801U
#define PRIMARY_SERVICE_UUID 0x2800U
#define SECONDARY_SERVICE_UUID 0x2801U
#define INCLUDE_SERVICE_UUID 0x2802U
#define CHARACTERISTIC_UUID 0x2803U
#define CHAR_EXTENDED_PROP_DESC_UUID 0x2900U
#define CHAR_USER_DESC_UUID 0x2901U
#define CHAR_CLIENT_CONFIG_DESC_UUID 0x2902U
#define CHAR_SERVER_CONFIG_DESC_UUID 0x2903U
#define CHAR_FORMAT_DESC_UUID 0x2904U
#define CHAR_AGGR_FMT_DESC_UUID 0x2905U
#define SERVICE_CHANGED_UUID 0x2A05U
#define CLIENT_SUPPORTED_FEATURES_UUID 0X2B29U
#define DATABASE_HASH_UUID 0X2B2AU
#define SERVER_SUPPORTED_FEATURES_UUID 0X2B3AU
/* GAP UUIDs
*/
#define GAP_SERVICE_UUID 0x1800U
#define DEVICE_NAME_UUID 0x2A00U
#define APPEARANCE_UUID 0x2A01U
#define PERIPHERAL_PREFERRED_CONN_PARAMS_UUID 0x2A04U
#define CENTRAL_ADDRESS_RESOLUTION_UUID 0x2AA6U
#define RESOLVABLE_PRIVATE_ADDRESS_ONLY_UUID 0x2AC9U
#define ENCRYPTED_DATA_KEY_MATERIAL_UUID 0x2B88U
#define LE_GATT_SECURITY_LEVELS_UUID 0x2BF5U
#endif /* BLE_STD_H__ */

View File

@@ -0,0 +1,225 @@
/*****************************************************************************
* @file bleplat.h
*
* @brief This file contains the interface of the BLE platform layer
* (lower interface of the BLE stack library).
* It is included by the STM32WBX BLE stack library.
*****************************************************************************
* @attention
*
* Copyright (c) 2018-2025 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.
*
*****************************************************************************
*/
#ifndef BLEPLAT_H__
#define BLEPLAT_H__
#include <stdint.h>
/* Enumerated values used for the return of the functions:
*/
enum
{
BLEPLAT_OK = 0, /* The function did the job and returns an OK status */
BLEPLAT_FULL = -1, /* The function exits because the HW resource is full */
BLEPLAT_BUSY = -2, /* The function is busy and is not available for the
requested operation */
BLEPLAT_EOF = -3, /* The function exits and notifies the HW resource
(memory for example) reached the end */
BLEPLAT_ERROR = -5 /* The function exits due to some issue (memory
corruption or buffer overflow for example) */
};
/* General functions:
*/
/**
* @brief This function is called by the BLE stack when it is initialized
* or reset (via hci_reset). The user shall call here the functions
* to reset the Timer, AES, PKA and RNG needed for the BLE stack.
* @param None
* @retval None
*/
extern void BLEPLAT_Init( void );
/* Non Volatile Memory (NVM) interface:
*/
/**
* @brief Store data in the NVM.
* This functions indicates the portion of NVM cache buffer that needs
* to be written in NVM.
* @param ptr: Pointer to the start of the data portion to be stored
* (it points inside the NVM cache buffer)
* @param size: Size of valid data in NVM cache buffer (in 64-bit words)
* Note: valid data always starts at the beginning of the NVM
* cache buffer.
* @retval None
*/
extern void BLEPLAT_NvmStore( const uint64_t* ptr,
uint16_t size );
/* Public Key Algorithms (PKA) interface:
*/
/**
* @brief Start P-256 public key generation
* @param local_private_key: table of 8 x 32-bit words that contains the
* P-256 private key (Little Endian format)
* @retval status (BLEPLAT_XX)
*/
extern int BLEPLAT_PkaStartP256Key( const uint32_t* local_private_key );
/**
* @brief Get result of P-256 public key generation
* @param local_public_key: table of 32 x 32-bit words that is filled by the
* function with the generated P-256 public key (Little Endian format)
* @retval status (BLEPLAT_XX)
*/
extern void BLEPLAT_PkaReadP256Key( uint32_t* local_public_key );
/**
* @brief Start DH key computation
* @param local_private_key: table of 8 x 32-bit words that contains the
* local P-256 private key (Little Endian format)
* @param remote_public_key: table of 32 x 32-bit words that contains the
* remote P-256 public key (Little Endian format)
* @retval status (BLEPLAT_XX)
*/
extern int BLEPLAT_PkaStartDhKey( const uint32_t* local_private_key,
const uint32_t* remote_public_key );
/**
* @brief Get result of DH key computation
* @param dh_key: table of 8 x 32-bit words that is filled by the function
* with the generated DH key (Little Endian format)
* @retval status (BLEPLAT_XX)
*/
extern int BLEPLAT_PkaReadDhKey( uint32_t* dh_key );
/**
* @brief Callback function implemented by the Bluetooth LE stack that must
* be called by the user to inform the Bluetooth LE stack about
* completion of P-256 public key generation or DH key computation
* @param None
* @retval status (BLEPLAT_XX)
*/
extern void BLEPLATCB_PkaComplete( void );
/* Advanced Encryption Standard (AES) interface:
*/
/**
* @brief Encrypt a single 128-bit block with a 128-bit key.
* @param key: table of 16 bytes that contains the key to use
* (Little Endian format)
* @param input: table of 16 bytes that contains the block to encrypt
* @param output: table of 16 bytes that is filled by the function with the
* encrypted block
* @retval None
*/
extern void BLEPLAT_AesEcbEncrypt( const uint8_t* key,
const uint8_t* input,
uint8_t* output );
/**
* @brief Set the 128-bit key to be used for CMAC computation.
* @param key: table of 16 bytes that contains the key to use
* (Little Endian format)
* @retval None
*/
extern void BLEPLAT_AesCmacSetKey( const uint8_t* key );
/**
* @brief CMAC computation: the function can be called several times with
* output_tag set to 0 to append data to the computation. It must be
* called once at the end with output_tag not set at 0 to complete
* the CMAC computation.
* @param input: table of "input_length" bytes that contains the data to
* append for the CMAC computation
* @param input_length: number of bytes in "input".
* @param output_tag: must be set to 0 for append.
* Otherwise: table of 16 bytes that is filled by the function with
* the computed CMAC tag.
* @retval None
*/
extern void BLEPLAT_AesCmacCompute( const uint8_t* input,
uint32_t input_length,
uint8_t* output_tag );
/**
* @brief CCM computation
*
* @param mode: CCM mode (0=encryption, 1=decryption)
* @param key: AES encryption key (16 bytes)
* @param iv_length: IV length (in bytes)
* @param iv: IV data
* @param add_length: add length (in bytes)
* @param add: add data
* @param input_length: input data length (in bytes)
* @param input: original data (to be encrypted or decrypted)
* @param tag_length: CCM tag length (in bytes)
* @param tag: CCM tag
* @param output: result data (encrypted or decrypted)
* @retval status (BLEPLAT_XX)
*/
extern int BLEPLAT_AesCcmCrypt( uint8_t mode,
const uint8_t* key,
uint8_t iv_length,
const uint8_t* iv,
uint16_t add_length,
const uint8_t* add,
uint32_t input_length,
const uint8_t* input,
uint8_t tag_length,
uint8_t* tag,
uint8_t* output );
/* Random Number Generation (RNG) interface:
*/
/**
* @brief Get random values.
* @param n: number of 32-bit words to read.
* @param val: pointer to a 32-bit table of size"n" that are filled with
* random values by the function.
* @retval None
*/
extern void BLEPLAT_RngGet( uint8_t n,
uint32_t* val );
/* Timer interface:
*/
/**
* @brief Start the Timer.
* @param id: The timer ID to be started
* @param timeout: The timeout needed to stop the timer (in ms)
* @retval status (BLEPLAT_XX)
*/
extern uint8_t BLEPLAT_TimerStart( uint16_t id,
uint32_t timeout );
/**
* @brief Stop the Timer
* @param id: The timer ID to be stopped
* @retval None
*/
extern void BLEPLAT_TimerStop( uint16_t id );
/**
* @brief The timer callback function called when the timeout of a given
* timer has elapsed
* @param id: The timer ID
* @retval None
*/
extern void BLEPLATCB_TimerExpiry( uint16_t id );
#endif /* BLEPLAT_H__ */

View File

@@ -0,0 +1,260 @@
/*****************************************************************************
* @file blestack.h
*
* @brief Header file for STM32WBA BLE stack
*****************************************************************************
* @attention
*
* Copyright (c) 2018-2025 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.
*
*****************************************************************************
*/
#ifndef BLESTACK_H__
#define BLESTACK_H__
#include "auto/ble_types.h"
#include "ble_bufsize.h"
/*
* Definitions for return value of BleStack_Process( )
*/
enum
{
BLE_SLEEPMODE_RUNNING = 0,
BLE_SLEEPMODE_CPU_HALT = 1,
BLE_SLEEPMODE_WAKETIMER = 2,
BLE_SLEEPMODE_NOTIMER = 3,
};
/*
* Definitions for 'debug' parameter
*/
enum
{
BLE_DEBUG_RAND_ADDR_INIT = 0x00000010UL,
};
/*
* This structure contains the BLE stack initialization parameters
*/
typedef struct
{
/* Start address of the RAM buffer allocated for BLE stack library.
* It must be a 32bit aligned RAM area.
*/
uint8_t* bleStartRamAddress;
/* Size of the RAM buffer allocated for BLE stack library.
* (could be filled with BLE_TOTAL_BUFFER_SIZE return value)
*/
uint32_t total_buffer_size;
/* Start address of the RAM buffer allocated for BLE NVM cache.
*/
uint64_t* nvm_cache_buffer;
/* Size of actual data in BLE NVM cache (in 64-bit words).
* Range: 0 .. (nvm_cache_max_size - 1)
*/
uint16_t nvm_cache_size;
/* Maximum size of BLE NVM cache (in 64-bit words).
* Range: 1 .. 1024
*/
uint16_t nvm_cache_max_size;
/* Start address of the RAM buffer allocated for GATT database.
* It must be a 32bit aligned RAM area.
*/
uint8_t* bleStartRamAddress_GATT;
/* Size of the RAM buffer allocated for GATT database.
* (could be filled with BLE_TOTAL_BUFFER_SIZE_GATT return value)
*/
uint32_t total_buffer_size_GATT;
/* Address of the RAM buffer allocated for GATT long write procedures.
* If ACI_GATT_WRITE_LONG_CHAR_VALUE/ACI_GATT_WRITE_CHAR_RELIABLE commands
* are used, this parameter must point to a 256-byte static buffer. If these
* commands are never used, this parameter can be set to NULL.
*/
uint8_t* gatt_long_write_buffer;
/* Address of the RAM buffer allocated for the extension of Host commands.
* This buffer is referred as the "extra data" buffer in the BLE Wireless
* Interface document. If the commands that need this extension are never
* used, this parameter can be set to NULL.
*/
uint8_t* extra_data_buffer;
/* Size of the RAM buffer allocated for the extension of Host commands.
*/
uint32_t extra_data_buffer_size;
/* Address of the Host events FIFO buffer.
*/
uint16_t* host_event_fifo_buffer;
/* Size of the Host events FIFO buffer (in 16-bit words).
*/
uint16_t host_event_fifo_buffer_size;
/* Maximum number of Attributes (i.e. the number of characteristic + the
* number of characteristic values + the number of descriptors, excluding the
* services) that can be stored in the GATT database.
* Note that certain characteristics and relative descriptors are added
* automatically during device initialization so this parameters should be 9
* (or 6 w.r.t. options) plus the number of user Attributes (NUM_GATT_
* ATTRIBUTES used in the calculation of BLE TOTAL_BUFFER_SIZE_GATT)
*/
uint16_t numAttrRecord;
/* Maximum number of Services that can be stored in the GATT database.
* Note that the GAP and GATT services are automatically added so this
* parameter should be 2 plus the number of user services (NUM_GATT_SERVICES
* used in the calculation of BLE_TOTAL_BUFFER_SIZE_GATT)
*/
uint16_t numAttrServ;
/* Size of the storage area for Attribute values (ATT_VALUE_ARRAY_SIZE used
* in the calculation of BLE_TOTAL_BUFFER_SIZE_GATT)
* This value depends on the number of attributes used by application. In
* particular the sum of the following quantities (in octets) should be made
* for each attribute:
* - attribute value length
* - 5, if UUID is 16 bit; 19, if UUID is 128 bit
* - 2, if server configuration descriptor is used
* - 2*numOfLinks, if client configuration descriptor is used
* - 2, if extended properties is used
* The total amount of memory needed is the sum of the above quantities for
* each attribute.
*/
uint16_t attrValueArrSize;
/* Maximum number of simultaneous connections that the device will support.
* Valid values are from 1 to 8 (NUM_LINKS used in the calculation of
* BLE_TOTAL_BUFFER_SIZE).
*/
uint8_t numOfLinks;
/* Prepare Write List size in terms of number of packet with ATT_MTU=23 bytes
*/
uint8_t prWriteListSize;
/* Number of allocated memory blocks
*/
uint16_t mblockCount;
/* Maximum number of bearers that can be created for Enhanced ATT
* in addition to the number of links
* Range: 0 .. 64
*/
uint8_t max_add_eatt_bearers;
/* Maximum supported ATT_MTU size
*/
uint16_t attMtu;
/* Maximum value of the connection-oriented channel Maximum Payload Size
* Range: 23 .. (BLE_EVT_MAX_PARAM_LEN - 7)
*/
uint16_t max_coc_mps;
/* Maximum number of connection-oriented channels.
* Range: 0 .. 64
*/
uint8_t max_coc_nbr;
/* Maximum number of connection-oriented channels in initiator mode.
* Range: 0 .. max_coc_nbr
*/
uint8_t max_coc_initiator_nbr;
/* Options flags
* Bitmap of the "BLE_OPTIONS_..." definitions (see ble_defs.h).
* - bit 0: 1: LL only 0: LL + host
* - bit 1: 1: no service change desc. 0: with service change desc.
* - bit 2: 1: device name Read-Only 0: device name R/W
* - bit 3: 1: extended adv supported 0: extended adv not supported
* - bit 5: 1: Reduced GATT db in NVM 0: Full GATT db in NVM
* - bit 6: 1: GATT caching is used 0: GATT caching is not used
* - bit 7: 1: LE Power Class 1 0: Other LE Power Classes
* - bit 8: 1: appearance Writable 0: appearance Read-Only
* - bit 9: 1: Enhanced ATT supported 0: Enhanced ATT not supported
* - other bits: reserved
*/
uint16_t options;
/* Debug flags
* Bitmap of the "BLE_DEBUG_..." definitions (see above).
*/
uint32_t debug;
} BleStack_init_t;
/*
* BleStack_Init
*
* @brief The BLE Stack initialization routine
*
* @param[in] Init_params_p pointer to the const structure containing
* memory and low level hardware configuration
* data for the device
*
* @return Value indicating success or error code.
*/
extern tBleStatus BleStack_Init( const BleStack_init_t* init_params_p );
/*
* BleStack_Process
*
* @brief This function executes the processing of all Host Stack layers.
* It has to be executed regularly to process incoming Link Layer packets and
* to process Host Layers procedures. All stack callbacks are called by this
* function.
*
* No BLE stack function must be called while the BleStack_Process is running.
* For example, if a BLE stack function may be called inside an
* interrupt routine, that interrupt must be disabled during the execution of
* BleStack_Process().
*
* @return
* BLE_SLEEPMODE_RUNNING (0) -> BLE Stack Process has to be executed,
* BLE_SLEEPMODE_CPU_HALT (1) -> BLE Stack Process does not have to be
* executed,
*/
extern uint8_t BleStack_Process( void );
/*
* BleStack_Request
*
* @brief This function gives a request from application to the BLE stack.
* The input parameter is a buffer of bytes in the BLE standard format:
* HCI/ACI command packet or ACL data packet.
* The response packet is returned in the same buffer and the size (in bytes)
* of the response is given by the function return value.
*/
extern uint16_t BleStack_Request( uint8_t* buffer );
/*
* BLECB_Indication
*
* @brief Callback called by the BLE stack (from BleStack_Process() context)
* to send an indication to the application. The indication is a BLE standard
* packet that can be either an ACI/HCI event or an ACL data.
*/
extern uint8_t BLECB_Indication( const uint8_t* data,
uint16_t length,
const uint8_t* ext_data,
uint16_t ext_length );
#endif /* BLESTACK_H__ */

View File

@@ -0,0 +1,207 @@
/**
******************************************************************************
* @file svc_ctl.h
* @author MCD Application Team
* @brief Header for ble_controller.c module
******************************************************************************
* @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
*
******************************************************************************
*/
/**
* The BLE Controller supports the application to handle services and clients.
* It provides an API to initialize the BLE core Device and a handler mechanism to rout the GATT/GAP events to the
* application. When the ble_controller is used (recommended), the application shall register a callback for each
* Service and each Client implemented. This is already done with the Services and Clients provided in that delivery.
* + A GATT event is relevant to only one Service and/or one Client. When a GATT event is received, it is notified to
* the registered handlers to the BLE controller. When no registered handler acknowledges positively the GATT event,
* it is reported to the application.
* + A GAP event is not relevant to either a Service or a Client. It is sent to the application
* + In case the application does not want to take benefit from the ble_controller, it could bypass it. In that case,
* the application shall:
* - call SVCCTL_Init() to initialize the BLE core device (or implement on its own what is inside that function
* - implement TLHCI_UserEvtRx() which is the notification from the HCI layer to report all events (GATT/GAP).
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __SVCCTL_H
#define __SVCCTL_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
#include "cmsis_compiler.h"
/* Exported types ------------------------------------------------------------*/
#define PACKED(d) __PACKED_STRUCT
typedef PACKED(struct) _hci_uart_pckt
{
uint8_t type;
uint8_t data[1];
} hci_uart_pckt;
typedef PACKED(struct) _hci_event_pckt
{
uint8_t evt;
uint8_t plen;
uint8_t data[1];
} hci_event_pckt;
typedef PACKED(struct) _evt_le_meta_event
{
uint8_t subevent;
uint8_t data[1];
} evt_le_meta_event;
/**
* Vendor specific event for BLE core.
*/
typedef PACKED(struct) _evt_blecore_aci
{
uint16_t ecode; /**< One of the BLE core event codes. */
uint8_t data[1];
} evt_blecore_aci;
/* ------------------------------------------------------------------------- */
#define ADV_IND 0
#define ADV_DIRECT_IND 1
#define ADV_SCAN_IND 2
#define ADV_NONCONN_IND 3
#define SCAN_RSP 4
#define HIGH_DUTY_CYCLE_DIRECTED_ADV 1
#define LOW_DUTY_CYCLE_DIRECTED_ADV 4
typedef enum
{
SVCCTL_EvtNotAck,
SVCCTL_EvtAckFlowEnable,
SVCCTL_EvtAckFlowDisable,
} SVCCTL_EvtAckStatus_t;
typedef enum
{
SVCCTL_UserEvtFlowDisable,
SVCCTL_UserEvtFlowEnable,
} SVCCTL_UserEvtFlowStatus_t;
typedef SVCCTL_EvtAckStatus_t (*SVC_CTL_p_EvtHandler_t)(void *p_evt);
/* Exported constants --------------------------------------------------------*/
/* External variables --------------------------------------------------------*/
/* Exported macros -----------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
/**
* @brief It initializes the BLE core Driver and sends some commands to initialize the BLE core device
* It shall be called before any BLE operation
*
* @param None
* @retval None
*/
void SVCCTL_Init( void );
/**
* @brief This API registers a handler to be called when a GATT user event is received from the BLE core device. When
* a Service is created, it shall register a callback to be notified when a GATT event is received from the
* BLE core device. When a GATT event is received, it shall be checked in the handler if the GATT events belongs
* to the Service or not. The handler shall return the correct status depending on the result. As soon as one
* Service handler registered acknowledges positively the GATT event, the ble_controller stops calling the
* registered Service handlers.
* This handler is called in the TL_BLE_HCI_UserEvtProc() context
*
* @param pfBLE_SVC_Service_Event_Handler: This is the Service handler that the ble_controller calls to report a GATT
* event received. If the GATT event belongs to that Service, the callback shall return positively with
* SVCCTL_EvtAckFlowEnable.
* @retval None
*/
void SVCCTL_RegisterSvcHandler( SVC_CTL_p_EvtHandler_t pfBLE_SVC_Service_Event_Handler );
/**
* @brief This API registers a handler to be called when a GATT user event is received from the BLE core device. When
* a Client is created, it shall register a callback to be notified when a GATT event is received from the
* BLE core device. When a GATT event is received, it shall be checked in the handler if the GATT events belongs
* to the Client or not. The handler shall return the correct status depending on the result. As soon as one
* Client handler registered acknowledges positively the GATT event, the ble_controller stops calling the
* registered Client handlers.
* This handler is called in the TL_BLE_HCI_UserEvtProc() context
*
* @param pfBLE_SVC_Client_Event_Handler: This is the Client handler that the ble_controller calls to report a GATT
* event received. If the GATT event belongs to that Client, the callback shall return positively with
* SVCCTL_EvtAckFlowEnable.
* @retval None
*/
void SVCCTL_RegisterCltHandler( SVC_CTL_p_EvtHandler_t pfBLE_SVC_Client_Event_Handler );
/**
* @brief This API registers a handler to be called when a GAP user event is received from the BLE core device. When
* a Profile is created, it could register a callback to be notified when a GAP event is received from the
* BLE core device.
* As soon as one handler registered acknowledges positively the event, the ble_controller stops calling the
* registered handlers.
* This handler is called in the TL_BLE_HCI_UserEvtProc() context
*
* @param pfBLE_SVC_Event_Handler: This is the handler that the ble_controller calls to report a GAP
* event received.
* @retval None
*/
void SVCCTL_RegisterHandler( SVC_CTL_p_EvtHandler_t pfBLE_SVC_Event_Handler );
/**
* @brief This API is used to resume the User Event Flow that has been stopped in return of SVCCTL_UserEvtRx()
*
* @param None
* @retval None
*/
void SVCCTL_ResumeUserEventFlow( void );
/**
* @brief This callback is triggered when either
* + a GAP event is received from the BLE core device.
* + a GATT event that has not been positively acknowledged by the registered handler is received from the
* BLE core device.
* The event is returned in a HCI packet. The full HCI packet is stored in a single buffer and is available when
* this callback is triggered. However, an ACI event may be longer than a HCI packet and could be fragmented over
* several HCI packets. The HCI layer only handles HCI packets so when an ACI packet is split over several HCI
* packets, this callback is triggered for each HCI fragment. It is the responsibility of the application to
* reassemble the ACI event.
* This callback is triggered in the TL_BLE_HCI_UserEvtProc() context
*
* @param pckt: The user event received from the BLE core device
* @retval None
*/
SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification( void *pckt );
/**
* @brief
*
*
* @param pckt: The user event received from the BLE core device
* @retval SVCCTL_UserEvtFlowStatus_t: SVCCTL_UserEvtFlowEnable when the packet has been processed
* SVCCTL_UserEvtFlowDisable otherwise (the packet is kept in the queue)
*/
SVCCTL_UserEvtFlowStatus_t SVCCTL_UserEvtRx( void *pckt );
#ifdef __cplusplus
}
#endif
#endif /*__SVCCTL_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@@ -0,0 +1,326 @@
/**
******************************************************************************
* @file uuid.h.h
* @author MCD Application Team
* @version V1.0.0
* @date 04-September-2018
* @brief Header containing the UUIDs of all the services and caharcteristics
*****************************************************************************
* @attention
*
* Copyright (c) 2018-2022 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.
*
*****************************************************************************
*/
#ifndef _UUID_H_
#define _UUID_H_
/* Descriptor UUIDs */
#define CHAR_EXTENDED_PROPERTIES_DESCRIPTOR_UUID (0x2900)
#define CHAR_USER_DESCRIPTION_DESCRIPTOR_UUID (0x2901)
#define CLIENT_CHAR_CONFIG_DESCRIPTOR_UUID (0x2902)
#define SERVER_CHAR_CONFIG_DESCRIPTOR_UUID (0x2903)
#define CHAR_PRESENTATION_FORMAT_DESCRIPTOR_UUID (0x2904)
#define CHAR_AGGREGATE_FORMAT_DESCRIPTOR_UUID (0x2905)
#define VALID_RANGE_DESCRIPTOR_UUID (0x2906)
#define EXTERNAL_REPORT_REFERENCE_DESCRIPTOR_UUID (0x2907)
#define REPORT_REFERENCE_DESCRIPTOR_UUID (0x2908)
#define NUMBER_OF_DIGITALS_DESCRIPTOR_UUID (0x2909)
#define VALUE_TRIGGER_SETTING_DESCRIPTOR_UUID (0x290A)
#define ES_CONFIGURATION_DESCRIPTOR_UUID (0x290B)
#define ES_MEASUREMENT_DESCRIPTOR_UUID (0x290C)
#define ES_TRIGGER_SETTING_DESCRIPTOR_UUID (0x290D)
#define TIME_TRIGGER_SETTING_DESCRIPTOR_UUID (0x290E)
/* UUIDs of Generic Attribute service */
#define GENERIC_ATTRIBUTE_SERVICE_UUID (0x1801)
#define SERVICE_CHANGED_CHARACTERISTIC_UUID (0x2A05)
/* UUIDs of immediate alert service */
#define IMMEDIATE_ALERT_SERVICE_UUID (0x1802)
#define ALERT_LEVEL_CHARACTERISTIC_UUID (0x2A06)
/* UUIDs for Link Loss service */
#define LINK_LOSS_SERVICE_UUID (0x1803)
#define LINK_LOSS_ALERT_LEVEL_CHARACTERISTIC_UUID (0x2A06)
/* UUIDs for TX Power service */
#define TX_POWER_SERVICE_UUID (0x1804)
#define TX_POWER_LEVEL_CHARACTERISTIC_UUID (0x2A07)
/* UUIDs for Time service */
#define CURRENT_TIME_SERVICE_UUID (0x1805)
#define CURRENT_TIME_CHAR_UUID (0x2A2B)
#define LOCAL_TIME_INFORMATION_CHAR_UUID (0x2A0F)
#define REFERENCE_TIME_INFORMATION_CHAR_UUID (0x2A14)
/* UUIDs for Reference Time Update service */
#define REFERENCE_UPDATE_TIME_SERVICE_UUID (0x1806)
#define TIME_UPDATE_CONTROL_POINT_CHAR_UUID (0x2A16)
#define TIME_UPDATE_STATE_CHAR_UUID (0x2A17)
/* UUIDs for Next DST Change service */
#define NEXT_DST_CHANGE_SERVICE_UUID (0x1807)
#define TIME_WITH_DST_CHAR_UUID (0x2A11)
/* UUIDs for glucose profile */
#define GLUCOSE_SERVICE_UUID (0x1808)
#define GLUCOSE_MEASUREMENT_CHAR_UUID (0x2A18)
#define GLUCOSE_MEASUREMENT_CONTEXT_CHAR_UUID (0x2A34)
#define GLUCOSE_FEATURE_CHAR_UUID (0x2A51)
/* Record Access Control Point (RACP) */
#define GLUCOSE_RACP_CHAR_UUID (0x2A52)
/* UUIDs for health thermometer profile */
#define HEALTH_THERMOMETER_SERVICE_UUID (0x1809)
#define TEMPERATURE_MEASUREMENT_CHAR_UUID (0x2A1C)
#define TEMPERATURE_TYPE_CHAR_UUID (0x2A1D)
#define INTERMEDIATE_TEMPERATURE_CHAR_UUID (0x2A1E)
#define MEASUREMENT_INTERVAL_CHAR_UUID (0x2A21)
/* UUIDs for Device Information Service */
#define DEVICE_INFORMATION_SERVICE_UUID (0x180A)
#define SYSTEM_ID_UUID (0x2A23)
#define MODEL_NUMBER_UUID (0x2A24)
#define SERIAL_NUMBER_UUID (0x2A25)
#define FIRMWARE_REVISION_UUID (0x2A26)
#define HARDWARE_REVISION_UUID (0x2A27)
#define SOFTWARE_REVISION_UUID (0x2A28)
#define MANUFACTURER_NAME_UUID (0x2A29)
#define IEEE_CERTIFICATION_UUID (0x2A2A)
#define PNP_ID_UUID (0x2A50)
/* UUIDs for Heart Rate Service */
#define HEART_RATE_SERVICE_UUID (0x180D)
#define CLIENT_CHARACTERISTIC_CONFIG_DESCRIPTOR_UUID (0x2902)
#define HEART_RATE_MEASURMENT_UUID (0x2A37)
#define SENSOR_LOCATION_UUID (0x2A38)
#define CONTROL_POINT_UUID (0x2A39)
/* UUIDs for Phone Alert status profile */
#define PHONE_ALERT_SERVICE_UUID (0x180E)
#define PHONE_ALERT_STATUS_CHARAC_UUID (0x2A3F)
#define RINGER_CNTRL_POINT_CHARAC_UUID (0x2A40)
#define RINGER_SETTING_CHARAC_UUID (0x2A41)
/* UUIDs for battery service */
#define BATTERY_SERVICE_UUID (0x180F)
#define BATTERY_LEVEL_CHAR_UUID (0x2A19)
/* UUIDs for Blood Pressure profile */
#define BLOOD_PRESSURE_SERVICE_UUID (0x1810)
#define BLOOD_PRESSURE_MEASUREMENT_CHAR_UUID (0x2A35)
#define INTERMEDIATE_CUFF_PRESSURE_CHAR_UUID (0x2A36)
#define BLOOD_PRESSURE_FEATURE_CHAR_UUID (0x2A49)
/* UUIDs for alert notification profile */
#define ALERT_NOTIFICATION_SERVICE_UUID (0x1811)
#define SUPPORTED_NEW_ALERT_CATEGORY_CHAR_UUID (0x2A47)
#define NEW_ALERT_CHAR_UUID (0x2A46)
#define SUPPORTED_UNREAD_ALERT_CATEGORY_CHAR_UUID (0x2A48)
#define UNREAD_ALERT_STATUS_CHAR_UUID (0x2A45)
#define ALERT_NOTIFICATION_CONTROL_POINT_CHAR_UUID (0x2A44)
/* UUIDs for human interface device */
#define HUMAN_INTERFACE_DEVICE_SERVICE_UUID (0x1812)
#define PROTOCOL_MODE_CHAR_UUID (0x2A4E)
#define REPORT_CHAR_UUID (0x2A4D)
#define REPORT_MAP_CHAR_UUID (0x2A4B)
#define BOOT_KEYBOARD_INPUT_REPORT_CHAR_UUID (0x2A22)
#define BOOT_KEYBOARD_OUTPUT_REPORT_CHAR_UUID (0x2A32)
#define BOOT_MOUSE_INPUT_REPORT_CHAR_UUID (0x2A33)
#define HID_INFORMATION_CHAR_UUID (0x2A4A)
#define HID_CONTROL_POINT_CHAR_UUID (0x2A4C)
/* UUIDs for scan parameter service */
#define SCAN_PARAMETER_SERVICE_UUID (0x1813)
#define SCAN_INTERVAL_WINDOW_CHAR_UUID (0x2A4F)
#define SCAN_REFRESH_CHAR_UUID (0x2A31)
/* UUIDs for running speed and cadence service */
#define RUNNING_SPEED_CADENCE_SERVICE_UUID (0x1814)
#define RUNNING_SPEED_CADENCE_MEASUREMENT_CHAR_UUID (0x2A53)
#define RUNNING_SPEED_CADENCE_FEATURE_CHAR_UUID (0x2A54)
/* UUIDs for automation IO service */
#define AUTOMATION_IO_SERVICE_UUID (0x1815)
#define AUTOMATION_IO_DIGITAL_CHAR_UUID (0x2A56)
#define AUTOMATION_IO_ANALOG_CHAR_UUID (0x2A58)
#define AUTOMATION_IO_AGGREGATE_CHAR_UUID (0x2A5A)
/* UUIDs for cycling speed and cadence service */
#define CYCLING_SPEED_CADENCE_SERVICE_UUID (0x1816)
#define CYCLING_SPEED_CADENCE_MEASUREMENT_CHAR_UUID (0x2A5B)
#define CYCLING_SPEED_CADENCE_FEATURE_CHAR_UUID (0x2A5C)
/* UUIDs for cycling power service */
#define CYCLING_POWER_SERVICE_UUID (0x1818)
#define CYCLING_POWER_MEASUREMENT_CHAR_UUID (0x2A63)
#define CYCLING_POWER_FEATURE_CHAR_UUID (0x2A65)
#define CYCLING_POWER_SENSOR_LOCATION_CHAR_UUID (0x2A5D)
/* UUIDs for location and navigation device */
#define LOCATION_NAVIGATION_SERVICE_UUID (0x1819)
#define LN_FEATURE_UUID (0x2A6A)
#define LOCATION_SPEED_UUID (0x2A67)
#define POSITION_QUALITY_UUID (0x2A69)
#define LN_CONTROL_POINT_UUID (0x2A6B)
#define NAVIGATION_UUID (0x2A68)
/* UUIDs for environmental sensing profile */
#define ENVIRONMENTAL_SENSING_SERVICE_UUID (0x181A)
#define DESCRIPTOR_VALUE_CHANGED_UUID (0x2A7D)
#define APPARENT_WIND_DIRECTION_UUID (0x2A73)
#define APPARENT_WIND_SPEED_UUID (0x2A72)
#define DEW_POINT_UUID (0x2A7B)
#define ELEVATION_UUID (0x2A6C)
#define GUST_FACTOR_UUID (0x2A74)
#define HEAT_INDEX_UUID (0x2A7A)
#define HUMIDITY_UUID (0x2A6F)
#define IRRADIANCE_UUID (0x2A77)
#define POLLEN_CONCENTRATION_UUID (0x2A75)
#define RAINFALL_UUID (0x2A78)
#define PRESSURE_UUID (0x2A6D)
#define TEMPERATURE_UUID (0x2A6E)
#define TRUE_WIND_DIRECTION_UUID (0x2A71)
#define TRUE_WIND_SPEED_UUID (0x2A70)
#define UV_INDEX_UUID (0x2A76)
#define WIND_CHILL_UUID (0x2A79)
#define BAROMETRIC_PRESSURE_TREND_UUID (0x2AA3)
#define MAGNETIC_DECLINATION_UUID (0x2A2C)
#define MAGNETIC_FLUX_DENSITY_2D_UUID (0x2AA0)
#define MAGNETIC_FLUX_DENSITY_3D_UUID (0x2AA1)
/* UUIDs for body composition service */
#define BODY_COMPOSITION_SERVICE_UUID (0x181B)
#define BODY_COMPOSITION_MEASUREMENT_CHAR_UUID (0x2A9C)
#define BODY_COMPOSITION_FEATURE_CHARAC (0x2A9B)
/* UUIDs for user data service */
#define USER_DATA_SERVICE_UUID (0x181C)
#define AERO_HR_LOWER_LIMIT_CHAR_UUID (0x2A7E)
#define AEROBIC_THRESHOLD_CHAR_UUID (0x2A7F)
#define AGE_CHAR_UUID (0x2A80)
#define ANAERO_HR_LOWER_LIMIT_CHAR_UUID (0x2A81)
#define ANAERO_HR_UPPER_LIMIT_CHAR_UUID (0x2A82)
#define ANAEROBIC_THRESHOLD_CHAR_UUID (0x2A83)
#define AERO_HR_UPPER_LIMIT_CHAR_UUID (0x2A84)
#define BIRTH_DATE_CHAR_UUID (0x2A85)
#define DATE_THRESHOLD_ASSESSMENT_CHAR_UUID (0x2A86)
#define EMAIL_ADDRESS_CHAR_UUID (0x2A87)
#define FAT_BURN_HR_LOWER_LIMIT_CHAR_UUID (0x2A88)
#define FAT_BURN_HR_UPPER_LIMIT_CHAR_UUID (0x2A89)
#define FIRST_NAME_CHAR_UUID (0x2A8A)
#define FIVE_ZONE_HR_LIMIT_CHAR_UUID (0x2A8B)
#define GENDER_CHAR_UUID (0x2A8C)
#define HEART_RATE_MAX_CHAR_UUID (0x2A8D)
#define HEIGHT_CHAR_UUID (0x2A8E)
#define HIP_CIRC_CHAR_UUID (0x2A8F)
#define LAST_NAME_CHAR_UUID (0x2A90)
#define MAX_RECO_HEART_RATE_CHAR_UUID (0x2A91)
#define RESTING_HEART_RATE_CHAR_UUID (0x2A92)
#define SPORT_TYPE_CHAR_UUID (0x2A93)
#define THREE_ZONE_HR_LIMIT_CHAR_UUID (0x2A94)
#define TWO_ZONE_HR_LIMIT_CHAR_UUID (0x2A95)
#define VO2_MAX_CHAR_UUID (0x2A96)
#define WAIST_CIRC_CHAR_UUID (0x2A97)
#define WEIGHT_CHAR_UUID (0x2A98)
#define DATABASE_CHANGE_INCREMENT_CHAR_UUID (0x2A99)
#define USER_INDEX_CHAR_UUID (0x2A9A)
#define USER_CONTROL_POINT_CHAR_UUID (0x2A9F)
#define LANGUAGE_CHAR_UUID (0x2AA2)
/* UUIDs for weight scale profile */
#define WEIGHT_SCALE_SERVICE_UUID (0x181D)
#define WEIGHT_SCALE_MEASUREMENT_CHAR_UUID (0x2A9D)
#define WEIGHT_SCALE_FEATURE_CHAR_UUID (0x2A9E)
/* UUIDs for weight scale profile */
#define BOND_MANAGEMENT_SERVICE_UUID (0x181E)
#define BM_CONTROL_POINT_CHAR_UUID (0x2AA4)
#define BM_FEATURE_CHAR_UUID (0x2AA5)
/* UUIDs for Internet Support Service */
#define INTERNET_SUPPORT_SERVICE_UUID (0x1820)
/* UUIDs for Indoor Positioning Service */
#define INDOOR_POSITIONING_SERVICE_UUID (0x1821)
#define IP_CONFIGURATION_CHAR_UUID (0x2AAD)
#define IP_LATITUDE_CHAR_UUID (0x2AAE)
#define IP_LONGITUDE_CHAR_UUID (0x2AAF)
/* UUIDs for HTTP proxy Service */
#define HTTP_PROXY_SERVICE_UUID (0x1823)
#define HTTP_URI_CHAR_UUID (0x2AB6)
#define HTTP_HEADERS_CHAR_UUID (0x2AB7)
#define HTTP_STATUS_CODE_CHAR_UUID (0x2AB8)
#define HTTP_ENTITY_BODY_CHAR_UUID (0x2AB9)
#define HTTP_CONTROL_POINT_CHAR_UUID (0x2ABA)
#define HTTP_SECURITY_CHAR_UUID (0x2ABB)
/* UUIDs for Object Transfer Service */
#define OBJECT_TRANSFER_SERVICE_UUID (0x1825)
#define OTS_FEATURE_CHAR_UUID (0x2ABD)
#define OBJECT_NAME_CHAR_UUID (0x2ABE)
#define OBJECT_TYPE_CHAR_UUID (0x2ABF)
#define OBJECT_SIZE_CHAR_UUID (0x2AC0)
#define OBJECT_PROPERTIES_CHAR_UUID (0x2AC4)
#define OBJECT_ACTION_CONTROL_POINT_CHAR_UUID (0x2AC5)
#define OBJECT_LIST_CONTROL_POINT_CHAR_UUID (0x2AC6)
/* Custom Services*/
/* UUIDs for data transfer service */
#define DATA_TRANSFER_SERVICE_UUID (0xFE80)
#define DATA_TRANSFER_TX_CHAR_UUID (0xFE81)
#define DATA_TRANSFER_RX_CHAR_UUID (0xFE82)
/* UUIDs for custom battery service */
#define CUSTOM_BATTERY_SERVICE_UUID (0xF2F0)
#define CUSTOM_BATTERY_LEVEL_CHAR_UUID (0xF2F1)
/* Custom Services*/
/* UUIDs for data transfer service */
#define LED_BUTTON_SERVICE_UUID (0x1A30)
#define LED_CHAR_UUID (0x2B50)
#define BUTTON_CHAR_UUID (0x2B51)
/*UUIDs for End Device Management Service*/
#define END_DEVICE_MGT_SERVICE_UUID (0x1A40)
#define END_DEVICE_STATUS_CHAR_UUID (0x2B60)
#define P2P_SERVICE_UUID (0xFE40)
#define P2P_WRITE_CHAR_UUID (0xFE41)
#define P2P_NOTIFY_CHAR_UUID (0xFE42)
#define HOME_SERVICE_UUID (0xFE90)
#define HOME_WRITE_CHAR_UUID (0xFE91)
#define HOME_NOTIFY_CHAR_UUID (0xFE92)
#define CAM_SERVICE_UUID (0xFEA0)
#define CAM_WRITE_CHAR_UUID (0xFEA1)
#define CAM_NOTIFY_CHAR_UUID (0xFEA2)
/* UUIDs for Cable Replacement Service */
#define CRS_SERVICE_UUID (0xFE60)
#define CRS_TX_CHAR_UUID (0xFE61)
#define CRS_RX_CHAR_UUID (0xFE62)
/* UUIDs for Apple Notification Center Service */
#define ANCS_SERVICE_UUID (0xF431)
#define ANCS_NOTIFICATION_SOURCE_CHAR_UUID (0x120D)
#define ANCS_CONTROL_POINT_CHAR_UUID (0xD8F3)
#define ANCS_DATA_SOURCE_CHAR_UUID (0xC6E9)
/* UUIDs for Apple Media Service start from iOS 8*/
#define AMS_SERVICE_UUID (0x502B)
#define AMS_REMOTE_COMMAND_CHAR_UUID (0x81D8)
#define AMS_ENTITY_UPDATE_CHAR_UUID (0xABCE)
#define AMS_ENTITY_ATTRIBUTE_CHAR_UUID (0xF38C)
#endif /* _UUID_H_ */

View File

@@ -0,0 +1,255 @@
/**
******************************************************************************
* @file svc_ctl.c
* @author MCD Application Team
* @brief BLE Controller
*****************************************************************************
* @attention
*
* Copyright (c) 2018-2022 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.
*
*****************************************************************************
*/
/* Includes ------------------------------------------------------------------*/
#include "svc_ctl.h"
#include "ble_core.h"
#include "ble_conf.h"
/* Private typedef -----------------------------------------------------------*/
typedef struct
{
#if (BLE_CFG_SVC_MAX_NBR_CB > 0)
SVC_CTL_p_EvtHandler_t SVCCTL__SvcHandlerTab[BLE_CFG_SVC_MAX_NBR_CB];
#endif
uint8_t NbreOfRegisteredHandler;
} SVCCTL_EvtHandler_t;
typedef struct
{
#if (BLE_CFG_CLT_MAX_NBR_CB > 0)
SVC_CTL_p_EvtHandler_t SVCCTL_CltHandlerTable[BLE_CFG_CLT_MAX_NBR_CB];
#endif
uint8_t NbreOfRegisteredHandler;
} SVCCTL_CltHandler_t;
typedef struct
{
#if (BLE_CFG_MAX_NBR_CB > 0)
SVC_CTL_p_EvtHandler_t SVCCTL_HandlerTable[BLE_CFG_MAX_NBR_CB];
#endif
uint8_t NbreOfRegisteredHandler;
} SVCCTL_Handler_t;
/* Private defines -----------------------------------------------------------*/
#define SVCCTL_EGID_EVT_MASK 0xFF00
#define SVCCTL_GATT_EVT_TYPE 0x0C00
/* Private macros ------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
SVCCTL_EvtHandler_t SVCCTL_EvtHandler;
SVCCTL_CltHandler_t SVCCTL_CltHandler;
SVCCTL_Handler_t SVCCTL_Handler;
/* Private functions ----------------------------------------------------------*/
/* Weak functions -------------------------------------------------------------*/
/* Functions Definition ------------------------------------------------------*/
void SVCCTL_Init( void )
{
/**
* Initialize the number of registered Handler
*/
SVCCTL_EvtHandler.NbreOfRegisteredHandler = 0;
SVCCTL_CltHandler.NbreOfRegisteredHandler = 0;
SVCCTL_Handler.NbreOfRegisteredHandler = 0;
return;
}
/**
* @brief BLE Controller initialization
* @param None
* @retval None
*/
void SVCCTL_RegisterSvcHandler( SVC_CTL_p_EvtHandler_t pfBLE_SVC_Service_Event_Handler )
{
#if (BLE_CFG_SVC_MAX_NBR_CB > 0)
SVCCTL_EvtHandler.SVCCTL__SvcHandlerTab[SVCCTL_EvtHandler.NbreOfRegisteredHandler] = pfBLE_SVC_Service_Event_Handler;
SVCCTL_EvtHandler.NbreOfRegisteredHandler++;
#else
(void)(pfBLE_SVC_Service_Event_Handler);
#endif
return;
}
/**
* @brief BLE Controller initialization
* @param None
* @retval None
*/
void SVCCTL_RegisterCltHandler( SVC_CTL_p_EvtHandler_t pfBLE_SVC_Client_Event_Handler )
{
#if (BLE_CFG_CLT_MAX_NBR_CB > 0)
SVCCTL_CltHandler.SVCCTL_CltHandlerTable[SVCCTL_CltHandler.NbreOfRegisteredHandler] = pfBLE_SVC_Client_Event_Handler;
SVCCTL_CltHandler.NbreOfRegisteredHandler++;
#else
(void)(pfBLE_SVC_Client_Event_Handler);
#endif
return;
}
/**
* @brief BLE Controller initialization
* @param None
* @retval None
*/
void SVCCTL_RegisterHandler( SVC_CTL_p_EvtHandler_t pfBLE_SVC_Event_Handler )
{
#if (BLE_CFG_MAX_NBR_CB > 0)
SVCCTL_Handler.SVCCTL_HandlerTable[SVCCTL_Handler.NbreOfRegisteredHandler] = pfBLE_SVC_Event_Handler;
SVCCTL_Handler.NbreOfRegisteredHandler++;
#else
(void)(pfBLE_SVC_Event_Handler);
#endif
return;
}
SVCCTL_UserEvtFlowStatus_t SVCCTL_UserEvtRx( void *pckt )
{
hci_event_pckt *event_pckt;
evt_blecore_aci *blecore_evt;
SVCCTL_EvtAckStatus_t event_notification_status;
SVCCTL_UserEvtFlowStatus_t return_status;
#if (BLE_CFG_SVC_MAX_NBR_CB > 0) || (BLE_CFG_CLT_MAX_NBR_CB > 0)
uint8_t index;
#endif
event_pckt = (hci_event_pckt*) ((hci_uart_pckt *) pckt)->data;
event_notification_status = SVCCTL_EvtNotAck;
switch (event_pckt->evt)
{
case HCI_VENDOR_SPECIFIC_DEBUG_EVT_CODE:
{
blecore_evt = (evt_blecore_aci*) event_pckt->data;
switch ((blecore_evt->ecode) & SVCCTL_EGID_EVT_MASK)
{
case SVCCTL_GATT_EVT_TYPE:
#if (BLE_CFG_SVC_MAX_NBR_CB > 0)
/* For Service event handler */
for (index = 0; index < SVCCTL_EvtHandler.NbreOfRegisteredHandler; index++)
{
event_notification_status = SVCCTL_EvtHandler.SVCCTL__SvcHandlerTab[index](pckt);
/**
* When a GATT event has been acknowledged by a Service, there is no need to call the other registered handlers
* a GATT event is relevant for only one Service
*/
if (event_notification_status != SVCCTL_EvtNotAck)
{
/**
* The event has been managed. The Event processing should be stopped
*/
break;
}
}
#endif
#if (BLE_CFG_CLT_MAX_NBR_CB > 0)
/* For Client event handler */
event_notification_status = SVCCTL_EvtNotAck;
for(index = 0; index <SVCCTL_CltHandler.NbreOfRegisteredHandler; index++)
{
event_notification_status = SVCCTL_CltHandler.SVCCTL_CltHandlerTable[index](pckt);
/**
* When a GATT event has been acknowledged by a Client, there is no need to call the other registered handlers
* a GATT event is relevant for only one Client
*/
if (event_notification_status != SVCCTL_EvtNotAck)
{
/**
* The event has been managed. The Event processing should be stopped
*/
break;
}
}
#endif
break;
default:
#if (BLE_CFG_MAX_NBR_CB > 0)
/* For event handler */
for(index = 0; index <SVCCTL_Handler.NbreOfRegisteredHandler; index++)
{
event_notification_status = SVCCTL_Handler.SVCCTL_HandlerTable[index](pckt);
/**
* When a GATT event has been acknowledged by a Client, there is no need to call the other registered handlers
* a GATT event is relevant for only one Client
*/
if (event_notification_status != SVCCTL_EvtNotAck)
{
/**
* The event has been managed. The Event processing should be stopped
*/
break;
}
}
#endif
break;
}
}
break; /* HCI_HCI_VENDOR_SPECIFIC_DEBUG_EVT_CODE_SPECIFIC */
default:
#if (BLE_CFG_MAX_NBR_CB > 0)
/* For event handler */
for(index = 0; index <SVCCTL_Handler.NbreOfRegisteredHandler; index++)
{
event_notification_status = SVCCTL_Handler.SVCCTL_HandlerTable[index](pckt);
}
#endif
break;
}
/**
* When no registered handlers (either Service or Client) has acknowledged the GATT event, it is reported to the application
* a GAP event is always reported to the application.
*/
switch (event_notification_status)
{
case SVCCTL_EvtNotAck:
/**
* The event has NOT been managed.
* It shall be passed to the application for processing
*/
return_status = SVCCTL_App_Notification(pckt);
break;
case SVCCTL_EvtAckFlowEnable:
return_status = SVCCTL_UserEvtFlowEnable;
break;
case SVCCTL_EvtAckFlowDisable:
return_status = SVCCTL_UserEvtFlowDisable;
break;
default:
return_status = SVCCTL_UserEvtFlowEnable;
break;
}
return (return_status);
}
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@@ -0,0 +1,262 @@
/*$Id: //dwh/bluetooth/DWC_ble154combo/firmware/rel/2.00a-lca01/firmware/public_inc/ll_fw_config.h#1 $*/
/**
********************************************************************************
* @file ll_fw_config.h
* @brief This file contains the major configurations to the BLE controller.
******************************************************************************
* @copy
* This Synopsys DWC Bluetooth Low Energy Combo Link Layer/MAC software and
* associated documentation ( hereinafter the "Software") is an unsupported
* proprietary work of Synopsys, Inc. unless otherwise expressly agreed to in
* writing between Synopsys and you. The Software IS NOT an item of Licensed
* Software or a Licensed Product under any End User Software License Agreement
* or Agreement for Licensed Products with Synopsys or any supplement thereto.
* Synopsys is a registered trademark of Synopsys, Inc. Other names included in
* the SOFTWARE may be the trademarks of their respective owners.
*
* Synopsys MIT License:
* Copyright (c) 2020-Present Synopsys, Inc
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* the Software), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute,
* sublicense, and/or sell copies of the Software, and to permit persons to whom
* the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING, BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE ARISING FROM,
* OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* */
#ifndef INCLUDE_LL_FW_CONFIG_H
#define INCLUDE_LL_FW_CONFIG_H
/*************************** General Configuration *********************************/
#ifndef SUPPORT_GNRC_SCHDLR_IF
#define SUPPORT_GNRC_SCHDLR_IF 1 /* Enable\Disable event EXTRNL_GNRC in Ble event manager. Enable:1 - Disable:0 */
#endif /* SUPPORT_GNRC_SCHDLR_IF */
/*************************** BLE Configuration *************************************/
/*Configurations of BLE will apply only when BLE is enabled*/
/* Variant configuration */
#define CFG_LL_BLE_BASIC 1
/* Roles configurations */
#ifndef SUPPORT_EXPLCT_OBSERVER_ROLE
#define SUPPORT_EXPLCT_OBSERVER_ROLE 1 /* Enable\Disable Explicit observer role. Enable:1 - Disable:0 */
#endif /* SUPPORT_EXPLCT_OBSERVER_ROLE */
#ifndef SUPPORT_EXPLCT_BROADCASTER_ROLE
#define SUPPORT_EXPLCT_BROADCASTER_ROLE 1 /* Enable\Disable Explicit broadcaster role. Enable:1 - Disable:0 */
#endif /* SUPPORT_EXPLCT_BROADCASTER_ROLE */
#ifndef SUPPORT_MASTER_CONNECTION
#define SUPPORT_MASTER_CONNECTION 1 /* Enable\Disable Master connection role. Enable:1 - Disable:0 */
#endif /* SUPPORT_MASTER_CONNECTION */
#ifndef SUPPORT_SLAVE_CONNECTION
#define SUPPORT_SLAVE_CONNECTION 1 /* Enable\Disable Slave connection role. Enable:1 - Disable:0 */
#endif /* SUPPORT_SLAVE_CONNECTION */
/* Standard features configurations */
#ifndef SUPPORT_LE_ENCRYPTION
#define SUPPORT_LE_ENCRYPTION 1 /* Enable\Disable Encryption feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_ENCRYPTION */
#ifndef SUPPORT_PRIVACY
#define SUPPORT_PRIVACY 1 /* Enable\Disable Privacy feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_PRIVACY */
#ifndef SUPPORT_LE_EXTENDED_ADVERTISING
#define SUPPORT_LE_EXTENDED_ADVERTISING 0 /* Enable\Disable Extended advertising feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_EXTENDED_ADVERTISING */
#ifndef SUPPORT_LE_PERIODIC_ADVERTISING
#define SUPPORT_LE_PERIODIC_ADVERTISING 0 /* Enable\Disable Periodic advertising feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_PERIODIC_ADVERTISING */
#ifndef SUPPORT_LE_POWER_CLASS_1
#define SUPPORT_LE_POWER_CLASS_1 1 /* Enable\Disable Low power class 1 feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_POWER_CLASS_1 */
#ifndef SUPPORT_AOA_AOD
#define SUPPORT_AOA_AOD 0 /* Enable\Disable AOA_AOD feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_AOA_AOD */
#ifndef SUPPORT_PERIODIC_SYNC_TRANSFER
#define SUPPORT_PERIODIC_SYNC_TRANSFER 0 /* Enable\Disable PAST feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_PERIODIC_SYNC_TRANSFER */
#ifndef SUPPORT_SLEEP_CLOCK_ACCURCY_UPDATES
#define SUPPORT_SLEEP_CLOCK_ACCURCY_UPDATES 1 /* Enable\Disable Sleep Clock Accuracy Updates Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_SLEEP_CLOCK_ACCURCY_UPDATES */
#ifndef SUPPORT_CONNECTED_ISOCHRONOUS
#define SUPPORT_CONNECTED_ISOCHRONOUS 0 /* Enable\Disable Connected Isochronous Channel Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_CONNECTED_ISOCHRONOUS */
#ifndef SUPPORT_BRD_ISOCHRONOUS
#define SUPPORT_BRD_ISOCHRONOUS 0 /* Enable\Disable Broadcast Isochronous Channel Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_BRD_ISOCHRONOUS */
#ifndef SUPPORT_SYNC_ISOCHRONOUS
#define SUPPORT_SYNC_ISOCHRONOUS 0 /* Enable\Disable Broadcast Isochronous Synchronizer Channel Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_SYNC_ISOCHRONOUS */
#ifndef SUPPORT_LE_POWER_CONTROL
#define SUPPORT_LE_POWER_CONTROL 0 /* Enable\Disable LE Power Control Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_POWER_CONTROL */
#ifndef SUPPORT_CHANNEL_CLASSIFICATION
#define SUPPORT_CHANNEL_CLASSIFICATION 0
#endif /* SUPPORT_CHANNEL_CLASSIFICATION */
#ifndef SUPPORT_PERIODIC_ADV_ADI
#define SUPPORT_PERIODIC_ADV_ADI 0
#endif /* SUPPORT_PERIODIC_ADV_ADI */
#ifndef SUPPORT_LE_ENHANCED_CONN_UPDATE
#define SUPPORT_LE_ENHANCED_CONN_UPDATE 0
#endif /* SUPPORT_LE_ENHANCED_CONN_UPDATE */
#ifndef SUPPORT_CSSA
#define SUPPORT_CSSA 0 /* Enable\Disable Coding Selection Scheme on Advertising Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_CSSA */
#ifndef SUPPORT_LE_PAWR_ADVERTISER_ROLE
#define SUPPORT_LE_PAWR_ADVERTISER_ROLE 0 /* Enable\Disable PAwR Advertiser role. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_PAWR_ADVERTISER_ROLE */
#ifndef SUPPORT_LE_PAWR_SYNC_ROLE
#define SUPPORT_LE_PAWR_SYNC_ROLE 0 /* Enable\Disable PAwR Synchronizer role. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_PAWR_SYNC_ROLE */
#ifndef SUPPORT_CHANNEL_SOUNDING
#define SUPPORT_CHANNEL_SOUNDING 0 /* Enable\Disable Channel Sounding Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_CHANNEL_SOUNDING */
#ifndef SUPPORT_FRAME_SPACE_UPDATE
#define SUPPORT_FRAME_SPACE_UPDATE 0 /* Enable\Disable Frame Space Update Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_FRAME_SPACE_UPDATE */
#ifndef SUPPORT_EXT_FEATURE_SET
#define SUPPORT_EXT_FEATURE_SET 0 /* Enable\Disable Extended Feature Set Exchange. Enable:1 - Disable:0 */
#endif /* SUPPORT_EXT_FEATURE_SET */
#ifndef SUPPORT_ISO_UNSEG_MODE
#define SUPPORT_ISO_UNSEG_MODE 0 /* Enable\Disable Unsegmented Mode for Framed ISO PDUs. Enable: 1 - Disable: 0*/
#endif /* SUPPORT_ISO_UNSEG_MODE */
#ifndef SUPPORT_LE_ADVERTISERS_MONITORING
#define SUPPORT_LE_ADVERTISERS_MONITORING 0 /* Enable\Disable Advertisers Monitoring Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_ADVERTISERS_MONITORING */
/* Capabilities configurations */
#ifndef MAX_NUM_CNCRT_STAT_MCHNS
#define MAX_NUM_CNCRT_STAT_MCHNS 8 /* Set maximum number of states the controller can support */
#endif /* MAX_NUM_CNCRT_STAT_MCHNS */
#ifndef USE_NON_ACCURATE_32K_SLEEP_CLK
#define USE_NON_ACCURATE_32K_SLEEP_CLK 1 /* Allow to drive the sleep clock by sources other than the default crystal oscillator source.*/
/*LL can use crystal oscillator or RTC or RCO to drive the sleep clock.This selection is done via "DEFAULT_SLEEP_CLOCK_SOURCE" macro. */
#endif /* USE_NON_ACCURATE_32K_SLEEP_CLK */
#ifndef SUPPORT_CTE_DEGRADATION_API
#define SUPPORT_CTE_DEGRADATION_API 1 /* Enable\Disable CTE degradation API. Enable:1 - Disable:0 */
#endif /* SUPPORT_CTE_DEGRADATION_API */
/* Non-standard features configurations */
#ifndef NUM_OF_CTSM_EMNGR_HNDLS
#define NUM_OF_CTSM_EMNGR_HNDLS 1 /* Number of custom handles in event manager to be used for app specific needs */
#endif /* NUM_OF_CTSM_EMNGR_HNDLS */
#ifndef SUPPORT_AUGMENTED_BLE_MODE
#define SUPPORT_AUGMENTED_BLE_MODE 1 /* Enable\Disable Augmented BLE Support. Enable:1 - Disable:0 */
#endif /* SUPPORT_AUGMENTED_BLE_MODE */
#ifndef SUPPORT_PTA
#define SUPPORT_PTA 1 /* Enable\Disable PTA Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_PTA */
#ifndef SUPPORT_CONFIGURABLE_GAIN_FIX
#define SUPPORT_CONFIGURABLE_GAIN_FIX 0 /* Enable\Disable configurable gain fix support */
#endif /* SUPPORT_CONFIGURABLE_GAIN_FIX */
#ifndef CHECK_ANY_MISSED_EVENT_ON_DEEP_SLEEP_EXIT
#define CHECK_ANY_MISSED_EVENT_ON_DEEP_SLEEP_EXIT 1 /* Enable\Disable calling event scheduler handler function at the end of deep sleep exit*/
#endif /* CHECK_ANY_MISSED_EVENT_ON_DEEP_SLEEP_EXIT */
#ifndef SUPPORT_PROFILE
#define SUPPORT_PROFILE PROFILE_LIGHTWEIGHT /* Enable\Disable profiling LL timing framework */
#endif /* SUPPORT_PROFILE */
#ifndef LL_BASIC
#define LL_BASIC 1
#endif /* LL_BASIC */
/*************************** MAC Configuration *************************************/
/*Configurations of MAC will apply only when MAC is enabled*/
#ifndef FFD_DEVICE_CONFIG
#define FFD_DEVICE_CONFIG 0 /* Enable\Disable FFD:1 - RFD:0 */
#endif /* FFD_DEVICE_CONFIG */
#ifdef SUPPORT_AUG_MAC_HCI_UART
#ifndef RAL_NUMBER_OF_INSTANCE
#define RAL_NUMBER_OF_INSTANCE 0 /* The Number of RAL instances supported */
#endif /* RAL_NUMBER_OF_INSTANCE */
#else
#ifndef RAL_NUMBER_OF_INSTANCE
#define RAL_NUMBER_OF_INSTANCE 0 /* The Number of RAL instances supported */
#endif /* RAL_NUMBER_OF_INSTANCE */
#endif
#ifndef MAX_NUMBER_OF_INDIRECT_DATA
#define MAX_NUMBER_OF_INDIRECT_DATA 0 /* The maximum number of supported indirect data buffers */
#endif /* MAX_NUMBER_OF_INDIRECT_DATA */
#ifndef SUPPORT_OPENTHREAD_1_2
#define SUPPORT_OPENTHREAD_1_2 0 /* Enable / disable FW parts related to new features introduced in openthread 1.2*/
#endif /* SUPPORT_OPENTHREAD_1_2 */
#ifndef SUPPORT_SEC
#define SUPPORT_SEC 0 /* The MAC Security Supported : 1 - Not Supported:0 */
#endif /* SUPPORT_SEC */
#ifndef RADIO_CSMA
#define RADIO_CSMA 0 /* Enable\Disable CSMA Algorithm in Radio Layer, Must be Enabled if MAC_LAYER_BUILD */
#endif /* RADIO_CSMA */
#ifndef ENHANCED_RX_WHILE_CSMA_BACKOFF_DELAY
#define ENHANCED_RX_WHILE_CSMA_BACKOFF_DELAY 1 /* Enable\Disable RX WITH CSMA Feature */
#endif /* ENHANCED_RX_WHILE_CSMA_BACKOFF_DELAY */
#ifndef SUPPORT_ANT_DIV
#define SUPPORT_ANT_DIV 1 /* Enable/Disable Antenna Diversity Feature */
#endif /* SUPPORT_ANT_DIV */
#ifndef SUPPORT_A_MAC
#define SUPPORT_A_MAC 0
#endif /* SUPPORT_A_MAC */
#ifndef SUPPORT_CONFIG_LIB
#define SUPPORT_CONFIG_LIB 1 /* Enable\Disable Configurable Library feature */
#endif /* SUPPORT_CONFIG_LIB */
#ifndef SMPL_PRTCL_TEST_ENABLE
#define SMPL_PRTCL_TEST_ENABLE 0
#endif /* SMPL_PRTCL_TEST_ENABLE */
/*************************** Zigbee Configuration **********************************/
#ifndef SUPPORT_ZIGBEE_PHY_CERTIFICATION
#define SUPPORT_ZIGBEE_PHY_CERTIFICATION 0 /* Enable support of hci command required to implement zigbee phy Test cases Enable:1 - Disable:0 */
#endif /* SUPPORT_ZIGBEE_PHY_CERTIFICATION */
#endif /* INCLUDE_LL_FW_CONFIG_H */

View File

@@ -0,0 +1,260 @@
/*$Id: //dwh/bluetooth/DWC_ble154combo/firmware/rel/2.00a-lca04/firmware/public_inc/ll_fw_config.h#1 $*/
/**
********************************************************************************
* @file ll_fw_config.h
* @brief This file contains the major configurations to the BLE controller.
******************************************************************************
* This Synopsys DWC Bluetooth Low Energy Combo Link Layer/MAC software and
* associated documentation ( hereinafter the "Software") is an unsupported
* proprietary work of Synopsys, Inc. unless otherwise expressly agreed to in
* writing between Synopsys and you. The Software IS NOT an item of Licensed
* Software or a Licensed Product under any End User Software License Agreement
* or Agreement for Licensed Products with Synopsys or any supplement thereto.
* Synopsys is a registered trademark of Synopsys, Inc. Other names included in
* the SOFTWARE may be the trademarks of their respective owners.
*
* Synopsys MIT License:
* Copyright (c) 2020-Present Synopsys, Inc
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* the Software), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute,
* sublicense, and/or sell copies of the Software, and to permit persons to whom
* the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING, BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE ARISING FROM,
* OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* */
#ifndef INCLUDE_LL_FW_CONFIG_H
#define INCLUDE_LL_FW_CONFIG_H
/*************************** General Configuration *********************************/
#ifndef SUPPORT_GNRC_SCHDLR_IF
#define SUPPORT_GNRC_SCHDLR_IF 1 /* Enable\Disable event EXTRNL_GNRC in Ble event manager. Enable:1 - Disable:0 */
#endif /* SUPPORT_GNRC_SCHDLR_IF */
/*************************** BLE Configuration *************************************/
/*Configurations of BLE will apply only when BLE is enabled*/
/* Variant configuration */
#define CFG_LL_BLE_BASIC 1
/* Roles configurations */
#ifndef SUPPORT_EXPLCT_OBSERVER_ROLE
#define SUPPORT_EXPLCT_OBSERVER_ROLE 1 /* Enable\Disable Explicit observer role. Enable:1 - Disable:0 */
#endif /* SUPPORT_EXPLCT_OBSERVER_ROLE */
#ifndef SUPPORT_EXPLCT_BROADCASTER_ROLE
#define SUPPORT_EXPLCT_BROADCASTER_ROLE 1 /* Enable\Disable Explicit broadcaster role. Enable:1 - Disable:0 */
#endif /* SUPPORT_EXPLCT_BROADCASTER_ROLE */
#ifndef SUPPORT_MASTER_CONNECTION
#define SUPPORT_MASTER_CONNECTION 1 /* Enable\Disable Master connection role. Enable:1 - Disable:0 */
#endif /* SUPPORT_MASTER_CONNECTION */
#ifndef SUPPORT_SLAVE_CONNECTION
#define SUPPORT_SLAVE_CONNECTION 1 /* Enable\Disable Slave connection role. Enable:1 - Disable:0 */
#endif /* SUPPORT_SLAVE_CONNECTION */
/* Standard features configurations */
#ifndef SUPPORT_LE_ENCRYPTION
#define SUPPORT_LE_ENCRYPTION 1 /* Enable\Disable Encryption feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_ENCRYPTION */
#ifndef SUPPORT_PRIVACY
#define SUPPORT_PRIVACY 1 /* Enable\Disable Privacy feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_PRIVACY */
#ifndef SUPPORT_LE_EXTENDED_ADVERTISING
#define SUPPORT_LE_EXTENDED_ADVERTISING 0 /* Enable\Disable Extended advertising feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_EXTENDED_ADVERTISING */
#ifndef SUPPORT_LE_PERIODIC_ADVERTISING
#define SUPPORT_LE_PERIODIC_ADVERTISING 0 /* Enable\Disable Periodic advertising feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_PERIODIC_ADVERTISING */
#ifndef SUPPORT_LE_POWER_CLASS_1
#define SUPPORT_LE_POWER_CLASS_1 1 /* Enable\Disable Low power class 1 feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_POWER_CLASS_1 */
#ifndef SUPPORT_AOA_AOD
#define SUPPORT_AOA_AOD 0 /* Enable\Disable AOA_AOD feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_AOA_AOD */
#ifndef SUPPORT_PERIODIC_SYNC_TRANSFER
#define SUPPORT_PERIODIC_SYNC_TRANSFER 0 /* Enable\Disable PAST feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_PERIODIC_SYNC_TRANSFER */
#ifndef SUPPORT_SLEEP_CLOCK_ACCURCY_UPDATES
#define SUPPORT_SLEEP_CLOCK_ACCURCY_UPDATES 1 /* Enable\Disable Sleep Clock Accuracy Updates Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_SLEEP_CLOCK_ACCURCY_UPDATES */
#ifndef SUPPORT_CONNECTED_ISOCHRONOUS
#define SUPPORT_CONNECTED_ISOCHRONOUS 0 /* Enable\Disable Connected Isochronous Channel Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_CONNECTED_ISOCHRONOUS */
#ifndef SUPPORT_BRD_ISOCHRONOUS
#define SUPPORT_BRD_ISOCHRONOUS 0 /* Enable\Disable Broadcast Isochronous Channel Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_BRD_ISOCHRONOUS */
#ifndef SUPPORT_SYNC_ISOCHRONOUS
#define SUPPORT_SYNC_ISOCHRONOUS 0 /* Enable\Disable Broadcast Isochronous Synchronizer Channel Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_SYNC_ISOCHRONOUS */
#ifndef SUPPORT_LE_POWER_CONTROL
#define SUPPORT_LE_POWER_CONTROL 0 /* Enable\Disable LE Power Control Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_POWER_CONTROL */
#ifndef SUPPORT_CHANNEL_CLASSIFICATION
#define SUPPORT_CHANNEL_CLASSIFICATION 0
#endif /* SUPPORT_CHANNEL_CLASSIFICATION */
#ifndef SUPPORT_PERIODIC_ADV_ADI
#define SUPPORT_PERIODIC_ADV_ADI 0
#endif /* SUPPORT_PERIODIC_ADV_ADI */
#ifndef SUPPORT_LE_ENHANCED_CONN_UPDATE
#define SUPPORT_LE_ENHANCED_CONN_UPDATE 0
#endif /* SUPPORT_LE_ENHANCED_CONN_UPDATE */
#ifndef SUPPORT_CSSA
#define SUPPORT_CSSA 0 /* Enable\Disable Coding Selection Scheme on Advertising Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_CSSA */
#ifndef SUPPORT_LE_PAWR_ADVERTISER_ROLE
#define SUPPORT_LE_PAWR_ADVERTISER_ROLE 0 /* Enable\Disable PAwR Advertiser role. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_PAWR_ADVERTISER_ROLE */
#ifndef SUPPORT_LE_PAWR_SYNC_ROLE
#define SUPPORT_LE_PAWR_SYNC_ROLE 0 /* Enable\Disable PAwR Synchronizer role. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_PAWR_SYNC_ROLE */
#ifndef SUPPORT_CHANNEL_SOUNDING
#define SUPPORT_CHANNEL_SOUNDING 0 /* Enable\Disable Channel Sounding Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_CHANNEL_SOUNDING */
#ifndef SUPPORT_FRAME_SPACE_UPDATE
#define SUPPORT_FRAME_SPACE_UPDATE 0 /* Enable\Disable Frame Space Update Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_FRAME_SPACE_UPDATE */
#ifndef SUPPORT_EXT_FEATURE_SET
#define SUPPORT_EXT_FEATURE_SET 0 /* Enable\Disable Extended Feature Set Exchange. Enable:1 - Disable:0 */
#endif /* SUPPORT_EXT_FEATURE_SET */
#ifndef SUPPORT_ISO_UNSEG_MODE
#define SUPPORT_ISO_UNSEG_MODE 0 /* Enable\Disable Unsegmented Mode for Framed ISO PDUs. Enable: 1 - Disable: 0*/
#endif /* SUPPORT_ISO_UNSEG_MODE */
#ifndef SUPPORT_LE_ADVERTISERS_MONITORING
#define SUPPORT_LE_ADVERTISERS_MONITORING 0 /* Enable\Disable Advertisers Monitoring Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_ADVERTISERS_MONITORING */
/* Capabilities configurations */
#ifndef MAX_NUM_CNCRT_STAT_MCHNS
#define MAX_NUM_CNCRT_STAT_MCHNS 20 /* Set maximum number of states the controller can support */
#endif /* MAX_NUM_CNCRT_STAT_MCHNS */
#ifndef USE_NON_ACCURATE_32K_SLEEP_CLK
#define USE_NON_ACCURATE_32K_SLEEP_CLK 1 /* Allow to drive the sleep clock by sources other than the default crystal oscillator source.*/
/*LL can use crystal oscillator or RTC or RCO to drive the sleep clock.This selection is done via "DEFAULT_SLEEP_CLOCK_SOURCE" macro. */
#endif /* USE_NON_ACCURATE_32K_SLEEP_CLK */
#ifndef SUPPORT_CTE_DEGRADATION_API
#define SUPPORT_CTE_DEGRADATION_API 1 /* Enable\Disable CTE degradation API. Enable:1 - Disable:0 */
#endif /* SUPPORT_CTE_DEGRADATION_API */
/* Non-standard features configurations */
#ifndef NUM_OF_CTSM_EMNGR_HNDLS
#define NUM_OF_CTSM_EMNGR_HNDLS 1 /* Number of custom handles in event manager to be used for app specific needs */
#endif /* NUM_OF_CTSM_EMNGR_HNDLS */
#ifndef SUPPORT_AUGMENTED_BLE_MODE
#define SUPPORT_AUGMENTED_BLE_MODE 1 /* Enable\Disable Augmented BLE Support. Enable:1 - Disable:0 */
#endif /* SUPPORT_AUGMENTED_BLE_MODE */
#ifndef SUPPORT_PTA
#define SUPPORT_PTA 1 /* Enable\Disable PTA Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_PTA */
#ifndef SUPPORT_CONFIGURABLE_GAIN_FIX
#define SUPPORT_CONFIGURABLE_GAIN_FIX 0 /* Enable\Disable configurable gain fix support */
#endif /* SUPPORT_CONFIGURABLE_GAIN_FIX */
#ifndef CHECK_ANY_MISSED_EVENT_ON_DEEP_SLEEP_EXIT
#define CHECK_ANY_MISSED_EVENT_ON_DEEP_SLEEP_EXIT 1 /* Enable\Disable calling event scheduler handler function at the end of deep sleep exit*/
#endif /* CHECK_ANY_MISSED_EVENT_ON_DEEP_SLEEP_EXIT */
#ifndef SUPPORT_PROFILE
#define SUPPORT_PROFILE PROFILE_LIGHTWEIGHT /* Enable\Disable profiling LL timing framework */
#endif /* SUPPORT_PROFILE */
#ifndef LL_BASIC
#define LL_BASIC 1
#endif /* LL_BASIC */
/*************************** MAC Configuration *************************************/
/*Configurations of MAC will apply only when MAC is enabled*/
#ifndef FFD_DEVICE_CONFIG
#define FFD_DEVICE_CONFIG 0 /* Enable\Disable FFD:1 - RFD:0 */
#endif /* FFD_DEVICE_CONFIG */
#ifdef SUPPORT_AUG_MAC_HCI_UART
#ifndef RAL_NUMBER_OF_INSTANCE
#define RAL_NUMBER_OF_INSTANCE 0 /* The Number of RAL instances supported */
#endif /* RAL_NUMBER_OF_INSTANCE */
#else
#ifndef RAL_NUMBER_OF_INSTANCE
#define RAL_NUMBER_OF_INSTANCE 0 /* The Number of RAL instances supported */
#endif /* RAL_NUMBER_OF_INSTANCE */
#endif
#ifndef MAX_NUMBER_OF_INDIRECT_DATA
#define MAX_NUMBER_OF_INDIRECT_DATA 0 /* The maximum number of supported indirect data buffers */
#endif /* MAX_NUMBER_OF_INDIRECT_DATA */
#ifndef SUPPORT_OPENTHREAD_1_2
#define SUPPORT_OPENTHREAD_1_2 0 /* Enable / disable FW parts related to new features introduced in openthread 1.2*/
#endif /* SUPPORT_OPENTHREAD_1_2 */
#ifndef SUPPORT_SEC
#define SUPPORT_SEC 0 /* The MAC Security Supported : 1 - Not Supported:0 */
#endif /* SUPPORT_SEC */
#ifndef RADIO_CSMA
#define RADIO_CSMA 0 /* Enable\Disable CSMA Algorithm in Radio Layer, Must be Enabled if MAC_LAYER_BUILD */
#endif /* RADIO_CSMA */
#ifndef ENHANCED_RX_WHILE_CSMA_BACKOFF_DELAY
#define ENHANCED_RX_WHILE_CSMA_BACKOFF_DELAY 1 /* Enable\Disable RX WITH CSMA Feature */
#endif /* ENHANCED_RX_WHILE_CSMA_BACKOFF_DELAY */
#ifndef SUPPORT_ANT_DIV
#define SUPPORT_ANT_DIV 1 /* Enable/Disable Antenna Diversity Feature */
#endif /* SUPPORT_ANT_DIV */
#ifndef SUPPORT_A_MAC
#define SUPPORT_A_MAC 0
#endif /* SUPPORT_A_MAC */
#ifndef SUPPORT_CONFIG_LIB
#define SUPPORT_CONFIG_LIB 1 /* Enable\Disable Configurable Library feature */
#endif /* SUPPORT_CONFIG_LIB */
#ifndef SMPL_PRTCL_TEST_ENABLE
#define SMPL_PRTCL_TEST_ENABLE 0
#endif /* SMPL_PRTCL_TEST_ENABLE */
/*************************** Zigbee Configuration **********************************/
#ifndef SUPPORT_ZIGBEE_PHY_CERTIFICATION
#define SUPPORT_ZIGBEE_PHY_CERTIFICATION 0 /* Enable support of hci command required to implement zigbee phy Test cases Enable:1 - Disable:0 */
#endif /* SUPPORT_ZIGBEE_PHY_CERTIFICATION */
#endif /* INCLUDE_LL_FW_CONFIG_H */

View File

@@ -0,0 +1,264 @@
/*$Id: //dwh/bluetooth/DWC_ble154combo/firmware/rel/2.00a-lca04/firmware/public_inc/ll_fw_config.h#1 $*/
/**
********************************************************************************
* @file ll_fw_config.h
* @brief This file contains the major configurations to the BLE controller.
******************************************************************************
* This Synopsys DWC Bluetooth Low Energy Combo Link Layer/MAC software and
* associated documentation ( hereinafter the "Software") is an unsupported
* proprietary work of Synopsys, Inc. unless otherwise expressly agreed to in
* writing between Synopsys and you. The Software IS NOT an item of Licensed
* Software or a Licensed Product under any End User Software License Agreement
* or Agreement for Licensed Products with Synopsys or any supplement thereto.
* Synopsys is a registered trademark of Synopsys, Inc. Other names included in
* the SOFTWARE may be the trademarks of their respective owners.
*
* Synopsys MIT License:
* Copyright (c) 2020-Present Synopsys, Inc
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* the Software), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute,
* sublicense, and/or sell copies of the Software, and to permit persons to whom
* the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING, BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE ARISING FROM,
* OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* */
#ifndef INCLUDE_LL_FW_CONFIG_H
#define INCLUDE_LL_FW_CONFIG_H
/*************************** General Configuration *********************************/
#ifndef SUPPORT_GNRC_SCHDLR_IF
#define SUPPORT_GNRC_SCHDLR_IF 1 /* Enable\Disable event EXTRNL_GNRC in Ble event manager. Enable:1 - Disable:0 */
#endif /* SUPPORT_GNRC_SCHDLR_IF */
/*************************** BLE Configuration *************************************/
/*Configurations of BLE will apply only when BLE is enabled*/
/* Variant configuration */
#define CFG_LL_BLE_BASIC_PLUS 1
/* Roles configurations */
#ifndef SUPPORT_EXPLCT_OBSERVER_ROLE
#define SUPPORT_EXPLCT_OBSERVER_ROLE 1 /* Enable\Disable Explicit observer role. Enable:1 - Disable:0 */
#endif /* SUPPORT_EXPLCT_OBSERVER_ROLE */
#ifndef SUPPORT_EXPLCT_BROADCASTER_ROLE
#define SUPPORT_EXPLCT_BROADCASTER_ROLE 1 /* Enable\Disable Explicit broadcaster role. Enable:1 - Disable:0 */
#endif /* SUPPORT_EXPLCT_BROADCASTER_ROLE */
#ifndef SUPPORT_MASTER_CONNECTION
#define SUPPORT_MASTER_CONNECTION 1 /* Enable\Disable Master connection role. Enable:1 - Disable:0 */
#endif /* SUPPORT_MASTER_CONNECTION */
#ifndef SUPPORT_SLAVE_CONNECTION
#define SUPPORT_SLAVE_CONNECTION 1 /* Enable\Disable Slave connection role. Enable:1 - Disable:0 */
#endif /* SUPPORT_SLAVE_CONNECTION */
/* Standard features configurations */
#ifndef SUPPORT_LE_ENCRYPTION
#define SUPPORT_LE_ENCRYPTION 1 /* Enable\Disable Encryption feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_ENCRYPTION */
#ifndef SUPPORT_PRIVACY
#define SUPPORT_PRIVACY 1 /* Enable\Disable Privacy feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_PRIVACY */
#ifndef SUPPORT_LE_EXTENDED_ADVERTISING
#define SUPPORT_LE_EXTENDED_ADVERTISING 1 /* Enable\Disable Extended advertising feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_EXTENDED_ADVERTISING */
#ifndef SUPPORT_LE_PERIODIC_ADVERTISING
#define SUPPORT_LE_PERIODIC_ADVERTISING 0 /* Enable\Disable Periodic advertising feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_PERIODIC_ADVERTISING */
#ifndef SUPPORT_LE_POWER_CLASS_1
#define SUPPORT_LE_POWER_CLASS_1 1 /* Enable\Disable Low power class 1 feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_POWER_CLASS_1 */
#ifndef SUPPORT_AOA_AOD
#define SUPPORT_AOA_AOD 0 /* Enable\Disable AOA_AOD feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_AOA_AOD */
#ifndef SUPPORT_PERIODIC_SYNC_TRANSFER
#define SUPPORT_PERIODIC_SYNC_TRANSFER 0 /* Enable\Disable PAST feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_PERIODIC_SYNC_TRANSFER */
#ifndef SUPPORT_SLEEP_CLOCK_ACCURCY_UPDATES
#define SUPPORT_SLEEP_CLOCK_ACCURCY_UPDATES 0 /* Enable\Disable Sleep Clock Accuracy Updates Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_SLEEP_CLOCK_ACCURCY_UPDATES */
#ifndef SUPPORT_CONNECTED_ISOCHRONOUS
#define SUPPORT_CONNECTED_ISOCHRONOUS 0 /* Enable\Disable Connected Isochronous Channel Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_CONNECTED_ISOCHRONOUS */
#ifndef SUPPORT_BRD_ISOCHRONOUS
#define SUPPORT_BRD_ISOCHRONOUS 0 /* Enable\Disable Broadcast Isochronous Channel Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_BRD_ISOCHRONOUS */
#ifndef SUPPORT_SYNC_ISOCHRONOUS
#define SUPPORT_SYNC_ISOCHRONOUS 0 /* Enable\Disable Broadcast Isochronous Synchronizer Channel Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_SYNC_ISOCHRONOUS */
#ifndef SUPPORT_LE_POWER_CONTROL
#define SUPPORT_LE_POWER_CONTROL 1 /* Enable\Disable LE Power Control Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_POWER_CONTROL */
#ifndef SUPPORT_CHANNEL_CLASSIFICATION
#define SUPPORT_CHANNEL_CLASSIFICATION 0
#endif /* SUPPORT_CHANNEL_CLASSIFICATION */
#ifndef SUPPORT_PERIODIC_ADV_ADI
#define SUPPORT_PERIODIC_ADV_ADI 0
#endif /* SUPPORT_PERIODIC_ADV_ADI */
#ifndef SUPPORT_LE_ENHANCED_CONN_UPDATE
#define SUPPORT_LE_ENHANCED_CONN_UPDATE 1
#endif /* SUPPORT_LE_ENHANCED_CONN_UPDATE */
#ifndef SUPPORT_CSSA
#define SUPPORT_CSSA 1 /* Enable\Disable Coding Selection Scheme on Advertising Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_CSSA */
#ifndef SUPPORT_LE_PAWR_ADVERTISER_ROLE
#define SUPPORT_LE_PAWR_ADVERTISER_ROLE 0 /* Enable\Disable PAwR Advertiser role. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_PAWR_ADVERTISER_ROLE */
#ifndef SUPPORT_LE_PAWR_SYNC_ROLE
#define SUPPORT_LE_PAWR_SYNC_ROLE 0 /* Enable\Disable PAwR Synchronizer role. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_PAWR_SYNC_ROLE */
#ifndef SUPPORT_CHANNEL_SOUNDING
#define SUPPORT_CHANNEL_SOUNDING 0 /* Enable\Disable Channel Sounding Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_CHANNEL_SOUNDING */
#ifndef SUPPORT_FRAME_SPACE_UPDATE
#define SUPPORT_FRAME_SPACE_UPDATE 0 /* Enable\Disable Frame Space Update Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_FRAME_SPACE_UPDATE */
#ifndef SUPPORT_EXT_FEATURE_SET
#define SUPPORT_EXT_FEATURE_SET 0 /* Enable\Disable Extended Feature Set Exchange. Enable:1 - Disable:0 */
#endif /* SUPPORT_EXT_FEATURE_SET */
#ifndef SUPPORT_ISO_UNSEG_MODE
#define SUPPORT_ISO_UNSEG_MODE 0 /* Enable\Disable Unsegmented Mode for Framed ISO PDUs. Enable: 1 - Disable: 0*/
#endif /* SUPPORT_ISO_UNSEG_MODE */
#ifndef SUPPORT_LE_ADVERTISERS_MONITORING
#define SUPPORT_LE_ADVERTISERS_MONITORING 0 /* Enable\Disable Advertisers Monitoring Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_ADVERTISERS_MONITORING */
/* Capabilities configurations */
#ifndef MAX_NUM_CNCRT_STAT_MCHNS
#define MAX_NUM_CNCRT_STAT_MCHNS 8 /* Set maximum number of states the controller can support */
#endif /* MAX_NUM_CNCRT_STAT_MCHNS */
#ifndef USE_NON_ACCURATE_32K_SLEEP_CLK
#define USE_NON_ACCURATE_32K_SLEEP_CLK 1 /* Allow to drive the sleep clock by sources other than the default crystal oscillator source.*/
/*LL can use crystal oscillator or RTC or RCO to drive the sleep clock.This selection is done via "DEFAULT_SLEEP_CLOCK_SOURCE" macro. */
#endif /* USE_NON_ACCURATE_32K_SLEEP_CLK */
#ifndef SUPPORT_CTE_DEGRADATION_API
#define SUPPORT_CTE_DEGRADATION_API 1 /* Enable\Disable CTE degradation API. Enable:1 - Disable:0 */
#endif /* SUPPORT_CTE_DEGRADATION_API */
/* Non-standard features configurations */
#ifndef NUM_OF_CTSM_EMNGR_HNDLS
#define NUM_OF_CTSM_EMNGR_HNDLS 1 /* Number of custom handles in event manager to be used for app specific needs */
#endif /* NUM_OF_CTSM_EMNGR_HNDLS */
#ifndef SUPPORT_AUGMENTED_BLE_MODE
#define SUPPORT_AUGMENTED_BLE_MODE 1 /* Enable\Disable Augmented BLE Support. Enable:1 - Disable:0 */
#endif /* SUPPORT_AUGMENTED_BLE_MODE */
#ifndef SUPPORT_PTA
#define SUPPORT_PTA 1 /* Enable\Disable PTA Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_PTA */
#ifndef SUPPORT_CONFIGURABLE_GAIN_FIX
#define SUPPORT_CONFIGURABLE_GAIN_FIX 0 /* Enable\Disable configurable gain fix support */
#endif /* SUPPORT_CONFIGURABLE_GAIN_FIX */
#ifndef CHECK_ANY_MISSED_EVENT_ON_DEEP_SLEEP_EXIT
#define CHECK_ANY_MISSED_EVENT_ON_DEEP_SLEEP_EXIT 1 /* Enable\Disable calling event scheduler handler function at the end of deep sleep exit*/
#endif /* CHECK_ANY_MISSED_EVENT_ON_DEEP_SLEEP_EXIT */
#ifndef SUPPORT_AUTONOMOUS_POWER_CONTROL_REQ
#define SUPPORT_AUTONOMOUS_POWER_CONTROL_REQ 1
#endif /* SUPPORT_AUTONOMOUS_POWER_CONTROL_REQ */
#ifndef SUPPORT_PROFILE
#define SUPPORT_PROFILE PROFILE_LIGHTWEIGHT /* Enable\Disable profiling LL timing framework */
#endif /* SUPPORT_PROFILE */
#ifndef LL_BASIC
#define LL_BASIC 0
#endif /* LL_BASIC */
/*************************** MAC Configuration *************************************/
/*Configurations of MAC will apply only when MAC is enabled*/
#ifndef FFD_DEVICE_CONFIG
#define FFD_DEVICE_CONFIG 0 /* Enable\Disable FFD:1 - RFD:0 */
#endif /* FFD_DEVICE_CONFIG */
#ifdef SUPPORT_AUG_MAC_HCI_UART
#ifndef RAL_NUMBER_OF_INSTANCE
#define RAL_NUMBER_OF_INSTANCE 0 /* The Number of RAL instances supported */
#endif /* RAL_NUMBER_OF_INSTANCE */
#else
#ifndef RAL_NUMBER_OF_INSTANCE
#define RAL_NUMBER_OF_INSTANCE 0 /* The Number of RAL instances supported */
#endif /* RAL_NUMBER_OF_INSTANCE */
#endif
#ifndef MAX_NUMBER_OF_INDIRECT_DATA
#define MAX_NUMBER_OF_INDIRECT_DATA 0 /* The maximum number of supported indirect data buffers */
#endif /* MAX_NUMBER_OF_INDIRECT_DATA */
#ifndef SUPPORT_OPENTHREAD_1_2
#define SUPPORT_OPENTHREAD_1_2 0 /* Enable / disable FW parts related to new features introduced in openthread 1.2*/
#endif /* SUPPORT_OPENTHREAD_1_2 */
#ifndef SUPPORT_SEC
#define SUPPORT_SEC 0 /* The MAC Security Supported : 1 - Not Supported:0 */
#endif /* SUPPORT_SEC */
#ifndef RADIO_CSMA
#define RADIO_CSMA 0 /* Enable\Disable CSMA Algorithm in Radio Layer, Must be Enabled if MAC_LAYER_BUILD */
#endif /* RADIO_CSMA */
#ifndef ENHANCED_RX_WHILE_CSMA_BACKOFF_DELAY
#define ENHANCED_RX_WHILE_CSMA_BACKOFF_DELAY 1 /* Enable\Disable RX WITH CSMA Feature */
#endif /* ENHANCED_RX_WHILE_CSMA_BACKOFF_DELAY */
#ifndef SUPPORT_ANT_DIV
#define SUPPORT_ANT_DIV 1 /* Enable/Disable Antenna Diversity Feature */
#endif /* SUPPORT_ANT_DIV */
#ifndef SUPPORT_A_MAC
#define SUPPORT_A_MAC 0
#endif /* SUPPORT_A_MAC */
#ifndef SUPPORT_CONFIG_LIB
#define SUPPORT_CONFIG_LIB 1 /* Enable\Disable Configurable Library feature */
#endif /* SUPPORT_CONFIG_LIB */
#ifndef SMPL_PRTCL_TEST_ENABLE
#define SMPL_PRTCL_TEST_ENABLE 0
#endif /* SMPL_PRTCL_TEST_ENABLE */
/*************************** Zigbee Configuration **********************************/
#ifndef SUPPORT_ZIGBEE_PHY_CERTIFICATION
#define SUPPORT_ZIGBEE_PHY_CERTIFICATION 0 /* Enable support of hci command required to implement zigbee phy Test cases Enable:1 - Disable:0 */
#endif /* SUPPORT_ZIGBEE_PHY_CERTIFICATION */
#endif /* INCLUDE_LL_FW_CONFIG_H */

View File

@@ -0,0 +1,264 @@
/*$Id: //dwh/bluetooth/DWC_ble154combo/firmware/rel/2.00a-lca04/firmware/public_inc/ll_fw_config.h#1 $*/
/**
********************************************************************************
* @file ll_fw_config.h
* @brief This file contains the major configurations to the BLE controller.
******************************************************************************
* This Synopsys DWC Bluetooth Low Energy Combo Link Layer/MAC software and
* associated documentation ( hereinafter the "Software") is an unsupported
* proprietary work of Synopsys, Inc. unless otherwise expressly agreed to in
* writing between Synopsys and you. The Software IS NOT an item of Licensed
* Software or a Licensed Product under any End User Software License Agreement
* or Agreement for Licensed Products with Synopsys or any supplement thereto.
* Synopsys is a registered trademark of Synopsys, Inc. Other names included in
* the SOFTWARE may be the trademarks of their respective owners.
*
* Synopsys MIT License:
* Copyright (c) 2020-Present Synopsys, Inc
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* the Software), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute,
* sublicense, and/or sell copies of the Software, and to permit persons to whom
* the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING, BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE ARISING FROM,
* OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* */
#ifndef INCLUDE_LL_FW_CONFIG_H
#define INCLUDE_LL_FW_CONFIG_H
/*************************** General Configuration *********************************/
#ifndef SUPPORT_GNRC_SCHDLR_IF
#define SUPPORT_GNRC_SCHDLR_IF 1 /* Enable\Disable event EXTRNL_GNRC in Ble event manager. Enable:1 - Disable:0 */
#endif /* SUPPORT_GNRC_SCHDLR_IF */
/*************************** BLE Configuration *************************************/
/*Configurations of BLE will apply only when BLE is enabled*/
/* Variant configuration */
#define CFG_LL_BLE_BASIC_PLUS 1
/* Roles configurations */
#ifndef SUPPORT_EXPLCT_OBSERVER_ROLE
#define SUPPORT_EXPLCT_OBSERVER_ROLE 1 /* Enable\Disable Explicit observer role. Enable:1 - Disable:0 */
#endif /* SUPPORT_EXPLCT_OBSERVER_ROLE */
#ifndef SUPPORT_EXPLCT_BROADCASTER_ROLE
#define SUPPORT_EXPLCT_BROADCASTER_ROLE 1 /* Enable\Disable Explicit broadcaster role. Enable:1 - Disable:0 */
#endif /* SUPPORT_EXPLCT_BROADCASTER_ROLE */
#ifndef SUPPORT_MASTER_CONNECTION
#define SUPPORT_MASTER_CONNECTION 1 /* Enable\Disable Master connection role. Enable:1 - Disable:0 */
#endif /* SUPPORT_MASTER_CONNECTION */
#ifndef SUPPORT_SLAVE_CONNECTION
#define SUPPORT_SLAVE_CONNECTION 1 /* Enable\Disable Slave connection role. Enable:1 - Disable:0 */
#endif /* SUPPORT_SLAVE_CONNECTION */
/* Standard features configurations */
#ifndef SUPPORT_LE_ENCRYPTION
#define SUPPORT_LE_ENCRYPTION 1 /* Enable\Disable Encryption feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_ENCRYPTION */
#ifndef SUPPORT_PRIVACY
#define SUPPORT_PRIVACY 1 /* Enable\Disable Privacy feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_PRIVACY */
#ifndef SUPPORT_LE_EXTENDED_ADVERTISING
#define SUPPORT_LE_EXTENDED_ADVERTISING 1 /* Enable\Disable Extended advertising feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_EXTENDED_ADVERTISING */
#ifndef SUPPORT_LE_PERIODIC_ADVERTISING
#define SUPPORT_LE_PERIODIC_ADVERTISING 0 /* Enable\Disable Periodic advertising feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_PERIODIC_ADVERTISING */
#ifndef SUPPORT_LE_POWER_CLASS_1
#define SUPPORT_LE_POWER_CLASS_1 1 /* Enable\Disable Low power class 1 feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_POWER_CLASS_1 */
#ifndef SUPPORT_AOA_AOD
#define SUPPORT_AOA_AOD 0 /* Enable\Disable AOA_AOD feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_AOA_AOD */
#ifndef SUPPORT_PERIODIC_SYNC_TRANSFER
#define SUPPORT_PERIODIC_SYNC_TRANSFER 0 /* Enable\Disable PAST feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_PERIODIC_SYNC_TRANSFER */
#ifndef SUPPORT_SLEEP_CLOCK_ACCURCY_UPDATES
#define SUPPORT_SLEEP_CLOCK_ACCURCY_UPDATES 0 /* Enable\Disable Sleep Clock Accuracy Updates Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_SLEEP_CLOCK_ACCURCY_UPDATES */
#ifndef SUPPORT_CONNECTED_ISOCHRONOUS
#define SUPPORT_CONNECTED_ISOCHRONOUS 0 /* Enable\Disable Connected Isochronous Channel Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_CONNECTED_ISOCHRONOUS */
#ifndef SUPPORT_BRD_ISOCHRONOUS
#define SUPPORT_BRD_ISOCHRONOUS 0 /* Enable\Disable Broadcast Isochronous Channel Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_BRD_ISOCHRONOUS */
#ifndef SUPPORT_SYNC_ISOCHRONOUS
#define SUPPORT_SYNC_ISOCHRONOUS 0 /* Enable\Disable Broadcast Isochronous Synchronizer Channel Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_SYNC_ISOCHRONOUS */
#ifndef SUPPORT_LE_POWER_CONTROL
#define SUPPORT_LE_POWER_CONTROL 1 /* Enable\Disable LE Power Control Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_POWER_CONTROL */
#ifndef SUPPORT_CHANNEL_CLASSIFICATION
#define SUPPORT_CHANNEL_CLASSIFICATION 0
#endif /* SUPPORT_CHANNEL_CLASSIFICATION */
#ifndef SUPPORT_PERIODIC_ADV_ADI
#define SUPPORT_PERIODIC_ADV_ADI 0
#endif /* SUPPORT_PERIODIC_ADV_ADI */
#ifndef SUPPORT_LE_ENHANCED_CONN_UPDATE
#define SUPPORT_LE_ENHANCED_CONN_UPDATE 1
#endif /* SUPPORT_LE_ENHANCED_CONN_UPDATE */
#ifndef SUPPORT_CSSA
#define SUPPORT_CSSA 1 /* Enable\Disable Coding Selection Scheme on Advertising Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_CSSA */
#ifndef SUPPORT_LE_PAWR_ADVERTISER_ROLE
#define SUPPORT_LE_PAWR_ADVERTISER_ROLE 0 /* Enable\Disable PAwR Advertiser role. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_PAWR_ADVERTISER_ROLE */
#ifndef SUPPORT_LE_PAWR_SYNC_ROLE
#define SUPPORT_LE_PAWR_SYNC_ROLE 0 /* Enable\Disable PAwR Synchronizer role. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_PAWR_SYNC_ROLE */
#ifndef SUPPORT_CHANNEL_SOUNDING
#define SUPPORT_CHANNEL_SOUNDING 0 /* Enable\Disable Channel Sounding Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_CHANNEL_SOUNDING */
#ifndef SUPPORT_FRAME_SPACE_UPDATE
#define SUPPORT_FRAME_SPACE_UPDATE 0 /* Enable\Disable Frame Space Update Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_FRAME_SPACE_UPDATE */
#ifndef SUPPORT_EXT_FEATURE_SET
#define SUPPORT_EXT_FEATURE_SET 0 /* Enable\Disable Extended Feature Set Exchange. Enable:1 - Disable:0 */
#endif /* SUPPORT_EXT_FEATURE_SET */
#ifndef SUPPORT_ISO_UNSEG_MODE
#define SUPPORT_ISO_UNSEG_MODE 0 /* Enable\Disable Unsegmented Mode for Framed ISO PDUs. Enable: 1 - Disable: 0*/
#endif /* SUPPORT_ISO_UNSEG_MODE */
#ifndef SUPPORT_LE_ADVERTISERS_MONITORING
#define SUPPORT_LE_ADVERTISERS_MONITORING 0 /* Enable\Disable Advertisers Monitoring Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_ADVERTISERS_MONITORING */
/* Capabilities configurations */
#ifndef MAX_NUM_CNCRT_STAT_MCHNS
#define MAX_NUM_CNCRT_STAT_MCHNS 20 /* Set maximum number of states the controller can support */
#endif /* MAX_NUM_CNCRT_STAT_MCHNS */
#ifndef USE_NON_ACCURATE_32K_SLEEP_CLK
#define USE_NON_ACCURATE_32K_SLEEP_CLK 1 /* Allow to drive the sleep clock by sources other than the default crystal oscillator source.*/
/*LL can use crystal oscillator or RTC or RCO to drive the sleep clock.This selection is done via "DEFAULT_SLEEP_CLOCK_SOURCE" macro. */
#endif /* USE_NON_ACCURATE_32K_SLEEP_CLK */
#ifndef SUPPORT_CTE_DEGRADATION_API
#define SUPPORT_CTE_DEGRADATION_API 1 /* Enable\Disable CTE degradation API. Enable:1 - Disable:0 */
#endif /* SUPPORT_CTE_DEGRADATION_API */
/* Non-standard features configurations */
#ifndef NUM_OF_CTSM_EMNGR_HNDLS
#define NUM_OF_CTSM_EMNGR_HNDLS 1 /* Number of custom handles in event manager to be used for app specific needs */
#endif /* NUM_OF_CTSM_EMNGR_HNDLS */
#ifndef SUPPORT_AUGMENTED_BLE_MODE
#define SUPPORT_AUGMENTED_BLE_MODE 1 /* Enable\Disable Augmented BLE Support. Enable:1 - Disable:0 */
#endif /* SUPPORT_AUGMENTED_BLE_MODE */
#ifndef SUPPORT_PTA
#define SUPPORT_PTA 1 /* Enable\Disable PTA Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_PTA */
#ifndef SUPPORT_CONFIGURABLE_GAIN_FIX
#define SUPPORT_CONFIGURABLE_GAIN_FIX 0 /* Enable\Disable configurable gain fix support */
#endif /* SUPPORT_CONFIGURABLE_GAIN_FIX */
#ifndef CHECK_ANY_MISSED_EVENT_ON_DEEP_SLEEP_EXIT
#define CHECK_ANY_MISSED_EVENT_ON_DEEP_SLEEP_EXIT 1 /* Enable\Disable calling event scheduler handler function at the end of deep sleep exit*/
#endif /* CHECK_ANY_MISSED_EVENT_ON_DEEP_SLEEP_EXIT */
#ifndef SUPPORT_AUTONOMOUS_POWER_CONTROL_REQ
#define SUPPORT_AUTONOMOUS_POWER_CONTROL_REQ 1
#endif /* SUPPORT_AUTONOMOUS_POWER_CONTROL_REQ */
#ifndef SUPPORT_PROFILE
#define SUPPORT_PROFILE PROFILE_LIGHTWEIGHT /* Enable\Disable profiling LL timing framework */
#endif /* SUPPORT_PROFILE */
#ifndef LL_BASIC
#define LL_BASIC 0
#endif /* LL_BASIC */
/*************************** MAC Configuration *************************************/
/*Configurations of MAC will apply only when MAC is enabled*/
#ifndef FFD_DEVICE_CONFIG
#define FFD_DEVICE_CONFIG 0 /* Enable\Disable FFD:1 - RFD:0 */
#endif /* FFD_DEVICE_CONFIG */
#ifdef SUPPORT_AUG_MAC_HCI_UART
#ifndef RAL_NUMBER_OF_INSTANCE
#define RAL_NUMBER_OF_INSTANCE 0 /* The Number of RAL instances supported */
#endif /* RAL_NUMBER_OF_INSTANCE */
#else
#ifndef RAL_NUMBER_OF_INSTANCE
#define RAL_NUMBER_OF_INSTANCE 0 /* The Number of RAL instances supported */
#endif /* RAL_NUMBER_OF_INSTANCE */
#endif
#ifndef MAX_NUMBER_OF_INDIRECT_DATA
#define MAX_NUMBER_OF_INDIRECT_DATA 0 /* The maximum number of supported indirect data buffers */
#endif /* MAX_NUMBER_OF_INDIRECT_DATA */
#ifndef SUPPORT_OPENTHREAD_1_2
#define SUPPORT_OPENTHREAD_1_2 0 /* Enable / disable FW parts related to new features introduced in openthread 1.2*/
#endif /* SUPPORT_OPENTHREAD_1_2 */
#ifndef SUPPORT_SEC
#define SUPPORT_SEC 0 /* The MAC Security Supported : 1 - Not Supported:0 */
#endif /* SUPPORT_SEC */
#ifndef RADIO_CSMA
#define RADIO_CSMA 0 /* Enable\Disable CSMA Algorithm in Radio Layer, Must be Enabled if MAC_LAYER_BUILD */
#endif /* RADIO_CSMA */
#ifndef ENHANCED_RX_WHILE_CSMA_BACKOFF_DELAY
#define ENHANCED_RX_WHILE_CSMA_BACKOFF_DELAY 1 /* Enable\Disable RX WITH CSMA Feature */
#endif /* ENHANCED_RX_WHILE_CSMA_BACKOFF_DELAY */
#ifndef SUPPORT_ANT_DIV
#define SUPPORT_ANT_DIV 1 /* Enable/Disable Antenna Diversity Feature */
#endif /* SUPPORT_ANT_DIV */
#ifndef SUPPORT_A_MAC
#define SUPPORT_A_MAC 0
#endif /* SUPPORT_A_MAC */
#ifndef SUPPORT_CONFIG_LIB
#define SUPPORT_CONFIG_LIB 1 /* Enable\Disable Configurable Library feature */
#endif /* SUPPORT_CONFIG_LIB */
#ifndef SMPL_PRTCL_TEST_ENABLE
#define SMPL_PRTCL_TEST_ENABLE 0
#endif /* SMPL_PRTCL_TEST_ENABLE */
/*************************** Zigbee Configuration **********************************/
#ifndef SUPPORT_ZIGBEE_PHY_CERTIFICATION
#define SUPPORT_ZIGBEE_PHY_CERTIFICATION 0 /* Enable support of hci command required to implement zigbee phy Test cases Enable:1 - Disable:0 */
#endif /* SUPPORT_ZIGBEE_PHY_CERTIFICATION */
#endif /* INCLUDE_LL_FW_CONFIG_H */

View File

@@ -0,0 +1,265 @@
/*$Id: //dwh/bluetooth/DWC_ble154combo/firmware/rel/2.00a-lca04/firmware/public_inc/ll_fw_config.h#1 $*/
/**
********************************************************************************
* @file ll_fw_config.h
* @brief This file contains the major configurations to the BLE controller.
******************************************************************************
* This Synopsys DWC Bluetooth Low Energy Combo Link Layer/MAC software and
* associated documentation ( hereinafter the "Software") is an unsupported
* proprietary work of Synopsys, Inc. unless otherwise expressly agreed to in
* writing between Synopsys and you. The Software IS NOT an item of Licensed
* Software or a Licensed Product under any End User Software License Agreement
* or Agreement for Licensed Products with Synopsys or any supplement thereto.
* Synopsys is a registered trademark of Synopsys, Inc. Other names included in
* the SOFTWARE may be the trademarks of their respective owners.
*
* Synopsys MIT License:
* Copyright (c) 2020-Present Synopsys, Inc
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* the Software), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute,
* sublicense, and/or sell copies of the Software, and to permit persons to whom
* the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING, BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE ARISING FROM,
* OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* */
#ifndef INCLUDE_LL_FW_CONFIG_H
#define INCLUDE_LL_FW_CONFIG_H
/*************************** General Configuration *********************************/
#ifndef SUPPORT_GNRC_SCHDLR_IF
#define SUPPORT_GNRC_SCHDLR_IF 1 /* Enable\Disable event EXTRNL_GNRC in Ble event manager. Enable:1 - Disable:0 */
#endif /* SUPPORT_GNRC_SCHDLR_IF */
/*************************** BLE Configuration *************************************/
/*Configurations of BLE will apply only when BLE is enabled*/
/* Variant configuration */
#define CFG_LL_BLE_FULL 1
/* Roles configurations */
#ifndef SUPPORT_EXPLCT_OBSERVER_ROLE
#define SUPPORT_EXPLCT_OBSERVER_ROLE 1 /* Enable\Disable Explicit observer role. Enable:1 - Disable:0 */
#endif /* SUPPORT_EXPLCT_OBSERVER_ROLE */
#ifndef SUPPORT_EXPLCT_BROADCASTER_ROLE
#define SUPPORT_EXPLCT_BROADCASTER_ROLE 1 /* Enable\Disable Explicit broadcaster role. Enable:1 - Disable:0 */
#endif /* SUPPORT_EXPLCT_BROADCASTER_ROLE */
#ifndef SUPPORT_MASTER_CONNECTION
#define SUPPORT_MASTER_CONNECTION 1 /* Enable\Disable Master connection role. Enable:1 - Disable:0 */
#endif /* SUPPORT_MASTER_CONNECTION */
#ifndef SUPPORT_SLAVE_CONNECTION
#define SUPPORT_SLAVE_CONNECTION 1 /* Enable\Disable Slave connection role. Enable:1 - Disable:0 */
#endif /* SUPPORT_SLAVE_CONNECTION */
/* Standard features configurations */
#ifndef SUPPORT_LE_ENCRYPTION
#define SUPPORT_LE_ENCRYPTION 1 /* Enable\Disable Encryption feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_ENCRYPTION */
#ifndef SUPPORT_PRIVACY
#define SUPPORT_PRIVACY 1 /* Enable\Disable Privacy feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_PRIVACY */
#ifndef SUPPORT_LE_EXTENDED_ADVERTISING
#define SUPPORT_LE_EXTENDED_ADVERTISING 1 /* Enable\Disable Extended advertising feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_EXTENDED_ADVERTISING */
#ifndef SUPPORT_LE_PERIODIC_ADVERTISING
#define SUPPORT_LE_PERIODIC_ADVERTISING 1 /* Enable\Disable Periodic advertising feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_PERIODIC_ADVERTISING */
#ifndef SUPPORT_LE_POWER_CLASS_1
#define SUPPORT_LE_POWER_CLASS_1 1 /* Enable\Disable Low power class 1 feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_POWER_CLASS_1 */
#ifndef SUPPORT_AOA_AOD
#define SUPPORT_AOA_AOD 1 /* Enable\Disable AOA_AOD feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_AOA_AOD */
#ifndef SUPPORT_PERIODIC_SYNC_TRANSFER
#define SUPPORT_PERIODIC_SYNC_TRANSFER 1 /* Enable\Disable PAST feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_PERIODIC_SYNC_TRANSFER */
#ifndef SUPPORT_SLEEP_CLOCK_ACCURCY_UPDATES
#define SUPPORT_SLEEP_CLOCK_ACCURCY_UPDATES 1 /* Enable\Disable Sleep Clock Accuracy Updates Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_SLEEP_CLOCK_ACCURCY_UPDATES */
#ifndef SUPPORT_CONNECTED_ISOCHRONOUS
#define SUPPORT_CONNECTED_ISOCHRONOUS 1 /* Enable\Disable Connected Isochronous Channel Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_CONNECTED_ISOCHRONOUS */
#ifndef SUPPORT_BRD_ISOCHRONOUS
#define SUPPORT_BRD_ISOCHRONOUS 1 /* Enable\Disable Broadcast Isochronous Channel Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_BRD_ISOCHRONOUS */
#ifndef SUPPORT_SYNC_ISOCHRONOUS
#define SUPPORT_SYNC_ISOCHRONOUS 1 /* Enable\Disable Broadcast Isochronous Synchronizer Channel Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_SYNC_ISOCHRONOUS */
#ifndef SUPPORT_LE_POWER_CONTROL
#define SUPPORT_LE_POWER_CONTROL 1 /* Enable\Disable LE Power Control Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_POWER_CONTROL */
#ifndef SUPPORT_CHANNEL_CLASSIFICATION
#define SUPPORT_CHANNEL_CLASSIFICATION 1
#endif /* SUPPORT_CHANNEL_CLASSIFICATION */
#ifndef SUPPORT_PERIODIC_ADV_ADI
#define SUPPORT_PERIODIC_ADV_ADI 1
#endif /* SUPPORT_PERIODIC_ADV_ADI */
#ifndef SUPPORT_LE_ENHANCED_CONN_UPDATE
#define SUPPORT_LE_ENHANCED_CONN_UPDATE 1
#endif /* SUPPORT_LE_ENHANCED_CONN_UPDATE */
#ifndef SUPPORT_CSSA
#define SUPPORT_CSSA 1 /* Enable\Disable Coding Selection Scheme on Advertising Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_CSSA */
#ifndef SUPPORT_LE_PAWR_ADVERTISER_ROLE
#define SUPPORT_LE_PAWR_ADVERTISER_ROLE 0 /* Enable\Disable PAwR Advertiser role. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_PAWR_ADVERTISER_ROLE */
#ifndef SUPPORT_LE_PAWR_SYNC_ROLE
#define SUPPORT_LE_PAWR_SYNC_ROLE 0 /* Enable\Disable PAwR Synchronizer role. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_PAWR_SYNC_ROLE */
#ifndef SUPPORT_CHANNEL_SOUNDING
#define SUPPORT_CHANNEL_SOUNDING 0 /* Enable\Disable Channel Sounding Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_CHANNEL_SOUNDING */
#ifndef SUPPORT_FRAME_SPACE_UPDATE
#define SUPPORT_FRAME_SPACE_UPDATE 0 /* Enable\Disable Frame Space Update Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_FRAME_SPACE_UPDATE */
#ifndef SUPPORT_EXT_FEATURE_SET
#define SUPPORT_EXT_FEATURE_SET 0 /* Enable\Disable Extended Feature Set Exchange. Enable:1 - Disable:0 */
#endif /* SUPPORT_EXT_FEATURE_SET */
#ifndef SUPPORT_ISO_UNSEG_MODE
#define SUPPORT_ISO_UNSEG_MODE 0 /* Enable\Disable Unsegmented Mode for Framed ISO PDUs. Enable: 1 - Disable: 0*/
#endif /* SUPPORT_ISO_UNSEG_MODE */
#ifndef SUPPORT_LE_ADVERTISERS_MONITORING
#define SUPPORT_LE_ADVERTISERS_MONITORING 0 /* Enable\Disable Advertisers Monitoring Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_ADVERTISERS_MONITORING */
/* Capabilities configurations */
#ifndef MAX_NUM_CNCRT_STAT_MCHNS
#define MAX_NUM_CNCRT_STAT_MCHNS 8 /* Set maximum number of states the controller can support */
#endif /* MAX_NUM_CNCRT_STAT_MCHNS */
#ifndef USE_NON_ACCURATE_32K_SLEEP_CLK
#define USE_NON_ACCURATE_32K_SLEEP_CLK 1 /* Allow to drive the sleep clock by sources other than the default crystal oscillator source.*/
/*LL can use crystal oscillator or RTC or RCO to drive the sleep clock.This selection is done via "DEFAULT_SLEEP_CLOCK_SOURCE" macro. */
#endif /* USE_NON_ACCURATE_32K_SLEEP_CLK */
#ifndef SUPPORT_CTE_DEGRADATION_API
#define SUPPORT_CTE_DEGRADATION_API 1 /* Enable\Disable CTE degradation API. Enable:1 - Disable:0 */
#endif /* SUPPORT_CTE_DEGRADATION_API */
/* Non-standard features configurations */
#ifndef NUM_OF_CTSM_EMNGR_HNDLS
#define NUM_OF_CTSM_EMNGR_HNDLS 1 /* Number of custom handles in event manager to be used for app specific needs */
#endif /* NUM_OF_CTSM_EMNGR_HNDLS */
#ifndef SUPPORT_AUGMENTED_BLE_MODE
#define SUPPORT_AUGMENTED_BLE_MODE 1 /* Enable\Disable Augmented BLE Support. Enable:1 - Disable:0 */
#endif /* SUPPORT_AUGMENTED_BLE_MODE */
#ifndef SUPPORT_PTA
#define SUPPORT_PTA 1 /* Enable\Disable PTA Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_PTA */
#ifndef SUPPORT_CONFIGURABLE_GAIN_FIX
#define SUPPORT_CONFIGURABLE_GAIN_FIX 0 /* Enable\Disable configurable gain fix support */
#endif /* SUPPORT_CONFIGURABLE_GAIN_FIX */
#ifndef CHECK_ANY_MISSED_EVENT_ON_DEEP_SLEEP_EXIT
#define CHECK_ANY_MISSED_EVENT_ON_DEEP_SLEEP_EXIT 1 /* Enable\Disable calling event scheduler handler function at the end of deep sleep exit*/
#endif /* CHECK_ANY_MISSED_EVENT_ON_DEEP_SLEEP_EXIT */
#ifndef SUPPORT_AUTONOMOUS_POWER_CONTROL_REQ
#define SUPPORT_AUTONOMOUS_POWER_CONTROL_REQ 1
#endif /* SUPPORT_AUTONOMOUS_POWER_CONTROL_REQ */
#ifndef SUPPORT_PROFILE
#define SUPPORT_PROFILE PROFILE_LIGHTWEIGHT /* Enable\Disable profiling LL timing framework */
#endif /* SUPPORT_PROFILE */
#ifndef LL_BASIC
#define LL_BASIC 0
#endif /* LL_BASIC */
/*************************** MAC Configuration *************************************/
/*Configurations of MAC will apply only when MAC is enabled*/
#ifndef FFD_DEVICE_CONFIG
#define FFD_DEVICE_CONFIG 0 /* Enable\Disable FFD:1 - RFD:0 */
#endif /* FFD_DEVICE_CONFIG */
#ifdef SUPPORT_AUG_MAC_HCI_UART
#ifndef RAL_NUMBER_OF_INSTANCE
#define RAL_NUMBER_OF_INSTANCE 0 /* The Number of RAL instances supported */
#endif /* RAL_NUMBER_OF_INSTANCE */
#else
#ifndef RAL_NUMBER_OF_INSTANCE
#define RAL_NUMBER_OF_INSTANCE 0 /* The Number of RAL instances supported */
#endif /* RAL_NUMBER_OF_INSTANCE */
#endif
#ifndef MAX_NUMBER_OF_INDIRECT_DATA
#define MAX_NUMBER_OF_INDIRECT_DATA 0 /* The maximum number of supported indirect data buffers */
#endif /* MAX_NUMBER_OF_INDIRECT_DATA */
#ifndef SUPPORT_OPENTHREAD_1_2
#define SUPPORT_OPENTHREAD_1_2 0 /* Enable / disable FW parts related to new features introduced in openthread 1.2*/
#endif /* SUPPORT_OPENTHREAD_1_2 */
#ifndef SUPPORT_SEC
#define SUPPORT_SEC 0 /* The MAC Security Supported : 1 - Not Supported:0 */
#endif /* SUPPORT_SEC */
#ifndef RADIO_CSMA
#define RADIO_CSMA 0 /* Enable\Disable CSMA Algorithm in Radio Layer, Must be Enabled if MAC_LAYER_BUILD */
#endif /* RADIO_CSMA */
#ifndef ENHANCED_RX_WHILE_CSMA_BACKOFF_DELAY
#define ENHANCED_RX_WHILE_CSMA_BACKOFF_DELAY 1 /* Enable\Disable RX WITH CSMA Feature */
#endif /* ENHANCED_RX_WHILE_CSMA_BACKOFF_DELAY */
#ifndef SUPPORT_ANT_DIV
#define SUPPORT_ANT_DIV 1 /* Enable/Disable Antenna Diversity Feature */
#endif /* SUPPORT_ANT_DIV */
#ifndef SUPPORT_A_MAC
#define SUPPORT_A_MAC 0
#endif /* SUPPORT_A_MAC */
#ifndef SUPPORT_CONFIG_LIB
#define SUPPORT_CONFIG_LIB 1 /* Enable\Disable Configurable Library feature */
#endif /* SUPPORT_CONFIG_LIB */
#ifndef SMPL_PRTCL_TEST_ENABLE
#define SMPL_PRTCL_TEST_ENABLE 0
#endif /* SMPL_PRTCL_TEST_ENABLE */
/*************************** Zigbee Configuration **********************************/
#ifndef SUPPORT_ZIGBEE_PHY_CERTIFICATION
#define SUPPORT_ZIGBEE_PHY_CERTIFICATION 0 /* Enable support of hci command required to implement zigbee phy Test cases Enable:1 - Disable:0 */
#endif /* SUPPORT_ZIGBEE_PHY_CERTIFICATION */
#endif /* INCLUDE_LL_FW_CONFIG_H */

View File

@@ -0,0 +1,265 @@
/*$Id: //dwh/bluetooth/DWC_ble154combo/firmware/rel/2.00a-lca04/firmware/public_inc/ll_fw_config.h#1 $*/
/**
********************************************************************************
* @file ll_fw_config.h
* @brief This file contains the major configurations to the BLE controller.
******************************************************************************
* This Synopsys DWC Bluetooth Low Energy Combo Link Layer/MAC software and
* associated documentation ( hereinafter the "Software") is an unsupported
* proprietary work of Synopsys, Inc. unless otherwise expressly agreed to in
* writing between Synopsys and you. The Software IS NOT an item of Licensed
* Software or a Licensed Product under any End User Software License Agreement
* or Agreement for Licensed Products with Synopsys or any supplement thereto.
* Synopsys is a registered trademark of Synopsys, Inc. Other names included in
* the SOFTWARE may be the trademarks of their respective owners.
*
* Synopsys MIT License:
* Copyright (c) 2020-Present Synopsys, Inc
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* the Software), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute,
* sublicense, and/or sell copies of the Software, and to permit persons to whom
* the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING, BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE ARISING FROM,
* OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* */
#ifndef INCLUDE_LL_FW_CONFIG_H
#define INCLUDE_LL_FW_CONFIG_H
/*************************** General Configuration *********************************/
#ifndef SUPPORT_GNRC_SCHDLR_IF
#define SUPPORT_GNRC_SCHDLR_IF 1 /* Enable\Disable event EXTRNL_GNRC in Ble event manager. Enable:1 - Disable:0 */
#endif /* SUPPORT_GNRC_SCHDLR_IF */
/*************************** BLE Configuration *************************************/
/*Configurations of BLE will apply only when BLE is enabled*/
/* Variant configuration */
#define CFG_LL_BLE_PERIPHERAL_ONLY 1
/* Roles configurations */
#ifndef SUPPORT_EXPLCT_OBSERVER_ROLE
#define SUPPORT_EXPLCT_OBSERVER_ROLE 0 /* Enable\Disable Explicit observer role. Enable:1 - Disable:0 */
#endif /* SUPPORT_EXPLCT_OBSERVER_ROLE */
#ifndef SUPPORT_EXPLCT_BROADCASTER_ROLE
#define SUPPORT_EXPLCT_BROADCASTER_ROLE 1 /* Enable\Disable Explicit broadcaster role. Enable:1 - Disable:0 */
#endif /* SUPPORT_EXPLCT_BROADCASTER_ROLE */
#ifndef SUPPORT_MASTER_CONNECTION
#define SUPPORT_MASTER_CONNECTION 0 /* Enable\Disable Master connection role. Enable:1 - Disable:0 */
#endif /* SUPPORT_MASTER_CONNECTION */
#ifndef SUPPORT_SLAVE_CONNECTION
#define SUPPORT_SLAVE_CONNECTION 1 /* Enable\Disable Slave connection role. Enable:1 - Disable:0 */
#endif /* SUPPORT_SLAVE_CONNECTION */
/* Standard features configurations */
#ifndef SUPPORT_LE_ENCRYPTION
#define SUPPORT_LE_ENCRYPTION 1 /* Enable\Disable Encryption feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_ENCRYPTION */
#ifndef SUPPORT_PRIVACY
#define SUPPORT_PRIVACY 1 /* Enable\Disable Privacy feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_PRIVACY */
#ifndef SUPPORT_LE_EXTENDED_ADVERTISING
#define SUPPORT_LE_EXTENDED_ADVERTISING 0 /* Enable\Disable Extended advertising feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_EXTENDED_ADVERTISING */
#ifndef SUPPORT_LE_PERIODIC_ADVERTISING
#define SUPPORT_LE_PERIODIC_ADVERTISING 0 /* Enable\Disable Periodic advertising feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_PERIODIC_ADVERTISING */
#ifndef SUPPORT_LE_POWER_CLASS_1
#define SUPPORT_LE_POWER_CLASS_1 1 /* Enable\Disable Low power class 1 feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_POWER_CLASS_1 */
#ifndef SUPPORT_AOA_AOD
#define SUPPORT_AOA_AOD 0 /* Enable\Disable AOA_AOD feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_AOA_AOD */
#ifndef SUPPORT_PERIODIC_SYNC_TRANSFER
#define SUPPORT_PERIODIC_SYNC_TRANSFER 0 /* Enable\Disable PAST feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_PERIODIC_SYNC_TRANSFER */
#ifndef SUPPORT_SLEEP_CLOCK_ACCURCY_UPDATES
#define SUPPORT_SLEEP_CLOCK_ACCURCY_UPDATES 0 /* Enable\Disable Sleep Clock Accuracy Updates Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_SLEEP_CLOCK_ACCURCY_UPDATES */
#ifndef SUPPORT_CONNECTED_ISOCHRONOUS
#define SUPPORT_CONNECTED_ISOCHRONOUS 0 /* Enable\Disable Connected Isochronous Channel Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_CONNECTED_ISOCHRONOUS */
#ifndef SUPPORT_BRD_ISOCHRONOUS
#define SUPPORT_BRD_ISOCHRONOUS 0 /* Enable\Disable Broadcast Isochronous Channel Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_BRD_ISOCHRONOUS */
#ifndef SUPPORT_SYNC_ISOCHRONOUS
#define SUPPORT_SYNC_ISOCHRONOUS 0 /* Enable\Disable Broadcast Isochronous Synchronizer Channel Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_SYNC_ISOCHRONOUS */
#ifndef SUPPORT_LE_POWER_CONTROL
#define SUPPORT_LE_POWER_CONTROL 0 /* Enable\Disable LE Power Control Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_POWER_CONTROL */
#ifndef SUPPORT_CHANNEL_CLASSIFICATION
#define SUPPORT_CHANNEL_CLASSIFICATION 0
#endif /* SUPPORT_CHANNEL_CLASSIFICATION */
#ifndef SUPPORT_PERIODIC_ADV_ADI
#define SUPPORT_PERIODIC_ADV_ADI 0
#endif /* SUPPORT_PERIODIC_ADV_ADI */
#ifndef SUPPORT_LE_ENHANCED_CONN_UPDATE
#define SUPPORT_LE_ENHANCED_CONN_UPDATE 0
#endif /* SUPPORT_LE_ENHANCED_CONN_UPDATE */
#ifndef SUPPORT_CSSA
#define SUPPORT_CSSA 0 /* Enable\Disable Coding Selection Scheme on Advertising Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_CSSA */
#ifndef SUPPORT_LE_PAWR_ADVERTISER_ROLE
#define SUPPORT_LE_PAWR_ADVERTISER_ROLE 0 /* Enable\Disable PAwR Advertiser role. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_PAWR_ADVERTISER_ROLE */
#ifndef SUPPORT_LE_PAWR_SYNC_ROLE
#define SUPPORT_LE_PAWR_SYNC_ROLE 0 /* Enable\Disable PAwR Synchronizer role. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_PAWR_SYNC_ROLE */
#ifndef SUPPORT_CHANNEL_SOUNDING
#define SUPPORT_CHANNEL_SOUNDING 0 /* Enable\Disable Channel Sounding Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_CHANNEL_SOUNDING */
#ifndef SUPPORT_FRAME_SPACE_UPDATE
#define SUPPORT_FRAME_SPACE_UPDATE 0 /* Enable\Disable Frame Space Update Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_FRAME_SPACE_UPDATE */
#ifndef SUPPORT_EXT_FEATURE_SET
#define SUPPORT_EXT_FEATURE_SET 0 /* Enable\Disable Extended Feature Set Exchange. Enable:1 - Disable:0 */
#endif /* SUPPORT_EXT_FEATURE_SET */
#ifndef SUPPORT_ISO_UNSEG_MODE
#define SUPPORT_ISO_UNSEG_MODE 0 /* Enable\Disable Unsegmented Mode for Framed ISO PDUs. Enable: 1 - Disable: 0*/
#endif /* SUPPORT_ISO_UNSEG_MODE */
#ifndef SUPPORT_LE_ADVERTISERS_MONITORING
#define SUPPORT_LE_ADVERTISERS_MONITORING 0 /* Enable\Disable Advertisers Monitoring Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_ADVERTISERS_MONITORING */
/* Capabilities configurations */
#ifndef MAX_NUM_CNCRT_STAT_MCHNS
#define MAX_NUM_CNCRT_STAT_MCHNS 8 /* Set maximum number of states the controller can support */
#endif /* MAX_NUM_CNCRT_STAT_MCHNS */
#ifndef USE_NON_ACCURATE_32K_SLEEP_CLK
#define USE_NON_ACCURATE_32K_SLEEP_CLK 1 /* Allow to drive the sleep clock by sources other than the default crystal oscillator source.*/
/*LL can use crystal oscillator or RTC or RCO to drive the sleep clock.This selection is done via "DEFAULT_SLEEP_CLOCK_SOURCE" macro. */
#endif /* USE_NON_ACCURATE_32K_SLEEP_CLK */
#ifndef SUPPORT_CTE_DEGRADATION_API
#define SUPPORT_CTE_DEGRADATION_API 1 /* Enable\Disable CTE degradation API. Enable:1 - Disable:0 */
#endif /* SUPPORT_CTE_DEGRADATION_API */
/* Non-standard features configurations */
#ifndef NUM_OF_CTSM_EMNGR_HNDLS
#define NUM_OF_CTSM_EMNGR_HNDLS 1 /* Number of custom handles in event manager to be used for app specific needs */
#endif /* NUM_OF_CTSM_EMNGR_HNDLS */
#ifndef SUPPORT_AUGMENTED_BLE_MODE
#define SUPPORT_AUGMENTED_BLE_MODE 1 /* Enable\Disable Augmented BLE Support. Enable:1 - Disable:0 */
#endif /* SUPPORT_AUGMENTED_BLE_MODE */
#ifndef SUPPORT_PTA
#define SUPPORT_PTA 1 /* Enable\Disable PTA Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_PTA */
#ifndef SUPPORT_CONFIGURABLE_GAIN_FIX
#define SUPPORT_CONFIGURABLE_GAIN_FIX 0 /* Enable\Disable configurable gain fix support */
#endif /* SUPPORT_CONFIGURABLE_GAIN_FIX */
#ifndef CHECK_ANY_MISSED_EVENT_ON_DEEP_SLEEP_EXIT
#define CHECK_ANY_MISSED_EVENT_ON_DEEP_SLEEP_EXIT 1 /* Enable\Disable calling event scheduler handler function at the end of deep sleep exit*/
#endif /* CHECK_ANY_MISSED_EVENT_ON_DEEP_SLEEP_EXIT */
#ifndef SUPPORT_AUTONOMOUS_POWER_CONTROL_REQ
#define SUPPORT_AUTONOMOUS_POWER_CONTROL_REQ 0
#endif /* SUPPORT_AUTONOMOUS_POWER_CONTROL_REQ */
#ifndef SUPPORT_PROFILE
#define SUPPORT_PROFILE PROFILE_LIGHTWEIGHT /* Enable\Disable profiling LL timing framework */
#endif /* SUPPORT_PROFILE */
#ifndef LL_BASIC
#define LL_BASIC 1
#endif /* LL_BASIC */
/*************************** MAC Configuration *************************************/
/*Configurations of MAC will apply only when MAC is enabled*/
#ifndef FFD_DEVICE_CONFIG
#define FFD_DEVICE_CONFIG 0 /* Enable\Disable FFD:1 - RFD:0 */
#endif /* FFD_DEVICE_CONFIG */
#ifdef SUPPORT_AUG_MAC_HCI_UART
#ifndef RAL_NUMBER_OF_INSTANCE
#define RAL_NUMBER_OF_INSTANCE 0 /* The Number of RAL instances supported */
#endif /* RAL_NUMBER_OF_INSTANCE */
#else
#ifndef RAL_NUMBER_OF_INSTANCE
#define RAL_NUMBER_OF_INSTANCE 0 /* The Number of RAL instances supported */
#endif /* RAL_NUMBER_OF_INSTANCE */
#endif
#ifndef MAX_NUMBER_OF_INDIRECT_DATA
#define MAX_NUMBER_OF_INDIRECT_DATA 0 /* The maximum number of supported indirect data buffers */
#endif /* MAX_NUMBER_OF_INDIRECT_DATA */
#ifndef SUPPORT_OPENTHREAD_1_2
#define SUPPORT_OPENTHREAD_1_2 0 /* Enable / disable FW parts related to new features introduced in openthread 1.2*/
#endif /* SUPPORT_OPENTHREAD_1_2 */
#ifndef SUPPORT_SEC
#define SUPPORT_SEC 0 /* The MAC Security Supported : 1 - Not Supported:0 */
#endif /* SUPPORT_SEC */
#ifndef RADIO_CSMA
#define RADIO_CSMA 0 /* Enable\Disable CSMA Algorithm in Radio Layer, Must be Enabled if MAC_LAYER_BUILD */
#endif /* RADIO_CSMA */
#ifndef ENHANCED_RX_WHILE_CSMA_BACKOFF_DELAY
#define ENHANCED_RX_WHILE_CSMA_BACKOFF_DELAY 1 /* Enable\Disable RX WITH CSMA Feature */
#endif /* ENHANCED_RX_WHILE_CSMA_BACKOFF_DELAY */
#ifndef SUPPORT_ANT_DIV
#define SUPPORT_ANT_DIV 1 /* Enable/Disable Antenna Diversity Feature */
#endif /* SUPPORT_ANT_DIV */
#ifndef SUPPORT_A_MAC
#define SUPPORT_A_MAC 0
#endif /* SUPPORT_A_MAC */
#ifndef SUPPORT_CONFIG_LIB
#define SUPPORT_CONFIG_LIB 1 /* Enable\Disable Configurable Library feature */
#endif /* SUPPORT_CONFIG_LIB */
#ifndef SMPL_PRTCL_TEST_ENABLE
#define SMPL_PRTCL_TEST_ENABLE 0
#endif /* SMPL_PRTCL_TEST_ENABLE */
/*************************** Zigbee Configuration **********************************/
#ifndef SUPPORT_ZIGBEE_PHY_CERTIFICATION
#define SUPPORT_ZIGBEE_PHY_CERTIFICATION 0 /* Enable support of hci command required to implement zigbee phy Test cases Enable:1 - Disable:0 */
#endif /* SUPPORT_ZIGBEE_PHY_CERTIFICATION */
#endif /* INCLUDE_LL_FW_CONFIG_H */

View File

@@ -0,0 +1,271 @@
/*$Id: //dwh/bluetooth/DWC_ble154combo/firmware/rel/2.00a-lca04/firmware/public_inc/ll_fw_config.h#1 $*/
/**
********************************************************************************
* @file ll_fw_config.h
* @brief This file contains the major configurations to the BLE controller.
******************************************************************************
* This Synopsys DWC Bluetooth Low Energy Combo Link Layer/MAC software and
* associated documentation ( hereinafter the "Software") is an unsupported
* proprietary work of Synopsys, Inc. unless otherwise expressly agreed to in
* writing between Synopsys and you. The Software IS NOT an item of Licensed
* Software or a Licensed Product under any End User Software License Agreement
* or Agreement for Licensed Products with Synopsys or any supplement thereto.
* Synopsys is a registered trademark of Synopsys, Inc. Other names included in
* the SOFTWARE may be the trademarks of their respective owners.
*
* Synopsys MIT License:
* Copyright (c) 2020-Present Synopsys, Inc
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* the Software), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute,
* sublicense, and/or sell copies of the Software, and to permit persons to whom
* the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING, BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE ARISING FROM,
* OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* */
#ifndef INCLUDE_LL_FW_CONFIG_H
#define INCLUDE_LL_FW_CONFIG_H
/*************************** General Configuration *********************************/
#ifndef SUPPORT_GNRC_SCHDLR_IF
#define SUPPORT_GNRC_SCHDLR_IF 1 /* Enable\Disable event EXTRNL_GNRC in Ble event manager. Enable:1 - Disable:0 */
#endif /* SUPPORT_GNRC_SCHDLR_IF */
/*************************** BLE Configuration *************************************/
/*Configurations of BLE will apply only when BLE is enabled*/
/* Variant configuration */
#define CFG_LL_BLE_BASIC 1
/* Roles configurations */
#ifndef SUPPORT_EXPLCT_OBSERVER_ROLE
#define SUPPORT_EXPLCT_OBSERVER_ROLE 1 /* Enable\Disable Explicit observer role. Enable:1 - Disable:0 */
#endif /* SUPPORT_EXPLCT_OBSERVER_ROLE */
#ifndef SUPPORT_EXPLCT_BROADCASTER_ROLE
#define SUPPORT_EXPLCT_BROADCASTER_ROLE 1 /* Enable\Disable Explicit broadcaster role. Enable:1 - Disable:0 */
#endif /* SUPPORT_EXPLCT_BROADCASTER_ROLE */
#ifndef SUPPORT_MASTER_CONNECTION
#define SUPPORT_MASTER_CONNECTION 1 /* Enable\Disable Master connection role. Enable:1 - Disable:0 */
#endif /* SUPPORT_MASTER_CONNECTION */
#ifndef SUPPORT_SLAVE_CONNECTION
#define SUPPORT_SLAVE_CONNECTION 1 /* Enable\Disable Slave connection role. Enable:1 - Disable:0 */
#endif /* SUPPORT_SLAVE_CONNECTION */
/* Standard features configurations */
#ifndef SUPPORT_LE_ENCRYPTION
#define SUPPORT_LE_ENCRYPTION 1 /* Enable\Disable Encryption feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_ENCRYPTION */
#ifndef SUPPORT_PRIVACY
#define SUPPORT_PRIVACY 1 /* Enable\Disable Privacy feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_PRIVACY */
#ifndef SUPPORT_LE_EXTENDED_ADVERTISING
#define SUPPORT_LE_EXTENDED_ADVERTISING 0 /* Enable\Disable Extended advertising feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_EXTENDED_ADVERTISING */
#ifndef SUPPORT_LE_PERIODIC_ADVERTISING
#define SUPPORT_LE_PERIODIC_ADVERTISING 0 /* Enable\Disable Periodic advertising feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_PERIODIC_ADVERTISING */
#ifndef SUPPORT_LE_POWER_CLASS_1
#define SUPPORT_LE_POWER_CLASS_1 0 /* Enable\Disable Low power class 1 feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_POWER_CLASS_1 */
#ifndef SUPPORT_AOA_AOD
#define SUPPORT_AOA_AOD 0 /* Enable\Disable AOA_AOD feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_AOA_AOD */
#ifndef SUPPORT_PERIODIC_SYNC_TRANSFER
#define SUPPORT_PERIODIC_SYNC_TRANSFER 0 /* Enable\Disable PAST feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_PERIODIC_SYNC_TRANSFER */
#ifndef SUPPORT_SLEEP_CLOCK_ACCURCY_UPDATES
#define SUPPORT_SLEEP_CLOCK_ACCURCY_UPDATES 1 /* Enable\Disable Sleep Clock Accuracy Updates Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_SLEEP_CLOCK_ACCURCY_UPDATES */
#ifndef SUPPORT_CONNECTED_ISOCHRONOUS
#define SUPPORT_CONNECTED_ISOCHRONOUS 0 /* Enable\Disable Connected Isochronous Channel Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_CONNECTED_ISOCHRONOUS */
#ifndef SUPPORT_BRD_ISOCHRONOUS
#define SUPPORT_BRD_ISOCHRONOUS 0 /* Enable\Disable Broadcast Isochronous Channel Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_BRD_ISOCHRONOUS */
#ifndef SUPPORT_SYNC_ISOCHRONOUS
#define SUPPORT_SYNC_ISOCHRONOUS 0 /* Enable\Disable Broadcast Isochronous Synchronizer Channel Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_SYNC_ISOCHRONOUS */
#ifndef SUPPORT_LE_POWER_CONTROL
#define SUPPORT_LE_POWER_CONTROL 0 /* Enable\Disable LE Power Control Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_POWER_CONTROL */
#ifndef SUPPORT_CHANNEL_CLASSIFICATION
#define SUPPORT_CHANNEL_CLASSIFICATION 0
#endif /* SUPPORT_CHANNEL_CLASSIFICATION */
#ifndef SUPPORT_PERIODIC_ADV_ADI
#define SUPPORT_PERIODIC_ADV_ADI 0
#endif /* SUPPORT_PERIODIC_ADV_ADI */
#ifndef SUPPORT_LE_ENHANCED_CONN_UPDATE
#define SUPPORT_LE_ENHANCED_CONN_UPDATE 0
#endif /* SUPPORT_LE_ENHANCED_CONN_UPDATE */
#ifndef SUPPORT_CSSA
#define SUPPORT_CSSA 0 /* Enable\Disable Coding Selection Scheme on Advertising Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_CSSA */
#ifndef SUPPORT_LE_PAWR_ADVERTISER_ROLE
#define SUPPORT_LE_PAWR_ADVERTISER_ROLE 0 /* Enable\Disable PAwR Advertiser role. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_PAWR_ADVERTISER_ROLE */
#ifndef SUPPORT_LE_PAWR_SYNC_ROLE
#define SUPPORT_LE_PAWR_SYNC_ROLE 0 /* Enable\Disable PAwR Synchronizer role. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_PAWR_SYNC_ROLE */
#ifndef SUPPORT_CHANNEL_SOUNDING
#define SUPPORT_CHANNEL_SOUNDING 0 /* Enable\Disable Channel Sounding Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_CHANNEL_SOUNDING */
#ifndef SUPPORT_FRAME_SPACE_UPDATE
#define SUPPORT_FRAME_SPACE_UPDATE 0 /* Enable\Disable Frame Space Update Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_FRAME_SPACE_UPDATE */
#ifndef SUPPORT_EXT_FEATURE_SET
#define SUPPORT_EXT_FEATURE_SET 0 /* Enable\Disable Extended Feature Set Exchange. Enable:1 - Disable:0 */
#endif /* SUPPORT_EXT_FEATURE_SET */
#ifndef SUPPORT_ISO_UNSEG_MODE
#define SUPPORT_ISO_UNSEG_MODE 0 /* Enable\Disable Unsegmented Mode for Framed ISO PDUs. Enable: 1 - Disable: 0*/
#endif /* SUPPORT_ISO_UNSEG_MODE */
#ifndef SUPPORT_LE_ADVERTISERS_MONITORING
#define SUPPORT_LE_ADVERTISERS_MONITORING 0 /* Enable\Disable Advertisers Monitoring Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_ADVERTISERS_MONITORING */
/* Capabilities configurations */
#ifndef MAX_NUM_CNCRT_STAT_MCHNS
#define MAX_NUM_CNCRT_STAT_MCHNS 8 /* Set maximum number of states the controller can support */
#endif /* MAX_NUM_CNCRT_STAT_MCHNS */
#ifndef USE_NON_ACCURATE_32K_SLEEP_CLK
#define USE_NON_ACCURATE_32K_SLEEP_CLK 1 /* Allow to drive the sleep clock by sources other than the default crystal oscillator source.*/
/*LL can use crystal oscillator or RTC or RCO to drive the sleep clock.This selection is done via "DEFAULT_SLEEP_CLOCK_SOURCE" macro. */
#endif /* USE_NON_ACCURATE_32K_SLEEP_CLK */
#ifndef SUPPORT_CTE_DEGRADATION_API
#define SUPPORT_CTE_DEGRADATION_API 1 /* Enable\Disable CTE degradation API. Enable:1 - Disable:0 */
#endif /* SUPPORT_CTE_DEGRADATION_API */
/* Non-standard features configurations */
#ifndef NUM_OF_CTSM_EMNGR_HNDLS
#define NUM_OF_CTSM_EMNGR_HNDLS 1 /* Number of custom handles in event manager to be used for app specific needs */
#endif /* NUM_OF_CTSM_EMNGR_HNDLS */
#ifndef SUPPORT_AUGMENTED_BLE_MODE
#define SUPPORT_AUGMENTED_BLE_MODE 1 /* Enable\Disable Augmented BLE Support. Enable:1 - Disable:0 */
#endif /* SUPPORT_AUGMENTED_BLE_MODE */
#ifndef SUPPORT_PTA
#define SUPPORT_PTA 1 /* Enable\Disable PTA Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_PTA */
#ifndef SUPPORT_CONFIGURABLE_GAIN_FIX
#define SUPPORT_CONFIGURABLE_GAIN_FIX 0 /* Enable\Disable configurable gain fix support */
#endif /* SUPPORT_CONFIGURABLE_GAIN_FIX */
#ifndef CHECK_ANY_MISSED_EVENT_ON_DEEP_SLEEP_EXIT
#define CHECK_ANY_MISSED_EVENT_ON_DEEP_SLEEP_EXIT 1 /* Enable\Disable calling event scheduler handler function at the end of deep sleep exit*/
#endif /* CHECK_ANY_MISSED_EVENT_ON_DEEP_SLEEP_EXIT */
#ifndef SUPPORT_PROFILE
#define SUPPORT_PROFILE PROFILE_LIGHTWEIGHT /* Enable\Disable profiling LL timing framework */
#endif /* SUPPORT_PROFILE */
#ifndef LL_BASIC
#define LL_BASIC 0
#endif /* LL_BASIC */
/*************************** MAC Configuration *************************************/
/*Configurations of MAC will apply only when MAC is enabled*/
#ifndef FFD_DEVICE_CONFIG
#define FFD_DEVICE_CONFIG 1 /* Enable\Disable FFD:1 - RFD:0 */
#endif /* FFD_DEVICE_CONFIG */
#ifdef RFD_DEVICE_CONFIG
#undef FFD_DEVICE_CONFIG
#define FFD_DEVICE_CONFIG 0 /* Enable\Disable FFD:1 - RFD:0 */
#endif
#ifdef SUPPORT_AUG_MAC_HCI_UART
#ifndef RAL_NUMBER_OF_INSTANCE
#define RAL_NUMBER_OF_INSTANCE 2 /* The Number of RAL instances supported */
#endif /* RAL_NUMBER_OF_INSTANCE */
#else
#ifndef RAL_NUMBER_OF_INSTANCE
#define RAL_NUMBER_OF_INSTANCE 1 /* The Number of RAL instances supported */
#endif /* RAL_NUMBER_OF_INSTANCE */
#endif
#ifndef MAX_NUMBER_OF_INDIRECT_DATA
#define MAX_NUMBER_OF_INDIRECT_DATA 10 /* The maximum number of supported indirect data buffers */
#endif /* MAX_NUMBER_OF_INDIRECT_DATA */
#ifndef SUPPORT_OPENTHREAD_1_2
#define SUPPORT_OPENTHREAD_1_2 1 /* Enable / disable FW parts related to new features introduced in openthread 1.2*/
#endif /* SUPPORT_OPENTHREAD_1_2 */
#ifndef SUPPORT_SEC
#define SUPPORT_SEC 1 /* The MAC Security Supported : 1 - Not Supported:0 */
#endif /* SUPPORT_SEC */
#ifndef RADIO_CSMA
#define RADIO_CSMA 1 /* Enable\Disable CSMA Algorithm in Radio Layer, Must be Enabled if MAC_LAYER_BUILD */
#endif /* RADIO_CSMA */
#ifndef ENHANCED_RX_WHILE_CSMA_BACKOFF_DELAY
#define ENHANCED_RX_WHILE_CSMA_BACKOFF_DELAY 1 /* Enable\Disable RX WITH CSMA Feature */
#endif /* ENHANCED_RX_WHILE_CSMA_BACKOFF_DELAY */
#ifndef SUPPORT_ANT_DIV
#define SUPPORT_ANT_DIV 1 /* Enable/Disable Antenna Diversity Feature */
#endif /* SUPPORT_ANT_DIV */
#ifndef SUPPORT_A_MAC
#define SUPPORT_A_MAC 1
#endif /* SUPPORT_A_MAC */
#ifndef SUPPORT_CONFIG_LIB
#define SUPPORT_CONFIG_LIB 1 /* Enable\Disable Configurable Library feature */
#endif /* SUPPORT_CONFIG_LIB */
#ifndef SMPL_PRTCL_TEST_ENABLE
#define SMPL_PRTCL_TEST_ENABLE 0
#endif /* SMPL_PRTCL_TEST_ENABLE */
#ifndef IEEE_EUI64_VENDOR_SPECIFIC_FUNC
#define IEEE_EUI64_VENDOR_SPECIFIC_FUNC 1 /* Comment to disable EUI-64 vendor specific function, in this case EUI-64 is not unique */
#endif /* IEEE_EUI64_VENDOR_SPECIFIC_FUNC */
/*************************** Zigbee Configuration **********************************/
#ifndef SUPPORT_ZIGBEE_PHY_CERTIFICATION
#define SUPPORT_ZIGBEE_PHY_CERTIFICATION 0 /* Enable support of hci command required to implement zigbee phy Test cases Enable:1 - Disable:0 */
#endif /* SUPPORT_ZIGBEE_PHY_CERTIFICATION */
#endif /* INCLUDE_LL_FW_CONFIG_H */

View File

@@ -0,0 +1,271 @@
/*$Id: //dwh/bluetooth/DWC_ble154combo/firmware/rel/2.00a-lca04/firmware/public_inc/ll_fw_config.h#1 $*/
/**
********************************************************************************
* @file ll_fw_config.h
* @brief This file contains the major configurations to the BLE controller.
******************************************************************************
* This Synopsys DWC Bluetooth Low Energy Combo Link Layer/MAC software and
* associated documentation ( hereinafter the "Software") is an unsupported
* proprietary work of Synopsys, Inc. unless otherwise expressly agreed to in
* writing between Synopsys and you. The Software IS NOT an item of Licensed
* Software or a Licensed Product under any End User Software License Agreement
* or Agreement for Licensed Products with Synopsys or any supplement thereto.
* Synopsys is a registered trademark of Synopsys, Inc. Other names included in
* the SOFTWARE may be the trademarks of their respective owners.
*
* Synopsys MIT License:
* Copyright (c) 2020-Present Synopsys, Inc
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* the Software), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute,
* sublicense, and/or sell copies of the Software, and to permit persons to whom
* the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING, BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE ARISING FROM,
* OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* */
#ifndef INCLUDE_LL_FW_CONFIG_H
#define INCLUDE_LL_FW_CONFIG_H
/*************************** General Configuration *********************************/
#ifndef SUPPORT_GNRC_SCHDLR_IF
#define SUPPORT_GNRC_SCHDLR_IF 1 /* Enable\Disable event EXTRNL_GNRC in Ble event manager. Enable:1 - Disable:0 */
#endif /* SUPPORT_GNRC_SCHDLR_IF */
/*************************** BLE Configuration *************************************/
/*Configurations of BLE will apply only when BLE is enabled*/
/* Variant configuration */
#define CFG_LL_BLE_BASIC 1
/* Roles configurations */
#ifndef SUPPORT_EXPLCT_OBSERVER_ROLE
#define SUPPORT_EXPLCT_OBSERVER_ROLE 1 /* Enable\Disable Explicit observer role. Enable:1 - Disable:0 */
#endif /* SUPPORT_EXPLCT_OBSERVER_ROLE */
#ifndef SUPPORT_EXPLCT_BROADCASTER_ROLE
#define SUPPORT_EXPLCT_BROADCASTER_ROLE 1 /* Enable\Disable Explicit broadcaster role. Enable:1 - Disable:0 */
#endif /* SUPPORT_EXPLCT_BROADCASTER_ROLE */
#ifndef SUPPORT_MASTER_CONNECTION
#define SUPPORT_MASTER_CONNECTION 1 /* Enable\Disable Master connection role. Enable:1 - Disable:0 */
#endif /* SUPPORT_MASTER_CONNECTION */
#ifndef SUPPORT_SLAVE_CONNECTION
#define SUPPORT_SLAVE_CONNECTION 1 /* Enable\Disable Slave connection role. Enable:1 - Disable:0 */
#endif /* SUPPORT_SLAVE_CONNECTION */
/* Standard features configurations */
#ifndef SUPPORT_LE_ENCRYPTION
#define SUPPORT_LE_ENCRYPTION 1 /* Enable\Disable Encryption feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_ENCRYPTION */
#ifndef SUPPORT_PRIVACY
#define SUPPORT_PRIVACY 1 /* Enable\Disable Privacy feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_PRIVACY */
#ifndef SUPPORT_LE_EXTENDED_ADVERTISING
#define SUPPORT_LE_EXTENDED_ADVERTISING 0 /* Enable\Disable Extended advertising feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_EXTENDED_ADVERTISING */
#ifndef SUPPORT_LE_PERIODIC_ADVERTISING
#define SUPPORT_LE_PERIODIC_ADVERTISING 0 /* Enable\Disable Periodic advertising feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_PERIODIC_ADVERTISING */
#ifndef SUPPORT_LE_POWER_CLASS_1
#define SUPPORT_LE_POWER_CLASS_1 0 /* Enable\Disable Low power class 1 feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_POWER_CLASS_1 */
#ifndef SUPPORT_AOA_AOD
#define SUPPORT_AOA_AOD 0 /* Enable\Disable AOA_AOD feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_AOA_AOD */
#ifndef SUPPORT_PERIODIC_SYNC_TRANSFER
#define SUPPORT_PERIODIC_SYNC_TRANSFER 0 /* Enable\Disable PAST feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_PERIODIC_SYNC_TRANSFER */
#ifndef SUPPORT_SLEEP_CLOCK_ACCURCY_UPDATES
#define SUPPORT_SLEEP_CLOCK_ACCURCY_UPDATES 1 /* Enable\Disable Sleep Clock Accuracy Updates Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_SLEEP_CLOCK_ACCURCY_UPDATES */
#ifndef SUPPORT_CONNECTED_ISOCHRONOUS
#define SUPPORT_CONNECTED_ISOCHRONOUS 0 /* Enable\Disable Connected Isochronous Channel Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_CONNECTED_ISOCHRONOUS */
#ifndef SUPPORT_BRD_ISOCHRONOUS
#define SUPPORT_BRD_ISOCHRONOUS 0 /* Enable\Disable Broadcast Isochronous Channel Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_BRD_ISOCHRONOUS */
#ifndef SUPPORT_SYNC_ISOCHRONOUS
#define SUPPORT_SYNC_ISOCHRONOUS 0 /* Enable\Disable Broadcast Isochronous Synchronizer Channel Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_SYNC_ISOCHRONOUS */
#ifndef SUPPORT_LE_POWER_CONTROL
#define SUPPORT_LE_POWER_CONTROL 0 /* Enable\Disable LE Power Control Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_POWER_CONTROL */
#ifndef SUPPORT_CHANNEL_CLASSIFICATION
#define SUPPORT_CHANNEL_CLASSIFICATION 0
#endif /* SUPPORT_CHANNEL_CLASSIFICATION */
#ifndef SUPPORT_PERIODIC_ADV_ADI
#define SUPPORT_PERIODIC_ADV_ADI 0
#endif /* SUPPORT_PERIODIC_ADV_ADI */
#ifndef SUPPORT_LE_ENHANCED_CONN_UPDATE
#define SUPPORT_LE_ENHANCED_CONN_UPDATE 0
#endif /* SUPPORT_LE_ENHANCED_CONN_UPDATE */
#ifndef SUPPORT_CSSA
#define SUPPORT_CSSA 0 /* Enable\Disable Coding Selection Scheme on Advertising Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_CSSA */
#ifndef SUPPORT_LE_PAWR_ADVERTISER_ROLE
#define SUPPORT_LE_PAWR_ADVERTISER_ROLE 0 /* Enable\Disable PAwR Advertiser role. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_PAWR_ADVERTISER_ROLE */
#ifndef SUPPORT_LE_PAWR_SYNC_ROLE
#define SUPPORT_LE_PAWR_SYNC_ROLE 0 /* Enable\Disable PAwR Synchronizer role. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_PAWR_SYNC_ROLE */
#ifndef SUPPORT_CHANNEL_SOUNDING
#define SUPPORT_CHANNEL_SOUNDING 0 /* Enable\Disable Channel Sounding Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_CHANNEL_SOUNDING */
#ifndef SUPPORT_FRAME_SPACE_UPDATE
#define SUPPORT_FRAME_SPACE_UPDATE 0 /* Enable\Disable Frame Space Update Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_FRAME_SPACE_UPDATE */
#ifndef SUPPORT_EXT_FEATURE_SET
#define SUPPORT_EXT_FEATURE_SET 0 /* Enable\Disable Extended Feature Set Exchange. Enable:1 - Disable:0 */
#endif /* SUPPORT_EXT_FEATURE_SET */
#ifndef SUPPORT_ISO_UNSEG_MODE
#define SUPPORT_ISO_UNSEG_MODE 0 /* Enable\Disable Unsegmented Mode for Framed ISO PDUs. Enable: 1 - Disable: 0*/
#endif /* SUPPORT_ISO_UNSEG_MODE */
#ifndef SUPPORT_LE_ADVERTISERS_MONITORING
#define SUPPORT_LE_ADVERTISERS_MONITORING 0 /* Enable\Disable Advertisers Monitoring Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_ADVERTISERS_MONITORING */
/* Capabilities configurations */
#ifndef MAX_NUM_CNCRT_STAT_MCHNS
#define MAX_NUM_CNCRT_STAT_MCHNS 8 /* Set maximum number of states the controller can support */
#endif /* MAX_NUM_CNCRT_STAT_MCHNS */
#ifndef USE_NON_ACCURATE_32K_SLEEP_CLK
#define USE_NON_ACCURATE_32K_SLEEP_CLK 1 /* Allow to drive the sleep clock by sources other than the default crystal oscillator source.*/
/*LL can use crystal oscillator or RTC or RCO to drive the sleep clock.This selection is done via "DEFAULT_SLEEP_CLOCK_SOURCE" macro. */
#endif /* USE_NON_ACCURATE_32K_SLEEP_CLK */
#ifndef SUPPORT_CTE_DEGRADATION_API
#define SUPPORT_CTE_DEGRADATION_API 1 /* Enable\Disable CTE degradation API. Enable:1 - Disable:0 */
#endif /* SUPPORT_CTE_DEGRADATION_API */
/* Non-standard features configurations */
#ifndef NUM_OF_CTSM_EMNGR_HNDLS
#define NUM_OF_CTSM_EMNGR_HNDLS 1 /* Number of custom handles in event manager to be used for app specific needs */
#endif /* NUM_OF_CTSM_EMNGR_HNDLS */
#ifndef SUPPORT_AUGMENTED_BLE_MODE
#define SUPPORT_AUGMENTED_BLE_MODE 1 /* Enable\Disable Augmented BLE Support. Enable:1 - Disable:0 */
#endif /* SUPPORT_AUGMENTED_BLE_MODE */
#ifndef SUPPORT_PTA
#define SUPPORT_PTA 1 /* Enable\Disable PTA Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_PTA */
#ifndef SUPPORT_CONFIGURABLE_GAIN_FIX
#define SUPPORT_CONFIGURABLE_GAIN_FIX 0 /* Enable\Disable configurable gain fix support */
#endif /* SUPPORT_CONFIGURABLE_GAIN_FIX */
#ifndef CHECK_ANY_MISSED_EVENT_ON_DEEP_SLEEP_EXIT
#define CHECK_ANY_MISSED_EVENT_ON_DEEP_SLEEP_EXIT 1 /* Enable\Disable calling event scheduler handler function at the end of deep sleep exit*/
#endif /* CHECK_ANY_MISSED_EVENT_ON_DEEP_SLEEP_EXIT */
#ifndef SUPPORT_PROFILE
#define SUPPORT_PROFILE PROFILE_LIGHTWEIGHT /* Enable\Disable profiling LL timing framework */
#endif /* SUPPORT_PROFILE */
#ifndef LL_BASIC
#define LL_BASIC 0
#endif /* LL_BASIC */
/*************************** MAC Configuration *************************************/
/*Configurations of MAC will apply only when MAC is enabled*/
#ifndef FFD_DEVICE_CONFIG
#define FFD_DEVICE_CONFIG 1 /* Enable\Disable FFD:1 - RFD:0 */
#endif /* FFD_DEVICE_CONFIG */
#ifdef RFD_DEVICE_CONFIG
#undef FFD_DEVICE_CONFIG
#define FFD_DEVICE_CONFIG 0 /* Enable\Disable FFD:1 - RFD:0 */
#endif
#ifdef SUPPORT_AUG_MAC_HCI_UART
#ifndef RAL_NUMBER_OF_INSTANCE
#define RAL_NUMBER_OF_INSTANCE 2 /* The Number of RAL instances supported */
#endif /* RAL_NUMBER_OF_INSTANCE */
#else
#ifndef RAL_NUMBER_OF_INSTANCE
#define RAL_NUMBER_OF_INSTANCE 1 /* The Number of RAL instances supported */
#endif /* RAL_NUMBER_OF_INSTANCE */
#endif
#ifndef MAX_NUMBER_OF_INDIRECT_DATA
#define MAX_NUMBER_OF_INDIRECT_DATA 10 /* The maximum number of supported indirect data buffers */
#endif /* MAX_NUMBER_OF_INDIRECT_DATA */
#ifndef SUPPORT_OPENTHREAD_1_2
#define SUPPORT_OPENTHREAD_1_2 1 /* Enable / disable FW parts related to new features introduced in openthread 1.2*/
#endif /* SUPPORT_OPENTHREAD_1_2 */
#ifndef SUPPORT_SEC
#define SUPPORT_SEC 1 /* The MAC Security Supported : 1 - Not Supported:0 */
#endif /* SUPPORT_SEC */
#ifndef RADIO_CSMA
#define RADIO_CSMA 1 /* Enable\Disable CSMA Algorithm in Radio Layer, Must be Enabled if MAC_LAYER_BUILD */
#endif /* RADIO_CSMA */
#ifndef ENHANCED_RX_WHILE_CSMA_BACKOFF_DELAY
#define ENHANCED_RX_WHILE_CSMA_BACKOFF_DELAY 1 /* Enable\Disable RX WITH CSMA Feature */
#endif /* ENHANCED_RX_WHILE_CSMA_BACKOFF_DELAY */
#ifndef SUPPORT_ANT_DIV
#define SUPPORT_ANT_DIV 1 /* Enable/Disable Antenna Diversity Feature */
#endif /* SUPPORT_ANT_DIV */
#ifndef SUPPORT_A_MAC
#define SUPPORT_A_MAC 1
#endif /* SUPPORT_A_MAC */
#ifndef SUPPORT_CONFIG_LIB
#define SUPPORT_CONFIG_LIB 1 /* Enable\Disable Configurable Library feature */
#endif /* SUPPORT_CONFIG_LIB */
#ifndef SMPL_PRTCL_TEST_ENABLE
#define SMPL_PRTCL_TEST_ENABLE 0
#endif /* SMPL_PRTCL_TEST_ENABLE */
#ifndef IEEE_EUI64_VENDOR_SPECIFIC_FUNC
#define IEEE_EUI64_VENDOR_SPECIFIC_FUNC 1 /* Comment to disable EUI-64 vendor specific function, in this case EUI-64 is not unique */
#endif /* IEEE_EUI64_VENDOR_SPECIFIC_FUNC */
/*************************** Zigbee Configuration **********************************/
#ifndef SUPPORT_ZIGBEE_PHY_CERTIFICATION
#define SUPPORT_ZIGBEE_PHY_CERTIFICATION 0 /* Enable support of hci command required to implement zigbee phy Test cases Enable:1 - Disable:0 */
#endif /* SUPPORT_ZIGBEE_PHY_CERTIFICATION */
#endif /* INCLUDE_LL_FW_CONFIG_H */

View File

@@ -0,0 +1,260 @@
/*$Id: //dwh/bluetooth/DWC_ble154combo/firmware/rel/2.00a-lca04/firmware/public_inc/ll_fw_config.h#1 $*/
/**
********************************************************************************
* @file ll_fw_config.h
* @brief This file contains the major configurations to the BLE controller.
******************************************************************************
* This Synopsys DWC Bluetooth Low Energy Combo Link Layer/MAC software and
* associated documentation ( hereinafter the "Software") is an unsupported
* proprietary work of Synopsys, Inc. unless otherwise expressly agreed to in
* writing between Synopsys and you. The Software IS NOT an item of Licensed
* Software or a Licensed Product under any End User Software License Agreement
* or Agreement for Licensed Products with Synopsys or any supplement thereto.
* Synopsys is a registered trademark of Synopsys, Inc. Other names included in
* the SOFTWARE may be the trademarks of their respective owners.
*
* Synopsys MIT License:
* Copyright (c) 2020-Present Synopsys, Inc
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* the Software), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute,
* sublicense, and/or sell copies of the Software, and to permit persons to whom
* the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING, BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE ARISING FROM,
* OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* */
#ifndef INCLUDE_LL_FW_CONFIG_H
#define INCLUDE_LL_FW_CONFIG_H
/*************************** General Configuration *********************************/
#ifndef SUPPORT_GNRC_SCHDLR_IF
#define SUPPORT_GNRC_SCHDLR_IF 1 /* Enable\Disable event EXTRNL_GNRC in Ble event manager. Enable:1 - Disable:0 */
#endif /* SUPPORT_GNRC_SCHDLR_IF */
/*************************** BLE Configuration *************************************/
/*Configurations of BLE will apply only when BLE is enabled*/
/* Roles configurations */
#ifndef SUPPORT_EXPLCT_OBSERVER_ROLE
#define SUPPORT_EXPLCT_OBSERVER_ROLE 0 /* Enable\Disable Explicit observer role. Enable:1 - Disable:0 */
#endif /* SUPPORT_EXPLCT_OBSERVER_ROLE */
#ifndef SUPPORT_EXPLCT_BROADCASTER_ROLE
#define SUPPORT_EXPLCT_BROADCASTER_ROLE 0 /* Enable\Disable Explicit broadcaster role. Enable:1 - Disable:0 */
#endif /* SUPPORT_EXPLCT_BROADCASTER_ROLE */
#ifndef SUPPORT_MASTER_CONNECTION
#define SUPPORT_MASTER_CONNECTION 0 /* Enable\Disable Master connection role. Enable:1 - Disable:0 */
#endif /* SUPPORT_MASTER_CONNECTION */
#ifndef SUPPORT_SLAVE_CONNECTION
#define SUPPORT_SLAVE_CONNECTION 0 /* Enable\Disable Slave connection role. Enable:1 - Disable:0 */
#endif /* SUPPORT_SLAVE_CONNECTION */
/* Standard features configurations */
#ifndef SUPPORT_LE_ENCRYPTION
#define SUPPORT_LE_ENCRYPTION 0 /* Enable\Disable Encryption feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_ENCRYPTION */
#ifndef SUPPORT_PRIVACY
#define SUPPORT_PRIVACY 0 /* Enable\Disable Privacy feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_PRIVACY */
#ifndef SUPPORT_LE_EXTENDED_ADVERTISING
#define SUPPORT_LE_EXTENDED_ADVERTISING 0 /* Enable\Disable Extended advertising feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_EXTENDED_ADVERTISING */
#ifndef SUPPORT_LE_PERIODIC_ADVERTISING
#define SUPPORT_LE_PERIODIC_ADVERTISING 0 /* Enable\Disable Periodic advertising feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_PERIODIC_ADVERTISING */
#ifndef SUPPORT_LE_POWER_CLASS_1
#define SUPPORT_LE_POWER_CLASS_1 0 /* Enable\Disable Low power class 1 feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_POWER_CLASS_1 */
#ifndef SUPPORT_AOA_AOD
#define SUPPORT_AOA_AOD 0 /* Enable\Disable AOA_AOD feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_AOA_AOD */
#ifndef SUPPORT_PERIODIC_SYNC_TRANSFER
#define SUPPORT_PERIODIC_SYNC_TRANSFER 0 /* Enable\Disable PAST feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_PERIODIC_SYNC_TRANSFER */
#ifndef SUPPORT_SLEEP_CLOCK_ACCURCY_UPDATES
#define SUPPORT_SLEEP_CLOCK_ACCURCY_UPDATES 0 /* Enable\Disable Sleep Clock Accuracy Updates Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_SLEEP_CLOCK_ACCURCY_UPDATES */
#ifndef SUPPORT_CONNECTED_ISOCHRONOUS
#define SUPPORT_CONNECTED_ISOCHRONOUS 0 /* Enable\Disable Connected Isochronous Channel Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_CONNECTED_ISOCHRONOUS */
#ifndef SUPPORT_BRD_ISOCHRONOUS
#define SUPPORT_BRD_ISOCHRONOUS 0 /* Enable\Disable Broadcast Isochronous Channel Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_BRD_ISOCHRONOUS */
#ifndef SUPPORT_SYNC_ISOCHRONOUS
#define SUPPORT_SYNC_ISOCHRONOUS 0 /* Enable\Disable Broadcast Isochronous Synchronizer Channel Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_SYNC_ISOCHRONOUS */
#ifndef SUPPORT_LE_POWER_CONTROL
#define SUPPORT_LE_POWER_CONTROL 0 /* Enable\Disable LE Power Control Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_POWER_CONTROL */
#ifndef SUPPORT_CHANNEL_CLASSIFICATION
#define SUPPORT_CHANNEL_CLASSIFICATION 0
#endif /* SUPPORT_CHANNEL_CLASSIFICATION */
#ifndef SUPPORT_PERIODIC_ADV_ADI
#define SUPPORT_PERIODIC_ADV_ADI 0
#endif /* SUPPORT_PERIODIC_ADV_ADI */
#ifndef SUPPORT_LE_ENHANCED_CONN_UPDATE
#define SUPPORT_LE_ENHANCED_CONN_UPDATE 0
#endif /* SUPPORT_LE_ENHANCED_CONN_UPDATE */
#ifndef SUPPORT_CSSA
#define SUPPORT_CSSA 0 /* Enable\Disable Coding Selection Scheme on Advertising Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_CSSA */
#ifndef SUPPORT_LE_PAWR_ADVERTISER_ROLE
#define SUPPORT_LE_PAWR_ADVERTISER_ROLE 0 /* Enable\Disable PAwR Advertiser role. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_PAWR_ADVERTISER_ROLE */
#ifndef SUPPORT_LE_PAWR_SYNC_ROLE
#define SUPPORT_LE_PAWR_SYNC_ROLE 0 /* Enable\Disable PAwR Synchronizer role. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_PAWR_SYNC_ROLE */
#ifndef SUPPORT_CHANNEL_SOUNDING
#define SUPPORT_CHANNEL_SOUNDING 0 /* Enable\Disable Channel Sounding Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_CHANNEL_SOUNDING */
#ifndef SUPPORT_FRAME_SPACE_UPDATE
#define SUPPORT_FRAME_SPACE_UPDATE 0 /* Enable\Disable Frame Space Update Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_FRAME_SPACE_UPDATE */
#ifndef SUPPORT_EXT_FEATURE_SET
#define SUPPORT_EXT_FEATURE_SET 0 /* Enable\Disable Extended Feature Set Exchange. Enable:1 - Disable:0 */
#endif /* SUPPORT_EXT_FEATURE_SET */
#ifndef SUPPORT_ISO_UNSEG_MODE
#define SUPPORT_ISO_UNSEG_MODE 0 /* Enable\Disable Unsegmented Mode for Framed ISO PDUs. Enable: 1 - Disable: 0*/
#endif /* SUPPORT_ISO_UNSEG_MODE */
#ifndef SUPPORT_LE_ADVERTISERS_MONITORING
#define SUPPORT_LE_ADVERTISERS_MONITORING 0 /* Enable\Disable Advertisers Monitoring Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_ADVERTISERS_MONITORING */
/* Capabilities configurations */
#ifndef MAX_NUM_CNCRT_STAT_MCHNS
#define MAX_NUM_CNCRT_STAT_MCHNS 0 /* Set maximum number of states the controller can support */
#endif /* MAX_NUM_CNCRT_STAT_MCHNS */
#ifndef USE_NON_ACCURATE_32K_SLEEP_CLK
#define USE_NON_ACCURATE_32K_SLEEP_CLK 1 /* Allow to drive the sleep clock by sources other than the default crystal oscillator source.*/
/*LL can use crystal oscillator or RTC or RCO to drive the sleep clock.This selection is done via "DEFAULT_SLEEP_CLOCK_SOURCE" macro. */
#endif /* USE_NON_ACCURATE_32K_SLEEP_CLK */
/* Non-standard features configurations */
#ifndef NUM_OF_CTSM_EMNGR_HNDLS
#define NUM_OF_CTSM_EMNGR_HNDLS 0 /* Number of custom handles in event manager to be used for app specific needs */
#endif /* NUM_OF_CTSM_EMNGR_HNDLS */
#ifndef SUPPORT_AUGMENTED_BLE_MODE
#define SUPPORT_AUGMENTED_BLE_MODE 0 /* Enable\Disable Augmented BLE Support. Enable:1 - Disable:0 */
#endif /* SUPPORT_AUGMENTED_BLE_MODE */
#ifndef SUPPORT_PTA
#define SUPPORT_PTA 1 /* Enable\Disable PTA Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_PTA */
#ifndef SUPPORT_CONFIGURABLE_GAIN_FIX
#define SUPPORT_CONFIGURABLE_GAIN_FIX 0 /* Enable\Disable configurable gain fix support */
#endif /* SUPPORT_CONFIGURABLE_GAIN_FIX */
#ifndef CHECK_ANY_MISSED_EVENT_ON_DEEP_SLEEP_EXIT
#define CHECK_ANY_MISSED_EVENT_ON_DEEP_SLEEP_EXIT 1 /* Enable\Disable calling event scheduler handler function at the end of deep sleep exit*/
#endif /* CHECK_ANY_MISSED_EVENT_ON_DEEP_SLEEP_EXIT */
#ifndef LL_BASIC
#define LL_BASIC 0
#endif /* LL_BASIC */
/*************************** MAC Configuration *************************************/
/*Configurations of MAC will apply only when MAC is enabled*/
#ifndef FFD_DEVICE_CONFIG
#define FFD_DEVICE_CONFIG 1 /* Enable\Disable FFD:1 - RFD:0 */
#endif /* FFD_DEVICE_CONFIG */
#ifdef RFD_DEVICE_CONFIG
#undef FFD_DEVICE_CONFIG
#define FFD_DEVICE_CONFIG 0 /* Enable\Disable FFD:1 - RFD:0 */
#endif
#ifdef SUPPORT_AUG_MAC_HCI_UART
#ifndef RAL_NUMBER_OF_INSTANCE
#define RAL_NUMBER_OF_INSTANCE 2 /* The Number of RAL instances supported */
#endif /* RAL_NUMBER_OF_INSTANCE */
#else
#ifndef RAL_NUMBER_OF_INSTANCE
#define RAL_NUMBER_OF_INSTANCE 1 /* The Number of RAL instances supported */
#endif /* RAL_NUMBER_OF_INSTANCE */
#endif
#ifndef MAX_NUMBER_OF_INDIRECT_DATA
#define MAX_NUMBER_OF_INDIRECT_DATA 10 /* The maximum number of supported indirect data buffers */
#endif /* MAX_NUMBER_OF_INDIRECT_DATA */
#ifndef SUPPORT_OPENTHREAD_1_2
#define SUPPORT_OPENTHREAD_1_2 1 /* Enable / disable FW parts related to new features introduced in openthread 1.2*/
#endif /* SUPPORT_OPENTHREAD_1_2 */
#ifndef SUPPORT_SEC
#define SUPPORT_SEC 1 /* The MAC Security Supported : 1 - Not Supported:0 */
#endif /* SUPPORT_SEC */
#ifndef RADIO_CSMA
#define RADIO_CSMA 1 /* Enable\Disable CSMA Algorithm in Radio Layer, Must be Enabled if MAC_LAYER_BUILD */
#endif /* RADIO_CSMA */
#ifndef ENHANCED_RX_WHILE_CSMA_BACKOFF_DELAY
#define ENHANCED_RX_WHILE_CSMA_BACKOFF_DELAY 1 /* Enable\Disable RX WITH CSMA Feature */
#endif /* ENHANCED_RX_WHILE_CSMA_BACKOFF_DELAY */
#ifndef SUPPORT_ANT_DIV
#define SUPPORT_ANT_DIV 1 /* Enable/Disable Antenna Diversity Feature */
#endif /* SUPPORT_ANT_DIV */
#ifndef SUPPORT_A_MAC
#define SUPPORT_A_MAC 1
#endif /* SUPPORT_A_MAC */
#ifndef SUPPORT_CONFIG_LIB
#define SUPPORT_CONFIG_LIB 1 /* Enable\Disable Configurable Library feature */
#endif /* SUPPORT_CONFIG_LIB */
#ifndef SMPL_PRTCL_TEST_ENABLE
#define SMPL_PRTCL_TEST_ENABLE 0
#endif /* SMPL_PRTCL_TEST_ENABLE */
#ifndef IEEE_EUI64_VENDOR_SPECIFIC_FUNC
#define IEEE_EUI64_VENDOR_SPECIFIC_FUNC 1 /* Comment to disable EUI-64 vendor specific function, in this case EUI-64 is not unique */
#endif /* IEEE_EUI64_VENDOR_SPECIFIC_FUNC */
/*************************** Zigbee Configuration **********************************/
#ifndef SUPPORT_ZIGBEE_PHY_CERTIFICATION
#define SUPPORT_ZIGBEE_PHY_CERTIFICATION 0 /* Enable support of hci command required to implement zigbee phy Test cases Enable:1 - Disable:0 */
#endif /* SUPPORT_ZIGBEE_PHY_CERTIFICATION */
#endif /* INCLUDE_LL_FW_CONFIG_H */

View File

@@ -0,0 +1,258 @@
/*$Id: //dwh/bluetooth/DWC_ble154combo/firmware/rel/2.00a-lca04/firmware/public_inc/ll_fw_config.h#1 $*/
/**
********************************************************************************
* @file ll_fw_config.h
* @brief This file contains the major configurations to the BLE controller.
******************************************************************************
* This Synopsys DWC Bluetooth Low Energy Combo Link Layer/MAC software and
* associated documentation ( hereinafter the "Software") is an unsupported
* proprietary work of Synopsys, Inc. unless otherwise expressly agreed to in
* writing between Synopsys and you. The Software IS NOT an item of Licensed
* Software or a Licensed Product under any End User Software License Agreement
* or Agreement for Licensed Products with Synopsys or any supplement thereto.
* Synopsys is a registered trademark of Synopsys, Inc. Other names included in
* the SOFTWARE may be the trademarks of their respective owners.
*
* Synopsys MIT License:
* Copyright (c) 2020-Present Synopsys, Inc
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* the Software), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute,
* sublicense, and/or sell copies of the Software, and to permit persons to whom
* the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING, BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE ARISING FROM,
* OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* */
#ifndef INCLUDE_LL_FW_CONFIG_H
#define INCLUDE_LL_FW_CONFIG_H
/*************************** General Configuration *********************************/
#ifndef SUPPORT_GNRC_SCHDLR_IF
#define SUPPORT_GNRC_SCHDLR_IF 1 /* Enable\Disable event EXTRNL_GNRC in Ble event manager. Enable:1 - Disable:0 */
#endif /* SUPPORT_GNRC_SCHDLR_IF */
/*************************** BLE Configuration *************************************/
/*Configurations of BLE will apply only when BLE is enabled*/
/* Roles configurations */
#ifndef SUPPORT_EXPLCT_OBSERVER_ROLE
#define SUPPORT_EXPLCT_OBSERVER_ROLE 0 /* Enable\Disable Explicit observer role. Enable:1 - Disable:0 */
#endif /* SUPPORT_EXPLCT_OBSERVER_ROLE */
#ifndef SUPPORT_EXPLCT_BROADCASTER_ROLE
#define SUPPORT_EXPLCT_BROADCASTER_ROLE 0 /* Enable\Disable Explicit broadcaster role. Enable:1 - Disable:0 */
#endif /* SUPPORT_EXPLCT_BROADCASTER_ROLE */
#ifndef SUPPORT_MASTER_CONNECTION
#define SUPPORT_MASTER_CONNECTION 0 /* Enable\Disable Master connection role. Enable:1 - Disable:0 */
#endif /* SUPPORT_MASTER_CONNECTION */
#ifndef SUPPORT_SLAVE_CONNECTION
#define SUPPORT_SLAVE_CONNECTION 0 /* Enable\Disable Slave connection role. Enable:1 - Disable:0 */
#endif /* SUPPORT_SLAVE_CONNECTION */
/* Standard features configurations */
#ifndef SUPPORT_LE_ENCRYPTION
#define SUPPORT_LE_ENCRYPTION 0 /* Enable\Disable Encryption feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_ENCRYPTION */
#ifndef SUPPORT_PRIVACY
#define SUPPORT_PRIVACY 0 /* Enable\Disable Privacy feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_PRIVACY */
#ifndef SUPPORT_LE_EXTENDED_ADVERTISING
#define SUPPORT_LE_EXTENDED_ADVERTISING 0 /* Enable\Disable Extended advertising feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_EXTENDED_ADVERTISING */
#ifndef SUPPORT_LE_PERIODIC_ADVERTISING
#define SUPPORT_LE_PERIODIC_ADVERTISING 0 /* Enable\Disable Periodic advertising feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_PERIODIC_ADVERTISING */
#ifndef SUPPORT_LE_POWER_CLASS_1
#define SUPPORT_LE_POWER_CLASS_1 0 /* Enable\Disable Low power class 1 feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_POWER_CLASS_1 */
#ifndef SUPPORT_AOA_AOD
#define SUPPORT_AOA_AOD 0 /* Enable\Disable AOA_AOD feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_AOA_AOD */
#ifndef SUPPORT_PERIODIC_SYNC_TRANSFER
#define SUPPORT_PERIODIC_SYNC_TRANSFER 0 /* Enable\Disable PAST feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_PERIODIC_SYNC_TRANSFER */
#ifndef SUPPORT_SLEEP_CLOCK_ACCURCY_UPDATES
#define SUPPORT_SLEEP_CLOCK_ACCURCY_UPDATES 0 /* Enable\Disable Sleep Clock Accuracy Updates Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_SLEEP_CLOCK_ACCURCY_UPDATES */
#ifndef SUPPORT_CONNECTED_ISOCHRONOUS
#define SUPPORT_CONNECTED_ISOCHRONOUS 0 /* Enable\Disable Connected Isochronous Channel Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_CONNECTED_ISOCHRONOUS */
#ifndef SUPPORT_BRD_ISOCHRONOUS
#define SUPPORT_BRD_ISOCHRONOUS 0 /* Enable\Disable Broadcast Isochronous Channel Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_BRD_ISOCHRONOUS */
#ifndef SUPPORT_SYNC_ISOCHRONOUS
#define SUPPORT_SYNC_ISOCHRONOUS 0 /* Enable\Disable Broadcast Isochronous Synchronizer Channel Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_SYNC_ISOCHRONOUS */
#ifndef SUPPORT_LE_POWER_CONTROL
#define SUPPORT_LE_POWER_CONTROL 0 /* Enable\Disable LE Power Control Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_POWER_CONTROL */
#ifndef SUPPORT_CHANNEL_CLASSIFICATION
#define SUPPORT_CHANNEL_CLASSIFICATION 0
#endif /* SUPPORT_CHANNEL_CLASSIFICATION */
#ifndef SUPPORT_PERIODIC_ADV_ADI
#define SUPPORT_PERIODIC_ADV_ADI 0
#endif /* SUPPORT_PERIODIC_ADV_ADI */
#ifndef SUPPORT_LE_ENHANCED_CONN_UPDATE
#define SUPPORT_LE_ENHANCED_CONN_UPDATE 0
#endif /* SUPPORT_LE_ENHANCED_CONN_UPDATE */
#ifndef SUPPORT_CSSA
#define SUPPORT_CSSA 0 /* Enable\Disable Coding Selection Scheme on Advertising Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_CSSA */
#ifndef SUPPORT_LE_PAWR_ADVERTISER_ROLE
#define SUPPORT_LE_PAWR_ADVERTISER_ROLE 0 /* Enable\Disable PAwR Advertiser role. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_PAWR_ADVERTISER_ROLE */
#ifndef SUPPORT_LE_PAWR_SYNC_ROLE
#define SUPPORT_LE_PAWR_SYNC_ROLE 0 /* Enable\Disable PAwR Synchronizer role. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_PAWR_SYNC_ROLE */
#ifndef SUPPORT_CHANNEL_SOUNDING
#define SUPPORT_CHANNEL_SOUNDING 0 /* Enable\Disable Channel Sounding Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_CHANNEL_SOUNDING */
#ifndef SUPPORT_FRAME_SPACE_UPDATE
#define SUPPORT_FRAME_SPACE_UPDATE 0 /* Enable\Disable Frame Space Update Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_FRAME_SPACE_UPDATE */
#ifndef SUPPORT_EXT_FEATURE_SET
#define SUPPORT_EXT_FEATURE_SET 0 /* Enable\Disable Extended Feature Set Exchange. Enable:1 - Disable:0 */
#endif /* SUPPORT_EXT_FEATURE_SET */
#ifndef SUPPORT_ISO_UNSEG_MODE
#define SUPPORT_ISO_UNSEG_MODE 0 /* Enable\Disable Unsegmented Mode for Framed ISO PDUs. Enable: 1 - Disable: 0*/
#endif /* SUPPORT_ISO_UNSEG_MODE */
#ifndef SUPPORT_LE_ADVERTISERS_MONITORING
#define SUPPORT_LE_ADVERTISERS_MONITORING 0 /* Enable\Disable Advertisers Monitoring Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_LE_ADVERTISERS_MONITORING */
/* Capabilities configurations */
#ifndef MAX_NUM_CNCRT_STAT_MCHNS
#define MAX_NUM_CNCRT_STAT_MCHNS 0 /* Set maximum number of states the controller can support */
#endif /* MAX_NUM_CNCRT_STAT_MCHNS */
#ifndef USE_NON_ACCURATE_32K_SLEEP_CLK
#define USE_NON_ACCURATE_32K_SLEEP_CLK 1 /* Allow to drive the sleep clock by sources other than the default crystal oscillator source.*/
/*LL can use crystal oscillator or RTC or RCO to drive the sleep clock.This selection is done via "DEFAULT_SLEEP_CLOCK_SOURCE" macro. */
#endif /* USE_NON_ACCURATE_32K_SLEEP_CLK */
/* Non-standard features configurations */
#ifndef NUM_OF_CTSM_EMNGR_HNDLS
#define NUM_OF_CTSM_EMNGR_HNDLS 0 /* Number of custom handles in event manager to be used for app specific needs */
#endif /* NUM_OF_CTSM_EMNGR_HNDLS */
#ifndef SUPPORT_AUGMENTED_BLE_MODE
#define SUPPORT_AUGMENTED_BLE_MODE 0 /* Enable\Disable Augmented BLE Support. Enable:1 - Disable:0 */
#endif /* SUPPORT_AUGMENTED_BLE_MODE */
#ifndef SUPPORT_PTA
#define SUPPORT_PTA 1 /* Enable\Disable PTA Feature. Enable:1 - Disable:0 */
#endif /* SUPPORT_PTA */
#ifndef SUPPORT_CONFIGURABLE_GAIN_FIX
#define SUPPORT_CONFIGURABLE_GAIN_FIX 0 /* Enable\Disable configurable gain fix support */
#endif /* SUPPORT_CONFIGURABLE_GAIN_FIX */
#ifndef CHECK_ANY_MISSED_EVENT_ON_DEEP_SLEEP_EXIT
#define CHECK_ANY_MISSED_EVENT_ON_DEEP_SLEEP_EXIT 1 /* Enable\Disable calling event scheduler handler function at the end of deep sleep exit*/
#endif /* CHECK_ANY_MISSED_EVENT_ON_DEEP_SLEEP_EXIT */
#ifndef LL_BASIC
#define LL_BASIC 0
#endif /* LL_BASIC */
/*************************** MAC Configuration *************************************/
/*Configurations of MAC will apply only when MAC is enabled*/
#ifndef FFD_DEVICE_CONFIG
#define FFD_DEVICE_CONFIG 1 /* Enable\Disable FFD:1 - RFD:0 */
#endif /* FFD_DEVICE_CONFIG */
#ifdef RFD_DEVICE_CONFIG
#undef FFD_DEVICE_CONFIG
#define FFD_DEVICE_CONFIG 0 /* Enable\Disable FFD:1 - RFD:0 */
#endif
#ifdef SUPPORT_AUG_MAC_HCI_UART
#ifndef RAL_NUMBER_OF_INSTANCE
#define RAL_NUMBER_OF_INSTANCE 2 /* The Number of RAL instances supported */
#endif /* RAL_NUMBER_OF_INSTANCE */
#else
#ifndef RAL_NUMBER_OF_INSTANCE
#define RAL_NUMBER_OF_INSTANCE 1 /* The Number of RAL instances supported */
#endif /* RAL_NUMBER_OF_INSTANCE */
#endif
#ifndef MAX_NUMBER_OF_INDIRECT_DATA
#define MAX_NUMBER_OF_INDIRECT_DATA 10 /* The maximum number of supported indirect data buffers */
#endif /* MAX_NUMBER_OF_INDIRECT_DATA */
#ifndef SUPPORT_OPENTHREAD_1_2
#define SUPPORT_OPENTHREAD_1_2 1 /* Enable / disable FW parts related to new features introduced in openthread 1.2*/
#endif /* SUPPORT_OPENTHREAD_1_2 */
#ifndef SUPPORT_SEC
#define SUPPORT_SEC 1 /* The MAC Security Supported : 1 - Not Supported:0 */
#endif /* SUPPORT_SEC */
#ifndef RADIO_CSMA
#define RADIO_CSMA 1 /* Enable\Disable CSMA Algorithm in Radio Layer, Must be Enabled if MAC_LAYER_BUILD */
#endif /* RADIO_CSMA */
#ifndef ENHANCED_RX_WHILE_CSMA_BACKOFF_DELAY
#define ENHANCED_RX_WHILE_CSMA_BACKOFF_DELAY 1 /* Enable\Disable RX WITH CSMA Feature */
#endif /* ENHANCED_RX_WHILE_CSMA_BACKOFF_DELAY */
#ifndef SUPPORT_ANT_DIV
#define SUPPORT_ANT_DIV 1 /* Enable/Disable Antenna Diversity Feature */
#endif /* SUPPORT_ANT_DIV */
#ifndef SUPPORT_A_MAC
#define SUPPORT_A_MAC 1
#endif /* SUPPORT_A_MAC */
#ifndef SUPPORT_CONFIG_LIB
#define SUPPORT_CONFIG_LIB 1 /* Enable\Disable Configurable Library feature */
#endif /* SUPPORT_CONFIG_LIB */
#ifndef SMPL_PRTCL_TEST_ENABLE
#define SMPL_PRTCL_TEST_ENABLE 0
#endif /* SMPL_PRTCL_TEST_ENABLE */
#ifndef IEEE_EUI64_VENDOR_SPECIFIC_FUNC
#define IEEE_EUI64_VENDOR_SPECIFIC_FUNC 1 /* Comment to disable EUI-64 vendor specific function, in this case EUI-64 is not unique */
#endif /* IEEE_EUI64_VENDOR_SPECIFIC_FUNC */
/*************************** Zigbee Configuration **********************************/
#ifndef SUPPORT_ZIGBEE_PHY_CERTIFICATION
#define SUPPORT_ZIGBEE_PHY_CERTIFICATION 0 /* Enable support of hci command required to implement zigbee phy Test cases Enable:1 - Disable:0 */
#endif /* SUPPORT_ZIGBEE_PHY_CERTIFICATION */
#endif /* INCLUDE_LL_FW_CONFIG_H */

View File

@@ -0,0 +1,60 @@
/*$Id: //dwh/bluetooth/DWC_ble154combo/firmware/rel/2.00a-lca04/firmware/public_inc/_40nm_reg_files/DWC_ble154combo.h#1 $*/
/**
********************************************************************************
* @brief
*
*
******************************************************************************
* This Synopsys DWC Bluetooth Low Energy Combo Link Layer/MAC software and
* associated documentation ( hereinafter the "Software") is an unsupported
* proprietary work of Synopsys, Inc. unless otherwise expressly agreed to in
* writing between Synopsys and you. The Software IS NOT an item of Licensed
* Software or a Licensed Product under any End User Software License Agreement
* or Agreement for Licensed Products with Synopsys or any supplement thereto.
* Synopsys is a registered trademark of Synopsys, Inc. Other names included in
* the SOFTWARE may be the trademarks of their respective owners.
*
* Synopsys MIT License:
* Copyright (c) 2020-Present Synopsys, Inc
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* the Software), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute,
* sublicense, and/or sell copies of the Software, and to permit persons to whom
* the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING, BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE ARISING FROM,
* OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* */
// Abstract: Configuration definition header file for DWC_ble154combo
#define Z_DATA_SYNC_STAGES 2
#define USE_SLPTMR_CAL 1
#define USE_SCAN_OUT_MUX 1
#define USE_RNG 0
#define USE_JTAG 1
#define Z_RESET_SYNC_STAGES 2
#define USE_AES 1
#define SW_ACT_HIGH 1
#define ANT 1
#define BUS_CLK 32
#define PHY_TYPE 1
#define BLE_MAC_ROLE 1
#define BLE_LL_ROLE 1
#define ACT_CLK 32
#define DF_NO_ANTENNAS 8
#define LST_ADDR 7
#define SEQ_RAM_ADDR_WIDTH 7
#define BLE_STANDARD 3
#define JTAG_CLK 16
#define DATA_RAM_ADDR_WIDTH 12
#define POW_GUARD_TIME 5

View File

@@ -0,0 +1,703 @@
/*$Id: //dwh/bluetooth/DWC_ble154combo/firmware/rel/2.00a-lca04/firmware/public_inc/bsp.h#1 $*/
/*$Id: //dwh/bluetooth/DWC_ble154combo/firmware/rel/2.00a-lca04/firmware/public_inc/bsp.h#1 $*/
/**
********************************************************************************
* @file bsp.h
* @brief board support package interface wrapper file.
******************************************************************************
* This Synopsys DWC Bluetooth Low Energy Combo Link Layer/MAC software and
* associated documentation ( hereinafter the "Software") is an unsupported
* proprietary work of Synopsys, Inc. unless otherwise expressly agreed to in
* writing between Synopsys and you. The Software IS NOT an item of Licensed
* Software or a Licensed Product under any End User Software License Agreement
* or Agreement for Licensed Products with Synopsys or any supplement thereto.
* Synopsys is a registered trademark of Synopsys, Inc. Other names included in
* the SOFTWARE may be the trademarks of their respective owners.
*
* Synopsys MIT License:
* Copyright (c) 2020-Present Synopsys, Inc
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* the Software), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute,
* sublicense, and/or sell copies of the Software, and to permit persons to whom
* the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING, BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE ARISING FROM,
* OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef LL_BSP_H_
#define LL_BSP_H_
#include <stdint.h>
#include "_40nm_reg_files/DWC_ble154combo.h"
#define INTERRUPT_ENABLE (1<<4)
#define SET_PRIORITY_LEVEL 2
#define PRIORITY_LEVEL_MASK 0x0F
/**
* This macros specify the different combinations that can be used to enable or disable
* a specific ISR
*/
#define LL_HIGH_ISR_ONLY 0x01 // Specify only LL high ISR to be enabled or disabled
#define LL_LOW_ISR_ONLY 0x02 // Specify only LL LOW ISR to be enabled or disabled
#define SYS_LOW_ISR 0x04 // Specify only system low ISR to be enabled or disabled
#ifndef EBQ_BUILD
#define EBQ_BUILD 0
#endif
#ifndef USE_HCI_TRANSPORT
#define USE_HCI_TRANSPORT 0
#endif
/**
* @brief InterruptPriorities Enum.
* it is used to define the different ISR priorities in the controller
*/
typedef enum InterruptPriorities {
INT_PRIO_HIGHEST = 0,
INT_PRIO_HIGH,
INT_PRIO_LOW,
INT_PRIO_LOWEST,
INT_PRIO_MAX
}InterruptPriorities;
/**
* @brief Event notification state Enum.
* it is used to the state of radio activity ,being started or ended
*/
typedef enum EvntNotiState {
EVNT_START,
EVNT_END,
EVNT_NOT_SPECIIFED
}EvntNotiState;
/**
* @brief periodic calibration state Enum.
* it is used to the state of Periodic calibration
*/
typedef enum _PhyClbrState {
PHY_CLBR_NOT_RUNNING,
PHY_CLBR_PNDING_OR_RUNNING,
PHY_CLBR_NOT_KNOWN
}PhyClbrState;
/* MACRO to explicitly disable unused parameter warning */
#define LL_UNUSED(x) (void)(x)
/**
* @brief link layer bus structure.
* it defines the callback functions that will be be called by the transport bus driver
* after the requested operation is done.
*/
typedef struct _ble_ll_bus {
/** Bus read callback that will be called after the requested number of bytes is read from the bus */
void (*read)(uint8_t *buffer);
/** Bus Write callback that will be called after the requested is written to the bus */
void (*write)(uint8_t *buffer);
} ble_ll_bus;
/* Structure holding the Event timing */
typedef struct Evnt_timing_s{
uint32_t drift_time; /* The total drift time between the software timer value and the start execution of the function evnt_schdlr_timer_callback */
uint32_t exec_time; /* The time to get the event ready for air transmission.
* When passed from the host, it indicates the profiled execution time. It will be replaced
* by the actual execution time using the CALCULATE_EXEC_TIME directive
* after calling ll_intf_config_schdling_time and this new value will be reported through bsp_evnt_schldr_timing_update_not */
uint32_t schdling_time; /* The total time to server the completed event and start new cycle of it, the time from longest time of the state machine done isr to till the debug dio DBG_IO_PROFILE_END_DRIFT_TIME is raised */
}Evnt_timing_t;
typedef enum _profiling_state_e {
PROFILE_STATE_START,
PROFILE_STATE_CLEAR,
PROFILE_STATE_END,
} profiling_state_e;
/**
* @brief enum holding all debugging gpio
*
*
*
*/
typedef enum Debug_GPIO_e{
DBG_IO_HCI_READ_DONE ,
DBG_IO_HCI_RCVD_CMD ,
DBG_IO_HCI_WRITE_DONE ,
DBG_IO_SCHDLR_EVNT_UPDATE ,
DBG_IO_SCHDLR_TIMER_SET ,
DBG_IO_SCHDLR_PHY_CLBR_TIMER ,
DBG_IO_SCHDLR_EVNT_SKIPPED ,
DBG_IO_SCHDLR_HNDL_NXT_TRACE ,
DBG_IO_ACTIVE_SCHDLR_NEAR_DETEDTED ,
DBG_IO_ACTIVE_SCHDLR_NEAR_GAP_CHECK ,
DBG_IO_ACTIVE_SCHDLR_NEAR_TIME_CHECK ,
DBG_IO_ACTIVE_SCHDLR_NEAR_TRACE ,
DBG_IO_SCHDLR_EVNT_RGSTR ,
DBG_IO_SCHDLR_ADD_CONFLICT_Q ,
DBG_IO_SCHDLR_HNDL_MISSED_EVNT ,
DBG_IO_SCHDLR_UNRGSTR_EVNT ,
DBG_IO_SCHDLR_EXEC_EVNT_TRACE ,
DBG_IO_SCHDLR_EXEC_EVNT_PROFILE ,
DBG_IO_SCHDLR_EXEC_EVNT_ERROR ,
DBG_IO_SCHDLR_EXEC_EVNT_WINDOW_WIDENING ,
DBG_IO_LLHWC_CMN_CLR_ISR ,
DBG_IO_LLWCC_CMN_HG_ISR ,
DBG_IO_LLHWC_CMN_LW_ISR ,
DBG_IO_LLHWC_CMN_CLR_TIMER_ERROR ,
DBG_IO_LLHWC_LL_ISR ,
DBG_IO_LLHWC_SPLTMR_SET ,
DBG_IO_LLHWC_SPLTMR_GET ,
DBG_IO_LLHWC_LOW_ISR ,
DBG_IO_LLHWC_STOP_SCN ,
DBG_IO_LLHWC_WAIT_ENVT_ON_AIR ,
DBG_IO_LLHWC_SET_CONN_EVNT_PARAM ,
DBG_IO_POST_EVNT ,
DBG_IO_HNDL_ALL_EVNTS ,
DBG_IO_PROCESS_EVNT ,
DBG_IO_PROCESS_ISO_DATA ,
DBG_IO_ALLOC_TX_ISO_EMPTY_PKT ,
DBG_IO_BIG_FREE_EMPTY_PKTS ,
DBG_IO_RECOMBINE_UNFRMD_DATA_OK ,
DBG_IO_RECOMBINE_UNFRMD_DATA_CRC ,
DBG_IO_RECOMBINE_UNFRMD_DATA_NoRX ,
DBG_IO_RECOMBINE_UNFRMD_DATA_TRACE ,
DBG_IO_ISO_HNDL_SDU ,
DBG_IO_LL_INTF_INIT ,
DBG_IO_DATA_TO_CNTRLR ,
DBG_IO_FREE_LL_PKT_HNDLR ,
DBG_IO_PHY_INIT_CLBR_TRACE ,
DBG_IO_PHY_RUNTIME_CLBR_TRACE ,
DBG_IO_PHY_CLBR_ISR ,
DBG_IO_PHY_INIT_CLBR_SINGLE_CH ,
DBG_IO_PHY_CLBR_STRTD ,
DBG_IO_PHY_CLBR_EXEC ,
DBG_IO_RCO_STRT_STOP_RUNTIME_CLBR_ACTV ,
DBG_IO_RCO_STRT_STOP_RUNTIME_RCO_CLBR ,
DBG_IO_STRT_STOP_RUNTIME_RCO_CLBR_SWT ,
DBG_IO_STRT_STOP_RUNTIME_RCO_CLBR_TRACE ,
DBG_IO_RCO_ISR_TRACE ,
DBG_IO_RCO_ISR_COMPENDATE ,
DBG_IO_RAL_STRT_TX ,
DBG_IO_RAL_ISR_TIMER_ERROR ,
DBG_IO_RAL_ISR_TRACE ,
DBG_IO_RAL_STOP_OPRTN ,
DBG_IO_RAL_STRT_RX ,
DBG_IO_RAL_DONE_CLBK_TX ,
DBG_IO_RAL_DONE_CLBK_RX ,
DBG_IO_RAL_DONE_CLBK_ED ,
DBG_IO_RAL_ED_SCAN ,
DBG_IO_ERROR_MEM_CAP_EXCED ,
DBG_IO_ERROR_COMMAND_DISALLOWED ,
DBG_IO_PTA_INIT ,
DBG_IO_PTA_EN ,
DBG_IO_LLHWC_PTA_SET_EN ,
DBG_IO_LLHWC_PTA_SET_PARAMS ,
DBG_IO_COEX_STRT_ON_IDLE ,
DBG_IO_COEX_ASK_FOR_AIR ,
DBG_IO_COEX_TIMER_EVNT_CLBK ,
DBG_IO_COEX_STRT_ONE_SHOT ,
DBG_IO_COEX_FORCE_STOP_RX ,
DBG_IO_LLHWC_ADV_DONE ,
DBG_IO_LLHWC_SCN_DONE ,
DBG_IO_LLHWC_INIT_DONE ,
DBG_IO_LLHWC_CONN_DONE ,
DBG_IO_LLHWC_CIG_DONE ,
DBG_IO_LLHWC_BIG_DONE ,
DBG_IO_OS_TMR_CREATE ,
DBG_IO_ADV_EXT_TIMEOUT_CBK ,
DBG_IO_ADV_EXT_SCN_DUR_CBK ,
DBG_IO_ADV_EXT_SCN_PERIOD_CBK ,
DBG_IO_ADV_EXT_PRDC_SCN_TIMEOUT_CBK ,
DBG_IO_BIS_SYNC_TIMEOUT_TMR_CBK ,
DBG_IO_BIS_TERM_TMR_CBK ,
DBG_IO_BIS_TST_MODE_CBK ,
DBG_IO_BIS_TST_MODE_TMR_CBK ,
DBG_IO_ISO_POST_TMR_CBK ,
DBG_IO_ISO_TST_MODE_TMR_CBK ,
DBG_IO_CONN_POST_TMR_CBK ,
DBG_IO_EVNT_SCHDLR_TMR_CBK ,
DBG_IO_HCI_POST_TMR_CBK ,
DBG_IO_LLCP_POST_TMR_CBK ,
DBG_IO_LLHWC_ENRGY_DETECT_CBK ,
DBG_IO_PRVCY_POST_TMR_CBK ,
DBG_IO_ANT_PRPR_TMR_CBK ,
DBG_IO_COEX_TMR_FRC_STOP_AIR_GRANT_CBK ,
DBG_IO_MLME_RX_EN_TMR_CBK ,
DBG_IO_MLME_GNRC_TMR_CBK ,
DBG_IO_MIB_JOIN_LST_TMR_CBK ,
DBG_IO_MLME_PWR_PRES_TMR_CBK ,
DBG_IO_PRESISTENCE_TMR_CBK ,
DBG_IO_RADIO_PHY_PRDC_CLBK_TMR_CBK ,
DBG_IO_RADIO_CSMA_TMR_CBK ,
DBG_IO_RADIO_CSL_RCV_TMR_CBK ,
DBG_IO_ED_TMR_CBK ,
DBG_IO_DIO_EXT_TMR_CBK ,
DBG_IO_RCO_CLBR_TMR_CBK ,
DBG_IO_ADV_EXT_MNGR_ADV_CBK ,
DBG_IO_ADV_EXT_MNGR_SCN_CBK ,
DBG_IO_ADV_EXT_MNGR_SCN_ERR_CBK ,
DBG_IO_ADV_EXT_MNGR_PRDC_SCN_CBK ,
DBG_IO_ADV_EXT_MNGR_PRDC_SCN_ERR_CBK ,
DBG_IO_BIG_ADV_CBK ,
DBG_IO_BIG_ADV_ERR_CBK ,
DBG_IO_BIG_SYNC_CBK ,
DBG_IO_BIG_SYNC_ERR_CBK ,
DBG_IO_ISO_CIS_PKT_TRNSM_RECEIVED_CBK ,
DBG_IO_ISO_CIG_ERR_CBK ,
DBG_IO_CONN_PKT_TRNSM_RECEIVED_CBK ,
DBG_IO_PRDC_CLBR_EXTRL_CBK ,
DBG_IO_PTR_PRDC_ADV_SYNC_CBK ,
DBG_IO_NCONN_SCN_CBK ,
DBG_IO_NCONN_ADV_CBK ,
DBG_IO_NCONN_INIT_CBK ,
DBG_IO_ANT_RADIO_CMPLT_EVNT_CBK ,
DBG_IO_ANT_STACK_EVNT_CBK ,
DBG_IO_ADV_EXT_PROCESS_TMOUT_EVNT_CBK ,
DBG_IO_ADV_EXT_MNGR_SCN_DUR_EVNT ,
DBG_IO_ADV_EXT_MNGR_SCN_PERIODIC_EVNT ,
DBG_IO_ADV_EXT_MNGR_PRDC_SCN_TMOUT_EVNT ,
DBG_IO_ADV_EXT_MNGR_PRDC_SCN_CNCEL_EVNT ,
DBG_IO_BIS_MNGR_BIG_TERM_CBK ,
DBG_IO_BIS_MNGR_SYNC_TMOUT_CBK ,
DBG_IO_ISOAL_MNGR_SDU_GEN ,
DBG_IO_ISO_MNGR_CIS_PROCESS_EVNT_CBK ,
DBG_IO_CONN_MNGR_PROCESS_EVNT_CLBK ,
DBG_IO_CONN_MNGR_UPDT_CONN_PARAM_CBK ,
DBG_IO_CONN_MNGR_DATA_LEN_UPDT_CBK ,
DBG_IO_EVNT_SCHDLR_HW_EVNT_CMPLT ,
DBG_IO_HCI_EVENT_HNDLR ,
DBG_IO_MLME_TMRS_CBK ,
DBG_IO_DIRECT_TX_EVNT_CBK ,
DBG_IO_INDIRECT_PKT_TOUR_CBK ,
DBG_IO_RADIO_CSMA_TMR ,
DBG_IO_RAL_SM_DONE_EVNT_CBK ,
DBG_IO_ED_TMR_HNDL ,
DBG_IO_OS_TMR_EVNT_CBK ,
DBG_IO_PROFILE_MARKER_PHY_WAKEUP_TIME ,
DBG_IO_PROFILE_MARKER_BLOCKING_PHY_WAKEUP_TIME ,
DBG_IO_PROFILE_END_DRIFT_TIME ,
DBG_IO_PROC_RADIO_RCV ,
DBG_IO_EVNT_TIME_UPDT ,
DBG_IO_MAC_RECEIVE_DONE ,
DBG_IO_MAC_TX_DONE ,
DBG_IO_RADIO_APPLY_CSMA ,
DBG_IO_RADIO_TRANSMIT ,
DBG_IO_PROC_RADIO_TX ,
DBG_IO_RAL_TX_DONE ,
DBG_IO_RAL_TX_DONE_INCREMENT_BACKOFF_COUNT ,
DBG_IO_RAL_TX_DONE_RST_BACKOFF_COUNT ,
DBG_IO_RAL_CONTINUE_RX ,
DBG_IO_RAL_PERFORM_CCA ,
DBG_IO_RAL_ENABLE_TRANSMITTER ,
DBG_IO_LLHWC_GET_CH_IDX_ALGO_2 ,
DBG_IO_ADV_EXT_MNGR_PAWR_ADV_SE_CBK ,
DBG_IO_ADV_EXT_MNGR_PAWR_ADV_SE_ERR_CBK ,
DBG_IO_ADV_EXT_MNGR_PAWR_SCN_ERR_CBK ,
DBG_IO_LLHWC_SET_ADV_PAWR_SE_PARAM ,
DBG_IO_LLHWC_ADV_PAWR_SE_DONE ,
DBG_IO_LLHWC_SET_PAWR_RSP_PARAM ,
DBG_IO_LLHWC_ADV_PAWR_RSP_DONE ,
DBG_IO_LLHWC_ADV_PAWR_RSP_DONE_RCV_PCKT ,
DBG_IO_LLHWC_ADV_PAWR_RSP_DONE_FREE_PCKT ,
DBG_IO_LLHWC_PAWR_PING_PONG_HNDL ,
DBG_IO_LLHWC_PAWR_PING_PONG_RCV_PCKT ,
DBG_IO_LLHWC_PAWR_ADV_STOP_RSPS ,
DBG_IO_LLHWC_PAWR_SYNC_SET_PARAM ,
DBG_IO_LLHWC_PAWR_SYNC_DONE ,
DBG_IO_LLHWC_PAWR_SYNC_SEND_RSP ,
DBG_IO_PAWR_ADV_SE_MISS_RSP ,
DBG_IO_PAWR_ADV_FORCE_RP ,
DBG_IO_PAWR_ADV_PUSH_STRT_TIM_FORW ,
DBG_IO_PAWR_ADV_RSP_NEAR ,
DBG_IO_EVNT_STRT_TIM_PUSHED ,
DBG_IO_PAWR_ADV_RSP_SWITCH_SE ,
DBG_IO_PAWR_ADV_QUEUE_WIN_UPDT ,
DBG_IO_PAWR_SYNC_REFUSE_INST_RSP ,
DBG_IO_PAWR_SYNC_ABOUT_TIMEOUT ,
DBG_IO_PAWR_SYNC_INST_RSP_TOO_LATE ,
DBG_IO_PAWR_SYNC_EXEC_SKIPPED ,
DBG_IO_NULL_PKT_STATUS ,
DBG_IO_PAWR_MULTIPLE_EVNTS_MISSED ,
DBG_IO_PAWR_CHM_UPDT_END ,
DBG_IO_LLHWC_CMN_INIT ,
DBG_IO_RADIO_SET_PENDING_TX_FULL ,
DBG_IO_RADIO_SET_PENDING_TX_CONTINUE ,
DBG_IO_RADIO_HANDLE_PENDING_TX ,
DBG_IO_RAL_AD_SET_MEASUREMENT_STATE ,
DBG_IO_PROFILE_CS_GEN,
DBG_IO_PROFILE_CS_CHNL_SHUFFLING,
DBG_IO_SET_DEEP_SLEEP_MODE,
DBG_IO_BACK_FROM_DEEP_SLEEP,
DBG_IO_CS_EVENT_MISSED,
DBG_IO_CS_EVENT_CONFLICTING,
DBG_IO_CS_GENERATOR_IS_LATE,
DBG_IO_CS_SCHDLR_OUT_OF_BOUND,
DBG_IO_CS_EXECUTION_FAILED,
DBG_IO_CS_OFFSET_FAILED,
DBG_IO_CS_STRT_TIM_FRM_ACL,
DBG_IO_RAL_TX_ACK ,
DBG_IO_RAL_HANDLE_PHY_ISR ,
Debug_GPIO_num
}Debug_GPIO_t;
/**
* @ingroup BSP_APIS
* @{
*/
/**
* @brief Bus initialization Function
*
* this function is used to initialize the used transport bus and link functions is @ref _ble_ll_bus to the ISRs of bus driver
* @param op[in] : pointer to @ref _ble_ll_bus structure that stores the bus callback functions
* @retval None
*
*/
void bus_init(ble_ll_bus * op);
/**
* @brief Bus read Function
* This function is used read @ref size bytes from the Bus in the given @ref buffer
* @note this function is asynchronous, it is expected that Bus read callback function is called to indicate that the requested data is available
* the read callback function will be set by calling @ref bus_init
* @param *buffer [in]: pointer to the buffer of the data
* @param size [in]: size of bytes read from the buffer
*
* @retval None
*/
void bus_read(uint8_t *buffer, uint16_t size);
/**
* @brief Bus write Function
* This function is used read @ref size bytes from the Bus in the given @ref buffer
* @note this function is asynchronous, it is expected that Bus will call read callback function when wrriting data is done
* the Write callback function will be set by calling @ref bus_init
* @param *buffer[in]: pointer to the buffer of the data
* @param size[in]: size of bytes written to the buffer
*
* @retval None
*/
void bus_write(uint8_t *buffer, uint16_t size);
/**
* @brief logger port initialization
*
*this function is used to initalizer the logger
* @param None
* @retval None
*
*/
void logger_init(void);
/**
* @brief logger write
* Thin function is used to log the data described by the input parameters
* @param *buffer: pointer to the buffer of the data to be written to logger
* @param size: size of bytes to be logged from the buffer
*
* @retval None
*/
void logger_write(uint8_t *buffer, uint32_t size);
/**
* @brief enable interrupt request function
* This function enable the MCU interrupt ,after calling this function the LL code can be interrupted by the controller
* @param None
*
* @retval None
*/
extern void enable_irq(
void
);
/**
* @brief disable interrupt request function
* This function disable the MCU interrupt ,after calling this function the LL code must not be interrupted as it is in critical section
* @param None
*
* @retval None
*/
extern void disable_irq(
void
);
/**
* @brief this function is used to enable a specific ISR
* @param[in] isr_type that holds specific ISR to be enabled by this function
* BIT[0] for LL_HIGH_ISR
* BIT[1] for LL_LOW_ISR
* BIT[2] for SYS_LOW_ISR
* @return None
*/
void enable_specific_irq(uint8_t isr_type );
/**
* @brief this function is used to disable a specific ISR
* @param[in] isr_type that holds specific ISR to be disabled by this function
* BIT[0] for LL_HIGH_ISR
* BIT[1] for LL_LOW_ISR
* BIT[2] for SYS_LOW_ISR
* @return None
*/
void disable_specific_irq(uint8_t isr_type );
/**
* @brief broad initialization Function
*
* this function is used to initialize the used MCU
* @param op[in] : pointer to @ref _ble_ll_bus structure that stores the bus callback functions
* @retval 0 if SUCCESS
* otherwise Not SUCESS
*
*/
int bsp_init(void);
/**
* @brief dealy us Function
*
* this function is microsecond delay function
* @param op[in] : Nunmber of microseconds that function this function execution should take
* @retval None
*
*/
void bsp_delay_us(uint32_t delay);
/**
* @brief interrupt enable Function
*
* this function is used to enabled and register ISR for the given interrupt line
* @param intrNum[in] : number to the interrupt line to be enabled
* @param intr_cb[in] : pionter to ISR function the will be called when this interupt is fired
* @retval None
*
*/
int bsp_intr_enable (uint32_t intrNum, void (*intr_cb)(void));
/**
* @brief interrupt set pri Function
*
* this function is used to set the interrupt priority and register ISR for the given interrupt line
* @param intrNum[in] : number to the configured interrupt line
* @param intr_cb[in] : pionter to ISR function the will be called when this interupt is fired
* @param intpri[in] : the priority oto used for the given interrupt
* @retval None
*
*/
int bsp_intr_set_pri(uint32_t intrNum, void (*intr_cb)(void), int32_t intpri);
/* */
/**
*
* @brief is in LL BLE memory function
* it Checks whether the given pointer in BLE Memory or outside it if the pointer points to a location in BLE memory
* @param ptr [in] pointer to check if in BLE memory or not
*
* @retval 1 the given pointer is in LL BLE memory
* @retval 0 the given pointer is not in LL BLE memory
*/
int bsp_is_ptr_in_ble_mem(void* ptr);
/**
* @brief make the mcu sleep in a certain power mode according to its idle time.
*
* @param None.
*
* @retval None.
*/
void bsp_mcu_slp(void);
/**
* @brief Clear GPIO pin output value
*
* @param enable: enable/disable flag
*
* @retval None.
*/
void bsp_gpio_clear(uint8_t gpio_num);
/**
* @brief Set GPIO pin output value
*
* @param enable: enable/disable flag
*
* @retval None.
*/
void bsp_gpio_set(uint8_t gpio_num);
/**
* @brief Enables/Disables the bus clock.
*
* @param enable: enable/disable flag
*
* @retval None.
*/
void bsp_control_hclk(uint8_t enable);
/**
* @brief Enables/Disables the active clock.
*
* @param enable: enable/disable flag
*
* @retval None.
*/
void bsp_control_aclk(uint8_t enable);
/**
* @brief Notification that LL FW will start or end a radio activity .
*
* @param enable: EVNT_START , radio activity started
* : Evnt_END Radio event completed
*
* @retval None.
*/
void bsp_evnt_not(EvntNotiState enable);
/**
* @brief Notification that LL FW will start or end RCO Calibration .
*
*@note this is an optional wrapper that used to inform the upper layer of the state of RCO calibration.
*@note the upper layer may ignore this wrapper
* @param enable: EVNT_START , RCO calibration will be started
* : Evnt_END RCO calibration has completed
*
* @retval None.
*/
void bsp_rco_clbr_not(EvntNotiState enable);
/**
* @brief used to assert/trigger the low priority interrupt from the SW.
*
* @param priority: if 1 then this SW ISR should be treated as if it was High priority HW ISR
*
* @retval None.
*/
void bsp_switch_to_lw_isr(uint8_t priority);
/**
* @brief wait for bus clock ready signal
*
* A platform that has more accurate information about the readiness of the bus clock should implement this function to
* avoid redundant delay while reading sleep timer .
*
* @note this function will be called only if @ref USE_SOC_ACCURATE_BUS_CLK_READY_API is set to one otherwise LL FW will wait for a change in sleep timer reading.
*
* @param None.
*
* @retval None.
*/
void bsp_wait_for_busclkrdy(void);
/**
* @brief used to start temperature calculations
* if the upper layer has informed the link layer by the existence of temperature sensor through @ref ll_intf_set_temperature_sensor_stat() or llhwc_cmn_set_temperature_sensor_stat() .
* New temperature will be requested in the following cases:
* 1- at initialization when the @ref ll_intf_set_temperature_sensor_state or llhwc_cmn_set_temperature_sensor_stat is called
* 2- before any radio event
* Once temperature is ready the upper layer should call @ref ll_intf_set_temperature_value() or llhwc_cmn_set_temperature_value() to inform Link Layer with new Temperature value
* @retval None.
*/
void bsp_request_temperature(void);
/**
* @brief a function to set a certain gpio pin.
*
* @param gpio[in]: one of the gpios defined in Debug_GPIO_t enum to be set
*
* @retval None.
*
* @note : some of the signals can be mapped to physical hardware and some may not be connected to a physical GPIO based in availability.
*/
void bsp_debug_gpio_set(Debug_GPIO_t gpio);
/**
* @brief a function to clear a certain gpio pin.
*
* @param gpio[in]: one of the gpios defined in Debug_GPIO_t enum to be cleared
*
* @retval None.
*
* @note : some of the signals can be mapped to physical hardware and some may not be connected to a physical GPIO based in availability.
*/
void bsp_debug_gpio_clear(Debug_GPIO_t gpio);
/**
* @brief a function to toggle a certain gpio pin.
*
* @param gpio[in]: one of the gpios defined in Debug_GPIO_t enum to be toggled
*
* @retval None.
*
* @note : some of the signals can be mapped to physical hardware and some may not be connected to a physical GPIO based in availability.
*/
void bsp_debug_gpio_toggle(Debug_GPIO_t gpio);
/**
* @brief a function to inform the upper layer by state of periodic calibration state.
*
* @param state[in]: Value from @ref PhyClbrState, NO_PHY_CLBR_NEEDED when the calibration is completed , PHY_CLBR_PNDING_OR_RUNNING when calibration is started or about to start from background task
*
* @retval None.
*/
void bsp_set_phy_clbr_state(PhyClbrState state);
/**
* @brief a function to notify the upper layer to switch the clock.
*
* @param evnt_timing[in]: Evnt_timing_t pointer to structure contains drift time , execution time and scheduling time. For the execution time, it shall follow this equation MAX(EXEC_TIME_PROFILED, PHY_WAKEUP_TIME) - PHY_WAKEUP_TIME + EXEC_TIME_MARGIN
*
* @retval None.
*/
void bsp_evnt_schldr_timing_update_not(Evnt_timing_t * p_evnt_timing);
/**
* @}
*/
int logCons(void* devHandle, char* logStr);
void* logFileInit(const char * fileName);
int logFileClose(void* fileHandle);
int logFile(void* devHandle, char* logStr);
int logUart(void* devHandle, char* logStr);
void bsp_assert_log(uint8_t condition, uint8_t severity, const char *ptr_func_name, const int line);
void bsp_assert(uint8_t condition, uint8_t severity);
/**
* @brief Communicates the state of the execution time profiling
*
* @param[in] state: Signals the start, end or clearance of the execution time
*/
void bsp_exec_time_profiling(const profiling_state_e state);
/**
* @brief Communicates the profiled value for the drift time
*
* @param[in] value: Profiled value in HW Cycles
*/
void bsp_drift_time_profiling(const uint32_t value);
#endif /* LL_BSP_H_ */

View File

@@ -0,0 +1,707 @@
/*$Id: //dwh/bluetooth/DWC_ble154combo/firmware/rel/2.00a-lca04/firmware/public_inc/common_types.h#1 $*/
/**
********************************************************************************
* @file common_types.h
* @brief This file contains common includes for BLE FW LL.
******************************************************************************
* This Synopsys DWC Bluetooth Low Energy Combo Link Layer/MAC software and
* associated documentation ( hereinafter the "Software") is an unsupported
* proprietary work of Synopsys, Inc. unless otherwise expressly agreed to in
* writing between Synopsys and you. The Software IS NOT an item of Licensed
* Software or a Licensed Product under any End User Software License Agreement
* or Agreement for Licensed Products with Synopsys or any supplement thereto.
* Synopsys is a registered trademark of Synopsys, Inc. Other names included in
* the SOFTWARE may be the trademarks of their respective owners.
*
* Synopsys MIT License:
* Copyright (c) 2020-Present Synopsys, Inc
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* the Software), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute,
* sublicense, and/or sell copies of the Software, and to permit persons to whom
* the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING, BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE ARISING FROM,
* OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef COMMON_TYPES_H_
#define COMMON_TYPES_H_
#include "_40nm_reg_files/DWC_ble154combo.h"
#include "bsp.h"
#include "ll_fw_config.h"
#include "mem_intf.h"
#include "os_wrapper.h"
/********************************************************************** */
/****************** BLE MAC COMBO Configurations*********************** */
/********************************************************************** */
#ifdef BLE_LL
#define SUPPORT_BLE 1 ///< BLE controller is supported
#else
#define SUPPORT_BLE 0 ///< BLE controller is not supported
#endif
#ifdef MAC
#define SUPPORT_MAC 1 ///< MAC controller is supported
#else
#define SUPPORT_MAC 0 ///< MAC controller is not supported
#endif
#ifdef ANT_ROLE
#define SUPPORT_ANT 1 ///< ANT controller is supported
#ifdef SUPPORT_ANT_TESTING
#define SUPPORT_ANT_HCI_UART 1 ///< ANT HCI UART is supported
#else
#define SUPPORT_ANT_HCI_UART 0 ///< ANT HCI UART is not supported
#endif /* SUPPORT_ANT_HCI_UART*/
#else
#define SUPPORT_ANT 0 ///< ANT controller is not supported
#define SUPPORT_ANT_HCI_UART 0 ///< ANT HCI UART is not supported
#endif
#ifdef MAC_LAYER
#define MAC_LAYER_BUILD 1 ///< MAC layer is supported
#else
#define MAC_LAYER_BUILD 0 ///< MAC layer is not supported
#endif
#ifdef SUPPORT_MAC_HCI_UART
#define SUPPORT_MAC_HCI_UART 1 ///< MAC HCI UART is supported
#else
#define SUPPORT_MAC_HCI_UART 0 ///< MAC HCI UART is not supported
#endif
#ifdef SUPPORT_AUG_MAC_HCI_UART
#define SUPPORT_AUG_MAC_HCI_UART 1 ///< AUG MAC HCI UART is supported
#else
#define SUPPORT_AUG_MAC_HCI_UART 0 ///< AUG MAC HCI UART is not supported
#endif
#define SUPPORT_RADIO_HCI_UART 0 ///< Radio HCI UART is not supported
#if((!SUPPORT_BLE)&&(SUPPORT_MAC || SUPPORT_AUG_MAC_HCI_UART)&&(RAL_NUMBER_OF_INSTANCE>1))
#error "BLE controller must be enabled to support MAC multiple Instances"
#endif
#if((SUPPORT_MAC)&&(SUPPORT_AUG_MAC_HCI_UART)&&(RAL_NUMBER_OF_INSTANCE<2))
#error "RAL_NUMBER_OF_INSTANCE must be 2 to support MAC and Augmented MAC"
#endif
#if((!SUPPORT_BLE)&&(SUPPORT_MAC)&&(SUPPORT_ANT))
#error "BLE controller must be enabled to support MAC and ANT Coexistence"
#endif
#if(SUPPORT_MAC && SUPPORT_CONFIG_LIB && (!MAC_LAYER_BUILD || !SUPPORT_OPENTHREAD_1_2))
#error "BUILD_MAC and SUPPORT_OPENTHREAD_1_2 must be TRUE to support configurable library feature"
#endif
#define SUPPORT_COEXISTENCE ((SUPPORT_BLE&&SUPPORT_MAC) || (SUPPORT_BLE&&SUPPORT_ANT))
#define SUPPORT_ANT_COEXISTENCE (SUPPORT_BLE&&SUPPORT_ANT)
/****************** User configuration **********************************/
#define CS_TESTING 1
#if(CS_TESTING && (defined(PHY_40nm_3_60_a_tc) || defined(PHY_40nm_2_10_a_tc))|| defined(PHY_40nm_3_60_a_tc_new_demod))
#define USE_ANT_MODE_FOR_CS_TESTING 1
#else
#define USE_ANT_MODE_FOR_CS_TESTING 0
#endif/*(CS_TESTING && (defined(PHY_40nm_3_60_a_tc) || defined(PHY_40nm_2_10_a_tc))|| defined(PHY_40nm_3_60_a_tc_new_demod))*/
#define PROFILE_DISABLED 0
#define PROFILE_DETAILED 1
#define PROFILE_LIGHTWEIGHT 2
#define PROFILE_BSP 3
#ifndef SUPPORT_PROFILE
#define SUPPORT_PROFILE PROFILE_DISABLED
#endif /* SUPPORT_PROFILE */
#define IS_INTERNAL_PROFILED_ENABLED ((SUPPORT_PROFILE == PROFILE_DETAILED) || (SUPPORT_PROFILE == PROFILE_LIGHTWEIGHT))
/********************* Macros **********************************/
#ifndef SUCCESS
#define SUCCESS 0
#endif
#ifndef GENERAL_FAILURE
#define GENERAL_FAILURE -1
#endif
#ifndef GENERAL_ERROR_STATUS
#define GENERAL_ERROR_STATUS 0xFF
#endif
#ifndef TRUE
#define TRUE 1
#endif /* TRUE */
#ifndef FALSE
#define FALSE 0
#endif /* FALSE */
#ifndef NULL
#define NULL ((void *)0)
#endif /* NULL */
#define UNUSED_VALUE 0
#define UNUSED_PTR NULL
#define MEMSET(ptr_memory, value, memory_size) ble_memset(ptr_memory, value, memory_size)
#define MEMCPY(ptr_destination, ptr_source, memory_size) ble_memcpy(ptr_destination, ptr_source, memory_size)
#define MEMCMP(ptr_destination, ptr_source, memory_size) ble_memcmp(ptr_destination, ptr_source, memory_size)
#define MEMMOV(ptr_destination, ptr_source, memory_size) ble_memmov(ptr_destination, ptr_source, memory_size)
#define MEMCPY_N_BYTES(ptr_dest, ptr_src,no_bytes ,keep_endian) ble_memcpy_n_bytes(ptr_dest,ptr_src ,no_bytes ,keep_endian)
extern os_mutex_id g_ll_lock;
#define LL_LOCK() os_rcrsv_mutex_wait(g_ll_lock,0xffffffff)
#define LL_UNLOCK() os_rcrsv_mutex_release(g_ll_lock)
#if SUPPORT_MAC
/** Maximum number of MAC TX done events. */
#define RADIO_MAC_TX_DONE_EVENT_MAX 1
/** Maximum number of RAL state machine done events. */
#define RAL_SM_DONE_EVENT_MAX RADIO_TX_RX_PACKET_BLOCK_COUNT
/** Maximum number of ED timer events allowed. */
#define ED_TIMER_EVENT_MAX 1
/** Maximum number of MLME timer events. */
#define MAX_MLME_TIMER_EVENT MAC_NUMBER_OF_INSTANCE
/** Maximum number of direct data transmission events. */
#define MAX_DIRECT_DATA_TX_EVENT MAC_NUMBER_OF_INSTANCE
/** Maximum number of timeout events for indirect data. */
#define MAX_INDIRECT_DATA_TIMEOUT_EVENT MAX_NUMBER_OF_INDIRECT_DATA
/** Maximum number of periodic calibration timer events. */
#define PRDC_CLBR_TMR_EVENT_MAX 1
/** Maximum value for CSL receiver timer event. */
#define CSL_RCV_TMR_EVENT_MAX 1
/** The sensitivity threshold (in dBm) for the OQPSK receiver. */
#define OQPSK_RECEIVER_SENSTIVITY -85
/** The length of an extended address, typically used for unique device identification. */
#define EXT_ADDRESS_LENGTH 8
#endif /* SUPPORT_MAC */
#if SUPPORT_MAC && SUPPORT_OPENTHREAD_1_2
/** Compiler flag to control supporting of CSL transmitter, RADIO TX at specific time, 1 supported, 0 not supported */
#define CONFIG_MAC_CSL_TRANSMITTER_ENABLE 1
/** Compiler flag to control supporting of CSL receiver, RADIO RX at specific time, 1 supported, 0 not supported */
#define CONFIG_MAC_CSL_RECEIVER_ENABLE 1
/** Compiler flag to control supporting of radio security handling, 1 supported, 0 not supported */
#define SUPPORT_RADIO_SECURITY_OT_1_2 1
/** Compiler flag to control supporting of Enhanced Ack Link metrics probing, 1 supported, 0 not supported */
#define SUPPORT_ENH_ACK_LINK_METRICS_PROBING_OT_1_2 1
/**
* Compiler flag to control supporting of Time sync experimental feature of OT 1.2
* (it is not a thread 1.2 shall not be added except for with OT 1.2 for testing purpose)
*/
#define SUPPORT_TIME_SYNC_OT_1_2 1
#else
/** Compiler flag to control supporting of CSL transmitter, RADIO TX at specific time, 1 supported, 0 not supported */
#define CONFIG_MAC_CSL_TRANSMITTER_ENABLE 0
/** Compiler flag to control supporting of CSL receiver, RADIO RX at specific time, 1 supported, 0 not supported */
#define CONFIG_MAC_CSL_RECEIVER_ENABLE 0
/** Compiler flag to control supporting of radio security handling, 1 supported, 0 not supported */
#define SUPPORT_RADIO_SECURITY_OT_1_2 0
/** Compiler flag to control supporting of Enhanced Ack Link metrics probing, 1 supported, 0 not supported */
#define SUPPORT_ENH_ACK_LINK_METRICS_PROBING_OT_1_2 0
/**
* Compiler flag to control supporting of Time sync experimental feature of OT 1.2
* (it is not a thread 1.2 shall not be added except for with OT 1.2 for testing purpose)
*/
#define SUPPORT_TIME_SYNC_OT_1_2 0
#endif /*SUPPORT_MAC && SUPPORT_OPENTHREAD_1_2 */
#ifndef SUPPORT_ANT_DIV
#define SUPPORT_ANT_DIV 0 ///< Antenna diversity feature is not supported
#endif
#ifndef SUPPORT_CONFIG_LIB
#define SUPPORT_CONFIG_LIB 0 ///< Configurable library feature is not supported
#endif
/* end of radio activity custom command flag */
#define END_OF_RADIO_ACTIVITY_REPORTING 1 /* Enable\Disable end of radio activity reporting feature. Enable:1 - Disable:0 */
/**
* @brief Global error definition across different components.
* refer the error codes defined in @ref ll_error.h for more information about the values that this type should set
*/
typedef uint32_t ble_stat_t;
/* Supported PHYs*/
typedef enum {
LE_NO_CHANGE = 0x00,
LE_1M = 0x01,
LE_2M = 0x02,
LE_CODED_S8 = 0x03,
LE_CODED = 0x04,
#if (SUPPORT_LE_POWER_CONTROL)
LE_PHY_UNDEFINED = 0xFC,
NEW_PHY_CODED_S2 = 0xFD,
NEW_PHY_CODED_S8 = 0xFE,
NEW_PHY_CODED_COMBINED = 0xFF,
#endif /* SUPPORT_LE_POWER_CONTROL */
/* PHY Recommendations - Combined Values */
#if ((SUPPORT_CONNECTED_ISOCHRONOUS && SUPPORT_MASTER_CONNECTION) || SUPPORT_BRD_ISOCHRONOUS)
RECOMMEND_1M_2M = 0x03,
RECOMMEND_1M_CODED = 0x05,
RECOMMEND_2M_CODED = 0x06,
RECOMMEND_1M_2M_CODED = 0x07,
#endif /* ((SUPPORT_CONNECTED_ISOCHRONOUS && SUPPORT_MASTER_CONNECTION) || SUPPORT_BRD_ISOCHRONOUS) */
} tx_rx_phy_e;
/**
* @brief time stamp structure.
*/
typedef struct time_st {
uint32_t time_stamp_base;
uint16_t time_stamp_fine;
uint8_t overflow_flag;
} ble_time_t, *ble_time_p;
typedef enum dpslp_state {
DEEP_SLEEP_ENABLE = 0x01,
DEEP_SLEEP_DISABLE = 0x00
} dpslp_state_e;
/**
* @enum crypto_endian_enum_t
* @brief States the available endian formats.
*
*/
typedef enum {
CRYPTO_LITTLE_ENDIAN,
CRYPTO_BIG_ENDIAN
} crypto_endian_enum_t;
/**
* @enum security_mode_enum_t
* @brief Contains the available security modes.
*
* Note: The enum values should be the same as specified in the register
* address header file.
*/
typedef enum {
ECB_DECRYPT = 0,
CCM_DECRYPT = 1,
ECB_ENCRYPT = 2,
CCM_ENCRYPT = 3,
CTR_ENCRYPT = 4,
CTR_DECRYPT = 5,
MODES_MAX_NUM
} security_mode_enum_t;
#if SUPPORT_MAC
/**
* @brief Enum defines the various PHY data rates supported by the RAL.
*
*/
typedef enum ral_phy_rate_enum {
#if SUPPORT_A_MAC
RAL_RATE_125K = 0x00,
RAL_RATE_1M = 0x02,
RAL_RATE_2M = 0x03,
#endif
RAL_RATE_256K = 0x01
} ral_phy_rate_enum_t;
#endif /*SUPPORT_MAC*/
/**
* @enum extrnl_evnt_priority_e
* @brief External Event priority
*/
typedef enum _extrnl_evnt_priority_e
{
PRIORITY_DEFAULT,
PRIORITY_HIGH,
PRIORITY_CRITICAL
}extrnl_evnt_priority_e;
/**
* @enum extrnl_evnt_state_e
* @brief External Event Blocked State and reason
*/
typedef enum _extrnl_evnt_state_e
{
STATE_BLOCKED_UNKNOWN,
STATE_BLOCKED_PRIORITY,
STATE_BLOCKED_CANCELLED,
STATE_BLOCKED_LATE,
STATE_BLOCKED_DEADLINE,
STATE_NOT_BLOCKED
}extrnl_evnt_state_e;
/**
* @brief Enumeration of the source type used to drive the sleep timer.
*/
typedef enum _slptmr_src_type_e {
CRYSTAL_OSCILLATOR_SLPTMR = 0x00,
#if (USE_NON_ACCURATE_32K_SLEEP_CLK)
RCO_SLPTMR = 0x01,
RTC_SLPTMR = 0x02
#endif /* USE_NON_ACCURATE_32K_SLEEP_CLK */
}slptmr_src_type_e;
#if SUPPORT_MAC && SUPPORT_ANT_DIV
/**
* @brief Enum defines the antenna diversity interval types.
*
*/
typedef enum ant_intrv_type_enum {
NO_TYPE,
FIXED_TIME,
PACKETS_NUMBER
} ant_intrv_type_enum_t;
/**
* @brief Structure represents antenna diversity parameters.
*
*/
typedef struct _antenna_diversity_st{
ant_intrv_type_enum_t ant_intrv_type; ///< Antenna interval type: FIXED_TIME(us) or PACKETS_NUMBER(n)
uint32_t ant_intrv_value; ///< Antenna interval value based on type; us for FIXED_TIME, n for PACKETS_NUMBER
uint16_t wntd_coord_shrt_addr; ///< Wanted coordinator/router short address
uint8_t wntd_coord_ext_addr[EXT_ADDRESS_LENGTH]; ///< Wanted coordinator/router extended address
uint8_t max_rx_ack_retries; ///< Maximum number of retries to receive ACK in case of ACK error reception
} antenna_diversity_st;
#endif /* SUPPORT_MAC && SUPPORT_ANT_DIV */
#if SUPPORT_MAC && SUPPORT_CONFIG_LIB
/**
* @brief Structure represents configurable library parameters.
*
*/
typedef struct _config_lib_st{
uint8_t mac_layer_build; ///< Disable/Enable MAC layer build
uint8_t support_openthread_1_2; ///< Disable/Enable FW parts related to new features introduced in OpenThread 1.2.
uint8_t ack_all_received_frames_with_ar_bit_set; ///< Disable/Enable sending ACK for all received frames with AR bit set
} config_lib_st;
extern config_lib_st g_config_lib_params; ///< Configurable library parameters
#endif /* SUPPORT_MAC && SUPPORT_CONFIG_LIB */
/*
* @brief structure that hold some information about the data transmitted across layers.
*/
typedef struct ble_buff_hdr_st {
/* pointer to buffer allocated in TX/RX buffer*/
uint8_t *buff_start;
/* pointer to next ble_buff_hdr node */
struct ble_buff_hdr_st *next_pkt;
/* Total buffer size */
uint16_t total_len;
/* offset to data location from the packet start pointed to by buff_start */
uint16_t data_offset;
/* data size for the data pointed to by buff_start + data_offset*/
uint16_t data_size;
/* bit field flags to be used for identifying buffer type data/control buffer,
* for data is it a BLE/MAC/ANT, does it contain complete SDU packet of it is a fragment,
* if it is a fragment is it the start or continuation or last fragment. */
uint8_t ble_hdr_flags;
} pkt_buff_hdr_t ,ble_buff_hdr_t, *ble_buff_hdr_p;
#if (SUPPORT_BRD_ISOCHRONOUS || SUPPORT_SYNC_ISOCHRONOUS || (SUPPORT_CONNECTED_ISOCHRONOUS && ( SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION)))
/**
* @brief: PDU info structure
*/
typedef struct _iso_pdu_buff_hdr_st {
ble_buff_hdr_t pkt; /* PDU Packet */
#if(SUPPORT_CONNECTED_ISOCHRONOUS && (SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION))
uint8_t flsh_tmout_cnt; /* flush timeout counter */
uint8_t flsh_tmout_subevnt_cnt; /* flush timeout subevent number */
uint8_t rx_flsh_tmout_cnt_updtd; /* flush timeout count updated or not flag */
#endif //(SUPPORT_CONNECTED_ISOCHRONOUS && (SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION))
uint8_t status;
} iso_pdu_buff_hdr_st;
/**
* @brief: SDU info structure
*/
typedef struct _sdu_buf_hdr_st {
iso_pdu_buff_hdr_st* ptr_last_pdu_buff_hdr; /* pointer to the last pdu buffer header pointed to this sdu */
struct _sdu_buf_hdr_st* ptr_nxt_sdu_buff_hdr; /* next sdu pointer */
uint32_t*ptr_sdu_buffer; /* pointer to SDU buffer in system memory for rx*/
uint32_t time_stamp; /* Time Stamp associated with this SDU */
uint32_t time_offset; /* Time Offset used only in framed SDUs */
uint16_t pkt_sqnc_num; /* Packet Sequence Number */
uint16_t iso_sdu_len; /* ISO SDU data real length */
uint16_t total_sdu_len; /* total sdu length for all sdu fragments */
uint8_t pkt_status_flag;
uint8_t pb_flag; /* PB_flag used in rx */
/*
* the first one will have the value 10 complete sdu until a new sdu fragment will be received then it will be 00 first fragment
* the subsequent one will have the value 11 last fragment until a new sdu fragment will be received then it will be 01 continuation fragment
*
* */
} iso_sdu_buf_hdr_st, *iso_sdu_buf_hdr_p;
#endif /* (SUPPORT_BRD_ISOCHRONOUS || SUPPORT_SYNC_ISOCHRONOUSs || (SUPPORT_CONNECTED_ISOCHRONOUS && ( SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION))) */
#if SUPPORT_LE_PAWR_ADVERTISER_ROLE
/**
* brief: PAWR host buffer struct
*/
typedef struct _pawr_host_buffer {
uint8_t buffer[257];
uint8_t total_data_lenth;
uint8_t number_of_reports;
}pawr_host_buffer;
#endif /* SUPPORT_LE_PAWR_ADVERTISER_ROLE */
/*
* @brief Transport layer event
*/
typedef enum {
HCI_CMD_PCKT = 0x01,
HCI_ACL_DATA_PCKT = 0x02,
HCI_EVNT_PCKT = 0x04,
HCI_ISO_DATA_PCKT = 0x05,
#if (SUPPORT_MAC && SUPPORT_MAC_HCI_UART)
HCI_MAC_REQ = 0x0A,
HCI_MAC_CFM = 0x0B,
HCI_MAC_KEY_TBL_CFM = 0x0E,
#endif /* SUPPORT_MAC && SUPPORT_MAC_HCI_UART */
#if (SUPPORT_ANT_HCI_UART)
HCI_ANT_REQ = 0x10,
HCI_ANT_CFM = 0x11,
#endif /* SUPPORT_ANT_HCI_UART */
#if (SUPPORT_AUG_MAC_HCI_UART)
AUG_HCI_MAC_REQ = 0x0C,
AUG_HCI_MAC_CFM = 0x0D,
#endif /* SUPPORT_AUG_MAC_HCI_UART */
} event_t;
/*constant flags to be used with ble_buff_hdr_t:ble_hdr_flags*/
#define BLE_BUFF_HDR_STRT_PKT (1<<0)
#define BLE_BUFF_HDR_CNTRL_PKT (1<<1)
#define BLE_BUFF_HDR_BUFF_FRGMNTD (1<<2)
#define BLE_BUFF_HDR_EVNT_CMD_PCKT (1<<3)
#define BLE_BUFF_HDR_ACL_DATA_PCKT (1<<4)
#if ((SUPPORT_CONNECTED_ISOCHRONOUS && (SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION)) \
||(SUPPORT_BRD_ISOCHRONOUS || SUPPORT_SYNC_ISOCHRONOUS))
#define BLE_BUFF_HDR_NULL_PCKT (1<<3)
/*
* BLE_BUFF_HDR_ISO_DATA_PCKT_BIT1 : BLE_BUFF_HDR_ISO_DATA_PCKT_BIT0 = Mode
* 1 : 1 = Unframed CIS Data PDU; end fragment of an SDU or a complete SDU. LLID (0b00)
* 0 : 1 = Unframed CIS Data PDU; start or continuation fragment of an SDU.
* 1 : 0 = Framed CIS Data PDU; one or more segments of an SDU.
* */
#define BLE_BUFF_HDR_ISO_DATA_PCKT_BIT0 (1<<5)
#define BLE_BUFF_HDR_ISO_DATA_PCKT_BIT1 (1<<6)
#endif /* (SUPPORT_CONNECTED_ISOCHRONOUS && (SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION)) */
#if (SUPPORT_MAC && SUPPORT_MAC_HCI_UART)
#define BLE_BUFF_HDR_MAC_CMD_PCK (1<<6)
#define BLE_BUFF_HDR_MAC_KEY_TBL_CMD_PCK ((1<<7)|(1<<4))
#endif /* (SUPPORT_MAC && SUPPORT_MAC_HCI_UART) */
#if (SUPPORT_AUG_MAC_HCI_UART)
#define BLE_BUFF_HDR_AUG_MAC_CMD_PCK ((1<<7)|(1<<6))
#endif /* SUPPORT_AUG_MAC_HCI_UART */
#if (SUPPORT_ANT_HCI_UART)
#define BLE_BUFF_HDR_ANT_CMD_PCK (1<<7)
#endif /* SUPPORT_ANT_HCI_UART */
/**
* The default PHY periodic calibration period in second. this Macro can be set to any value , Zero means that phy periodic calibration is disabled
*/
#ifndef DEFAULT_PHY_CALIBRATION_PERIOD
#define DEFAULT_PHY_CALIBRATION_PERIOD 10 /* Time period for PHY calibration = 10s */
#endif /* DEFAULT_PHY_CALIBRATION_PERIOD */
#ifndef SUPPORT_MAC_PHY_CONT_TESTING_CMDS
#define SUPPORT_MAC_PHY_CONT_TESTING_CMDS 1
#endif /* SUPPORT_MAC_PHY_CONT_TESTING_CMDS */
#if (defined(PHY_40nm_3_60_a_tc)|| defined(PHY_40nm_3_60_a_tc_new_demod) || defined(PHY_40nm_3_00_a) || defined(PHY_40nm_3_40_a) || defined(PHY_40nm_6_00_a))
#define SUPPORT_MAC_CONT_TESTING_CMDS_PHY_SUPPORT SUPPORT_MAC_PHY_CONT_TESTING_CMDS
#else
#define SUPPORT_MAC_CONT_TESTING_CMDS_PHY_SUPPORT 0
#endif /*end of defined(PHY_40nm_3_60_a_tc) || defined(PHY_40nm_3_60_a_tc_new_demod)|| defined(PHY_40nm_3_00_a) || defined(PHY_40nm_3_40_a) || defined(PHY_40nm_6_00_a) */
#ifndef EXTERNAL_CUSTOM_CMDS
#define EXTERNAL_CUSTOM_CMDS 0 /* Indicates that an external custom HCI commands module exists */
#endif /* EXTERNAL_CUSTOM_CMDS */
#ifndef SUPPORT_ZIGBEE_PHY_CERTIFICATION
#define SUPPORT_ZIGBEE_PHY_CERTIFICATION 0 /* 0 disable , 1 enable .. used to enable support of hci command required to implement zigbee phy Test cases*/
#endif /* SUPPORT_ZIGBEE_PHY_CERTIFICATION */
#ifndef SUPPORT_HCI_EVENT_ONLY
#if (!USE_HCI_TRANSPORT) && (SUPPORT_BLE) /* SUPPORT_HCI_EVENT_ONLY cannot be supported with default HCI_transport */
/* if this marco is enabled it will enable the below features
* -Queue events - ACL - ISO - Reports into different queues
-Allow host to register callback to refuse current controller event and receive it later with another callback*/
#define SUPPORT_HCI_EVENT_ONLY 1
#else
#define SUPPORT_HCI_EVENT_ONLY 0
#endif/* (!USE_HCI_TRANSPORT) && (SUPPORT_BLE) */
#endif /* SUPPORT_HCI_EVENT_ONLY */
#ifndef SUPPORT_HCI_EVENT_ONLY_TESTING
#define SUPPORT_HCI_EVENT_ONLY_TESTING 0
#endif /* SUPPORT_HCI_EVENT_ONLY_TESTING */
#ifndef SUPPORT_HW_AUDIO_SYNC_SIGNAL
#define SUPPORT_HW_AUDIO_SYNC_SIGNAL 0
#endif /* SUPPORT_HW_AUDIO_SYNC_SIGNAL */
#if SUPPORT_LE_PAWR_SYNC_ROLE
#define SUPPORT_PAWR_CUSTOM_SYNC 1
#else
#define SUPPORT_PAWR_CUSTOM_SYNC 0
#endif /* SUPPORT_LE_PAWR_SYNC_ROLE */
#define PAWR_TESTING 0
#ifndef SUPPORT_LE_PAWR_ADVERTISER_ROLE
#define SUPPORT_LE_PAWR_ADVERTISER_ROLE 0
#endif
#ifndef SUPPORT_TIM_UPDT
#define SUPPORT_TIM_UPDT 1
#endif /* SUPPORT_TIM_UPDT */
#ifndef SUPPORT_RX_DTP_CONTROL
#define SUPPORT_RX_DTP_CONTROL 1 /* Enable\Disable ACL Rx data throughput feature */
#endif /* SUPPORT_RX_DTP_CONTROL */
#ifndef SUPPORT_CHANNEL_SOUNDING
#define SUPPORT_CHANNEL_SOUNDING 0
#endif /* SUPPORT_CHANNEL_SOUNDING */
#ifndef SUPPORT_EXT_FEATURE_SET
#define SUPPORT_EXT_FEATURE_SET 0
#endif /* SUPPORT_EXT_FEATURE_SET */
#ifndef SUPPORT_CONFIGURABLE_GAIN_FIX
#define SUPPORT_CONFIGURABLE_GAIN_FIX 0 /* Enable\Disable configurable gain fix support */
#endif /* SUPPORT_CONFIGURABLE_GAIN_FIX */
#if SUPPORT_CONFIGURABLE_GAIN_FIX
#define SUPPORT_DYNAMIC_PREEMPH_COEFF 1 /* Enable\Disable dynamic preemphasis coefficients support */
#define PREEMPH_GAIN_COEFF_STEP_SIZE 10 /* percentage margin of single step */
#define GAIN_FIX_WAKEUP_TIME_OVERHEAD 4 /* in sleep timer units, the added time overhead from patching all pre-emphasis coefficients */
#else
#define SUPPORT_DYNAMIC_PREEMPH_COEFF 0
#define GAIN_FIX_WAKEUP_TIME_OVERHEAD 0
#endif /* SUPPORT_CONFIGURABLE_GAIN_FIX */
#ifndef SUPPORT_PHY_SHUTDOWN_MODE
#define SUPPORT_PHY_SHUTDOWN_MODE 1 /* Enable\Disable phpy shutdown mode support */
#endif /* SUPPORT_PHY_SHUTDOWN_MODE */
#if (defined(PHY_40nm_3_60_a_tc) || defined(PHY_40nm_3_60_a_tc_new_demod) || defined(PHY_40nm_3_00_a) || defined(PHY_40nm_3_40_a) || defined(PHY_40nm_6_00_a))
#define PHY_SHUTDOWN_MODE_PHY_SUPPORT SUPPORT_PHY_SHUTDOWN_MODE
#else
#define PHY_SHUTDOWN_MODE_PHY_SUPPORT 0
#endif /* defined(PHY_40nm_3_60_a_tc) || defined(PHY_40nm_3_60_a_tc_new_demod) || defined(PHY_40nm_3_00_a) || defined(PHY_40nm_3_40_a) || defined(PHY_40nm_6_00_a) */
#if PHY_SHUTDOWN_MODE_PHY_SUPPORT
#define PHY_SHUTDOWN_WAKEUP_TIME_OVERHEAD 2 /* in sleep timer units, the added time overhead from executing override seqeuences needed in phy shutdown mode */
#else
#define PHY_SHUTDOWN_WAKEUP_TIME_OVERHEAD 0
#endif /* PHY_SHUTDOWN_MODE_PHY_SUPPORT */
#ifndef SUPPORT_CTE_DEGRADATION_API
#define SUPPORT_CTE_DEGRADATION_API 0 /* Enable\Disable CTE PHY Degradation fix support */
#endif /* SUPPORT_CTE_DEGRADATION_API */
#if (defined(PHY_40nm_3_00_a) || defined(PHY_40nm_3_40_a))
#define CTE_DEGRADATION_API_PHY_SUPPORT SUPPORT_CTE_DEGRADATION_API
#else
#define CTE_DEGRADATION_API_PHY_SUPPORT 0
#endif /* defined(PHY_40nm_3_00_a) || defined(PHY_40nm_3_40_a) */
#ifndef SUPPORT_GNRC_SCHDLR_IF
#define SUPPORT_GNRC_SCHDLR_IF 1
#endif /* SUPPORT_GNRC_SCHDLR_IF */
#ifndef NEAR_AUX_AFTER_EXT_SLEEP_TIMER_SCHEDULING
#define NEAR_AUX_AFTER_EXT_SLEEP_TIMER_SCHEDULING 0
#endif /* NEAR_AUX_AFTER_EXT_SLEEP_TIMER_SCHEDULING */
#ifndef SUPPORT_LE_ENHANCED_CONN_UPDATE
#define SUPPORT_LE_ENHANCED_CONN_UPDATE 0
#endif /* SUPPORT_LE_ENHANCED_CONN_UPDATE */
#if defined(PHY_40nm_6_00_a)
#define PHY_USE_APB_TRANSPORT 1
#else
#define PHY_USE_APB_TRANSPORT 0
#endif /*PHY_40nm_6_00_a */
#if defined(RTL_VER_7)
#define USE_NEW_DEMODULATOR 1
#endif /* (USED_RTL_VER >= 7) */
#ifndef USE_NEW_DEMODULATOR
#define USE_NEW_DEMODULATOR 0
#endif /*USE_NEW_DEMODULATOR*/
#ifndef CS_TESTING
#define CS_TESTING 0
#endif /* CS_TESTING */
#if (SUPPORT_CHANNEL_SOUNDING &&( SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION))
/**
* @brief holds the possible values for cs roles
*/
typedef enum _cs_role_e
{
CS_ROLE_INITIATOR,
CS_ROLE_REFLECTOR
} cs_role_e;
/**
* @brief holds the possible values for cs step mode types
*/
typedef enum _cs_step_mode_type_e
{
CS_STEP_MODE_0,
CS_STEP_MODE_1,
CS_STEP_MODE_2,
CS_STEP_MODE_3,
CS_STEP_MODE_NONE = 0xFF
} cs_step_mode_type_e;
/**
* @brief cs host buffer structure
*/
typedef struct _cs_host_buffer {
uint8_t buffer[257]; /*CS_HOST_BUFFER_DATA_MAX (255) + HCI_EVENT_HEADER_LEN(2)*/
}cs_host_buffer;
#endif /*SUPPORT_CHANNEL_SOUNDING &&( SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION)*/
#ifndef ENABLE_AUTOMOUS_SCHEDULING_TIMING_UPDATE
/**
* Compiler flag to enable autonomous link layer timing updates, which increases EXEC_TIME when some event fails to execute multiple times.
* This serves as a recovery mechanism for misconfigured EXEC_TIME values. However, enabling this flag may introduce conflicts in some multi-role scenarios.
* The recommended approach is to set EXEC_TIME correctly based on the worst-case scenario, in which case this flag is not needed.
* If EXEC_TIME is not set properly, enabling this flag may cause conflicts and degrade scheduling performance, which is expected.
* If conflicts arise due to the autonomous link layer timing introduced by this flag, EXEC_TIME should be re-profiled and the new profiled value should be set in EXEC_TIME_PROFILED.
* If @ref SUPPORT_TIM_UPDT is set to 0, this flag has no meaning
*/
#define ENABLE_AUTOMOUS_SCHEDULING_TIMING_UPDATE 0
#endif /*ENABLE_AUTOMOUS_SCHEDULING_TIMING_UPDATE*/
#endif /*COMMON_TYPES_H_*/

View File

@@ -0,0 +1,254 @@
/*$Id: //dwh/bluetooth/DWC_ble154combo/firmware/rel/2.00a-lca04/firmware/public_inc/dtm.h#1 $*/
/**
********************************************************************************
* @file dtm.h
* @brief header file for Synopsys zigbee phy testing APIs
*
*
******************************************************************************
* This Synopsys DWC Bluetooth Low Energy Combo Link Layer/MAC software and
* associated documentation ( hereinafter the "Software") is an unsupported
* proprietary work of Synopsys, Inc. unless otherwise expressly agreed to in
* writing between Synopsys and you. The Software IS NOT an item of Licensed
* Software or a Licensed Product under any End User Software License Agreement
* or Agreement for Licensed Products with Synopsys or any supplement thereto.
* Synopsys is a registered trademark of Synopsys, Inc. Other names included in
* the SOFTWARE may be the trademarks of their respective owners.
*
* Synopsys MIT License:
* Copyright (c) 2020-Present Synopsys, Inc
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* the Software), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute,
* sublicense, and/or sell copies of the Software, and to permit persons to whom
* the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING, BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE ARISING FROM,
* OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* */
#ifndef MAC_CONTROLLER_INC_DTM_H_
#define MAC_CONTROLLER_INC_DTM_H_
/********************************************************************************************
* Includes
*********************************************************************************************/
#include "ral.h"
/*=========================================== MACROS ======================================*/
#define aMaxSIFSFrameSize 18 ///< Maximum SIFS frame size in bytes
#define macMinSIFSPeriod 192 ///< Minimum SIFS period in microseconds
#define macMinLIFSPeriod 640 ///< Minimum LIFS period in microseconds
#define MAX_PHY_PACKET_SIZE 127 ///< Maximum PHY packet size in bytes
#define MAX_ERROR_PER_SINGLE_TX 5 ///< Maximum error types per single TX
/*============================= Enumerations ================================*/
/**
* @brief Enum represents the current DTM State.
*
*/
typedef enum z_dtm_mode {
Z_DTM_STOPPED = 0,
Z_DTM_TX = 1,
Z_DTM_RX = 2,
Z_DTM_TX_ACK = 3,
Z_DTM_CHECK_TX_ERROR = 4
} z_dtm_mode_e;
/*============================= Structures ================================*/
/**
* @brief Structure represents the current state of DTM TX.
*
*/
typedef struct Tx_Info
{
uint16_t TxTotal; ///< Total number of transmitted frames (with/without errors)
uint16_t NoErr; ///< Number of frames transmitted successfully
uint16_t ErrNoAck; ///< Number of frames requesting ACK and no ACK received after transmission
uint16_t ErrOther; ///< Number of frames transmitted with errors excluding no ACK error
} TxInfo_s;
/**
* @brief Structure represents the current state of DTM RX.
*
*/
typedef struct Rx_Info
{
uint16_t RxTotal; ///< Total number of received frames (with/without errors)
uint16_t NoErr; ///< Number of frames successfully received
uint16_t ErrFcs; ///< Number of frames received with invalid FCS
uint16_t ErrOther; ///< Number of frames received with errors excluding invalid FCS error
uint8_t lqi; ///< LQI of the received frame
} RxInfo_s;
/**
* @brief Structure represents all information related to DTM.
*
*/
typedef struct dtmInfo_st
{
z_dtm_mode_e curr_mode; ///< Current State (TX, RX, Stopped)
/**
* @brief Union represents DTM TX/RX information.
*
*/
union{
TxInfo_s TxInfo; ///< DTM information in case of TX and TX_ACK
RxInfo_s RxInfo; ///< DTM information in case of RX
} tx_rx_info_u;
} dtmInfo_t;
/** @ingroup mac_dtm
* @{
*/
/*=========================================== API ============================================*/
/**
* @brief Initialize or reset DTM, or stop the current running DTM.
*
*/
void dtmReset(void);
/**
* @brief Get the state of DTM (running or stopped).
*
* @return TRUE if DTM is running, FALSE if DTM is stopped.
*/
uint8_t dtmIsEnabled(void);
/**
* @brief Start continuous DTM transmission with the given input parameters until the dtmStop() API is called.
*
* @param[in] mPsdu : Pointer to MAC DTM frame including MAC header.
* @param[in] mLength : Length of the frame to be transmitted.
* @param[in] mChannel : Channel to transmit the frame on.
* @param[in] IFS : Interframe spacing in us.
* @return MAC error state of starting transmission.
*/
mac_status_enum_t dtmStartTransmit(uint8_t * mPsdu, uint8_t mLength, uint8_t mChannel, uint16_t IFS);
/**
* @brief Start transmission of a single DTM frame that is requesting ACK with the given input parameters.
*
* @param[in] mPsdu : Pointer to MAC DTM frame including MAC header.
* @param[in] mLength : Length of the frame to be transmitted.
* @param[in] mChannel : Channel to transmit the frame on.
* @param[in] IFS : Interframe spacing in us.
* @return MAC error state of starting transmission.
*/
mac_status_enum_t dtmStartTransmitwithAck(uint8_t * mPsdu, uint8_t mLength, uint8_t mChannel, uint16_t IFS);
/**
* @brief Stop the current running DTM (TX or RX).
*
* @param[out] num_rec_pckts : Pointer to number of received packets.
* @param[out] lqi : Pointer to average LQI.
* @return MAC error state of stopping DTM.
*/
mac_status_enum_t dtmStop(uint16_t *num_rec_pckts, uint8_t *lqi);
/**
* @brief Start continuous DTM reception on the given channel.
*
* @param[in] aChannel : Channel to receive on.
* @return MAC error state of starting reception.
*/
mac_status_enum_t dtmStartReceive(uint8_t aChannel);
/**
* @brief Start CCA on the given channel.
*
* @param[in] channel : Channel to perform CCA on.
* @return MAC error state of performing CCA.
*/
mac_status_enum_t dtmPerformCCA(uint8_t channel);
/**
* @brief Get the current LQI of the last received packet.
*
* @return LQI value.
*/
uint8_t dtmGetLQIValue(void);
/**
* @brief get the current RSSI of the last received packet
* @retval int8_t. RSSI value
*/
int8_t dtmGetRSSIValue(void);
/**
* @}
*/
/**
* @brief Check if there are more DTM frames to transmit.
*
* @return TRUE to continue DTM transmission, FALSE to stop DTM transmission.
*/
uint8_t dtmCheckMoreTx(void);
/**
* @brief Check if DTM is in reception state.
*
* @return TRUE if DTM is in reception mode, FALSE otherwise.
*/
uint8_t dtmCheckRxState(void);
/**
* @brief Done function called after each DTM event.
*
* @param[in] aFrame : Pointer to MAC transmitted/received frame.
* @param[in] aError : Status error of overall transmission (success, No_ack, and other errors).
*/
void dtmRadioDone(otRadioFrame *aFrame, otError aError);
/**
* @brief Check if in Z_DTM_CHECK_TX_ERROR transmission mode or not.
*
* @return TRUE if in Z_DTM_CHECK_TX_ERROR transmission mode, FALSE otherwise.
*/
uint8_t dtmCheckTxErrorState(void);
/**
* @brief Count errors that happen in single TX in Z_DTM_CHECK_TX_ERROR transmission mode.
*
* @param[in] tx_error : Type of error to be counted for this trial.
*/
void dtmCheckTxErrorCount(otError tx_error);
/**
* @brief Gives stored errors and their count that happen in single TX in Z_DTM_CHECK_TX_ERROR transmission mode.
*
* @param[out] errors : Pointer to array of stored errors in Z_DTM_CHECK_TX_ERROR transmission mode.
* @param[out] error_count : Pointer to number of errors stored in errors array.
*/
void dtmTxCheckErrorCountDone(uint8_t ** errors, uint8_t *error_count);
/**
* @brief Start transmission in Z_DTM_CHECK_TX_ERROR transmission mode.
*
* @param[in] mac_hndl : MAC instance handle.
* @param[in] mPsdu : Pointer to TX packet.
* @param[in] mLength : Length of TX packet.
* @param[in] mChannel : Channel that packet will be sent on.
* @param[in] IFS : Used inter-frame-spacing.
* @param[in] csma_en : Flag to indicate to apply CSMA in this transmission if max_csma_retry_count != 0.
* @param[in] backoff_count_max : Maximum number of TX trials in every full CSMA trial.
* @param[in] frame_retry : Maximum number of trials after failure not related to CCA failure.
* @param[in] ack_req : Indicate if this packet requires ACK or not.
* @return Status.
*/
mac_status_enum_t dtmTxSpecificErrorCount(uint32_t mac_hndl, uint8_t * mPsdu, uint8_t mLength, uint8_t mChannel, uint16_t IFS,
uint8_t csma_en, uint8_t backoff_count_max, uint8_t frame_retry, uint8_t ack_req);
/**
* @brief Reset tx_check_err_arr array and its counter for Z_DTM_CHECK_TX_ERROR mode.
*
*/
void dtmTxErrorCountReset(void);
#endif /* MAC_CONTROLLER_INC_DTM_H_ */

View File

@@ -0,0 +1,365 @@
/*$Id: //dwh/bluetooth/DWC_ble154combo/firmware/rel/2.00a-lca04/firmware/public_inc/event_manager.h#1 $*/
/**
********************************************************************************
* @file event_manager.h
* @brief This file contains all the functions prototypes for the event_manager.c.
******************************************************************************
* This Synopsys DWC Bluetooth Low Energy Combo Link Layer/MAC software and
* associated documentation ( hereinafter the "Software") is an unsupported
* proprietary work of Synopsys, Inc. unless otherwise expressly agreed to in
* writing between Synopsys and you. The Software IS NOT an item of Licensed
* Software or a Licensed Product under any End User Software License Agreement
* or Agreement for Licensed Products with Synopsys or any supplement thereto.
* Synopsys is a registered trademark of Synopsys, Inc. Other names included in
* the SOFTWARE may be the trademarks of their respective owners.
*
* Synopsys MIT License:
* Copyright (c) 2020-Present Synopsys, Inc
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* the Software), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute,
* sublicense, and/or sell copies of the Software, and to permit persons to whom
* the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING, BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE ARISING FROM,
* OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef INCLUDE_EVENT_MANAGER_H_
#define INCLUDE_EVENT_MANAGER_H_
#include <stdint.h>
#include "ll_fw_config.h"
#include "common_types.h"
/* Defination ----------------------------------------------------------------*/
/*Event manager events*/
#define EVENT_PENDING 1
#define HANDLE_IS_FULL 77
#define NO_EVENT_PENDING 0
#define EVENT_NOT_BUSY 0
#define EVENT_BUSY 1
#if (NUM_OF_CTSM_EMNGR_HNDLS > 3)
#error "NUM_OF_CTSM_EMNGR_HNDLS shouldn't exceed 3 !"
#endif
typedef uint8_t (*conditional_cbk)(void * em_data , void * caller_data);
/**
* @brief Enum event manager handler types.
*/
/* Event Manager IDs */
typedef enum {
#if SUPPORT_BLE
LLHWC_EVENT,
PRDC_CLBR_EVENT,
#if ((SUPPORT_MASTER_CONNECTION) || (SUPPORT_SLAVE_CONNECTION))
CONN_EVENT, /*connection event handler ID*/
CONN_PARAM_UPDATE_EVENT, /* handler for connection parameter update initiated by link layer */
#if ((SUPPORT_CONNECTED_ISOCHRONOUS) && (SUPPORT_MASTER_CONNECTION))
CONN_DATA_LEN_UPDATE_EVENT, /* handler for connection data length update initiated by link layer */
#endif /*SUPPORT_CONNECTED_ISOCHRONOUS && SUPPORT_MASTER_CONNECTION*/
#if(SUPPORT_CONNECTED_ISOCHRONOUS &&( SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION))
CIS_EVENT,
#endif /*SUPPORT_CONNECTED_ISOCHRONOUS*/
#endif /* SUPPORT_MASTER_CONNECTION) || (SUPPORT_SLAVE_CONNECTION */
#if(SUPPORT_BRD_ISOCHRONOUS || SUPPORT_SYNC_ISOCHRONOUS)
BIS_TERM_EVENT,
#if(SUPPORT_SYNC_ISOCHRONOUS)
BIS_SYNC_TIMEOUT_EVENT,
#endif /* SUPPORT_SYNC_ISOCHRONOUS */
#endif /* SUPPORT_BRD_ISOCHRONOUS || SUPPORT_SYNC_ISOCHRONOUS */
#endif /*SUPPORT_BLE*/
#if SUPPORT_BLE
HCI_HANDLER, /* handler for the HCI events; handling events from Host to HCI*/
#endif /*SUPPORT_BLE*/
#if SUPPORT_BLE
#if SUPPORT_LE_EXTENDED_ADVERTISING
ADV_TIMEOUT_EVENT, /*handler for advertising extended timeout feature */
SCN_DURATION_EVENT, /*handler for extended scanning duration */
SCN_PERIOD_EVENT, /*handler for extended scanning period */
#if SUPPORT_LE_PERIODIC_ADVERTISING
PRDC_SCAN_TIMEOUT_EVENT, /*handler for periodic scan sync timeout */
PRDC_SCAN_CANCEL_EVENT,
#endif /* SUPPORT_LE_PERIODIC_ADVERTISING */
#if SUPPORT_LE_PAWR_ADVERTISER_ROLE
PAWR_SEND_FRST_REQ,
#endif /* SUPPORT_LE_PAWR_ADVERTISER_ROLE */
#endif /* SUPPORT_LE_EXTENDED_ADVERTISING */
#endif /*SUPPORT_BLE*/
#if SUPPORT_MAC
RADIO_MAC_TX_DONE_EVENT,
RAL_SM_DONE_EVENT,
MAC_SM_DONE_EVENT,
ED_TMR_EVENT,
#endif /*SUPPORT_MAC*/
#if ((SUPPORT_BLE)||(SUPPORT_MAC_HCI_UART)||(SUPPORT_ANT_HCI_UART) || (SUPPORT_AUG_MAC_HCI_UART) || (SUPPORT_RADIO_HCI_UART))
HCI_TRANSPORT_HANDLER, /* handler for the HCI transport events; handling events from HCI to Host */
#endif /* ((SUPPORT_BLE)||(SUPPORT_MAC_HCI_UART)||(SUPPORT_ANT_HCI_UART) || (SUPPORT_AUG_MAC_HCI_UART) || (SUPPORT_RADIO_HCI_UART)) */
#if (SUPPORT_HCI_EVENT_ONLY)
GENERIC_EVENT,
#if SUPPORT_SYNC_ISOCHRONOUS || SUPPORT_CONNECTED_ISOCHRONOUS
ISO_DATA_EVENT,
#endif /* SUPPORT_SYNC_ISOCHRONOUS || SUPPORT_CONNECTED_ISOCHRONOUS */
#if SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION
ACL_DATA_EVENT,
#endif /* SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION */
#if SUPPORT_EXPLCT_OBSERVER_ROLE || SUPPORT_MASTER_CONNECTION || SUPPORT_SYNC_ISOCHRONOUS || (SUPPORT_AOA_AOD && SUPPORT_SLAVE_CONNECTION)
ADV_REPORT_EVENT,
#endif /* SUPPORT_EXPLCT_OBSERVER_ROLE || SUPPORT_MASTER_CONNECTION || SUPPORT_SYNC_ISOCHRONOUS || (SUPPORT_AOA_AOD && SUPPORT_SLAVE_CONNECTION) */
#if (SUPPORT_CONNECTED_ISOCHRONOUS && (SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION) || (SUPPORT_BRD_ISOCHRONOUS) || (SUPPORT_SYNC_ISOCHRONOUS))
HCI_SYNC_EVENT,
#endif /* SYNC_EVENT */
#if END_OF_RADIO_ACTIVITY_REPORTING
HCI_RADIO_ACTIVITY_EVENT,
#endif /* END_OF_RADIO_ACTIVITY_REPORTING */
#endif /* SUPPORT_HCI_EVENT_ONLY */
#if (SUPPORT_CHANNEL_SOUNDING &&( SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION))
CS_EVENT_REMOVE,
#endif /*(SUPPORT_CHANNEL_SOUNDING &&( SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION))*/
#if ((SUPPORT_MAC) && (MAC_LAYER_BUILD))
MLME_TIMER_EVENT,
DIRECT_DATA_TX_EVENT,
INDIRECT_DATA_TIMEOUT_EVENT,
#if SUPPORT_MAC_HCI_UART
MAC_HCI_HANDLER,
#endif /* SUPPORT_MAC_HCI_UART */
#endif/*((SUPPORT_MAC) && (MAC_LAYER_BUILD)) */
#if ((!SUPPORT_COEXISTENCE) && (SUPPORT_OPENTHREAD_1_2 && CONFIG_MAC_CSL_RECEIVER_ENABLE))
CSL_RCV_TMR_EVENT,
#endif /*((!SUPPORT_COEXISTENCE) && (SUPPORT_OPENTHREAD_1_2 && CONFIG_MAC_CSL_RECEIVER_ENABLE))*/
#if(!SUPPORT_COEXISTENCE && DEFAULT_PHY_CALIBRATION_PERIOD && SUPPORT_MAC)
PRDC_CLBR_TMR_EVENT,
#endif
#if SUPPORT_AUG_MAC_HCI_UART
AUG_MAC_HCI_HANDLER,
#endif/*SUPPORT_AUG_MAC_HCI_UART */
#if SUPPORT_ANT
ANT_RADIO_CMPLT_EVENT,
ANT_STACK_TASK_EVENT,
#if SUPPORT_ANT_HCI_UART
ANT_HCI_HANDLER,
#endif /*SUPPORT_ANT_TESTING */
#endif /* SUPPORT_ANT */
#if (NUM_OF_CTSM_EMNGR_HNDLS >= 1)
CUSTOM_HANDLE_1,
#endif
#if (NUM_OF_CTSM_EMNGR_HNDLS >= 2)
CUSTOM_HANDLE_2,
#endif
#if (NUM_OF_CTSM_EMNGR_HNDLS >= 3)
CUSTOM_HANDLE_3,
#endif
MAX_EM_HANDLE
} handler_t;
/* Exported functions ------------------------------------------------------- */
/**
* @brief Used to initialize the event manager component.
*
* @param None.
*
* @retval None.
*/
void emngr_init(void);
/**
* @brief Used to reset the event manager structure.
*
* @param None.
*
* @retval Status : 0: SUCCESS. Otherwise: FAILED.
*/
int emngr_reset(void);
/** @ingroup event_manager_functions
* @{
*/
/**
* @brief Used to initialize a certain handle in the event manager.
*
* @param id : [in] ID of the handle to be initialized. [Range: 0 to 255].
* @param max : [in] Maximum number of events that can be added to this handle. [Range: 0 to 255].
* @param call_back_fun : [in] Pointer to the function that will process the events of that handle.
*
* @retval Status : 0: SUCCESS. Otherwise: FAILED.
*/
int emngr_handle_init(unsigned char id, unsigned char max,
void (*call_back_fun)(void *));
/**
* @brief Used to remove a certain handle from the event manager.
*
* @param id : [in] ID of the handle to be removed. [Range: 0 to 255].
*
* @retval Status : 0: SUCCESS. Otherwise: FAILED.
*/
int emngr_handle_remove(
unsigned char id);
/**
* @brief Used to post an event to a certain event manager handle that is identified by the handle ID.
*
* @param id : [in] ID of the handle to which the event will be posted. [Range: 0 to 255].
* @param event : [in] Void pointer pointing to the data related to the posted event.
*
* @retval Status : 0: SUCCESS. Otherwise: FAILED.
*/
int emngr_post_event(unsigned char id, void *event);
/**
* @brief Used to post an event to a certain event manager handle that is identified by the handle ID.
* This Event will be handled first
*
* @param id : [in] ID of the handle to which the event will be posted. [Range: 0 to 255].
* @param event : [in] Void pointer pointing to the data related to the posted event.
*
* @retval Status : 0: SUCCESS. Otherwise: FAILED.
*/
int emngr_post_event_first(unsigned char id ,void *event);
/**
* @brief Used to get an event from a certain event manager handle that is identified by the handle ID.
*
* @param id : [in] ID of the handle whose events are to be gotten. [Range: 0 to 255].
*
* @retval event handle : Void pointer pointing to the returned event.
*/
void * emngr_get_event(unsigned char id);
/**
* @brief Used to process an event from a a certain event manager handle that is identified by the handle ID, by first getting the event (in case the handle contains any) then processing it through the associated callback function.
*
* @param id : [in] ID of the handle whose events are to be processed. [Range: 0 to 255].
*
* @retval Status : 0: SUCCESS. Otherwise: FAILED.
*/
int emngr_process_event(unsigned char id);
/**
* @brief Used to return the number of events in the event manager.
*
* @param None.
*
* @retval Events Number.
*/
int emngr_get_total_events(void);
/**
* @brief Used to return the number of events in a certain handle that is identified by the handle ID.
*
* @param id : [in] ID of the handle whose events number is to be returned. [Range: 0 to 255].
*
* @retval Events Number per handle.
*/
int emngr_get_handle_events(unsigned char id);
/**
* @brief Used to set a flag "busy_flag" to determine whether a certain handle is busy processing an event.
*
* @param id : [in] ID of the handle whose "busy_flag" parameter value is to be set. [Range: 0 to 255].
* @param busy_flag : [in] Value to be set to the "busy_flag" parameter. 0: EVENT_NOT_BUSY. 1: EVENT_BUSY.
*
* @retval None.
*/
void emngr_set_event_handle_busy(unsigned char id, unsigned char busy_flag);
/**
* @brief Used to return the state of the event "busy_flag", which indicates whether the events of a certain handle, identified by the handle ID, are being currently processed.
*
* @param id : [in] ID of the handle whose events are being currently processed. [Range: 0 to 255].
*
* @retval busy_flag state : 0: EVENT_NOT_BUSY. 1: EVENT_BUSY.
*/
int emngr_is_event_busy(
unsigned char id);
/**
* @brief Used to loop through all the registered handles in the event manager and process their events, if any exists.
*
* @param None.
*
* @retval None.
*/
void emngr_handle_all_events(void);
/**
* @brief Used to process an event of a certain event manager handle that is identified by the handle ID.
*
* @param id : [in] ID of the handle whose event is to be processed. [Range: 0 to 255].
*
* @retval None.
*/
void emngr_handle_event(handler_t id);
/**
* @brief Used to return a pointer to the first event in a certain event manager handle, identified by the handle ID, without dequeuing that event.
*
* @param id : [in] ID of the handle whose first event is to be returned without being removed from the handle queue. [Range: 0 to 255].
*
* @retval : void Pointer to the first event of the specified handle.
*/
void * emngr_peak_frst_event(unsigned char id);
/**
* @brief Used to delete an event from a certain event manager handle, identified by the handle ID.
*
* @param id : [in] ID of the handle whose one of its events is to be deleted. [Range: 0 to 255].
* @param data : [in] Pointer to the event data to be used for searching for the event to be deleted out of all the events in the specified handle.
*
* @retval handle : Void pointer to the event data of the event node that is being deleted.
*/
void * emngr_del_event(unsigned char id, void *data);
/* @breif Used to remove a certain event within a queue that satisfies the condition set by cbk
* the cbk can delete priv data if it has allocated data.
* @param id: [In] ID of the queue to search for
* @param only_one_event: [In] if False delete all events that satisfies the condition
* @param conitional_data: [In] Optional pointer to pass to cbk along with priv data
* @param cbk: [In] A callback function that returns True if the event priv data satisfies a condition
* @retval True if any event was found and removed
* */
uint8_t emngr_remove_conditional_event( uint8_t id, uint8_t only_one_event,
void* conditional_data, conditional_cbk cbk);
/*
* @brief Check if MCU can sleep in the case that all events in the event manager are busy and
* of type that allows sleep while busy.
* @retval True if MCU can sleep.
* */
uint8_t emngr_can_mcu_sleep(void);
/* @breif Used to process a certain event within a queue that satisfies the condition set by cbk
* @param id: [In] ID of the queue to search for
* @param only_one_event: [In] if False process all events that satisfies the condition
* @param conitional_data: [In] Optional pointer to pass to cbk along with priv data
* @param cbk: [In] A callback function that returns True if the event priv data satisfies a condition
* */
uint8_t emngr_process_conditional_event( uint8_t id, uint8_t only_one_event,
void* conditional_data, conditional_cbk cbk);
/**
* @}
*/
#endif /* INCLUDE_EVENT_MANAGER_H_ */

View File

@@ -0,0 +1,205 @@
/*$Id: //dwh/bluetooth/DWC_ble154combo/firmware/rel/2.00a-lca04/firmware/public_inc/evnt_schdlr_gnrc_if.h#1 $*/
/**
********************************************************************************
* @file evnt_schdlr_gnrc_if.h
* @brief This file contains all the functions prototypes for the evnt_schdlr.c
* that are used by other layers to interface with the scheduler.
******************************************************************************
* This Synopsys DWC Bluetooth Low Energy Combo Link Layer/MAC software and
* associated documentation ( hereinafter the "Software") is an unsupported
* proprietary work of Synopsys, Inc. unless otherwise expressly agreed to in
* writing between Synopsys and you. The Software IS NOT an item of Licensed
* Software or a Licensed Product under any End User Software License Agreement
* or Agreement for Licensed Products with Synopsys or any supplement thereto.
* Synopsys is a registered trademark of Synopsys, Inc. Other names included in
* the SOFTWARE may be the trademarks of their respective owners.
*
* Synopsys MIT License:
* Copyright (c) 2020-Present Synopsys, Inc
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* the Software), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute,
* sublicense, and/or sell copies of the Software, and to permit persons to whom
* the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING, BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE ARISING FROM,
* OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* */
/**
* @ingroup gnrc_schdlr_intf
* @brief Provides APIs to register an external event in the system, all operations for utilizing the generic interface are part of the APIs in evnt_schdlr_gnrc_if.h header file.
* * @{
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef INCLUDE_EVNT_GNRC_SCHDLR_IF_H_
#define INCLUDE_EVNT_GNRC_SCHDLR_IF_H_
/* Includes ------------------------------------------------------------------*/
#include <stdint.h>
#include "bsp.h"
#include "os_wrapper.h"
#include "common_types.h"
typedef void* ext_evnt_hndl_t;
/**
* @brief Generic External Event node that holds the the external event information.
* @note All parameters that are related to time assumed to be in microseconds
*/
typedef struct _extrnl_evnt_st_t{
/** Event must end before this point in time (us) it is an optional parameter and
* it should set with zero if not used by stack.*/
uint64_t deadline;
/** Earliest time the event can start (us) , it is an optional parameter and
* it should set with zero if not used by stack.it is not logical to have periodic event with max start time.
* So, it will be neglected and never checked in case of periodic event.*/
uint64_t strt_min;
/** Latest time the event can start (us), it is an optional parameter and
* it should set with zero if not used by stack.*/
uint64_t strt_max;
/** Minimum amount of time that must be allocated to the event (us) , */
uint32_t durn_min;
/** Maximum amount of time that the event is requesting (us), it is an optional parameter and
* it should set with zero if not used by stack.*/
uint32_t durn_max;
/** Periodicity of the event (us), 0: Not Periodic
* if the value is not zero , it should be multiple of 1250 us to be aligned with BLE events.*/
uint32_t prdc_intrvl;
/** Priority of the event from @ref _extrnl_evnt_priority_e*/
extrnl_evnt_priority_e priority;
/** Event blocked or not, and reason if blocked from @ref _extrnl_evnt_state_e */
extrnl_evnt_state_e blocked;
/** Pointer to private data that should passed with the call back function */
void* ptr_priv;
/** Event Started Callback Function , this function will be called at the allocated time to do the job related to
* executing the event, it must not be NULL.
* At the end of given grant, @ref evnt_schdlr_gnrc_evnt_cmplt function should be called to inform scheduler
* that the event is finished, and PHY should not be accessed after that call until a new grant is given
* from event scheduler. @ref evnt_strtd_cbk should handle calling of @ref evnt_schdlr_gnrc_evnt_cmplt via timer or
* at the end of execution if the execution is blocking
*
* if @ref slot_durn is set to zero "0" , event scheduler has given the on idle event unlimited grant.
* It will be aborted later with a calling to evnt_abortd_cbk function.*/
uint32_t (*evnt_strtd_cbk)(ext_evnt_hndl_t evnt_hndl,
uint32_t slot_durn, void* priv_data_ptr);
/** Event Blocked Callback Function , called if the event is blocked due deadline or other reasons as
* in @ref blocked_state .it could be NULL if not used by stack
* if it is not NULL ,it will be called when event exceeded the given maximum start time or the given deadline while scheduling the event*/
uint32_t (*evnt_blckd_cbk)(extrnl_evnt_state_e blocked_state);
/** Event Aborted Callback Function. it could be NULL if not used by stack. it will be called when event execution is aborted.
* the event @ref EXTRNL_ON_IDLE is the only event type that can be aborted so it must not be NULL for this event type
* when it is called from event scheduler, the stack should stop all running operation that access phy,
* no need to call @ref evnt_schdlr_gnrc_evnt_cmpltafter calling this callback as it is called from scheduler itself.
* */
uint32_t (*evnt_abortd_cbk)(void);
/** Event coexistence error Callback Function. it will be called when @ref EXTRNL_GNRC event execution returned error.
* when @ref evnt_strtd_cbk of @ref EXTRNL_GNRC failed at execution for any reason, this callback will be called from event scheduler,
* it'll send the returned error to ral_tx_done to check if there will retransmission of failed packet or send the error to upper layers,
* */
void (*coex_error_cbk)(uint32_t error);
} extrnl_evnt_st_t;
#if(SUPPORT_COEXISTENCE || SUPPORT_GNRC_SCHDLR_IF)
/**
* @brief request duration extension of previous registered external generic event.
*
* @param evnt_hndl_t [in] : Event handle of registered event.
* @param updated_priority [in] : Updated priority of the event during new extend request.
* @param flxbl_req [in] : Flexible request flag,
* True: scheduler will try to extend duration with available duration up to requested deadline
* False: scheduler will try to extend duration with requested duration only (full requested duration or not)
* @param reqstd_deadline [in and out] : Pointer to new end time that the event request to extend the grant to it.
* It is also will be used as an output to report the given grant end time if the request is successfully accepted..
* @retval Status (0: SUCCESS, 0xXX: ERROR_CODE from @ref ble_stat_t).
*/
uint32_t evnt_schdlr_extend_gnrc_evnt_durn(ext_evnt_hndl_t evnt_hndl, extrnl_evnt_priority_e updated_priority,
uint8_t flxbl_req, uint64_t *reqstd_deadline);
/**
* @brief register external generic event.
* This function is used to register external generic event in event scheduler.all required information to schedule this event are contained in @ref p_extrnl_evnt_st parameter
* @param p_extrnl_evnt_st [in] : Pointer to external event structure.
* @retval evnt_hndl_t : The event handle of registered event.
* @retval NULL : means that the event is not registered.
*/
ext_evnt_hndl_t evnt_schdlr_rgstr_gnrc_evnt(extrnl_evnt_st_t* p_extrnl_evnt_st);
/**
* @brief un-register external generic/ onidle event.
* This function is used to remove external generic event from event scheduler.
* @param evnt_hndl [in] : Event handle of generic event to be removed from scheduler.
* @retval Status (0: SUCCESS, 0xXX: ERROR_CODE from @ref ble_stat_t).
*/
uint32_t evnt_schdlr_unrgstr_gnrc_evnt(ext_evnt_hndl_t evnt_hndl);
/**
* @brief register external on idle event.
*
* the external on idle event is low priority event that will be executed in scheduler idle time.
* if multiple on idle events are registered the scheduler will divide the idle on them in round robin manner.
* @note All parameters in in @ ref _extrnl_evnt_st_t will be ignored except ptr_priv parameter,
* as it will be passed to event started call back
* @note @ref evnt_strtd_cbk and @ref evnt_abortd_cbk pointers must not be NULL,
* as event scheduler will call evnt_abortd_cbk to stop current running on idle event
* if other higher event wants to access air while on idle event has grant to access it.
*
* @note There is no need to call this function more than once as the event scheduler
* stores the event and will call it every time it has a window to start on idle event
*
* @param p_extrnl_evnt_st [in] : Pointer to external event structure.
* @retval evnt_hndl_t : The event handle of registered event.
* @retval NULL : means that the event is not registered.
*/
ext_evnt_hndl_t evnt_schdlr_rgstr_on_idle_evnt(extrnl_evnt_st_t* p_extrnl_evnt_st);
#if SUPPORT_COEXISTENCE
/**
* @brief Disable aborting the on idle event given by the handle @ref on_idle_evnt_hdl. the user should call @ref evnt_schdlr_gnrc_evnt_cmplt after the event is completed
*
* @note the usage of this function should be limited to the cases where the event can't be aborted like MAC DTM. and the user should return the grant to scheduler as fast as possible.
* if this function is called where the event is granted, scheduler will ignore all other event till the grant is return to scheduler. it is not recommended to use this function
*
* @param on_idle_evnt_hdl [in] : handle of the on the idle event to disable aborting it
* @retval None
*/
void evnt_schdlr_disable_idle_abort(ext_evnt_hndl_t on_idle_evnt_hdl);
#endif /* SUPPORT_COEXISTENCE */
#endif /* (#if SUPPORT_COEXISTENCE || SUPPORT_GNRC_SCHDLR_IF) */
/**
* @brief external generic event complete.
*
* This function is used to return the grant back to event scheduler
* at the end of duration given at the started function from event scheduler @ref _extrnl_evnt_st_t for more info
*
* @param evnt_hndl_t [in] : Event handle of registered event.
* @retval Status (0: SUCCESS, 0xXX: ERROR_CODE from @ref ble_stat_t).
*/
uint32_t evnt_schdlr_gnrc_evnt_cmplt(ext_evnt_hndl_t evnt_hndl);
#if(SUPPORT_COEXISTENCE || SUPPORT_GNRC_SCHDLR_IF)
/**
* @brief Confirm the event currently has grant to access phy from event scheduler.
*
* @param evnt_hndl [in] : pointer of event scheduler handle.
* @retval 1: grant given.
* @retval 0: no grant given.
*/
uint8_t evnt_schdlr_confrm_grant(void * evnt_hndl);
#endif /* (SUPPORT_COEXISTENCE || SUPPORT_GNRC_SCHDLR_IF) */
#endif /* INCLUDE_EVNT_SCHDLR_IF_H */
/**
* @}
*/

View File

@@ -0,0 +1,234 @@
/*$Id: //dwh/bluetooth/DWC_ble154combo/firmware/rel/2.00a-lca04/firmware/public_inc/hci.h#1 $*/
/**
********************************************************************************
* @file hci.h
* @brief This file contains all the functions prototypes for the hci.h.
******************************************************************************
* This Synopsys DWC Bluetooth Low Energy Combo Link Layer/MAC software and
* associated documentation ( hereinafter the "Software") is an unsupported
* proprietary work of Synopsys, Inc. unless otherwise expressly agreed to in
* writing between Synopsys and you. The Software IS NOT an item of Licensed
* Software or a Licensed Product under any End User Software License Agreement
* or Agreement for Licensed Products with Synopsys or any supplement thereto.
* Synopsys is a registered trademark of Synopsys, Inc. Other names included in
* the SOFTWARE may be the trademarks of their respective owners.
*
* Synopsys MIT License:
* Copyright (c) 2020-Present Synopsys, Inc
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* the Software), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute,
* sublicense, and/or sell copies of the Software, and to permit persons to whom
* the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING, BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE ARISING FROM,
* OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* */
/** @defgroup hci_intf HCI Layer
* @ingroup BLE_STACK_API
* @brief Provide APIs to interface with HCI layer, like HCI layer initialization, allocation and free of HCI buffer header, process the received HCI command packet ...etc, HCI APIS are defined in hci.h header file.
* @{
*/
/* Define to prevnt recursive inclusion */
#ifndef INCLUDE_HCI_H
#define INCLUDE_HCI_H
/* Includes ---------------------------------------------------------------------*/
#include <stdint.h>
#include "bsp.h"
#include "ll_intf.h"
/* Exported Enumerations -----------------------------------------------------*/
/**
* @brief Enumeration holding the types of the returned commands in response
* to a received HCI command.
*/
typedef enum {
HCI_RETURN_COMMAND_TYPE_COMPLETE,
HCI_RETURN_COMMAND_TYPE_STATUS,
} hci_return_command_type;
/* Exported Defines -----------------------------------------------------------*/
typedef uint8_t (*hci_trnsprt_cbk)(
ble_buff_hdr_t *ptr_evnt_hdr);
/** @ingroup ext_hci_cmds External HCI Commands
* @{
*/
typedef ble_stat_t (*ble_ext_custm_cb_t) (uint16_t ocf, uint8_t *pckt_p, uint8_t *evnt_pckt_p, uint8_t* params_length, hci_return_command_type* return_command_type);
/**@}
*/
/* Exported functions ---------------------------------------------------------*/
/**
* @brief Initialize the HCI layer and Registers a callback function to the upper layer
*
* @param p_trnsprt_cbk : [in] callback function
*
* @retval always returns SUCCESS
*/
ble_stat_t ll_hci_init(
hci_trnsprt_cbk p_trnsprt_cbk);
/**
* @brief get a pointer to the HCI dispatch table.
*
* @param p_p_dispatch_tbl : [out] pointer to be filled by the address of the HCI dispatch table.
*/
void hci_get_dis_tbl(
const struct hci_dispatch_tbl** p_p_dispatch_tbl);
#if !SUPPORT_HCI_EVENT_ONLY || SUPPORT_HCI_EVENT_ONLY_TESTING
#if (SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION)
/**
* @brief Process the received ACL data packet from the host.
*
* @param ptr_buff_hdr : [in] Pointer to the HCI command packet.
*
* @retval ble_stat_t : Command status to be sent to the Host.
*/
ble_stat_t hci_rcvd_acl_data_pckt_hndlr(
ble_buff_hdr_t *ptr_buff_hdr);
#endif /* (SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION) */
#if ((SUPPORT_CONNECTED_ISOCHRONOUS && (SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION)) || (SUPPORT_BRD_ISOCHRONOUS))
/**
* @brief Process the received ISO data packet from the host.
*
* @param ptr_buff_hdr : [in] Pointer to the HCI command packet.
*
* @retval ble_stat_t : Command status to be sent to the Host.
*/
ble_stat_t hci_rcvd_iso_data_pckt_hndlr(
ble_buff_hdr_t *ptr_buff_hdr);
#endif /* ((SUPPORT_CONNECTED_ISOCHRONOUS && (SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION)) || SUPPORT_BRD_ISOCHRONOUS) */
/**
* @brief Process the received HCI command packet from the host.
*
* @param ptr_rcvd_pckt_strt : [in] Pointer to the HCI command packet.
* @param rcvd_pckt_len : [in] Length of the HCI command packet.
* @retval ble_stat_t : Command status to be sent to the Host.
*/
ble_stat_t hci_rcvd_cmd_pckt_hndlr(
uint8_t *ptr_rcvd_pckt_strt,
uint16_t rcvd_pckt_len);
#endif /* !SUPPORT_HCI_EVENT_ONLY || SUPPORT_HCI_EVENT_ONLY_TESTING */
/**
* @brief allocate a message structure to be sent to the HCI layer through event manager.
*
* @retval ble_buff_hdr_t* : pointer to the buffer header allocated.
*/
ble_buff_hdr_t* hci_alloc_msg(void);
/**
* @brief free an allocated message structure
*
* @param ptr_hci_msg : [in] Pointer to the message to be freed.
*/
void hci_free_msg(
ble_buff_hdr_t *ptr_hci_msg);
/**
* @}
*/
/** @ingroup ext_hci_cmds External HCI Commands
* @{
*/
/**
* @brief Registers a custom callback function to be called when the
* hci_cstm_pckt_hndlr() cannot resolve the OCF.
*
* @param ext_custm_cbk :[IN] Pointer to the callback function.
*
* @retval False if the cbk is null, True otherwise.
*/
uint8_t hci_rgstr_ble_external_custom_cbk(ble_ext_custm_cb_t ext_custm_cbk);
/**@}
*/
#if SUPPORT_HCI_EVENT_ONLY
/**
* @brief Initialize event manager data/events queue call backs
*
* @retval ble_stat_t None
*/
void hci_init_events_queues(void);
/**
* @brief Post data/event to appropriate queue. This function is called
* in case of sending data/events to host
*
* @param ptr_evnt_hdr data/event ble_buff_hdr to send
*
* @retval ble_stat_t None
*/
uint8_t hci_queue_send_pckt(ble_buff_hdr_t *ptr_evnt_hdr);
/*
* @brief register callback to be called sending data to host
* @param upper_layer_cbk: host callback
* @retval None
* */
void hci_rgstr_hst_cbk(hst_cbk cbk);
/*
* @brief register callback to be called on LL queue is full
* This function should be called at initialization
* @param cbk: host callback
* @retval None
* */
void hci_rgstr_hst_cbk_ll_queue_full(hst_cbk_queue_full cbk);
/*
* @brief sets the LE event mask in hci event only configuration
* @param event_mask : [In] an array of 8 bytes representing new event mask
* @retval: None
* */
void hci_ll_set_le_event_mask(uint8_t event_mask[8]);
/*
* @brief sets the event mask in hci event only configuration
* @param event_mask : [In] an array of 8 bytes representing new event mask
* @retval: None
* */
void hci_ll_set_event_mask(uint8_t event_mask[8]);
/*
* @brief sets the page 2 event mask in hci event only configuration
* @param event_mask : [In] an array of 8 bytes representing new event mask
* @retval: None
* */
void hci_ll_set_event_mask_page2(uint8_t event_mask[8]);
/*
* @brief sets the custom event mask in hci event only configuration
* @param cstm_evnt_mask : [In] custom event mask bitfield
* @retval: None
* */
void hci_ll_set_custom_event_mask(uint8_t cstm_evnt_mask);
#endif /* SUPPORT_HCI_EVENT_ONLY */
#endif /* INCLUDE_HCI_H */

View File

@@ -0,0 +1,243 @@
/*$Id: //dwh/bluetooth/DWC_ble154combo/firmware/rel/2.00a-lca04/firmware/public_inc/ll_error.h#1 $*/
/**
********************************************************************************
* @file error.h
* @brief This file contains error defines across BLE FW LL.
******************************************************************************
* This Synopsys DWC Bluetooth Low Energy Combo Link Layer/MAC software and
* associated documentation ( hereinafter the "Software") is an unsupported
* proprietary work of Synopsys, Inc. unless otherwise expressly agreed to in
* writing between Synopsys and you. The Software IS NOT an item of Licensed
* Software or a Licensed Product under any End User Software License Agreement
* or Agreement for Licensed Products with Synopsys or any supplement thereto.
* Synopsys is a registered trademark of Synopsys, Inc. Other names included in
* the SOFTWARE may be the trademarks of their respective owners.
*
* Synopsys MIT License:
* Copyright (c) 2020-Present Synopsys, Inc
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* the Software), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute,
* sublicense, and/or sell copies of the Software, and to permit persons to whom
* the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING, BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE ARISING FROM,
* OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef ERROR_H_
#define ERROR_H_
typedef enum _HW_ERROR_CODES
{
HW_ERROR_CODE_UNDEFINED_ERROR,
HW_ERROR_CODE_BL_SEARCH, /* this error code indicates an issue while searching in the HW Black list */
HW_ERROR_CODE_RL_SEARCH, /* this error code indicates an issue while searching in the HW Resolving list */
HW_ERROR_CODE_WL_SEARCH, /* this error code indicates an issue while searching in the HW White list */
HW_ERROR_CODE_PDU_PARSING, /* this error code indicates an issue while Parsing PDU */
HW_ERROR_CODE_PDU_RECEIVING, /* this error code indicates an unexpected PDU type received */
HW_ERROR_CODE_SM_UPDATE, /* this error code indicates an update in the state machine */
HW_ERROR_CODE_UNREGISTERING_EVENT, /* this error code indicates an issue while unregistering an event */
HW_ERROR_CODE_STARTING_CONNECTION, /* this error code indicates an issue while starting a connection */
HW_ERROR_CODE_MEMORY_EXCEEDED, /* this error code indicates an issue in allocating */
HW_ERROR_CODE_UNEXPECTED_ADV_STATE /* this error code indicates unexpected adv state */
}HW_ERROR_CODES;
/* Includes ---------------------------------------------------------------------*/
/* Exported Defines -----------------------------------------------------------*/
#ifndef SUCCESS
#define SUCCESS 0x00
#endif
#define UNKNOWN_HCI_COMMAND 0x01
#define UNKNOWN_CONNECTION_IDENTIF 0x02
#define HARDWARE_FAILURE 0x03
#define PAGE_TIMEOUT 0x04
#define AUTHENTICATION_FAILURE 0x05
#define PIN_OR_KEY_MISSING 0x06
#define MEMORY_CAPACITY_EXCEEDED 0x07
#define CONNECTION_TIMEOUT 0x08
#define CONNECTION_LIMIT_EXCEEDED 0x09
#define SYNCHRONOUS_CONNECTION_LIMIT_TO_A_DEVICE_EXCEEDED 0x0A
#define ACL_CONNECTION_ALREADY_EXISTS 0x0B
#define COMMAND_DISALLOWED 0x0C
#define CONNECTION_REJECTED_DUE_TO_LIMITED_RESOURCES 0x0D
#define CONNECTION_REJECTED_DUE_TO_SECURITY_REASONS 0x0E
#define CONNECTION_REJECTED_DUE_TO_UNACCEPTABLE_BD_ADDR 0x0F
#define CONNECTION_ACCEPT_TIMEOUT_EXCEEDED 0x10
#define UNSUPPORTED_FEATURE_OR_PARAMETER_VALUE 0x11
#define INVALID_HCI_COMMAND_PARAMETERS 0x12
#define REMOTE_USER_TERMINATED_CONNECTION 0x13
#define REMOTE_DEVICE_TERMINATED_CONNECTION_DUE_TO_LOW_RESOURCES 0x14
#define REMOTE_DEVICE_TERMINATED_CONNECTION_DUE_TO_POWER_OFF 0x15
#define CONNECTION_TERMINATED_BY_LOCAL_HOST 0x16
#define REPEATED_ATTEMPTS 0x17
#define PAIRING_NOT_ALLOWED 0x18
#define UNKNOWN_LMP_PDU 0x19
#define UNSUPPORTED_REMOTE_FEATURE 0x1A
#define SCO_OFFSET_REJECTED 0x1B
#define SCO_INTERVAL_REJECTED 0x1C
#define SCO_AIR_MODE_REJECTED 0x1D
#define INVALID_LMP_PARAMETERS_INVALID_LL_PARAMETERS 0x1E
#define UNSPECIFIED_ERROR 0x1F
#define UNSUPPORTED_LMP_PARAMETER_VALUE_UNSUPPORTED_LL_PARAMETER_VALUE 0x20
#define ROLE_CHANGE_NOT_ALLOWED 0x21
#define LMP_RESPONSE_TIMEOUT_LL_RESPONSE_TIMEOUT 0x22
#define LMP_ERROR_TRANSACTION_COLLISION 0x23
#define LMP_PDU_NOT_ALLOWED 0x24
#define ENCRYPTION_MODE_NOT_ACCEPTABLE 0x25
#define LINK_KEY_CANNOT_BE_CHANGED 0x26
#define REQUESTED_QOS_NOT_SUPPORTED 0x27
#define INSTANT_PASSED 0x28
#define PAIRING_WITH_UNIT_KEY_NOT_SUPPORTED 0x29
#define DIFFERENT_TRANSACTION_COLLISION 0x2A
#define RESERVED_FOR_FUTURE_1 0x2B
#define QOS_UNACCEPTABLE_PARAMETER 0x2C
#define QOS_REJECTED 0x2D
#define CHANNEL_ASSESSMENT_NOT_SUPPORTED 0x2E
#define INSUFFICIENT_SECURITY 0x2F
#define PARAMETER_OUT_OF_MANDATORY_RANGE 0x30
#define RESERVED_FOR_FUTURE_2 0x31
#define ROLE_SWITCH_PENDING 0x32
#define RESERVED_FOR_FUTURE_3 0x33
#define RESERVED_SLOT_VIOLATION 0x34
#define ROLE_SWITCH_FAILED 0x35
#define EXTENDED_INQUIRY_RESPONSE_TOO_LARGE 0x36
#define SECURE_SIMPLE_PAIRING_NOT_SUPPORTED_BY_HOST 0x37
#define HOST_BUSY_PAIRING 0x38
#define CONNECTION_REJECTED_DUE_TO_NO_SUITABLE_CHANNEL_FOUND 0x39
#define CONTROLLER_BUSY 0x3A
#define UNACCEPTABLE_CONNECTION_PARAMETERS 0x3B
#define DIRECTED_ADVERTISING_TIMEOUT 0x3C
#define CONNECTION_TERMINATED_DUE_TO_MIC_FAILURE 0x3D
#define CONNECTION_FAILED_TO_BE_ESTABLISHED 0x3E
#define SYNCHRONIZATION_TIMEOUT 0X3E
#define MAC_CONNECTION_FAILED 0x3F
#define COARSE_CLOCK_ADJUSTMENT_REJECTED_BUT_WILL_TRY_TO_ADJUST_USING_CLOCK_DRAGGING 0x40
#define UNKNOWN_ADVERTISING_IDENTIFIER 0x42
#define LIMIT_REACHED 0x43
#define OPERATION_CANCELLED_BY_HOST 0x44
#define PACKET_TOO_LONG 0x45
#define TOO_LATE 0x46
#define INSUFFICIENT_CHANNELS 0x48
#if SUPPORT_BLE
#if ((MAX_NUM_CNCRT_STAT_MCHNS > 1) && !((SUPPORT_MASTER_CONNECTION) || (SUPPORT_SLAVE_CONNECTION)||(SUPPORT_LE_EXTENDED_ADVERTISING)))
#error define at least either master or slave role
#endif
#if (SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION || SUPPORT_LE_EXTENDED_ADVERTISING) && (MAX_NUM_CNCRT_STAT_MCHNS == 0)
#error define at least one state machine in order to support slave or master role or extended advertising
#endif /* SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION */
#if ((SUPPORT_LE_ENCRYPTION) && (!SUPPORT_MASTER_CONNECTION && !SUPPORT_SLAVE_CONNECTION))
#error Encryption feature shall be enabled only when the master role or slave role is enabled
#endif /* #error */
#if ((SUPPORT_LE_PERIODIC_ADVERTISING) && (!SUPPORT_LE_EXTENDED_ADVERTISING))
#error Since controller supports periodic advertising feature, then it shall support Extended advertising feature
#endif /* #error */
#if (SUPPORT_PERIODIC_SYNC_TRANSFER && (!SUPPORT_MASTER_CONNECTION && !SUPPORT_SLAVE_CONNECTION))
#error Sending PAST IND shall be enabled only when the master role or slave role is enabled
#endif /* #error */
#if (SUPPORT_PERIODIC_SYNC_TRANSFER && (!SUPPORT_LE_PERIODIC_ADVERTISING))
#error Sending PAST IND shall be enabled only when the Periodic ADV is enabled
#endif /* #error */
#if ((SUPPORT_LE_POWER_CONTROL) && (!SUPPORT_MASTER_CONNECTION && !SUPPORT_SLAVE_CONNECTION))
#error LE Power Control feature shall be enabled only when the master role or slave role is enabled
#endif /* #error */
#if ((SUPPORT_AOA_AOD) && (!SUPPORT_MASTER_CONNECTION && !SUPPORT_SLAVE_CONNECTION && !SUPPORT_LE_PERIODIC_ADVERTISING))
#error CTE feature shall be enabled only when the master role or slave role or periodic advertising is enabled
#endif /* #error */
#if ((SUPPORT_BRD_ISOCHRONOUS || SUPPORT_SYNC_ISOCHRONOUS) && (!SUPPORT_LE_PERIODIC_ADVERTISING))
#error Broadcast Isochronous feature shall be enabled only when periodic advertisng is enabled
#endif /* #error */
#if ((SUPPORT_CONNECTED_ISOCHRONOUS) && (!SUPPORT_MASTER_CONNECTION && !SUPPORT_SLAVE_CONNECTION))
#error Connection Isochronous feature shall be enabled when at least one the master role or slave role is enabled
#endif /* #error */
#if (SUPPORT_PERIODIC_ADV_ADI && (!SUPPORT_LE_PERIODIC_ADVERTISING))
#error Periodic Advertising ADI feature shall be enabled only when periodic advertisng is enabled
#endif /* #error */
#if ((SUPPORT_CHANNEL_CLASSIFICATION) && (!SUPPORT_MASTER_CONNECTION && !SUPPORT_SLAVE_CONNECTION))
#error Channel Classification feature shall be enabled only when the master role or slave role is enabled
#endif /* #error */
#if (SUPPORT_LE_ENHANCED_CONN_UPDATE) && (!SUPPORT_MASTER_CONNECTION && !SUPPORT_SLAVE_CONNECTION)
#error "LE Enhanced Connection Update(subrating) enabled only if master or slave enabled"
#endif /* #error */
#if ((SUPPORT_CSSA) && (!SUPPORT_LE_EXTENDED_ADVERTISING))
#error If controller supports Code Scheme selection feature , then it shall support Extended advertising feature
#endif /* ((SUPPORT_CSSA) && (!SUPPORT_LE_EXTENDED_ADVERTISING)) */
#if ((SUPPORT_LE_PAWR_ADVERTISER_ROLE) && (!SUPPORT_PERIODIC_SYNC_TRANSFER || !SUPPORT_EXPLCT_BROADCASTER_ROLE))
#error PAWR feature shall be enabled only if PAST transmitter feature is enabled
#endif /* #error */
#if ((SUPPORT_LE_PAWR_SYNC_ROLE) && (!SUPPORT_PERIODIC_SYNC_TRANSFER || !SUPPORT_EXPLCT_OBSERVER_ROLE))
#error PAWR feature shall be enabled only if PAST recipient feature is enabled
#endif /* #error */
#if ((SUPPORT_FRAME_SPACE_UPDATE) && (!SUPPORT_MASTER_CONNECTION && !SUPPORT_SLAVE_CONNECTION))
#error Frame Space update feature shall be enabled only when the master role or slave role is enabled
#endif /* #error */
#if ((SUPPORT_FRAME_SPACE_UPDATE) && (!SUPPORT_EXT_FEATURE_SET))
#error Frame Space update feature shall be enabled only when the extended feature set is enabled.
#endif /* #error */
#if (SUPPORT_CHANNEL_SOUNDING && (!SUPPORT_MASTER_CONNECTION && !SUPPORT_SLAVE_CONNECTION))
#error Channel Sounding feature can be enabled only if the master role or slave role is enabled
#endif /* #error */
#if (SUPPORT_EXT_FEATURE_SET && (!SUPPORT_MASTER_CONNECTION && !SUPPORT_SLAVE_CONNECTION))
#error Extended Feature Set Exchange feature can be enabled only if the master role or slave role is enabled
#endif /* #error */
#if ((SUPPORT_LE_ADVERTISERS_MONITORING) && (!SUPPORT_EXPLCT_OBSERVER_ROLE))
#error Advertisers Monitoring feature can be enabled when the device is an observer.
#endif /* ((SUPPORT_LE_ADVERTISERS_MONITORING) && (!SUPPORT_EXPLCT_OBSERVER_ROLE)) */
#if defined(PHY_40nm_2_00_a_tc)
#error "PHY_40nm_2_00_a_tc is not supported by the current FW version"
#endif /* PHY_40nm_2_00_a_tc */
#if (SUPPORT_DYNAMIC_PREEMPH_COEFF && CTE_DEGRADATION_API_PHY_SUPPORT)
#error "Dynamic Preemphasis coefficients feature cannot be enabled while the CTE degradation API is enabled"
#endif /* SUPPORT_DYNAMIC_PREEMPH_COEFF && CTE_DEGRADATION_API_PHY_SUPPORT */
#if (defined(RTL_VER_7) ^ defined(PHY_40nm_3_60_a_tc_new_demod)) && defined(snps_ble_demo)
#error "Configuration error: RTL_VER_7 and PHY_40nm_3_60_a_tc_new_demod must be defined together or not at all"
#endif /*(defined(RTL_VER_7) && (!defined(PHY_40nm_3_60_a_tc_new_demod)))*/
/* Exported macros ------------------------------------------------------------*/
/* Exported types -------------------------------------------------------------*/
/* Exported functions ---------------------------------------------------------*/
#endif /* SUPPORT_BLE */
#endif /* ERROR_H_ */
/******************* (C) (C) COPYRIGHT 2025 SYNOPSYS, INC. *****END OF FILE****/

View File

@@ -0,0 +1,178 @@
/*$Id: //dwh/bluetooth/DWC_ble154combo/firmware/rel/2.00a-lca04/firmware/public_inc/ll_intf_cmn.h#1 $*/
/**
********************************************************************************
* @file ll_intf_cmn.h
* @brief This file includes declaration of common interfaces of MAC only and BLE/COEXISTENCE APIs.
******************************************************************************
* This Synopsys DWC Bluetooth Low Energy Combo Link Layer/MAC software and
* associated documentation ( hereinafter the "Software") is an unsupported
* proprietary work of Synopsys, Inc. unless otherwise expressly agreed to in
* writing between Synopsys and you. The Software IS NOT an item of Licensed
* Software or a Licensed Product under any End User Software License Agreement
* or Agreement for Licensed Products with Synopsys or any supplement thereto.
* Synopsys is a registered trademark of Synopsys, Inc. Other names included in
* the SOFTWARE may be the trademarks of their respective owners.
*
* Synopsys MIT License:
* Copyright (c) 2020-Present Synopsys, Inc
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* the Software), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute,
* sublicense, and/or sell copies of the Software, and to permit persons to whom
* the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING, BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE ARISING FROM,
* OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* */
#ifndef INCLUDE_LL_INTF_CMN_H_
#define INCLUDE_LL_INTF_CMN_H_
#include "common_types.h"
/*========================================================================================================*/
/*================================ Configure LL Context Control Command =================================*/
/*========================================================================================================*/
/** @ingroup ll_common_interface_functions
* @{
*/
/**
* @brief Configure the LL contexts, where:
* 1. For bare-metal:
* - High ISR is executed in the ISR context
* - Low ISR can be executed in the high ISR context, or switched to low ISR context
* 2. For RTOS:
* - High ISR is executed in the ISR context
* - Low ISR is executed in the thread of the "linkLayerHighPrioTask"
*
* @param[in] allow_low_isr : Configuration parameter for the context of the low ISR in the bare-metal model. Range is [0,1].
* 0: Low ISR code is executed in the same context of the high ISR.
* 1: Low ISR code is executed in the context of the low ISR (by configuring a low priority interrupt that is triggered by FW).
* @param[in] run_post_evnt_frm_isr : Configuration parameter to decide whether the scheduling of the next BLE event is done in the low ISR context or to be handled by the LL main thread. Range is [0,1].
* 0: BLE next event scheduling is handled in the LL main thread.
* 1: BLE next event scheduling is handled in the low ISR context.
* @return Command status
*/
ble_stat_t ll_intf_cmn_config_ll_ctx_params(uint8_t allow_low_isr, uint8_t run_post_evnt_frm_isr);
/*========================================================================================================*/
/*================================== LE Select Sleep Clock Source =======================================*/
/*========================================================================================================*/
#if (USE_NON_ACCURATE_32K_SLEEP_CLK)
/**
* @brief Select the source that drives the sleep clock, whether to use an external crystal oscillator or an integrated RC oscillator (RCO).
*
* @param[in] slp_clk_src : Indicate which source to drive the sleep clock. 0: Crystal Oscillator (default). 1: RC0
* @param[out] ptr_slp_clk_freq_value : Indicate the nominal frequency value of the sleep clock.
* @return Command status to be sent to the Host.
*/
ble_stat_t ll_intf_cmn_le_select_slp_clk_src(uint8_t slp_clk_src, uint16_t *ptr_slp_clk_freq_value);
/*========================================================================================================*/
/*=============================== LE Set RCO Calibration Event Parameters ===============================*/
/*========================================================================================================*/
/**
* @brief Configure the runtime RCO calibration event parameters.
*
* @param[in] rco_clbr_event_duration : Indicate the number of sleep clock cycles for performing the RCO calibration process.
* @param[in] rco_clbr_event_interval : Indicate the periodicity of running the runtime RCO calibration event.
* @return Command status to be sent to the Host.
*/
ble_stat_t ll_intf_cmn_le_set_rco_clbr_evnt_params(uint8_t rco_clbr_event_duration, uint32_t rco_clbr_event_interval);
#endif
/*========================================================================================================*/
/*====================================== LE Select TX_Power Table =======================================*/
/*========================================================================================================*/
/**
* @brief Specify the used power table and its size based on the selected TX_Power table ID.
*
* @param[in] tx_power_table_id : Selected TX_Power table ID.
* @return Status : 0: SUCCESS. Otherwise: Error code.
*/
uint8_t ll_intf_cmn_select_tx_power_table(uint8_t tx_power_table_id);
/**
* @brief flag to the LL the existence of a temperature sensor
*
*/
void ll_intf_cmn_set_temperature_sensor_state(void);
/**
* @brief Set the current temperature
*
* @param[in] temperature : The current temperature
* @return Command status
*/
ble_stat_t ll_intf_cmn_set_temperature_value(uint32_t temperature);
/*========================================================================================================*/
/*==================================== Random Number Generation Group ===================================*/
/*========================================================================================================*/
/**
* @brief Request new random number.
*
* @param[out] ptr_rnd : Pointer to the output random bytes .
* @param[in] len : Number of required random bytes.
*
* @return Status.
*/
uint32_t ll_intf_cmn_gen_rnd_num(uint8_t *ptr_rnd, uint32_t len);
/**
* @brief A common wrapper for BLE-ECB and MAC-CCM security modes
*
* @param[in] ptr_pckt : Pointer to the data buffer (variable length in case of CCM mode, 16 bytes in case of ECB mode).
* The resulting Encrypted/Decrypted data overwrites this buffer.
* @param[in] ptr_key : Pointer to the security key buffer (16 bytes).
* @param[in] ptr_nonce : Pointer to the security nonce buffer (13 bytes in case of CCM mode, a Null pointer in case of ECB mode).
* @param[in] mic_len : Length of MIC, supported values are 0, 4, 6, 8, 10, 12, 14, and 16 in case of CCM, 0 only in case of ECB.
* @param[in] ad_len : Length of Data to be authenticated.
* @param[in] md_len : Length of Data to be encrypted.
* @param[in] key_endian : Represents the format of the security key.
* @param[in] data_endian : Represents the endian format of the data.
* @param[in] security_mode : Hardware security mode.
* @return Status
*/
uint32_t ll_intf_cmn_crypto(uint8_t *ptr_pckt, const uint8_t *ptr_key,
uint8_t *ptr_nonce, uint32_t mic_len, uint32_t ad_len, uint32_t md_len,
crypto_endian_enum_t key_endian, crypto_endian_enum_t data_endian,
security_mode_enum_t security_mode);
/*=============== LL Common Interface LE Set Deep Sleep Mode ===============*/
/**
* @brief Switches the controller to and from Deep Sleep mode.
*
* @param[in] dp_slp_mode : Input according to dpslp_state_e.
* DEEP_SLEEP_ENABLE -> Activate Deep Sleep.
* DEEP_SLEEP_DISABLE -> Deactivate Deep Sleep.
* @return Status.
*/
ble_stat_t ll_intf_cmn_le_set_dp_slp_mode(uint8_t dp_slp_mode);
#if SUPPORT_CONFIGURABLE_GAIN_FIX
/**
* @brief Initialize RSSI gain fix region and select resistor measured
* percentage that affects pre-emphasis sequence.
*
* @param[in] region_0x1f_val : Absolute gain fix for region 0x1F in dbm.
* @param[in] region_0x0f_val : Absolute gain fix for region 0x0F in dbm.
* @param[in] region_0x0b_val : Absolute gain fix for region 0x0B in dbm.
* @param[in] region_0x09_val : Absolute gain fix for region 0x09 in dbm.
* @param[in] r_msur_percent : Percentage of the measured resistor value that will be used
* to select the update values in pre-emphasis sequence (range: 0 to 99).
*/
void ll_intf_cmn_gain_fix_init(
uint8_t region_0x1f_val, uint8_t region_0x0f_val,
uint8_t region_0x0b_val, uint8_t region_0x09_val,
uint8_t r_msur_percent);
#endif /* SUPPORT_CONFIGURABLE_GAIN_FIX */
/*=============== Set PHY Calibration Period =================*/
/**
* @brief Set PHY calibration period.
*
* @param[in] phy_clbr_evnt_period : Indicate the periodicity of the PHY calibration event. Periodicity = phy_clbr_evnt_period * 1s.
* @param[in] phy_clbr_evnt_count : Indicate the number of the PHY calibration events to be executed.
*/
void ll_intf_cmn_set_phy_clbr_period(uint32_t phy_clbr_evnt_period, uint32_t phy_clbr_evnt_count);
/** @}
*/
#endif /* INCLUDE_LL_INTF_CMN_H_ */

View File

@@ -0,0 +1,118 @@
/*$Id: //dwh/bluetooth/DWC_ble154combo/firmware/rel/2.00a-lca04/firmware/public_inc/mem_intf.h#1 $*/
/**
********************************************************************************
* @file mem_intf.h
* @brief This file contains all the functions prototypes for the mem_intf.c.
******************************************************************************
* This Synopsys DWC Bluetooth Low Energy Combo Link Layer/MAC software and
* associated documentation ( hereinafter the "Software") is an unsupported
* proprietary work of Synopsys, Inc. unless otherwise expressly agreed to in
* writing between Synopsys and you. The Software IS NOT an item of Licensed
* Software or a Licensed Product under any End User Software License Agreement
* or Agreement for Licensed Products with Synopsys or any supplement thereto.
* Synopsys is a registered trademark of Synopsys, Inc. Other names included in
* the SOFTWARE may be the trademarks of their respective owners.
*
* Synopsys MIT License:
* Copyright (c) 2020-Present Synopsys, Inc
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* the Software), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute,
* sublicense, and/or sell copies of the Software, and to permit persons to whom
* the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING, BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE ARISING FROM,
* OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef MEM_INTF_H
#define MEM_INTF_H
/* Includes ------------------------------------------------------------------*/
#include <stdint.h>
/* Defination ----------------------------------------------------------------*/
/* Exported variables ------------------------------------------------------- */
/* Exported types ------------------------------------------------------------*/
/* Exported macros -----------------------------------------------------------*/
/* Exported types ------------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
/** @addtogroup Memory_Interface_Exported_Functions
* @{
*/
/**
* @brief Coping memory from position to another.
* @param ptr_dstntion : pointer to the destination array where the content is to be copied.
* @param ptr_src : pointer to the source of data to be copied.
* @param n : the number of bytes to be copied.
* @retval pointer to destination.
*/
void *ble_memcpy(
void *ptr_dstntion,
const void *ptr_src,
uint16_t n);
/**
* @brief Setting a certian block of memory with a certain value.
* @param ptr_mem : pointer to the block of memory to fill.
* @param value : the value to be set. The value is passed as an int.
* @param n : the number of bytes to be set to the value.
* @retval pointer to destination.
*/
void *ble_memset(
void *ptr_mem,
uint8_t value,
uint16_t n);
/**
* @brief comparing a certain block of memory with another.
* @param ptr_dstntion : pointer to the destination array where the content is to be compared.
* @param ptr_src : pointer to the source of data to be compared.
* @param n : the number of bytes to be compared.
* @retval < 0 ptr_dstntion is less than ptr_src.
* > 0 ptr_src is less than ptr_dstntion.
* 0 ptr_dstntion is equal to ptr_src.
*/
int8_t ble_memcmp(
const void *ptr_dstntion,
const void *ptr_src,
uint16_t n);
/**
* @brief Moving memory from position to another.
* @param ptr_dstntion : pointer to the destination array where the content is to be moved.
* @param ptr_src : pointer to the source of data to be moved.
* @param n : the number of bytes to be moved.
* @retval pointer to destination.
*/
void *ble_memmov(
void *ptr_dstntion,
const void *ptr_src,
uint16_t n);
/**
* @brief Coping n bytes of memory from position to another.
* @param destination : pointer to the destination array where the content is to be copied.
* @param source : pointer to the source of data to be copied.
* @param num_bytes : the number of bytes to be copied.
* @param keep_endian : flag to keep or change the endian
* @retval pointer to destination.
*/
void ble_memcpy_n_bytes(uint8_t *destination,
const uint8_t *source, uint8_t num_bytes, uint8_t keep_endian);
/**
* @}
*/
#endif /* MEM_INTF_H */

View File

@@ -0,0 +1,506 @@
/*$Id: //dwh/bluetooth/DWC_ble154combo/firmware/rel/2.00a-lca04/firmware/public_inc/os_wrapper.h#1 $*/
/**
********************************************************************************
* @file os_wrapper.h
* @brief Wrapper header for OS porting
******************************************************************************
* This Synopsys DWC Bluetooth Low Energy Combo Link Layer/MAC software and
* associated documentation ( hereinafter the "Software") is an unsupported
* proprietary work of Synopsys, Inc. unless otherwise expressly agreed to in
* writing between Synopsys and you. The Software IS NOT an item of Licensed
* Software or a Licensed Product under any End User Software License Agreement
* or Agreement for Licensed Products with Synopsys or any supplement thereto.
* Synopsys is a registered trademark of Synopsys, Inc. Other names included in
* the SOFTWARE may be the trademarks of their respective owners.
*
* Synopsys MIT License:
* Copyright (c) 2020-Present Synopsys, Inc
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* the Software), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute,
* sublicense, and/or sell copies of the Software, and to permit persons to whom
* the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING, BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE ARISING FROM,
* OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* */
/* Define to prevent recursive inclusion */
#ifndef INCLUDE_OS_WRAPPER_H_
#define INCLUDE_OS_WRAPPER_H_
#include "stdint.h"
/********************* Macros **********************************/
#define POOL_BLOCK_SIZE 16
#define POOL_TOTAL_BLOCKS_SIZE 10
#define POOL_INDEX_SIZE 6
/* Exported Defines -----------------------------------------------------------*/
#define os_Pool_Def(type) \
os_pool_def_t os_pool_##type
#define os_Pool(type) \
&os_pool_##type
#define os_Pool_Def_extern(type) \
extern os_pool_def_t os_pool_##type
/* Exported macros ------------------------------------------------------------*/
/* Exported types -------------------------------------------------------------*/
/**
* @brief Interrupt status.
*/
typedef enum int_state {
NOT_ACTIVE,
LINK_LAYER_INTRPT,
LINK_LAYER_LOW_PRIORITY_INTRPT,
UART_READ_INTRPT,
UART_WRITE_INTRPT,
TIMER_INTRPT,
MAC_INTRPT,
TOTAL_INTERRUPTS
} int_state_e;
/**
* @brief Priority used for thread control.
*/
typedef enum {
os_priority_high,
os_priority_normal,
os_priority_low,
} os_priority;
/**
* @brief SW Timer Activity Status.
*/
typedef enum _sw_timer_activity_status_e {
SW_TIMER_NOT_ACTIVE = 0x00,
SW_TIMER_ACTIVE = 0x01,
SW_TIMER_MAY_BE_NOT_ACTIVE = 0x02
} sw_timer_activity_status_e;
/**
* @brief SW Timer Type.
*/
typedef enum {
os_timer_once = 0, ///< one-shot timer
os_timer_periodic = 1 ///< repeating timer
} os_timer_type;
/**
* @brief SW Timer Priority.
*/
typedef enum {
lw_prio_tmr = 0, // Low Priority Timer
hg_prio_tmr = 1 // High Priority Timer
} os_timer_prio;
/**
* @brief Software Timer State Active, Expired or Stopped
*/
typedef enum {
osTimerActive, /**< @brief Active timer : Timer in the list waiting for its time to fire */
osTimerExpired, /**< @brief Expired timer: Timer fired and removed form the list, or created and not exist in the list */
osTimerStopped /**< @brief Stopped timer: Timer stopped and removed form the list */
} os_timer_state;
// Thread Management
typedef void (*os_pthread) (void const *argument);
typedef void* os_thread_id;
// Timer Management
typedef void (*t_timer_callbk)(const void*);
typedef void* os_timer_id;
typedef void (*os_timer_activity_cb_t)(sw_timer_activity_status_e timer_activity);
typedef struct sw_timer sw_timer_t;
// Mutex Management
typedef void os_mutex_def_t;
typedef void * os_mutex_id;
// Semaphore Management
typedef void os_semaphore_def_t;
typedef void * os_semaphore_id;
/**
* @brief Software Timer structure.
*/
struct sw_timer {
sw_timer_t *stnext; /**< @brief Next timer in the timers list. */
uint32_t vtime; /**< @brief value of timer */
uint32_t rtime; /**< @brief remain time. */
t_timer_callbk ptimer; /**< @brief Timer callback function pointer. */
void *argument; /**< @brief Timer callback function arguments. */
uint16_t overflow_flag : 1;
uint16_t frac_time : 5; /** < @brief fraction time of period [0:31] in terms of us */
uint16_t cycles : 5; /** < @brief cycles [0:31] number of elapsed cycles of periodic timer */
uint16_t rem_time : 5; /** < @brief remainder to be added to the fraction [0:31] in terms of us */
uint8_t state; /**< @brief Timer State : Active or Expired or Stopped */
uint8_t type:1 ; /**< @brief Timer Type : one-shot (0) or periodic (1) */
uint8_t prio:1 ; /* used to indicate if this timer ISR should be handled from hg isr in case of allow_lw_isr==1 */
};
/**
* @brief Memory Block Structure
*/
typedef struct _mem_blck_t {
/* 8 bits | 8 bits | 8 bits | 8 bits *
* Free memory chunk flag | sub-pool number | reserved | handle_id */
uint32_t flag;
struct _mem_blck_t * next;
} mem_blck_t;
/**
* @brief Memory Pool Block Structure
*/
typedef struct {
uint32_t blck_size : POOL_BLOCK_SIZE; /* block size */
uint32_t total_blcks : POOL_TOTAL_BLOCKS_SIZE; /* total number of blocks */
uint32_t indx : POOL_INDEX_SIZE; /* pool index (sub-pool number) */
mem_blck_t* next_blck; /* next free block */
} os_pool_def_t;
/* Exported functions ---------------------------------------------------------*/
/**
* @brief Creates a thread
*
* @param thread Pointer to a function to be executed by the thread
* @param name Thread's name
* @param pri Thread's priority
* @param argu Arguments to be passed to the function executed by the thread
* @param stack_size Thread stack size
*
* @retval Handle of the created task
*/
os_thread_id os_thread_create(
os_pthread thread,
char* name,
os_priority pri,
void* argu,
uint32_t stack_size);
/**
* @brief Registers an interrupt function corresponding to the passed interrupt ID
*
* @param ptr_int_hndlr Interrupt function
* @param int_id Interrupt ID
*/
void intr_hndlr_reg(
void (*ptr_int_hndlr)(void),
int_state_e int_id);
/**
* @brief initialize function to to os_wrapper
*/
void os_wrapper_init(void);
/**
* @brief reset function to os_wrapper component
*/
void os_wrapper_reset(void);
/**
* @brief initialize timer function
*/
void os_timer_init(void);
/**
* @brief initialize timer function
*/
void os_timer_reset(void);
/** @ingroup SW_TIMER
* @{
*/
/**
* @brief create a new timer
*
* @param p_callbk pointer to the call_back function.
* @param type os_timer_once for one-shot or os_timer_periodic for periodic behavior.
* @param argument argument to the timer call back function.
*
* @retval timer ID for reference by other functions or NULL in case of error.
*/
void* os_timer_create(
t_timer_callbk p_callbk,
os_timer_type type,
void *argument);
/**
* @brief set the timer priority
*
* @param timer id
* @param tmr_prio: the new priority of the timer in case of allow_lw_isr==1
*
* @retval None
*/
void os_timer_set_prio(os_timer_id timer_id ,
os_timer_prio tmr_prio);
/**
* @brief get the timer priority
*
* @retval get the priority of the SW timers head
*/
uint8_t os_timer_is_any_near_sw_timer_hg_prio(void);
/**
* @brief start a running timer.
*
* @param timer_id timer Id.
* @param steps number of steps in 31.25 us resolution
*
* @retval error code.
*/
int32_t os_timer_start(
os_timer_id timer_id,
uint32_t steps);
/**
* @brief start a running timer.
*
* @param timer_id timer Id.
* @param time_us time in us
*
* @retval error code.
*/
int32_t os_timer_start_in_us(
os_timer_id timer_id,
uint32_t time_us);
/**
* @brief stop a running timer.
*
* @param timer_id timer Id.
*
* @retval error code.
*/
int32_t os_timer_stop(
os_timer_id timer_id);
/**
* @brief free an allocated timer.
*
* @param timer_id timer Id.
*
* @retval error code.
*/
int32_t os_timer_free(
os_timer_id timer_id);
/**
* @brief Stop the timer if it is running and delete it.
*
* @param ptr_timer_id pointer to the timer ID obtained by os_timer_create.
*
* @retval status code that indicates the execution status of the function.
*/
int32_t os_timer_stop_free(
os_timer_id *ptr_timer_id);
/**
* @brief Stop the timer if it is running and start it with the new value.
*
* @param timer timer ID obtained by \ref os_timer_create.
* @param steps steps to set the timer with.
*
* @retval status code that indicates the execution status of the function.
*/
int32_t os_timer_set(
os_timer_id timer,
uint32_t steps);
/**
* @brief get the starte of the timer.
*
* @param timer_id timer Id.
*
* @retval os_timer_state. Active , Expired, or stopped
*/
os_timer_state os_get_tmr_state(
os_timer_id timer_id);
/**@}
* *
*/
/**
* @brief Get the number of active SW timers.
*
* @retval active_sw_timers_num: The number of currently active SW timers
*/
uint32_t os_timer_get_active_sw_timers_number(void);
/**
* @brief Register a callback function to show whether the timer is in use or not.
*
* @param cbk : [in] Callback function.
*/
void os_timer_rgstr_timer_activity_cbk(
os_timer_activity_cb_t cbk);
/**
* @brief Gets the remaining time of the first time set to fire, if exists
*
* @retval Remaining time. 0 if no timers exist.
*/
uint64_t os_timer_get_earliest_time(void);
/**
* @brief This function calls the proper handling based on the incming interrupt
*
* @param intrpt_fired current interrupt to be served.
*/
void os_process_isr(
int_state_e intrpt_fired);
/**
* @ingroup os_wrappers
* @{
*/
/**
* @brief disables system Interrupts
*/
void os_disable_isr(void);
/**
* @brief enables system Interrupts, the imp. should respect the nested disable calls
*/
void os_enable_isr(void);
// ==== Mutex Management ====
/**
* @brief create a new recursive mutex
*
* @retval handle to the created mutex
*/
os_mutex_id os_rcrsv_mutex_create(void);
/**
* @brief Wait until a mutex becames available
*
* @param mutex_id mutex id.
* @param millisec time-out value, 0 for no time-out.
*
* @retval status code , 0 for success
*/
int32_t os_rcrsv_mutex_wait(
os_mutex_id mutex_id,
uint32_t millisec);
/**
* @brief Release a mutex
*
* @param mutex_id mutex id.
*
* @retval status code, 0 for success
*/
int32_t os_rcrsv_mutex_release(
os_mutex_id mutex_id);
// ==== Semaphore Management Functions ====
/**
* @brief Create and initialize a semaphore
*
* @param max_count The max value to which the semaphore can count.
* @param initial_count initial value assigned to the count.
*
* @retval semaphore id for reference
*/
os_semaphore_id os_semaphore_create(
int32_t max_count,
int32_t initial_count);
/**
* @brief Wait until a semaphore becomes available
*
* @param semaphore_id semaphore id.
* @param millisec time-out value, 0 for no time-out.
*
* @retval status code, 0 for success
*/
int32_t os_semaphore_wait(
os_semaphore_id semaphore_id,
uint32_t millisec);
/**
* @brief Release a semaphore
*
* @param semaphore_id semaphore id.
*
* @retval status code, 0 for success
*/
int32_t os_semaphore_release(
os_semaphore_id semaphore_id);
/**
* @brief Release an ISR semaphore
*
* @param semaphore_id semaphore id.
*
* @retval status code, 0 for success
*/
int32_t os_semaphore_release_isr(
os_semaphore_id semaphore_id);
/**
* @}
*/
/* ==== Memory Pool Management Functions ==== */
/**
* @brief Allocates from the passed memory pool
*
* @param pool Pointer to the pool to allocate from
*
* @retval Pointer at the allocated block
*/
void * os_mem_pool_alloc(
os_pool_def_t * pool);
/**
* @brief Frees from the passed memory pool
*
* @param block Pointer at the block that will be freed
*/
void os_mem_pool_free(
void *block);
/**
* @brief Allocates from the shared memory pool
*
* @param pool Pointer to the pool to allocate from
*
* @retval Pointer at the allocated block
*/
void* os_shrd_mem_alloc(
os_pool_def_t * pool);
/**
* @fn uint8_t os_wrapper_is_rtos_used()
*
* @brief This function used to detect whether RTOS configuration is enabled or not.
* @param None.
* @return is_rtos_enabled : TRUE: RTOS enabled. FALSE: otherwise
*/
uint8_t os_wrapper_is_rtos_used(void);
#endif /* INCLUDE_CONN_MNGR_H_ */

View File

@@ -0,0 +1,768 @@
/*$Id: //dwh/bluetooth/DWC_ble154combo/firmware/rel/2.00a-lca04/firmware/public_inc/ot_inc/crypto.h#1 $*/
/*
* Copyright (c) 2021, The OpenThread Authors.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/**
* @file
* @brief
* This file includes the platform abstraction for Crypto operations.
*/
#ifndef OPENTHREAD_PLATFORM_CRYPTO_H_
#define OPENTHREAD_PLATFORM_CRYPTO_H_
#include <stdint.h>
#include <stdlib.h>
#include "error.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @addtogroup plat-crypto
*
* @brief
* This module includes the platform abstraction for Crypto.
*
* @{
*
*/
/**
* Defines the key types.
*
*/
typedef enum
{
OT_CRYPTO_KEY_TYPE_RAW, ///< Key Type: Raw Data.
OT_CRYPTO_KEY_TYPE_AES, ///< Key Type: AES.
OT_CRYPTO_KEY_TYPE_HMAC, ///< Key Type: HMAC.
OT_CRYPTO_KEY_TYPE_ECDSA, ///< Key Type: ECDSA.
} otCryptoKeyType;
/**
* Defines the key algorithms.
*
*/
typedef enum
{
OT_CRYPTO_KEY_ALG_VENDOR, ///< Key Algorithm: Vendor Defined.
OT_CRYPTO_KEY_ALG_AES_ECB, ///< Key Algorithm: AES ECB.
OT_CRYPTO_KEY_ALG_HMAC_SHA_256, ///< Key Algorithm: HMAC SHA-256.
OT_CRYPTO_KEY_ALG_ECDSA, ///< Key Algorithm: ECDSA.
} otCryptoKeyAlgorithm;
/**
* Defines the key usage flags.
*
*/
enum
{
OT_CRYPTO_KEY_USAGE_NONE = 0, ///< Key Usage: Key Usage is empty.
OT_CRYPTO_KEY_USAGE_EXPORT = 1 << 0, ///< Key Usage: Key can be exported.
OT_CRYPTO_KEY_USAGE_ENCRYPT = 1 << 1, ///< Key Usage: Encryption (vendor defined).
OT_CRYPTO_KEY_USAGE_DECRYPT = 1 << 2, ///< Key Usage: AES ECB.
OT_CRYPTO_KEY_USAGE_SIGN_HASH = 1 << 3, ///< Key Usage: Sign Hash.
OT_CRYPTO_KEY_USAGE_VERIFY_HASH = 1 << 4, ///< Key Usage: Verify Hash.
};
/**
* Defines the key storage types.
*
*/
typedef enum
{
OT_CRYPTO_KEY_STORAGE_VOLATILE, ///< Key Persistence: Key is volatile.
OT_CRYPTO_KEY_STORAGE_PERSISTENT, ///< Key Persistence: Key is persistent.
} otCryptoKeyStorage;
/**
* This datatype represents the key reference.
*
*/
typedef uint32_t otCryptoKeyRef;
/**
* @struct otCryptoKey
*
* Represents the Key Material required for Crypto operations.
*
*/
typedef struct otCryptoKey
{
const uint8_t *mKey; ///< Pointer to the buffer containing key. NULL indicates to use `mKeyRef`.
uint16_t mKeyLength; ///< The key length in bytes (applicable when `mKey` is not NULL).
uint32_t mKeyRef; ///< The PSA key ref (requires `mKey` to be NULL).
} otCryptoKey;
/**
* @struct otCryptoContext
*
* Stores the context object for platform APIs.
*
*/
typedef struct otCryptoContext
{
void *mContext; ///< Pointer to the context.
uint16_t mContextSize; ///< The length of the context in bytes.
} otCryptoContext;
/**
* Length of SHA256 hash (in bytes).
*
*/
#define OT_CRYPTO_SHA256_HASH_SIZE 32
/**
* @struct otPlatCryptoSha256Hash
*
* Represents a SHA-256 hash.
*
*/
OT_TOOL_PACKED_BEGIN
struct otPlatCryptoSha256Hash
{
uint8_t m8[OT_CRYPTO_SHA256_HASH_SIZE]; ///< Hash bytes.
} OT_TOOL_PACKED_END;
/**
* Represents a SHA-256 hash.
*
*/
typedef struct otPlatCryptoSha256Hash otPlatCryptoSha256Hash;
/**
* Max buffer size (in bytes) for representing the EDCSA key-pair in DER format.
*
*/
#define OT_CRYPTO_ECDSA_MAX_DER_SIZE 125
/**
* @struct otPlatCryptoEcdsaKeyPair
*
* Represents an ECDSA key pair (public and private keys).
*
* The key pair is stored using Distinguished Encoding Rules (DER) format (per RFC 5915).
*
*/
typedef struct otPlatCryptoEcdsaKeyPair
{
uint8_t mDerBytes[OT_CRYPTO_ECDSA_MAX_DER_SIZE];
uint8_t mDerLength;
} otPlatCryptoEcdsaKeyPair;
/**
* Buffer size (in bytes) for representing the EDCSA public key.
*
*/
#define OT_CRYPTO_ECDSA_PUBLIC_KEY_SIZE 64
/**
* @struct otPlatCryptoEcdsaPublicKey
*
* Represents a ECDSA public key.
*
* The public key is stored as a byte sequence representation of an uncompressed curve point (RFC 6605 - sec 4).
*
*/
OT_TOOL_PACKED_BEGIN
struct otPlatCryptoEcdsaPublicKey
{
uint8_t m8[OT_CRYPTO_ECDSA_PUBLIC_KEY_SIZE];
} OT_TOOL_PACKED_END;
typedef struct otPlatCryptoEcdsaPublicKey otPlatCryptoEcdsaPublicKey;
/**
* Buffer size (in bytes) for representing the EDCSA signature.
*
*/
#define OT_CRYPTO_ECDSA_SIGNATURE_SIZE 64
/**
* @struct otPlatCryptoEcdsaSignature
*
* Represents an ECDSA signature.
*
* The signature is encoded as the concatenated binary representation of two MPIs `r` and `s` which are calculated
* during signing (RFC 6605 - section 4).
*
*/
OT_TOOL_PACKED_BEGIN
struct otPlatCryptoEcdsaSignature
{
uint8_t m8[OT_CRYPTO_ECDSA_SIGNATURE_SIZE];
} OT_TOOL_PACKED_END;
typedef struct otPlatCryptoEcdsaSignature otPlatCryptoEcdsaSignature;
/**
* Max PBKDF2 SALT length: salt prefix (6) + extended panid (8) + network name (16)
*
*/
#define OT_CRYPTO_PBDKF2_MAX_SALT_SIZE 30
/**
* Initialize the Crypto module.
*
*/
void otPlatCryptoInit(void);
/**
* Import a key into PSA ITS.
*
* @param[in,out] aKeyRef Pointer to the key ref to be used for crypto operations.
* @param[in] aKeyType Key Type encoding for the key.
* @param[in] aKeyAlgorithm Key algorithm encoding for the key.
* @param[in] aKeyUsage Key Usage encoding for the key (combinations of `OT_CRYPTO_KEY_USAGE_*`).
* @param[in] aKeyPersistence Key Persistence for this key
* @param[in] aKey Actual key to be imported.
* @param[in] aKeyLen Length of the key to be imported.
*
* @retval OT_ERROR_NONE Successfully imported the key.
* @retval OT_ERROR_FAILED Failed to import the key.
* @retval OT_ERROR_INVALID_ARGS @p aKey was set to NULL.
*
* @note If OT_CRYPTO_KEY_STORAGE_PERSISTENT is passed for aKeyPersistence then @p aKeyRef is input and platform
* should use the given aKeyRef and MUST not change it.
*
* If OT_CRYPTO_KEY_STORAGE_VOLATILE is passed for aKeyPersistence then @p aKeyRef is output, the initial
* value does not matter and platform API MUST update it to return the new key ref.
*
* This API is only used by OT core when `OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE` is enabled.
*
*/
otError otPlatCryptoImportKey(otCryptoKeyRef *aKeyRef,
otCryptoKeyType aKeyType,
otCryptoKeyAlgorithm aKeyAlgorithm,
int aKeyUsage,
otCryptoKeyStorage aKeyPersistence,
const uint8_t *aKey,
size_t aKeyLen);
/**
* Export a key stored in PSA ITS.
*
* @param[in] aKeyRef The key ref to be used for crypto operations.
* @param[out] aBuffer Pointer to the buffer where key needs to be exported.
* @param[in] aBufferLen Length of the buffer passed to store the exported key.
* @param[out] aKeyLen Pointer to return the length of the exported key.
*
* @retval OT_ERROR_NONE Successfully exported @p aKeyRef.
* @retval OT_ERROR_FAILED Failed to export @p aKeyRef.
* @retval OT_ERROR_INVALID_ARGS @p aBuffer was NULL
*
* @note This API is only used by OT core when `OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE` is enabled.
*
*/
otError otPlatCryptoExportKey(otCryptoKeyRef aKeyRef, uint8_t *aBuffer, size_t aBufferLen, size_t *aKeyLen);
/**
* Destroy a key stored in PSA ITS.
*
* @param[in] aKeyRef The key ref to be destroyed
*
* @retval OT_ERROR_NONE Successfully destroyed the key.
* @retval OT_ERROR_FAILED Failed to destroy the key.
*
* @note This API is only used by OT core when `OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE` is enabled.
*
*/
otError otPlatCryptoDestroyKey(otCryptoKeyRef aKeyRef);
/**
* Check if the key ref passed has an associated key in PSA ITS.
*
* @param[in] aKeyRef The Key Ref to check.
*
* @retval TRUE There is an associated key with @p aKeyRef.
* @retval FALSE There is no associated key with @p aKeyRef.
*
* @note This API is only used by OT core when `OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE` is enabled.
*
*/
bool otPlatCryptoHasKey(otCryptoKeyRef aKeyRef);
/**
* Initialize the HMAC operation.
*
* @param[in] aContext Context for HMAC operation.
*
* @retval OT_ERROR_NONE Successfully initialized HMAC operation.
* @retval OT_ERROR_FAILED Failed to initialize HMAC operation.
* @retval OT_ERROR_INVALID_ARGS @p aContext was NULL
*
* @note The platform driver shall point the context to the correct object such as psa_mac_operation_t or
* mbedtls_md_context_t.
*
*/
otError otPlatCryptoHmacSha256Init(otCryptoContext *aContext);
/**
* Uninitialize the HMAC operation.
*
* @param[in] aContext Context for HMAC operation.
*
* @retval OT_ERROR_NONE Successfully uninitialized HMAC operation.
* @retval OT_ERROR_FAILED Failed to uninitialized HMAC operation.
* @retval OT_ERROR_INVALID_ARGS @p aContext was NULL
*
*/
otError otPlatCryptoHmacSha256Deinit(otCryptoContext *aContext);
/**
* Start HMAC operation.
*
* @param[in] aContext Context for HMAC operation.
* @param[in] aKey Key material to be used for HMAC operation.
*
* @retval OT_ERROR_NONE Successfully started HMAC operation.
* @retval OT_ERROR_FAILED Failed to start HMAC operation.
* @retval OT_ERROR_INVALID_ARGS @p aContext or @p aKey was NULL
*
*/
otError otPlatCryptoHmacSha256Start(otCryptoContext *aContext, const otCryptoKey *aKey);
/**
* Update the HMAC operation with new input.
*
* @param[in] aContext Context for HMAC operation.
* @param[in] aBuf A pointer to the input buffer.
* @param[in] aBufLength The length of @p aBuf in bytes.
*
* @retval OT_ERROR_NONE Successfully updated HMAC with new input operation.
* @retval OT_ERROR_FAILED Failed to update HMAC operation.
* @retval OT_ERROR_INVALID_ARGS @p aContext or @p aBuf was NULL
*
*/
otError otPlatCryptoHmacSha256Update(otCryptoContext *aContext, const void *aBuf, uint16_t aBufLength);
/**
* Complete the HMAC operation.
*
* @param[in] aContext Context for HMAC operation.
* @param[out] aBuf A pointer to the output buffer.
* @param[in] aBufLength The length of @p aBuf in bytes.
*
* @retval OT_ERROR_NONE Successfully completed HMAC operation.
* @retval OT_ERROR_FAILED Failed to complete HMAC operation.
* @retval OT_ERROR_INVALID_ARGS @p aContext or @p aBuf was NULL
*
*/
otError otPlatCryptoHmacSha256Finish(otCryptoContext *aContext, uint8_t *aBuf, size_t aBufLength);
/**
* Initialise the AES operation.
*
* @param[in] aContext Context for AES operation.
*
* @retval OT_ERROR_NONE Successfully Initialised AES operation.
* @retval OT_ERROR_FAILED Failed to Initialise AES operation.
* @retval OT_ERROR_INVALID_ARGS @p aContext was NULL
* @retval OT_ERROR_NO_BUFS Cannot allocate the context.
*
* @note The platform driver shall point the context to the correct object such as psa_key_id
* or mbedtls_aes_context_t.
*
*/
otError otPlatCryptoAesInit(otCryptoContext *aContext);
/**
* Set the key for AES operation.
*
* @param[in] aContext Context for AES operation.
* @param[out] aKey Key to use for AES operation.
*
* @retval OT_ERROR_NONE Successfully set the key for AES operation.
* @retval OT_ERROR_FAILED Failed to set the key for AES operation.
* @retval OT_ERROR_INVALID_ARGS @p aContext or @p aKey was NULL
*
*/
otError otPlatCryptoAesSetKey(otCryptoContext *aContext, const otCryptoKey *aKey);
/**
* Encrypt the given data.
*
* @param[in] aContext Context for AES operation.
* @param[in] aInput Pointer to the input buffer.
* @param[in] aOutput Pointer to the output buffer.
*
* @retval OT_ERROR_NONE Successfully encrypted @p aInput.
* @retval OT_ERROR_FAILED Failed to encrypt @p aInput.
* @retval OT_ERROR_INVALID_ARGS @p aContext or @p aKey or @p aOutput were NULL
*
*/
otError otPlatCryptoAesEncrypt(otCryptoContext *aContext, const uint8_t *aInput, uint8_t *aOutput);
/**
* Free the AES context.
*
* @param[in] aContext Context for AES operation.
*
* @retval OT_ERROR_NONE Successfully freed AES context.
* @retval OT_ERROR_FAILED Failed to free AES context.
* @retval OT_ERROR_INVALID_ARGS @p aContext was NULL
*
*/
otError otPlatCryptoAesFree(otCryptoContext *aContext);
/**
* Initialise the HKDF context.
*
* @param[in] aContext Context for HKDF operation.
*
* @retval OT_ERROR_NONE Successfully Initialised AES operation.
* @retval OT_ERROR_FAILED Failed to Initialise AES operation.
* @retval OT_ERROR_INVALID_ARGS @p aContext was NULL
*
* @note The platform driver shall point the context to the correct object such as psa_key_derivation_operation_t
* or HmacSha256::Hash
*
*/
otError otPlatCryptoHkdfInit(otCryptoContext *aContext);
/**
* Perform HKDF Expand step.
*
* @param[in] aContext Operation context for HKDF operation.
* @param[in] aInfo Pointer to the Info sequence.
* @param[in] aInfoLength Length of the Info sequence.
* @param[out] aOutputKey Pointer to the output Key.
* @param[in] aOutputKeyLength Size of the output key buffer.
*
* @retval OT_ERROR_NONE HKDF Expand was successful.
* @retval OT_ERROR_FAILED HKDF Expand failed.
* @retval OT_ERROR_INVALID_ARGS @p aContext was NULL
*
*/
otError otPlatCryptoHkdfExpand(otCryptoContext *aContext,
const uint8_t *aInfo,
uint16_t aInfoLength,
uint8_t *aOutputKey,
uint16_t aOutputKeyLength);
/**
* Perform HKDF Extract step.
*
* @param[in] aContext Operation context for HKDF operation.
* @param[in] aSalt Pointer to the Salt for HKDF.
* @param[in] aSaltLength Length of Salt.
* @param[in] aInputKey Pointer to the input key.
*
* @retval OT_ERROR_NONE HKDF Extract was successful.
* @retval OT_ERROR_FAILED HKDF Extract failed.
*
*/
otError otPlatCryptoHkdfExtract(otCryptoContext *aContext,
const uint8_t *aSalt,
uint16_t aSaltLength,
const otCryptoKey *aInputKey);
/**
* Uninitialize the HKDF context.
*
* @param[in] aContext Context for HKDF operation.
*
* @retval OT_ERROR_NONE Successfully un-initialised HKDF operation.
* @retval OT_ERROR_FAILED Failed to un-initialised HKDF operation.
* @retval OT_ERROR_INVALID_ARGS @p aContext was NULL
*
*/
otError otPlatCryptoHkdfDeinit(otCryptoContext *aContext);
/**
* Initialise the SHA-256 operation.
*
* @param[in] aContext Context for SHA-256 operation.
*
* @retval OT_ERROR_NONE Successfully initialised SHA-256 operation.
* @retval OT_ERROR_FAILED Failed to initialise SHA-256 operation.
* @retval OT_ERROR_INVALID_ARGS @p aContext was NULL
*
*
* @note The platform driver shall point the context to the correct object such as psa_hash_operation_t
* or mbedtls_sha256_context.
*/
otError otPlatCryptoSha256Init(otCryptoContext *aContext);
/**
* Uninitialize the SHA-256 operation.
*
* @param[in] aContext Context for SHA-256 operation.
*
* @retval OT_ERROR_NONE Successfully un-initialised SHA-256 operation.
* @retval OT_ERROR_FAILED Failed to un-initialised SHA-256 operation.
* @retval OT_ERROR_INVALID_ARGS @p aContext was NULL
*
*/
otError otPlatCryptoSha256Deinit(otCryptoContext *aContext);
/**
* Start SHA-256 operation.
*
* @param[in] aContext Context for SHA-256 operation.
*
* @retval OT_ERROR_NONE Successfully started SHA-256 operation.
* @retval OT_ERROR_FAILED Failed to start SHA-256 operation.
* @retval OT_ERROR_INVALID_ARGS @p aContext was NULL
*
*/
otError otPlatCryptoSha256Start(otCryptoContext *aContext);
/**
* Update SHA-256 operation with new input.
*
* @param[in] aContext Context for SHA-256 operation.
* @param[in] aBuf A pointer to the input buffer.
* @param[in] aBufLength The length of @p aBuf in bytes.
*
* @retval OT_ERROR_NONE Successfully updated SHA-256 with new input operation.
* @retval OT_ERROR_FAILED Failed to update SHA-256 operation.
* @retval OT_ERROR_INVALID_ARGS @p aContext or @p aBuf was NULL
*
*/
otError otPlatCryptoSha256Update(otCryptoContext *aContext, const void *aBuf, uint16_t aBufLength);
/**
* Finish SHA-256 operation.
*
* @param[in] aContext Context for SHA-256 operation.
* @param[in] aHash A pointer to the output buffer, where hash needs to be stored.
* @param[in] aHashSize The length of @p aHash in bytes.
*
* @retval OT_ERROR_NONE Successfully completed the SHA-256 operation.
* @retval OT_ERROR_FAILED Failed to complete SHA-256 operation.
* @retval OT_ERROR_INVALID_ARGS @p aContext or @p aHash was NULL
*
*/
otError otPlatCryptoSha256Finish(otCryptoContext *aContext, uint8_t *aHash, uint16_t aHashSize);
/**
* Initialize cryptographically-secure pseudorandom number generator (CSPRNG).
*
*/
void otPlatCryptoRandomInit(void);
/**
* Deinitialize cryptographically-secure pseudorandom number generator (CSPRNG).
*
*/
void otPlatCryptoRandomDeinit(void);
/**
* Fills a given buffer with cryptographically secure random bytes.
*
* @param[out] aBuffer A pointer to a buffer to fill with the random bytes.
* @param[in] aSize Size of buffer (number of bytes to fill).
*
* @retval OT_ERROR_NONE Successfully filled buffer with random values.
* @retval OT_ERROR_FAILED Operation failed.
*
*/
otError otPlatCryptoRandomGet(uint8_t *aBuffer, uint16_t aSize);
/**
* Generate and populate the output buffer with a new ECDSA key-pair.
*
* @param[out] aKeyPair A pointer to an ECDSA key-pair structure to store the generated key-pair.
*
* @retval OT_ERROR_NONE A new key-pair was generated successfully.
* @retval OT_ERROR_NO_BUFS Failed to allocate buffer for key generation.
* @retval OT_ERROR_NOT_CAPABLE Feature not supported.
* @retval OT_ERROR_FAILED Failed to generate key-pair.
*
*/
otError otPlatCryptoEcdsaGenerateKey(otPlatCryptoEcdsaKeyPair *aKeyPair);
/**
* Get the associated public key from the input context.
*
* @param[in] aKeyPair A pointer to an ECDSA key-pair structure where the key-pair is stored.
* @param[out] aPublicKey A pointer to an ECDSA public key structure to store the public key.
*
* @retval OT_ERROR_NONE Public key was retrieved successfully, and @p aBuffer is updated.
* @retval OT_ERROR_PARSE The key-pair DER format could not be parsed (invalid format).
* @retval OT_ERROR_INVALID_ARGS The @p aContext is NULL.
*
*/
otError otPlatCryptoEcdsaGetPublicKey(const otPlatCryptoEcdsaKeyPair *aKeyPair, otPlatCryptoEcdsaPublicKey *aPublicKey);
/**
* Calculate the ECDSA signature for a hashed message using the private key from the input context.
*
* Uses the deterministic digital signature generation procedure from RFC 6979.
*
* @param[in] aKeyPair A pointer to an ECDSA key-pair structure where the key-pair is stored.
* @param[in] aHash A pointer to a SHA-256 hash structure where the hash value for signature calculation
* is stored.
* @param[out] aSignature A pointer to an ECDSA signature structure to output the calculated signature.
*
* @retval OT_ERROR_NONE The signature was calculated successfully, @p aSignature was updated.
* @retval OT_ERROR_PARSE The key-pair DER format could not be parsed (invalid format).
* @retval OT_ERROR_NO_BUFS Failed to allocate buffer for signature calculation.
* @retval OT_ERROR_INVALID_ARGS The @p aContext is NULL.
*
*/
otError otPlatCryptoEcdsaSign(const otPlatCryptoEcdsaKeyPair *aKeyPair,
const otPlatCryptoSha256Hash *aHash,
otPlatCryptoEcdsaSignature *aSignature);
/**
* Use the key from the input context to verify the ECDSA signature of a hashed message.
*
* @param[in] aPublicKey A pointer to an ECDSA public key structure where the public key for signature
* verification is stored.
* @param[in] aHash A pointer to a SHA-256 hash structure where the hash value for signature verification
* is stored.
* @param[in] aSignature A pointer to an ECDSA signature structure where the signature value to be verified is
* stored.
*
* @retval OT_ERROR_NONE The signature was verified successfully.
* @retval OT_ERROR_SECURITY The signature is invalid.
* @retval OT_ERROR_INVALID_ARGS The key or hash is invalid.
* @retval OT_ERROR_NO_BUFS Failed to allocate buffer for signature verification.
*
*/
otError otPlatCryptoEcdsaVerify(const otPlatCryptoEcdsaPublicKey *aPublicKey,
const otPlatCryptoSha256Hash *aHash,
const otPlatCryptoEcdsaSignature *aSignature);
/**
* Calculate the ECDSA signature for a hashed message using the Key reference passed.
*
* Uses the deterministic digital signature generation procedure from RFC 6979.
*
* @param[in] aKeyRef Key Reference to the slot where the key-pair is stored.
* @param[in] aHash A pointer to a SHA-256 hash structure where the hash value for signature calculation
* is stored.
* @param[out] aSignature A pointer to an ECDSA signature structure to output the calculated signature.
*
* @retval OT_ERROR_NONE The signature was calculated successfully, @p aSignature was updated.
* @retval OT_ERROR_PARSE The key-pair DER format could not be parsed (invalid format).
* @retval OT_ERROR_NO_BUFS Failed to allocate buffer for signature calculation.
* @retval OT_ERROR_INVALID_ARGS The @p aContext is NULL.
*
* @note This API is only used by OT core when `OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE` is enabled.
*
*/
otError otPlatCryptoEcdsaSignUsingKeyRef(otCryptoKeyRef aKeyRef,
const otPlatCryptoSha256Hash *aHash,
otPlatCryptoEcdsaSignature *aSignature);
/**
* Get the associated public key from the key reference passed.
*
* The public key is stored differently depending on the crypto backend library being used
* (OPENTHREAD_CONFIG_CRYPTO_LIB).
*
* This API must make sure to return the public key as a byte sequence representation of an
* uncompressed curve point (RFC 6605 - sec 4)
*
* @param[in] aKeyRef Key Reference to the slot where the key-pair is stored.
* @param[out] aPublicKey A pointer to an ECDSA public key structure to store the public key.
*
* @retval OT_ERROR_NONE Public key was retrieved successfully, and @p aBuffer is updated.
* @retval OT_ERROR_PARSE The key-pair DER format could not be parsed (invalid format).
* @retval OT_ERROR_INVALID_ARGS The @p aContext is NULL.
*
* @note This API is only used by OT core when `OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE` is enabled.
*
*/
otError otPlatCryptoEcdsaExportPublicKey(otCryptoKeyRef aKeyRef, otPlatCryptoEcdsaPublicKey *aPublicKey);
/**
* Generate and import a new ECDSA key-pair at reference passed.
*
* @param[in] aKeyRef Key Reference to the slot where the key-pair is stored.
*
* @retval OT_ERROR_NONE A new key-pair was generated successfully.
* @retval OT_ERROR_NO_BUFS Failed to allocate buffer for key generation.
* @retval OT_ERROR_NOT_CAPABLE Feature not supported.
* @retval OT_ERROR_FAILED Failed to generate key-pair.
*
* @note This API is only used by OT core when `OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE` is enabled.
*
*/
otError otPlatCryptoEcdsaGenerateAndImportKey(otCryptoKeyRef aKeyRef);
/**
* Use the keyref to verify the ECDSA signature of a hashed message.
*
* @param[in] aKeyRef Key Reference to the slot where the key-pair is stored.
* @param[in] aHash A pointer to a SHA-256 hash structure where the hash value for signature verification
* is stored.
* @param[in] aSignature A pointer to an ECDSA signature structure where the signature value to be verified is
* stored.
*
* @retval OT_ERROR_NONE The signature was verified successfully.
* @retval OT_ERROR_SECURITY The signature is invalid.
* @retval OT_ERROR_INVALID_ARGS The key or hash is invalid.
* @retval OT_ERROR_NO_BUFS Failed to allocate buffer for signature verification.
*
* @note This API is only used by OT core when `OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE` is enabled.
*
*/
otError otPlatCryptoEcdsaVerifyUsingKeyRef(otCryptoKeyRef aKeyRef,
const otPlatCryptoSha256Hash *aHash,
const otPlatCryptoEcdsaSignature *aSignature);
/**
* Perform PKCS#5 PBKDF2 using CMAC (AES-CMAC-PRF-128).
*
* @param[in] aPassword Password to use when generating key.
* @param[in] aPasswordLen Length of password.
* @param[in] aSalt Salt to use when generating key.
* @param[in] aSaltLen Length of salt.
* @param[in] aIterationCounter Iteration count.
* @param[in] aKeyLen Length of generated key in bytes.
* @param[out] aKey A pointer to the generated key.
*
* @retval OT_ERROR_NONE A new key-pair was generated successfully.
* @retval OT_ERROR_NO_BUFS Failed to allocate buffer for key generation.
* @retval OT_ERROR_NOT_CAPABLE Feature not supported.
* @retval OT_ERROR_FAILED Failed to generate key.
*/
otError otPlatCryptoPbkdf2GenerateKey(const uint8_t *aPassword,
uint16_t aPasswordLen,
const uint8_t *aSalt,
uint16_t aSaltLen,
uint32_t aIterationCounter,
uint16_t aKeyLen,
uint8_t *aKey);
/**
* @}
*
*/
#ifdef __cplusplus
} // end of extern "C"
#endif
#endif // OPENTHREAD_PLATFORM_CRYPTO_H_

View File

@@ -0,0 +1,273 @@
/*$Id: //dwh/bluetooth/DWC_ble154combo/firmware/rel/2.00a-lca04/firmware/public_inc/ot_inc/error.h#1 $*/
/*
* Copyright (c) 2016, The OpenThread Authors.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/**
* @file
* @brief
* This file defines the errors used in the OpenThread.
*/
#ifndef OPENTHREAD_ERROR_H_
#define OPENTHREAD_ERROR_H_
#include "toolchain.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @addtogroup api-error
*
* @brief
* This module includes error definitions used in OpenThread.
*
* @{
*
*/
/**
* Represents error codes used throughout OpenThread.
*
*/
typedef enum OT_MUST_USE_RESULT otError
{
/**
* No error.
*/
OT_ERROR_NONE = 0,
/**
* Operational failed.
*/
OT_ERROR_FAILED = 1,
/**
* Message was dropped.
*/
OT_ERROR_DROP = 2,
/**
* Insufficient buffers.
*/
OT_ERROR_NO_BUFS = 3,
/**
* No route available.
*/
OT_ERROR_NO_ROUTE = 4,
/**
* Service is busy and could not service the operation.
*/
OT_ERROR_BUSY = 5,
/**
* Failed to parse message.
*/
OT_ERROR_PARSE = 6,
/**
* Input arguments are invalid.
*/
OT_ERROR_INVALID_ARGS = 7,
/**
* Security checks failed.
*/
OT_ERROR_SECURITY = 8,
/**
* Address resolution requires an address query operation.
*/
OT_ERROR_ADDRESS_QUERY = 9,
/**
* Address is not in the source match table.
*/
OT_ERROR_NO_ADDRESS = 10,
/**
* Operation was aborted.
*/
OT_ERROR_ABORT = 11,
/**
* Function or method is not implemented.
*/
OT_ERROR_NOT_IMPLEMENTED = 12,
/**
* Cannot complete due to invalid state.
*/
OT_ERROR_INVALID_STATE = 13,
/**
* No acknowledgment was received after macMaxFrameRetries (IEEE 802.15.4-2006).
*/
OT_ERROR_NO_ACK = 14,
/**
* A transmission could not take place due to activity on the channel, i.e., the CSMA-CA mechanism has failed
* (IEEE 802.15.4-2006).
*/
OT_ERROR_CHANNEL_ACCESS_FAILURE = 15,
/**
* Not currently attached to a Thread Partition.
*/
OT_ERROR_DETACHED = 16,
/**
* FCS check failure while receiving.
*/
OT_ERROR_FCS = 17,
/**
* No frame received.
*/
OT_ERROR_NO_FRAME_RECEIVED = 18,
/**
* Received a frame from an unknown neighbor.
*/
OT_ERROR_UNKNOWN_NEIGHBOR = 19,
/**
* Received a frame from an invalid source address.
*/
OT_ERROR_INVALID_SOURCE_ADDRESS = 20,
/**
* Received a frame filtered by the address filter (allowlisted or denylisted).
*/
OT_ERROR_ADDRESS_FILTERED = 21,
/**
* Received a frame filtered by the destination address check.
*/
OT_ERROR_DESTINATION_ADDRESS_FILTERED = 22,
/**
* The requested item could not be found.
*/
OT_ERROR_NOT_FOUND = 23,
/**
* The operation is already in progress.
*/
OT_ERROR_ALREADY = 24,
/**
* The creation of IPv6 address failed.
*/
OT_ERROR_IP6_ADDRESS_CREATION_FAILURE = 26,
/**
* Operation prevented by mode flags
*/
OT_ERROR_NOT_CAPABLE = 27,
/**
* Coap response or acknowledgment or DNS, SNTP response not received.
*/
OT_ERROR_RESPONSE_TIMEOUT = 28,
/**
* Received a duplicated frame.
*/
OT_ERROR_DUPLICATED = 29,
/**
* Message is being dropped from reassembly list due to timeout.
*/
OT_ERROR_REASSEMBLY_TIMEOUT = 30,
/**
* Message is not a TMF Message.
*/
OT_ERROR_NOT_TMF = 31,
/**
* Received a non-lowpan data frame.
*/
OT_ERROR_NOT_LOWPAN_DATA_FRAME = 32,
/**
* The link margin was too low.
*/
OT_ERROR_LINK_MARGIN_LOW = 34,
/**
* Input (CLI) command is invalid.
*/
OT_ERROR_INVALID_COMMAND = 35,
/**
* Special error code used to indicate success/error status is pending and not yet known.
*
*/
OT_ERROR_PENDING = 36,
/**
* Request rejected.
*/
OT_ERROR_REJECTED = 37,
/**
* The number of defined errors.
*/
OT_NUM_ERRORS,
/**
* Generic error (should not use).
*/
OT_ERROR_GENERIC = 255,
} otError;
/**
* Converts an otError enum into a string.
*
* @param[in] aError An otError enum.
*
* @returns A string representation of an otError.
*
*/
const char *otThreadErrorToString(otError aError);
/**
* @}
*
*/
#ifdef __cplusplus
} // extern "C"
#endif
#endif // OPENTHREAD_ERROR_H_

View File

@@ -0,0 +1,349 @@
/*$Id: //dwh/bluetooth/DWC_ble154combo/firmware/rel/2.00a-lca04/firmware/public_inc/ot_inc/instance.h#1 $*/
/*
* Copyright (c) 2016, The OpenThread Authors.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/**
* @file
* @brief
* This file defines the OpenThread Instance API.
*/
#ifndef OPENTHREAD_INSTANCE_H_
#define OPENTHREAD_INSTANCE_H_
#include <stdlib.h>
#include "error.h"
#include "logging.h"
#include "toolchain.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* The OpenThread API monotonic version number.
*
* This number MUST increase by one each time the contents of public OpenThread API include headers change.
*
* @note This number versions both OpenThread platform and user APIs.
*
*/
#define OPENTHREAD_API_VERSION (420)
/**
* @addtogroup api-instance
*
* @brief
* This module includes functions that control the OpenThread Instance.
*
* @{
*
*/
/**
* Represents the OpenThread instance structure.
*/
typedef struct otInstance otInstance;
/**
* Initializes the OpenThread library.
*
* Initializes OpenThread and prepares it for subsequent OpenThread API calls. This function must be
* called before any other calls to OpenThread.
*
* Is available and can only be used when support for multiple OpenThread instances is enabled.
*
* @param[in] aInstanceBuffer The buffer for OpenThread to use for allocating the otInstance structure.
* @param[in,out] aInstanceBufferSize On input, the size of aInstanceBuffer. On output, if not enough space for
* otInstance, the number of bytes required for otInstance.
*
* @returns A pointer to the new OpenThread instance.
*
* @sa otInstanceFinalize
*
*/
otInstance *otInstanceInit(void *aInstanceBuffer, size_t *aInstanceBufferSize);
/**
* Initializes the static single instance of the OpenThread library.
*
* Initializes OpenThread and prepares it for subsequent OpenThread API calls. This function must be
* called before any other calls to OpenThread.
*
* Is available and can only be used when support for multiple OpenThread instances is disabled.
*
* @returns A pointer to the single OpenThread instance.
*
*/
otInstance *otInstanceInitSingle(void);
/**
* Initializes the OpenThread instance.
*
* This function initializes OpenThread and prepares it for subsequent OpenThread API calls. This function must be
* called before any other calls to OpenThread. This method utilizes static buffer to initialize the OpenThread
* instance.
*
* This function is available and can only be used when support for multiple OpenThread static instances is
* enabled (`OPENTHREAD_CONFIG_MULTIPLE_STATIC_INSTANCE_ENABLE`)
*
* @param[in] aIdx The index of the OpenThread instance to initialize.
*
* @returns A pointer to the new OpenThread instance.
*
*/
otInstance *otInstanceInitMultiple(uint8_t aIdx);
/**
* Gets the instance identifier.
*
* The instance identifier is set to a random value when the instance is constructed, and then its value will not
* change after initialization.
*
* @returns The instance identifier.
*
*/
uint32_t otInstanceGetId(otInstance *aInstance);
/**
* Indicates whether or not the instance is valid/initialized.
*
* The instance is considered valid if it is acquired and initialized using either `otInstanceInitSingle()` (in single
* instance case) or `otInstanceInit()` (in multi instance case). A subsequent call to `otInstanceFinalize()` causes
* the instance to be considered as uninitialized.
*
* @param[in] aInstance A pointer to an OpenThread instance.
*
* @returns TRUE if the given instance is valid/initialized, FALSE otherwise.
*
*/
bool otInstanceIsInitialized(otInstance *aInstance);
/**
* Disables the OpenThread library.
*
* Call this function when OpenThread is no longer in use.
*
* @param[in] aInstance A pointer to an OpenThread instance.
*
*/
void otInstanceFinalize(otInstance *aInstance);
/**
* Returns the current instance uptime (in msec).
*
* Requires `OPENTHREAD_CONFIG_UPTIME_ENABLE` to be enabled.
*
* The uptime is given as number of milliseconds since OpenThread instance was initialized.
*
* @param[in] aInstance A pointer to an OpenThread instance.
*
* @returns The uptime (number of milliseconds).
*
*/
uint64_t otInstanceGetUptime(otInstance *aInstance);
#define OT_UPTIME_STRING_SIZE 24 ///< Recommended size for string representation of uptime.
/**
* Returns the current instance uptime as a human-readable string.
*
* Requires `OPENTHREAD_CONFIG_UPTIME_ENABLE` to be enabled.
*
* The string follows the format "<hh>:<mm>:<ss>.<mmmm>" for hours, minutes, seconds and millisecond (if uptime is
* shorter than one day) or "<dd>d.<hh>:<mm>:<ss>.<mmmm>" (if longer than a day).
*
* If the resulting string does not fit in @p aBuffer (within its @p aSize characters), the string will be truncated
* but the outputted string is always null-terminated.
*
* @param[in] aInstance A pointer to an OpenThread instance.
* @param[out] aBuffer A pointer to a char array to output the string.
* @param[in] aSize The size of @p aBuffer (in bytes). Recommended to use `OT_UPTIME_STRING_SIZE`.
*
*/
void otInstanceGetUptimeAsString(otInstance *aInstance, char *aBuffer, uint16_t aSize);
#define OT_CHANGED_IP6_ADDRESS_ADDED (1U << 0) ///< IPv6 address was added
#define OT_CHANGED_IP6_ADDRESS_REMOVED (1U << 1) ///< IPv6 address was removed
#define OT_CHANGED_THREAD_ROLE (1U << 2) ///< Role (disabled, detached, child, router, leader) changed
#define OT_CHANGED_THREAD_LL_ADDR (1U << 3) ///< The link-local address changed
#define OT_CHANGED_THREAD_ML_ADDR (1U << 4) ///< The mesh-local address changed
#define OT_CHANGED_THREAD_RLOC_ADDED (1U << 5) ///< RLOC was added
#define OT_CHANGED_THREAD_RLOC_REMOVED (1U << 6) ///< RLOC was removed
#define OT_CHANGED_THREAD_PARTITION_ID (1U << 7) ///< Partition ID changed
#define OT_CHANGED_THREAD_KEY_SEQUENCE_COUNTER (1U << 8) ///< Thread Key Sequence changed
#define OT_CHANGED_THREAD_NETDATA (1U << 9) ///< Thread Network Data changed
#define OT_CHANGED_THREAD_CHILD_ADDED (1U << 10) ///< Child was added
#define OT_CHANGED_THREAD_CHILD_REMOVED (1U << 11) ///< Child was removed
#define OT_CHANGED_IP6_MULTICAST_SUBSCRIBED (1U << 12) ///< Subscribed to a IPv6 multicast address
#define OT_CHANGED_IP6_MULTICAST_UNSUBSCRIBED (1U << 13) ///< Unsubscribed from a IPv6 multicast address
#define OT_CHANGED_THREAD_CHANNEL (1U << 14) ///< Thread network channel changed
#define OT_CHANGED_THREAD_PANID (1U << 15) ///< Thread network PAN Id changed
#define OT_CHANGED_THREAD_NETWORK_NAME (1U << 16) ///< Thread network name changed
#define OT_CHANGED_THREAD_EXT_PANID (1U << 17) ///< Thread network extended PAN ID changed
#define OT_CHANGED_NETWORK_KEY (1U << 18) ///< Network key changed
#define OT_CHANGED_PSKC (1U << 19) ///< PSKc changed
#define OT_CHANGED_SECURITY_POLICY (1U << 20) ///< Security Policy changed
#define OT_CHANGED_CHANNEL_MANAGER_NEW_CHANNEL (1U << 21) ///< Channel Manager new pending Thread channel changed
#define OT_CHANGED_SUPPORTED_CHANNEL_MASK (1U << 22) ///< Supported channel mask changed
#define OT_CHANGED_COMMISSIONER_STATE (1U << 23) ///< Commissioner state changed
#define OT_CHANGED_THREAD_NETIF_STATE (1U << 24) ///< Thread network interface state changed
#define OT_CHANGED_THREAD_BACKBONE_ROUTER_STATE (1U << 25) ///< Backbone Router state changed
#define OT_CHANGED_THREAD_BACKBONE_ROUTER_LOCAL (1U << 26) ///< Local Backbone Router configuration changed
#define OT_CHANGED_JOINER_STATE (1U << 27) ///< Joiner state changed
#define OT_CHANGED_ACTIVE_DATASET (1U << 28) ///< Active Operational Dataset changed
#define OT_CHANGED_PENDING_DATASET (1U << 29) ///< Pending Operational Dataset changed
#define OT_CHANGED_NAT64_TRANSLATOR_STATE (1U << 30) ///< The state of NAT64 translator changed
#define OT_CHANGED_PARENT_LINK_QUALITY (1U << 31) ///< Parent link quality changed
/**
* Represents a bit-field indicating specific state/configuration that has changed. See `OT_CHANGED_*`
* definitions.
*
*/
typedef uint32_t otChangedFlags;
/**
* Pointer is called to notify certain configuration or state changes within OpenThread.
*
* @param[in] aFlags A bit-field indicating specific state that has changed. See `OT_CHANGED_*` definitions.
* @param[in] aContext A pointer to application-specific context.
*
*/
typedef void (*otStateChangedCallback)(otChangedFlags aFlags, void *aContext);
/**
* Registers a callback to indicate when certain configuration or state changes within OpenThread.
*
* @param[in] aInstance A pointer to an OpenThread instance.
* @param[in] aCallback A pointer to a function that is called with certain configuration or state changes.
* @param[in] aContext A pointer to application-specific context.
*
* @retval OT_ERROR_NONE Added the callback to the list of callbacks.
* @retval OT_ERROR_ALREADY The callback was already registered.
* @retval OT_ERROR_NO_BUFS Could not add the callback due to resource constraints.
*
*/
otError otSetStateChangedCallback(otInstance *aInstance, otStateChangedCallback aCallback, void *aContext);
/**
* Removes a callback to indicate when certain configuration or state changes within OpenThread.
*
* @param[in] aInstance A pointer to an OpenThread instance.
* @param[in] aCallback A pointer to a function that is called with certain configuration or state changes.
* @param[in] aContext A pointer to application-specific context.
*
*/
void otRemoveStateChangeCallback(otInstance *aInstance, otStateChangedCallback aCallback, void *aContext);
/**
* Triggers a platform reset.
*
* The reset process ensures that all the OpenThread state/info (stored in volatile memory) is erased. Note that the
* `otPlatformReset` does not erase any persistent state/info saved in non-volatile memory.
*
* @param[in] aInstance A pointer to an OpenThread instance.
*
*/
void otInstanceReset(otInstance *aInstance);
/**
* Triggers a platform reset to bootloader mode, if supported.
*
* Requires `OPENTHREAD_CONFIG_PLATFORM_BOOTLOADER_MODE_ENABLE`.
*
* @param[in] aInstance A pointer to an OpenThread instance.
*
* @retval OT_ERROR_NONE Reset to bootloader successfully.
* @retval OT_ERROR_BUSY Failed due to another operation is ongoing.
* @retval OT_ERROR_NOT_CAPABLE Not capable of resetting to bootloader.
*
*/
otError otInstanceResetToBootloader(otInstance *aInstance);
/**
* Deletes all the settings stored on non-volatile memory, and then triggers a platform reset.
*
* @param[in] aInstance A pointer to an OpenThread instance.
*
*/
void otInstanceFactoryReset(otInstance *aInstance);
/**
* Resets the internal states of the OpenThread radio stack.
*
* Callbacks and configurations are preserved.
*
* This API is only available under radio builds (`OPENTHREAD_RADIO = 1`).
*
* @param[in] aInstance A pointer to an OpenThread instance.
*
*/
void otInstanceResetRadioStack(otInstance *aInstance);
/**
* Erases all the OpenThread persistent info (network settings) stored on non-volatile memory.
* Erase is successful only if the device is in `disabled` state/role.
*
* @param[in] aInstance A pointer to an OpenThread instance.
*
* @retval OT_ERROR_NONE All persistent info/state was erased successfully.
* @retval OT_ERROR_INVALID_STATE Device is not in `disabled` state/role.
*
*/
otError otInstanceErasePersistentInfo(otInstance *aInstance);
/**
* Gets the OpenThread version string.
*
* @returns A pointer to the OpenThread version.
*
*/
const char *otGetVersionString(void);
/**
* Gets the OpenThread radio version string.
*
* @param[in] aInstance A pointer to an OpenThread instance.
*
* @returns A pointer to the OpenThread radio version.
*
*/
const char *otGetRadioVersionString(otInstance *aInstance);
/**
* @}
*
*/
#ifdef __cplusplus
} // extern "C"
#endif
#endif // OPENTHREAD_INSTANCE_H_

View File

@@ -0,0 +1,187 @@
/*$Id: //dwh/bluetooth/DWC_ble154combo/firmware/rel/2.00a-lca04/firmware/public_inc/ot_inc/logging.h#1 $*/
/*
* Copyright (c) 2016, The OpenThread Authors.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/**
* @file
* @brief
* This file includes the platform abstraction for the debug log service.
*/
#ifndef OPENTHREAD_PLATFORM_LOGGING_H_
#define OPENTHREAD_PLATFORM_LOGGING_H_
#include <stdarg.h>
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @addtogroup plat-logging
*
* @brief
* This module includes the platform abstraction for the debug log service.
*
* @{
*
*/
/**
* Log level None.
*
* @note Log Levels are defines so that embedded implementations can eliminate code at compile time via
* #if/#else/#endif.
*
*/
#define OT_LOG_LEVEL_NONE 0
/**
* Log level Critical.
*
* @note Log Levels are defines so that embedded implementations can eliminate code at compile time via
* #if/#else/#endif.
*
*/
#define OT_LOG_LEVEL_CRIT 1
/**
* Log level Warning.
*
* @note Log Levels are defines so that embedded implementations can eliminate code at compile time via
* #if/#else/#endif.
*
*/
#define OT_LOG_LEVEL_WARN 2
/**
* Log level Notice.
*
* @note Log Levels are defines so that embedded implementations can eliminate code at compile time via
* #if/#else/#endif.
*
*/
#define OT_LOG_LEVEL_NOTE 3
/**
* Log level Informational.
*
* @note Log Levels are defines so that embedded implementations can eliminate code at compile time via
* #if/#else/#endif.
*
*/
#define OT_LOG_LEVEL_INFO 4
/**
* Log level Debug.
*
* @note Log Levels are defines so that embedded implementations can eliminate code at compile time via
* #if/#else/#endif.
*
*/
#define OT_LOG_LEVEL_DEBG 5
/**
* Represents the log level.
*
*/
typedef int otLogLevel;
/**
* Represents log regions.
*
* The support for log region is removed and instead each core module can define its own name to appended to the logs.
* However, the `otLogRegion` enumeration is still defined as before to help with platforms which we may be using it
* in their `otPlatLog()` implementation. The OT core will always emit all logs with `OT_LOG_REGION_CORE`.
*
*/
typedef enum otLogRegion
{
OT_LOG_REGION_API = 1, ///< OpenThread API
OT_LOG_REGION_MLE = 2, ///< MLE
OT_LOG_REGION_ARP = 3, ///< EID-to-RLOC mapping.
OT_LOG_REGION_NET_DATA = 4, ///< Network Data
OT_LOG_REGION_ICMP = 5, ///< ICMPv6
OT_LOG_REGION_IP6 = 6, ///< IPv6
OT_LOG_REGION_TCP = 7, ///< TCP
OT_LOG_REGION_MAC = 8, ///< IEEE 802.15.4 MAC
OT_LOG_REGION_MEM = 9, ///< Memory
OT_LOG_REGION_NCP = 10, ///< NCP
OT_LOG_REGION_MESH_COP = 11, ///< Mesh Commissioning Protocol
OT_LOG_REGION_NET_DIAG = 12, ///< Network Diagnostic
OT_LOG_REGION_PLATFORM = 13, ///< Platform
OT_LOG_REGION_COAP = 14, ///< CoAP
OT_LOG_REGION_CLI = 15, ///< CLI
OT_LOG_REGION_CORE = 16, ///< OpenThread Core
OT_LOG_REGION_UTIL = 17, ///< Utility module
OT_LOG_REGION_BBR = 18, ///< Backbone Router (available since Thread 1.2)
OT_LOG_REGION_MLR = 19, ///< Multicast Listener Registration (available since Thread 1.2)
OT_LOG_REGION_DUA = 20, ///< Domain Unicast Address (available since Thread 1.2)
OT_LOG_REGION_BR = 21, ///< Border Router
OT_LOG_REGION_SRP = 22, ///< Service Registration Protocol (SRP)
OT_LOG_REGION_DNS = 23, ///< DNS
} otLogRegion;
/**
* Outputs logs.
*
* Note that the support for log region is removed. The OT core will always emit all logs with `OT_LOG_REGION_CORE`
* as @p aLogRegion.
*
* @param[in] aLogLevel The log level.
* @param[in] aLogRegion The log region.
* @param[in] aFormat A pointer to the format string.
* @param[in] ... Arguments for the format specification.
*
*/
void otPlatLog(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aFormat, ...);
/**
* Handles OpenThread log level changes.
*
* This platform function is called whenever the OpenThread log level changes.
* This platform function is optional since an empty weak implementation has been provided.
*
* @note Only applicable when `OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE=1`.
*
* @param[in] aLogLevel The new OpenThread log level.
*
*/
void otPlatLogHandleLevelChanged(otLogLevel aLogLevel);
/**
* @}
*
*/
#ifdef __cplusplus
} // extern "C"
#endif
#endif // OPENTHREAD_PLATFORM_LOGGING_H_

View File

@@ -0,0 +1,316 @@
/*$Id: //dwh/bluetooth/DWC_ble154combo/firmware/rel/2.00a-lca04/firmware/public_inc/ot_inc/toolchain.h#1 $*/
/*
* Copyright (c) 2016, The OpenThread Authors.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/**
* @addtogroup plat-toolchain
*
* @brief
* This module defines a toolchain abstraction layer through macros.
*
* Usage:
*
* @code
*
* typedef
* OT_TOOL_PACKED_BEGIN
* struct
* {
* char mField1;
* union
* {
* char mField2;
* long mField3;
* } OT_TOOL_PACKED_FIELD;
* } OT_TOOL_PACKED_END packed_struct_t;
*
* @endcode
*
* @{
*
*/
#ifndef OPENTHREAD_PLATFORM_TOOLCHAIN_H_
#define OPENTHREAD_PLATFORM_TOOLCHAIN_H_
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @def OT_MUST_USE_RESULT
*
* Compiler-specific indication that a class or enum must be used when it is
* the return value of a function.
*
* @note This is currently only available with clang (C++17 implements it
* as attribute [[nodiscard]]).
* @note To suppress the 'unused-result' warning/error, please use the
* '-Wno-unused-result' compiler option.
*
*/
#if defined(__clang__) && (__clang_major__ >= 4 || (__clang_major__ >= 3 && __clang_minor__ >= 9))
#define OT_MUST_USE_RESULT __attribute__((warn_unused_result))
#else
#define OT_MUST_USE_RESULT
#endif
/**
* @def OT_TOOL_PACKED_BEGIN
*
* Compiler-specific indication that a class or struct must be byte packed.
*
*/
/**
* @def OT_TOOL_PACKED_FIELD
*
* Indicate to the compiler a nested struct or union to be packed
* within byte packed class or struct.
*
*/
/**
* @def OT_TOOL_PACKED_END
*
* Compiler-specific indication at the end of a byte packed class or struct.
*
*/
/**
* @def OT_TOOL_WEAK
*
* Compiler-specific weak symbol modifier.
*
*/
/**
* @def OT_TOOL_PRINTF_STYLE_FORMAT_ARG_CHECK
*
* Specifies that a function or method takes `printf` style arguments and should be type-checked against
* a format string.
*
* Must be added after the function/method declaration. For example:
*
* `void MyPrintf(void *aObject, const char *aFormat, ...) OT_TOOL_PRINTF_STYLE_FORMAT_ARG_CHECK(2, 3);`
*
* The two argument index values indicate format string and first argument to check against it. They start at index 1
* for the first parameter in a function and at index 2 for the first parameter in a method.
*
* @param[in] aFmtIndex The argument index of the format string.
* @param[in] aStartIndex The argument index of the first argument to check against the format string.
*
*/
// =========== TOOLCHAIN SELECTION : START ===========
#if defined(__GNUC__) || defined(__clang__) || defined(__CC_ARM) || defined(__TI_ARM__)
// https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html
// http://www.keil.com/support/man/docs/armcc/armcc_chr1359124973480.htm
#define OT_TOOL_PACKED_BEGIN
#define OT_TOOL_PACKED_FIELD __attribute__((packed))
#define OT_TOOL_PACKED_END __attribute__((packed))
#define OT_TOOL_WEAK __attribute__((weak))
#define OT_TOOL_PRINTF_STYLE_FORMAT_ARG_CHECK(aFmtIndex, aStartIndex) \
__attribute__((format(printf, aFmtIndex, aStartIndex)))
#elif defined(__ICCARM__) || defined(__ICC8051__)
// http://supp.iar.com/FilesPublic/UPDINFO/004916/arm/doc/EWARM_DevelopmentGuide.ENU.pdf
#include "intrinsics.h"
#define OT_TOOL_PACKED_BEGIN __packed
#define OT_TOOL_PACKED_FIELD
#define OT_TOOL_PACKED_END
#define OT_TOOL_WEAK __weak
#define OT_TOOL_PRINTF_STYLE_FORMAT_ARG_CHECK(aFmtIndex, aStartIndex)
#elif defined(__SDCC)
// Structures are packed by default in sdcc, as it primarily targets 8-bit MCUs.
#define OT_TOOL_PACKED_BEGIN
#define OT_TOOL_PACKED_FIELD
#define OT_TOOL_PACKED_END
#define OT_TOOL_WEAK
#define OT_TOOL_PRINTF_STYLE_FORMAT_ARG_CHECK(aFmtIndex, aStartIndex)
#else
#error "Error: No valid Toolchain specified"
// Symbols for Doxygen
#define OT_TOOL_PACKED_BEGIN
#define OT_TOOL_PACKED_FIELD
#define OT_TOOL_PACKED_END
#define OT_TOOL_WEAK
#define OT_TOOL_PRINTF_STYLE_FORMAT_ARG_CHECK(aFmtIndex, aStartIndex)
#endif
// =========== TOOLCHAIN SELECTION : END ===========
/**
* @def OT_UNUSED_VARIABLE
*
* Suppress unused variable warning in specific toolchains.
*
*/
/**
* @def OT_UNREACHABLE_CODE
*
* Suppress Unreachable code warning in specific toolchains.
*
*/
#if defined(__ICCARM__)
#include <stddef.h>
#define OT_UNUSED_VARIABLE(VARIABLE) \
do \
{ \
if (&VARIABLE == NULL) \
{ \
} \
} while (false)
#define OT_UNREACHABLE_CODE(CODE) \
_Pragma("diag_suppress=Pe111") _Pragma("diag_suppress=Pe128") CODE _Pragma("diag_default=Pe111") \
_Pragma("diag_default=Pe128")
#elif defined(__CC_ARM)
#include <stddef.h>
#define OT_UNUSED_VARIABLE(VARIABLE) \
do \
{ \
if (&VARIABLE == NULL) \
{ \
} \
} while (false)
#define OT_UNREACHABLE_CODE(CODE) CODE
#elif defined(__TI_ARM__)
#include <stddef.h>
#define OT_UNUSED_VARIABLE(VARIABLE) \
do \
{ \
if (&VARIABLE == NULL) \
{ \
} \
} while (false)
/*
* #112-D statement is unreachable
* #129-D loop is not reachable
*/
#define OT_UNREACHABLE_CODE(CODE) \
_Pragma("diag_push") _Pragma("diag_suppress 112") _Pragma("diag_suppress 129") CODE _Pragma("diag_pop")
#else
#define OT_UNUSED_VARIABLE(VARIABLE) \
do \
{ \
(void)(VARIABLE); \
} while (false)
#define OT_UNREACHABLE_CODE(CODE) CODE
#endif
/*
* Keil and IAR compiler doesn't provide type limits for C++.
*/
#ifdef __cplusplus
#if defined(__CC_ARM) || defined(__ICCARM__)
#ifndef UINT8_MAX
#define UINT8_MAX 0xff
#endif
#ifndef UINT16_MAX
#define UINT16_MAX 0xffff
#endif
#endif
#endif
#ifdef __APPLE__
#define OT_APPLE_IGNORE_GNU_FOLDING_CONSTANT(...) \
_Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wgnu-folding-constant\"") \
__VA_ARGS__ _Pragma("GCC diagnostic pop")
#else
#define OT_APPLE_IGNORE_GNU_FOLDING_CONSTANT(...) __VA_ARGS__
#endif
/**
* @def OT_FALL_THROUGH
*
* Suppress fall through warning in specific compiler.
*
*/
#if defined(__cplusplus) && (__cplusplus >= 201703L)
#define OT_FALL_THROUGH [[fallthrough]]
#elif defined(__clang__)
#define OT_FALL_THROUGH [[clang::fallthrough]]
#elif defined(__GNUC__) && (__GNUC__ >= 7)
#define OT_FALL_THROUGH __attribute__((fallthrough))
#else
#define OT_FALL_THROUGH \
do \
{ \
} while (false) /* fallthrough */
#endif
/**
* @}
*
*/
#ifdef __cplusplus
} // extern "C"
#endif
#endif // OPENTHREAD_PLATFORM_TOOLCHAIN_H_

View File

@@ -0,0 +1,592 @@
/*$Id: //dwh/bluetooth/DWC_ble154combo/firmware/rel/2.00a-lca04/firmware/public_inc/platform.h#1 $*/
/**
********************************************************************************
* @file platform.h
* @brief this file include all helper functions in radio.c which is not described in Openthread
*
*
******************************************************************************
* This Synopsys DWC Bluetooth Low Energy Combo Link Layer/MAC software and
* associated documentation ( hereinafter the "Software") is an unsupported
* proprietary work of Synopsys, Inc. unless otherwise expressly agreed to in
* writing between Synopsys and you. The Software IS NOT an item of Licensed
* Software or a Licensed Product under any End User Software License Agreement
* or Agreement for Licensed Products with Synopsys or any supplement thereto.
* Synopsys is a registered trademark of Synopsys, Inc. Other names included in
* the SOFTWARE may be the trademarks of their respective owners.
*
* Synopsys MIT License:
* Copyright (c) 2020-Present Synopsys, Inc
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* the Software), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute,
* sublicense, and/or sell copies of the Software, and to permit persons to whom
* the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING, BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE ARISING FROM,
* OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* */
#ifndef INCLUDE_PLATFORM_H_
#define INCLUDE_PLATFORM_H_
#include "radio.h"
#include "common_types.h"
/*==================================== MACROS =======================================*/
/*
* The following macros are used for testing purpose only
*/
#define ACK_FRAME_TYPE 0x2 ///< ACK frame type
#define MAC_ACK_WAIT 864 ///< The time in microseconds of waiting for ACK
/******************************************************************************************//**
* Enums
*********************************************************************************************/
/**
* @brief Enum defines the states of the radio event that used in coexistence
*
*/
typedef enum _radio_evnt_type_enum
{
TX_PCKT_STATE, ///< Sending packet (not ACK)
TX_ACK_STATE, ///< Sending ACK
RX_PCKT_STATE, ///< Receiving packet (not ACK)
RX_ACK_STATE, ///< Receiving Ack
RADIO_ED, ///< Energy detection
RADIO_SLEEP_STATE, ///< Sleep state
RADIO_DISABLED_STATE,///< Disable state
#if(SUPPORT_COEXISTENCE)
TX_AT_STATE , ///< Tx at specific time
RX_AT_STATE , ///< Rx at specific time
#endif /* SUPPORT_COEXISTENCE */
}radio_event_enum_t;
/******************************************************************************************//**
* Structures
*********************************************************************************************/
/** @ingroup systm_layer
* @{
*/
/**
* @brief Structure defines all callback functions used to notify MAC layer after specific event compeletion
*
*/
struct mac_cbk_dispatch_tbl{
/**
* @brief Energy detection scan done callback
*
* @param[in] aInstance : Radio instance
* @param[in] aEnergyScanMaxRssi: The result for ED operation which is RSSI value
*
* @note This function is called after handling SM_DONE event in ral through a sequence of calls
* ral_sm_done() -> ral_ed_scan_done() -> callback
*/
void (*mac_ed_scan_done)(otInstance *aInstance, int8_t aEnergyScanMaxRssi);
/**
* @brief Transmission done callback
*
* @param[in] aInstance : Radio instance
* @param[in] aFrame : Pointer to the transmitted frame
* @param[in] aAckFrame : Pointer to the received ACK frame (in case of AR bit is detected in aFrame)
* @param[in] aError : Error code if happens in transmission
*
* @note This function is called after handling SM_DONE event in ral through a sequence of calls
* ral_sm_done() -> ral_tx_done() -> callback
*/
void (*mac_tx_done)(otInstance *aInstance, otRadioFrame *aFrame, otRadioFrame *aAckFrame, otError aError);
/**
* @brief Reception done callback
*
* @param[in] aInstance : Radio instance
* @param[in] aFrame : Pointer to the received frame
* @param[in] aError : Error code if happens in transmission
*
* @note This function is called after handling SM_DONE event in ral through a sequence of calls
* ral_sm_done() -> ral_rx_done() -> callback
*/
void (*mac_rx_done)(otInstance *aInstance, otRadioFrame *aFrame, otError aError);
/**
* @brief The start of successfull transmission callback
*
* @param[in] aInstance : Radio instance
* @param[in] aFrame : Pointer to the transmitted frame
* @param[in] aError : Error code if happens in transmission
*
* @note This function is called after calling proc_radio_tx which is called with calling of otplatRadioTransmit
* in case of no error returned. These errors may be (CCA channel access failure, ral busy due to ongoing transmission ...etc )
*/
void (*mac_tx_strtd)(otInstance *aInstance, otRadioFrame *aFrame);
/**
* @brief The frame update callback
*
* @param[in] aInstance : Radio instance
* @param[in] aFrame : Pointer to the frame
*/
void (*mac_frm_updtd)(otInstance *aInstance, otRadioFrame *aFrame);
};
/**
* @}
*
*/
/******************************************************************************************//**
* APIs
*********************************************************************************************/
/** @ingroup systm_layer_cmn_proc
* @{
*/
/**
* @brief Initialize radio layer including registeration for RAL callbacks, some filter configurations,
* and some automatic configurations like auto_sleep and auto_ack...etc
*
*/
void radio_init(void);
/**
* @brief Register upper layer callback functions.
* This function called from upper layer init function (mac_init in case of MAC integration e.g. Zigbee stack).
*
* @param[in] ptr_cbk_dispatch_tbl : Pointer to callback functions to be registered
*/
void radio_call_back_funcs_init(struct mac_cbk_dispatch_tbl * ptr_cbk_dispatch_tbl);
/**
* @}
*
*/
/**
* @brief Initialize openthread dispatch table
*
* @param sInstance : Radio instance
*/
void otDispatch_tbl_init(otInstance *sInstance);
/** @ingroup systm_layer_enc
* @{
*/
/**
* @brief Encrypt frame pointed to by ptr_pckt
*
* @param[in] ptr_pckt : Pointer to the data buffer (variable length in case of CCM mode, 16 bytes in case of ECB mode).
* The resulting Encrypted/Decrypted data overwrites this buffer.
* @param[in] ptr_session_key : Pointer to the security key buffer (16 bytes)
* @param[in] ptr_ccm_nonce : Pointer to the security nonce buffer (13 bytes in case of CCM mode, a Null pointer in case of ECB mode).
* @param[in] mic_len : Length of MIC, supported values are 0, 4, 6, 8, 10, 12, 14, and 16 in case of CCM, 0 only in case of ECB.
* @param[in] ad_len : Length of Data to be authenticated
* @param[in] md_len : Length of Data to be encrypted
* @retval Status of the encryption process
*/
uint32_t radio_encrypt_pckts( uint8_t *ptr_pckt,
const uint8_t *ptr_session_key,
uint8_t *ptr_ccm_nonce,
uint32_t mic_len,
uint32_t ad_len,
uint32_t md_len);
/**
* @}
*
*/
/** @ingroup systm_layer_cmn_config
* @{
*/
/**
* @brief Configure automatic ACK response by RAL layer including AIFS, ACK frame timeout.. etc
*
* @param[in] auto_ack_state : Auto ACK state (TRUE to enable, FALSE to disable)
* @retval Status of configuration
*/
otError radio_set_auto_Ack_state(uint8_t auto_ack_state);
/**
* @}
*
*/
/** @ingroup systm_layer_cmn_proc
* @{
*/
/**
* @brief Reset radio layer operation which in turns stop all running operations
*
* @return Status
*/
uint32_t radio_reset(void);
/**
* @}
*
*/
/**
* @brief Control RAL setup for reception
*
* @param[in] aChannel : Channel to receive on
* @param[in] duration : Reception duration in microsecond, 0 means receive forever
* @return Status
*/
otError proc_radio_rcv(uint8_t aChannel ,uint32_t duration);
/**
* @brief Control RAL setup for transmission based on CCA procedure.
*
* @param[in] aFrame : Pointer to the transmitted frame
* @param[in] strt_time : Pointer to TX request time
* @return Status
*/
otError proc_radio_tx(otRadioFrame *aFrame , ble_time_t* strt_time);
/**
* @brief Control RAL setup for energy detection scan
*
* @param[in] aScanChannel : Channel to perform ED on
* @param[in] aScanDuration : Scan duration
* @return Status
*/
otError proc_radio_ed(uint8_t aScanChannel, uint16_t aScanDuration);
/** @ingroup systm_layer_cmn_config
* @{
*/
/**
* @brief Set PAN coordinator role in HW to be used while applying MAC 802.15.4 filtration policies
*
* @param[in] aEnable : PAN coordinator role flag (TRUE to enable, FALSE to disable)
*/
void setPANcoordinator(uint8_t aEnable);
/**
* @brief Notify RAL layer of RX on when idle state
*
* @param[in] aEnable : Continuous reception state (TRUE to enable, FALSE to disable)
*/
void setContRecp(uint8_t aEnable);
/**
* @brief Disable filtration policies while performing scan
*
* @param[in] aInstance : Radio instance
*/
void enableScanFilters(otInstance *aInstance);
/**
* @brief Restore filtration policies after the scan is completed
*
* @param[in] aInstance : Radio instance
*/
void disableScanFilters(otInstance *aInstance);
/**
* @}
*
*/
/** @ingroup systm_layer_cmn_proc
* @{
*/
/**
* @brief Get the latest LQI value
*
* @retval LQI value
*/
uint8_t radio_GetLQIValue(void);
/**
* @}
*
*/
#if RADIO_CSMA
/** @ingroup systm_layer_cmn_config
* @{
*/
/**
* @brief Set minimum CSMA backoff exponent
*
* @param[in] value : Minimum csma backoff exponent
*/
void set_min_csma_be(uint8_t value);
/**
* @brief Set maximum CSMA backoff exponent
*
* @param[in] value : Maximum CSMA backoff exponent
*/
void set_max_csma_be(uint8_t value);
/**
* @brief Set maximum CSMA backoff counter
*
* @param[in] value : Maximum CSMA backoff counter
*/
void set_max_csma_backoff(uint8_t value);
/**
* @brief Set custom maximum full CSMA frame retries
*
* @param[in] value : Maximum full CSMA retrials
*/
void set_max_full_csma_frm_retries(uint8_t value);
#endif /*end of RADIO_CSMA*/
/**
* @brief Set maximum frame retries
*
* @param[in] value : Maximum frame retries
*/
void set_max_frm_retries(uint8_t value);
/**
* @}
*
*/
/** @ingroup systm_layer_cmn_proc
* @{
*/
/**
* @brief Generate random number
*
* @param[out] ptr_rnd : Pointer to the output random bytes
* @param[in] len : Number of required random bytes
* @param[in] check_cont_rx : Flag to check continuous reception
* @return Status
*/
uint32_t mac_gen_rnd_num(uint8_t *ptr_rnd, uint16_t len, uint8_t check_cont_rx);
/**
* @}
*
*/
/** @ingroup systm_layer_enc
* @{
*/
/**
* @brief Decrypt frame pointed to by ptr_pckt
*
* @param[in] ptr_pckt : Pointer to the data buffer (variable length in case of CCM mode, 16 bytes in case of ECB mode).
* The resulting Encrypted/Decrypted data overwrites this buffer.
* @param[in] ptr_session_key : Pointer to the security key buffer (16 bytes)
* @param[in] ptr_ccm_nonce : Pointer to the security nonce buffer (13 bytes in case of CCM mode, a Null pointer in case of ECB mode).
* @param[in] mic_len : Length of MIC, supported values are 0, 4, 6, 8, 10, 12, 14, and 16 in case of CCM, 0 only in case of ECB.
* @param[in] ad_len : Length of Data to be authenticated
* @param[in] md_len : Length of Data to be decrypted
* @retval Status of the decryption process
*/
uint32_t radio_decrypt_pckts( uint8_t *ptr_pckt,
uint8_t *ptr_session_key,
uint8_t *ptr_ccm_nonce,
uint32_t mic_len,
uint32_t ad_len,
uint32_t md_len);
/**
* @}
*
*/
/**
* @brief Call MAC radio rx done callback after the end of reception.
*
* @param[in] aFrame : Pointer to the received frame
* @param[in] aError : Reception error
*/
void radio_mac_rx_done(otRadioFrame *aFrame, otError aError);
#if (SUPPORT_ENH_ACK_LINK_METRICS_PROBING_OT_1_2)
/**
* @brief Set the link metrics noise floor value needed to calculate the link margin
*
* @param[in] noise_floor : The noise floor used by Link Metrics.
* It should be set to the platform's noise floor (measured noise floor, receiver sensitivity or a constant).
*/
void radio_link_metrics_set_noise_floor(int8_t noise_floor);
#endif
#if(SUPPORT_OPENTHREAD_1_2 && CONFIG_MAC_CSL_TRANSMITTER_ENABLE)
/**
* @brief Call MAC radio TX done
*
* @param[in] tx_frame : Pointer to the transmitted frame
* @param[in] aError : TX error
*/
void radio_mac_tx_done_error(otRadioFrame * tx_frame,otError aError);
#endif /*(SUPPORT_OPENTHREAD_1_2 && CONFIG_MAC_CSL_TRANSMITTER_ENABLE)*/
#if !SUPPORT_COEXISTENCE
/*##### Random Number Generation Group #####*/
/** @ingroup rnd_gen_functions
* @{
*/
/**
* @brief Request new random number.
*
* @param[out] ptr_rnd : Pointer to the output random bytes .
* @param[in] len : Number of required random bytes.
*
* @retval Status.
*/
uint32_t platform_gen_rnd_num(
uint8_t *ptr_rnd,
uint32_t len);
/** @}
*/
/**
* @brief A common wrapper for BLE-ECB and MAC-CCM security modes
*
* @param[in] ptr_pckt : Pointer to the data buffer (variable length in case of CCM mode, 16 bytes in case of ECB mode).
* The resulting Encrypted/Decrypted data overwrites this buffer.
* @param[in] ptr_key : Pointer to the security key buffer (16 bytes).
* @param[in] ptr_nonce : Pointer to the security nonce buffer (13 bytes in case of CCM mode, a Null pointer in case of ECB mode).
* @param[in] mic_len : Length of MIC, supported values are 0, 4, 6, 8, 10, 12, 14, and 16 in case of CCM, 0 only in case of ECB.
* @param[in] ad_len : Length of Data to be authenticated.
* @param[in] md_len : Length of Data to be encrypted.
* @param[in] key_endian : Represents the format of the security key.
* @param[in] data_endian : Represents the endian format of the data.
* @param[in] security_mode : Hardware security mode.
* @retval Status
*/
uint32_t platform_crypto(uint8_t *ptr_pckt, const uint8_t *ptr_key,
uint8_t *ptr_nonce, uint32_t mic_len, uint32_t ad_len, uint32_t md_len,
crypto_endian_enum_t key_endian, crypto_endian_enum_t data_endian,
security_mode_enum_t security_mode);
/**
* @brief Run periodic calibration if tempature has changed
*
*/
void radio_run_phy_clbr_on_temp_change(void);
#endif /*!SUPPORT_COEXISTENCE*/
#if (!SUPPORT_COEXISTENCE)
/**
* @brief Set link layer deep sleep mode
*
* @param[in] dp_slp_mode : Deep sleep mode (enable or disable)
* @retval Status .
*/
otError radio_set_dp_slp_mode(dpslp_state_e dp_slp_mode);
#endif /*end of (!SUPPORT_COEXISTENCE)*/
#if SUPPORT_MAC_CONT_TESTING_CMDS_PHY_SUPPORT
/**
* @brief Set the PHY continuous modulation and continuous wave modes upon enable
*
* @param[in] type : The type of the modulation (0: modulation, 1: wave)
* @param[in] enable_mode : TRUE to enable the selected mode, FALSE to disable it
* @param[in] chnl_num : Channel number to be used in modulation (range: 0 to 15)
* @param[in] pwr : The used power in dBm.
* @retval Status
*/
otError platform_zigbee_set_phy_cont_modul_mode(uint8_t type, uint8_t enable_mode, uint8_t chnl_num, int8_t pwr);
#endif /*end of SUPPORT_MAC_CONT_TESTING_CMDS_PHY_SUPPORT */
#if SUPPORT_ANT_DIV
/**
* @brief Set antenna diversity feature parameters
*
* @param[in] aInstance : Radio instance
* @param[in] ptr_ant_div_params: Pointer to antenna diversity feature parameters
* @retval Status
*/
otError radio_set_ant_div_params(otInstance *aInstance, antenna_diversity_st* ptr_ant_div_params);
/**
* @brief Get antenna diversity feature parameters
*
* @param[in] aInstance : Radio instance
* @param[out] ptr_ant_div_params : Pointer to antenna diversity feature parameters
*/
void radio_get_ant_div_params(otInstance *aInstance, antenna_diversity_st* ptr_ant_div_params);
/**
* @brief Set antenna diversity feature state
*
* @param[in] aInstance : Radio instance
* @param[in] enable : Antenna diversity feature state (TRUE to enable, FALSE to disable)
* @retval Status
*/
otError radio_set_ant_div_enable(otInstance *aInstance, uint8_t enable);
/**
* @brief Set the default antenna ID of the antenna diversity feature to be used for transmission and reception
*
* @param[in] aInstance : Radio instance
* @param[in] default_ant_id : Default antenna ID
* @retval Status
*/
otError radio_set_default_ant_id(otInstance *aInstance, uint8_t default_ant_id);
/**
* @brief Set the RSSI threshold for antenna diversity feature
*
* @param[in] aInstance : Radio instance
* @param[in] rssi_threshold: RSSI threshold to compare with during antenna diversity measurements
* @retval Status
*/
otError radio_set_ant_div_rssi_threshold(otInstance *aInstance, int8_t rssi_threshold);
#endif /* SUPPORT_ANT_DIV */
/**
* @brief Set bus latency between thread core and radio platform
*
* @param[in] aInstance : Radio instance
* @param[in] bus_latency : Time in microseconds for latency between thread core and radio platform
*/
void otPlatRadioSetBusLatency(otInstance *aInstance, uint32_t bus_latency);
#if SUPPORT_OPENTHREAD_1_2
/**
* @brief Set clock accuracy
*
* @param[in] clk_acc: Clock accuracy in PPM
*/
void radio_set_clk_accuracy(uint8_t clk_acc);
/**
* @brief Set clock uncertainty
*
* @param[in] clk_uncer: Clock uncertainty in units of 10 us.
*/
void radio_set_clk_uncertainty(uint8_t clk_uncer);
#endif /*SUPPORT_OPENTHREAD_1_2*/
#if SUPPORT_CONFIGURABLE_GAIN_FIX
/**
* @brief Initialize RSSI gain fix region and select resistor measured percentage that affects pre-emphasis sequence.
*
* @param[in] region_0x1f_val: Absolute gain fix for region 0x1F in dbm.
* @param[in] region_0x0f_val: Absolute gain fix for region 0x0F in dbm.
* @param[in] region_0x0b_val: Absolute gain fix for region 0x0B in dbm.
* @param[in] region_0x09_val: Absolute gain fix for region 0x09 in dbm.
* @param[in] r_msur_percent : Percentage of the measured resistor value that will be used
* to select the update values in pre-emphasis sequence (range: 0 to 99).
*/
void radio_gain_fix_init(
uint8_t region_0x1f_val, uint8_t region_0x0f_val,
uint8_t region_0x0b_val, uint8_t region_0x09_val,
uint8_t r_msur_percent);
#endif /* SUPPORT_CONFIGURABLE_GAIN_FIX */
#if SUPPORT_CONFIG_LIB
/**
* @brief Set configurable library feature parameters
*
* @param[in] aInstance : Radio instance
* @param[in] ptr_config_lib_params : pointer to configurable library feature parameters
* @retval Status
*/
otError radio_set_config_lib_params(otInstance *aInstance, config_lib_st* ptr_config_lib_params);
/**
* @brief Get current configurable library parameters
*
* @param[in] aInstance : Radio instance
* @param[out] ptr_config_lib_params: Pointer to configurable library feature parameters
*/
void radio_get_config_lib_params(otInstance *aInstance, config_lib_st* ptr_config_lib_params);
/**
* @brief Set RTL polling time
*
* @param[in] aInstance : Radio instance
* @param[in] rtl_polling_time: RTL polling time value
*/
void radio_set_rtl_polling_time(otInstance *aInstance, uint8_t rtl_polling_time);
/**
* @brief Get current RTL polling time
*
* @param[in] aInstance : Radio instance
* @retval Current RTL polling time
*/
uint8_t radio_get_rtl_polling_time(otInstance *aInstance);
#endif /* SUPPORT_CONFIG_LIB */
#if !SUPPORT_COEXISTENCE && DEFAULT_PHY_CALIBRATION_PERIOD
/**
* @brief Set PHY calibration period
*
* @param[in] phy_clbr_evnt_period : PHY calibration period
*/
void radio_set_phy_clbr_period(uint32_t phy_clbr_evnt_period);
#endif /* !SUPPORT_COEXISTENCE && DEFAULT_PHY_CALIBRATION_PERIOD */
#if SUPPORT_COEXISTENCE && RADIO_CSMA
/**
* @brief Get minimum block counter of TX packet to increase priority to critical.
*
* @retval Minimum block number of TX packets to be critical
*/
uint8_t radio_get_min_blck_cnt_to_be_critical(void);
#endif /* SUPPORT_COEXISTENCE && RADIO_CSMA */
#endif /* INCLUDE_PLATFORM_H_ */

View File

@@ -0,0 +1,103 @@
/*$Id: //dwh/bluetooth/DWC_ble154combo/firmware/rel/2.00a-lca04/firmware/public_inc/power_table.h#1 $*/
/**
******************************************************************************
* @file power_table.h
* @brief This file contains APIs prototypes related to configuring the used power table and the external power amplifier (EPA) parameters
******************************************************************************
* This Synopsys DWC Bluetooth Low Energy Combo Link Layer/MAC software and
* associated documentation ( hereinafter the "Software") is an unsupported
* proprietary work of Synopsys, Inc. unless otherwise expressly agreed to in
* writing between Synopsys and you. The Software IS NOT an item of Licensed
* Software or a Licensed Product under any End User Software License Agreement
* or Agreement for Licensed Products with Synopsys or any supplement thereto.
* Synopsys is a registered trademark of Synopsys, Inc. Other names included in
* the SOFTWARE may be the trademarks of their respective owners.
*
* Synopsys MIT License:
* Copyright (c) 2020-Present Synopsys, Inc
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* the Software), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute,
* sublicense, and/or sell copies of the Software, and to permit persons to whom
* the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING, BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE ARISING FROM,
* OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* */
#ifndef POWER_TABLE_H_
#define POWER_TABLE_H_
#include "common_types.h"
/* Private typedef -----------------------------------------------------------*/
typedef uint8_t (*epa_enable_cb_t)(uint8_t epa_enable);
/**
* @brief Structure of one element of the power table.
*/
typedef struct {
const uint8_t vddh_pa; /* VDDHPA supply volatge level */
const uint8_t internal_pa_code; /* Internal PA code */
const uint8_t epa_bypass; /* External PA Bypass 1: enabled, 0 : disabled */
const int8_t tx_pwr; /* TX Power level in dBm. */
} power_table_entry;
/**
* @brief Structure of the power table ID.
*/
typedef struct _power_table_id_t{
const power_table_entry *ptr_tx_power_table; /* Pointer to the TX_Power table corresponding to the associated "power_table_id". */
const uint8_t tx_power_levels_count; /* Number of TX_Power levels in the selected power table. */
const uint8_t g_vdd_ldo_value_1; /* Value to be set in PHY register (address: 0x63) to select the TX_Power mode */
const uint8_t g_vdd_ldo_value_2; /* Value to be set in PHY register (address: 0xEA) to select the TX_Power mode */
const uint8_t power_table_id; /* TX_Power table ID */
} power_table_id_t;
extern const power_table_id_t ll_tx_power_tables[];
extern const uint8_t num_of_supported_power_tables;
/* APIs ----------------------------------------------------------------------*/
/** @ingroup power_control_functions
* @{
*/
/**
* @brief Used to initialize the EPA parameters. Called during the initialization.
* Note: If an EPA is in use, then a valid callback function shall be passed to LL FW, otherwise the LL FW returns error status.
*
* @param use_epa : [in] 1: External PA exists. 0: There is no External PA.
* @param cbk : [in] Callback function to actually enable and disable the EPA.
*
* @retval Status : FW returns an error code, in case:
* 1. "use_epa" has wrong value
* 2. An EPA is in use and its enable callback function is set to NULL.
*/
uint8_t ll_tx_pwr_if_epa_init(uint8_t use_epa, epa_enable_cb_t cbk);
/**
* @brief Used to specify the used power table and its size based on the selected power mode.
*
* @param tx_power_mode : [in] Parameter indicating the selected TX_Power mode
*
* @retval Status : 0: SUCCESS. Otherwise: Error code.
*/
uint8_t ll_tx_pwr_if_select_tx_power_mode(uint8_t tx_power_table_id);
/**
* @}
*/
#endif /* POWER_TABLE_H_ */

View File

@@ -0,0 +1,271 @@
/*$Id: //dwh/bluetooth/DWC_ble154combo/firmware/rel/2.00a-lca04/firmware/public_inc/pta.h#1 $*/
/**
******************************************************************************
* @file pta.h
* @brief This file contains all prototypes for the public PTA APIs
******************************************************************************
* This Synopsys DWC Bluetooth Low Energy Combo Link Layer/MAC software and
* associated documentation ( hereinafter the "Software") is an unsupported
* proprietary work of Synopsys, Inc. unless otherwise expressly agreed to in
* writing between Synopsys and you. The Software IS NOT an item of Licensed
* Software or a Licensed Product under any End User Software License Agreement
* or Agreement for Licensed Products with Synopsys or any supplement thereto.
* Synopsys is a registered trademark of Synopsys, Inc. Other names included in
* the SOFTWARE may be the trademarks of their respective owners.
*
* Synopsys MIT License:
* Copyright (c) 2020-Present Synopsys, Inc
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* the Software), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute,
* sublicense, and/or sell copies of the Software, and to permit persons to whom
* the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING, BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE ARISING FROM,
* OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* */
#ifndef PTA_H_
#define PTA_H_
#include "common_types.h"
#if (SUPPORT_PTA)
#define PTA_HCI_TESTING 0
/***************************** PUBLIC ENUMERATIONS *****************************/
/**
* @brief Enumeration holding the PTA enable and disable.
*/
typedef enum {
PTA_DISABLED = 0,
PTA_ENABLED,
} pta_state;
#if (SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION || (SUPPORT_LE_PERIODIC_ADVERTISING && (SUPPORT_EXPLCT_OBSERVER_ROLE || SUPPORT_SYNC_ISOCHRONOUS)))
/**
* @brief Enumeration holding the event types passed to the BLE_SetLinkCoexPriority().
*/
typedef enum {
PTA_LINK_COEX_CONN,
PTA_LINK_COEX_PRDC_SCAN,
} pta_link_coex_event_type;
#endif /* (SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION || \
(SUPPORT_LE_PERIODIC_ADVERTISING && (SUPPORT_EXPLCT_OBSERVER_ROLE || SUPPORT_SYNC_ISOCHRONOUS))) */
#if (SUPPORT_BRD_ISOCHRONOUS || SUPPORT_SYNC_ISOCHRONOUS || (SUPPORT_CONNECTED_ISOCHRONOUS && (SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION)))
/**
* @brief Enumeration holding the event types passed to the BLE_SetISOCoexPriority().
*/
typedef enum {
PTA_ISO_CIG,
PTA_ISO_BIG,
} pta_iso_type;
#endif /* (SUPPORT_BRD_ISOCHRONOUS || SUPPORT_SYNC_ISOCHRONOUS || \
(SUPPORT_CONNECTED_ISOCHRONOUS && (SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION))) */
/**
* @brief Enumeration holding all the error codes for the PTA interfaces
*/
typedef enum pta_error {
PTA_ERROR_SUCCESS,
PTA_ERROR_PTA_NOT_ENABLED,
PTA_ERROR_INVALID_PRIORITY_CONF,
PTA_ERROR_UNKNOWN_CONN_HANDLE,
PTA_ERROR_UNKNOWN_PRDC_SYNC_HANDLE,
PTA_ERROR_UNKNOWN_CIG_HANDLE,
PTA_ERROR_UNKNOWN_BIG_HANDLE,
PTA_ERROR_INVALID_NBR_OF_PKTS,
PTA_ERROR_INVALID_TIMEOUT,
PTA_ERROR_INVALID_REQUEST_TO_EVENT_TIME,
PTA_ERROR_INVALID_PTA_STATE,
PTA_ERROR_INIT_ALREADY_CALLED,
PTA_ERROR_PTA_ENABLED_IN_INIT,
PTA_ERROR_PTA_INIT_NOT_CALLED,
} pta_error;
/***************************** Functions Prototypes *****************************/
/*##### PTA' Group #####*/
/** @ingroup pta_functions
* @{
*/
/**
* @brief Used to enable and disable the PTA.
* @note This API can be called directly to enable/disable the PTA feature. In case the BLE controller is supported, beside this API,
* there is an option to enable/disable the PTA feature through the "HCI_CMD_OCF_PTA_ENABLE" custom HCI command.
*
* @param enable: [in] 0: Disable. 1: Enable.
*
* @retval pta_error : PTA_ERROR_INVALID_PTA_STATE:
* - If enable is passed while the PTA is already enabled.
* - If disabled is passed while the PTA is already disabled.
* - If a value outside of the pta_state enumeration is passed.
* PTA_ERROR_SUCCESS : Otherwise.
*/
pta_error pta_enable(
pta_state enable);
/**
* @brief Used to initialize the PTA feature. The PHY sequences are configured with
* respect to the "request_to_event_time" parameter.
* @note This API can be called directly to initialize the PTA feature. In case the BLE controller is supported, beside this API,
* there is an option to initialize the PTA feature through the "HCI_CMD_OCF_PTA_INIT" custom HCI command.
*
* @param request_to_event_time : [in] Time between the request signal assertion
* and beginning of event on air.
*
* @retval pta_error : PTA_DISABLED: If PTA is disabled.
* PTA_ERROR_INVALID_REQUEST_TO_EVENT_TIME: If the request_to_event_time is greater than the minimum time of the TX/RX interpacket time.
* PTA_ERROR_SUCCESS : Otherwise.
*/
pta_error pta_init(
uint8_t request_to_event_time);
/***************************** BLE Functions *****************************/
#if (SUPPORT_BLE)
#if (SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION || \
(SUPPORT_LE_EXTENDED_ADVERTISING && SUPPORT_LE_PERIODIC_ADVERTISING && (SUPPORT_EXPLCT_OBSERVER_ROLE || SUPPORT_SYNC_ISOCHRONOUS)))
/**
* @brief Used to configure the priority of the ACL and Periodic Scan events.
* @note This API can be called directly to configure the priority of the ACL and Periodic Scan events. In case the BLE controller is supported, beside this API,
* there is an option to configure the priority of the ACL and Periodic Scan events through the "HCI_CMD_OCF_PTA_BLE_SetLinkCoexPriority" custom HCI command.
*
* @param event_type : [in] Either ACL or Periodic Scan event.
* @param handle : [in] ACL Handle or Periodic Scan Handle.
* @param priority : [in] Determines the state of each priority mode.
* @param priority_mask : [in] Determines which priorities are in effect in
* the priority variable.
* @param acl_multi_slot_nbr_of_packets : [in] Number of protected slots.
* @param link_loss_limit_timeout : [in] Timeout percentage for link loss mode
*
* @retval pta_error : PTA_DISABLED: If PTA is disabled.
* PTA_ERROR_INVALID_PRIORITY_CONF:
* - If Forced configuration = 11
* - priority_mask did not mask away the reserved bits in priority
* - priority_mask masked one bit only of the first two bits in the priority.
* - event_type has invalid event type.
* - ACL Multi Slot is used with periodic sync event.
* - ACL Multi Slot is used with Link Loss Limit.
* PTA_ERROR_UNKNOWN_CONN_HANDLE : Connection Handle not found.
* PTA_ERROR_UNKNOWN_PRDC_SYNC_HANDLE : Periodic Sync Handle not found.
* PTA_ERROR_INVALID_NBR_OF_PKTS : acl_multi_slot_nbr_of_slots > PACKETS_PER_EVENT_MAX
* PTA_ERROR_INVALID_TIMEOUT : link_loss_limit_timeout < 0 or > 100.
* PTA_ERROR_SUCCESS : Otherwise.
*/
pta_error pta_set_link_coex_priority(
pta_link_coex_event_type event_type,
uint16_t handle,
uint32_t priority,
uint32_t priority_mask,
uint8_t acl_multi_slot_nbr_of_packets,
uint8_t link_loss_limit_timeout);
#endif /* (SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION || \
(SUPPORT_LE_EXTENDED_ADVERTISING && SUPPORT_LE_PERIODIC_ADVERTISING && (SUPPORT_EXPLCT_OBSERVER_ROLE || SUPPORT_SYNC_ISOCHRONOUS))) */
#if (SUPPORT_BRD_ISOCHRONOUS || SUPPORT_SYNC_ISOCHRONOUS || SUPPORT_CONNECTED_ISOCHRONOUS)
/**
* @brief Used to configure the priority of the BIG and CIG events.
* @note This API can be called directly to configure the priority of the BIG and CIG events. In case the BLE controller is supported, beside this API,
* there is an option to configure the priority of the BIG and CIG events through the "HCI_CMD_OCF_PTA_BLE_SetISOCoexPriority" custom HCI command.
*
* @param iso_type : [in] Either BIG or CIG event.
* @param group_id : [in] Isochronous Group ID.
* @param priority : [in] Determines the state of each priority mode.
* @param priority_mask : [in] Determines which priorities are in effect in
* the priority variable.
* @param link_loss_limit_timeout : [in] Timeout percentage for link loss mode
*
* @retval pta_error : PTA_DISABLED: If PTA is disabled.
* PTA_ERROR_INVALID_PRIORITY_CONF:
* - If Forced configuration = 11
* - priority_mask did not mask away the reserved bits in priority
* - priority_mask masked one bit only of the first two bits in the priority.
* - iso_type has invalid event type.
* - Protect All or Protect RTN is used with BIG.
* - Link Loss Limit is configured for Broadcaster Role for BIG.
* PTA_ERROR_UNKNOWN_BIG_HANDLE : BIG ID not found.
* PTA_ERROR_UNKNOWN_CIG_HANDLE : CIG ID not found.
* PTA_ERROR_INVALID_TIMEOUT : link_loss_limit_timeout < 0 or > 100.
* PTA_ERROR_SUCCESS : Otherwise.
*/
pta_error pta_set_iso_coex_priority(
pta_iso_type iso_type,
uint8_t group_id,
uint32_t priority,
uint32_t priority_mask,
uint8_t link_loss_limit_timeout);
#endif /* (SUPPORT_BRD_ISOCHRONOUS || SUPPORT_SYNC_ISOCHRONOUS || SUPPORT_CONNECTED_ISOCHRONOUS) */
#if (SUPPORT_CHANNEL_SOUNDING &&( SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION))
/**
* @brief Channel Sounding Priority Configuration Function
* @param [in] is_test_mode : Single Bit, Set if this for CS Test Mode
* @param [in] conn_id : ACL Connection ID Asscoiated with this CS
* @param [in] priority : Determines the state of each priority mode.
* @param [in] priority_mask : Determines which priorities are in effect in the priority variable.
* @param [in] number_protected_steps : Number of protected steps :
* @retval SUCCESS: Otherwise
*/
pta_error pta_set_cs_coex_priority(uint8_t is_test_mode,
uint16_t conn_id,
uint32_t priority,
uint32_t priority_mask,
uint8_t number_protected_steps);
#endif /*(SUPPORT_CHANNEL_SOUNDING &&( SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION))*/
#endif /* SUPPORT_BLE */
/**
* @brief Used to configure the priority of the generic BLE events.
* @note This API can be called directly to configure the priority of the generic BLE events. In case the BLE controller is supported, beside this API,
* there is an option to configure the priority of the generic BLE events through the "HCI_CMD_OCF_PTA_BLE_SetCoexPriority" custom HCI command.
*
* @param priority : [in] Determines the state of each priority mode.
* @param priority_mask : [in] Determines which priorities are in effect in
* the priority variable.
*
* @retval pta_error : PTA_DISABLED: If PTA is disabled.
* PTA_ERROR_INVALID_PRIORITY_CONF:
* - If Forced configuration = 11
* - priority_mask did not mask away the reserved bits in priority
* - priority_mask masked one bit only of the first two bits in the priority.
* PTA_ERROR_SUCCESS : Otherwise.
*/
pta_error pta_set_coex_priority(
uint32_t priority,
uint32_t priority_mask);
/***************************** MAC Functions *****************************/
#if (SUPPORT_MAC)
/**
* @brief Used to configure the priority of the MAC Packets.
* @note This API can be called directly to configure the priority of the MAC Packets. Beside this API,
* there is an option to configure the priority of the MAC Packets through the "PTA_SET_PRIORITY" MAC custom HCI command.
*
* @param priority : [in] Determines the state of each priority mode.
* @param priority_mask : [in] Determines which priorities are in effect in
* the priority variable.
*
* @retval pta_error : PTA_DISABLED: If PTA is disabled.
* PTA_ERROR_INVALID_PRIORITY_CONF:
* - If Forced configuration = 11
* - priority_mask did not mask away the reserved bits in priority
* - priority_mask masked one bit only of the first two bits in the priority.
* PTA_ERROR_SUCCESS : Otherwise.
*/
pta_error pta_set_mac_coex_priority(
uint32_t priority,
uint32_t priority_mask);
#endif /* SUPPORT_MAC */
/** @}
*/
#endif /* SUPPORT_PTA */
#endif /* PTA_H_ */

View File

@@ -0,0 +1,61 @@
/*$Id: //dwh/bluetooth/DWC_ble154combo/firmware/rel/2.00a-lca04/firmware/public_inc/rfd_dev_config.h#1 $*/
/**
********************************************************************************
* @file rfd_dev_config.h
* @brief Configurations for reduced function device and full function device
*
*
******************************************************************************
* This Synopsys DWC Bluetooth Low Energy Combo Link Layer/MAC software and
* associated documentation ( hereinafter the "Software") is an unsupported
* proprietary work of Synopsys, Inc. unless otherwise expressly agreed to in
* writing between Synopsys and you. The Software IS NOT an item of Licensed
* Software or a Licensed Product under any End User Software License Agreement
* or Agreement for Licensed Products with Synopsys or any supplement thereto.
* Synopsys is a registered trademark of Synopsys, Inc. Other names included in
* the SOFTWARE may be the trademarks of their respective owners.
*
* Synopsys MIT License:
* Copyright (c) 2020-Present Synopsys, Inc
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* the Software), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute,
* sublicense, and/or sell copies of the Software, and to permit persons to whom
* the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING, BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE ARISING FROM,
* OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* */
#ifndef MAC_CONTROLLER_INC_RFD_DEV_CONFIG_H_
#define MAC_CONTROLLER_INC_RFD_DEV_CONFIG_H_
#include "ll_fw_config.h"
#if (!FFD_DEVICE_CONFIG) /* RFD Device Configuration */
#define RFD_SUPPORT_ACTIVE_SCAN 1 /* Enable\Disable :RFD supports Active Scanning Enable:1 - Disable:0 */
#define RFD_SUPPORT_ENERGY_DETECT 1 /* Enable\Disable :RFD supports Energy Detection Enable:1 - Disable:0 */
#define RFD_SUPPORT_DATA_PURGE 0 /* Enable\Disable :RFD supports Data Purge Primitive Enable:1 - Disable:0 */
#define RFD_SUPPORT_ASSOCIATION_IND_RSP 0 /* Enable\Disable :RFD supports Association Indication and Response Primitives Enable:1 - Disable:0 */
#define RFD_SUPPORT_ORPHAN_IND_RSP 1 /* Enable\Disable :RFD supports Orphan Indication and Response Primitives Enable:1 - Disable:0 */
#define RFD_SUPPORT_START_PRIM 1 /* Enable\Disable :RFD supports Start Primitive Enable:1 - Disable:0 */
#define RFD_SUPPORT_PROMISCUOUS_MODE 1 /* Enable\Disable :RFD supports Promiscuous Mode Enable:1 - Disable:0 */
#define RFD_SUPPORT_SEND_BEACON 1 /* Enable\Disable :RFD supports Sending Beacons if Coordinator Enable:1 - Disable:0 */
#define RFD_SUPPORT_PANID_CONFLICT_RSLN 1 /* Enable\Disable :RFD supports Pan Id conflict detection and resolution Enable:1 - Disable:0 */
#endif
#endif /* MAC_CONTROLLER_INC_RFD_DEV_CONFIG_H_ */

View File

@@ -0,0 +1,348 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.lib.release.168222971.1575901614">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.lib.release.168222971.1575901614" moduleId="org.eclipse.cdt.core.settings" name="Thread">
<externalSettings>
<externalSetting>
<entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/CubeIDE_LL"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/CubeIDE_LL/WBA_MAC_Lib"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/CubeIDE_LL/Thread"/>
<entry flags="RESOLVED" kind="libraryFile" name="LinkLayer_Thread_lib_CubeIDE" srcPrefixMapping="" srcRootPath=""/>
</externalSetting>
</externalSettings>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactExtension="a" artifactName="LinkLayer_Thread_lib_CubeIDE" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release" cleanCommand="rm -rf" description="" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.lib.release.168222971.1575901614" name="Thread" parent="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.lib.release" postannouncebuildStep="Copy ${BuildArtifactFileName} in Delivery folder" postbuildStep="cp &quot;${CWD}\${BuildArtifactFileName}&quot; &quot;${CWD}\..\..&quot;">
<folderInfo id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.lib.release.168222971.1575901614." name="/" resourcePath="">
<toolChain id="com.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.lib.release.418831215" name="MCU ARM GCC" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.lib.release">
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_mcu.230645373" name="MCU" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_mcu" useByScannerDiscovery="true" value="STM32WBA52CGUx" valueType="string"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_cpuid.485318033" name="CPU" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_cpuid" useByScannerDiscovery="false" value="0" valueType="string"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_coreid.1021324293" name="Core" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_coreid" useByScannerDiscovery="false" value="0" valueType="string"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.fpu.652847402" name="Floating-point unit" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.fpu" useByScannerDiscovery="true" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.fpu.value.none" valueType="enumerated"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.floatabi.497462426" name="Floating-point ABI" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.floatabi" useByScannerDiscovery="true" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.floatabi.value.hard" valueType="enumerated"/>
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform.1724638613" isAbstract="false" osList="all" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform"/>
<builder buildPath="${workspace_loc:/CubeIDE_LL}/Release" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder.506004295" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder"/>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.858402915" name="MCU GCC Assembler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler">
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.1731450049" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.value.g0" valueType="enumerated"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.includepaths.1244135756" name="Include paths (-I)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.includepaths" useByScannerDiscovery="false" valueType="includePath"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.definedsymbols.248883881" name="Define symbols (-D)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.definedsymbols" useByScannerDiscovery="false" valueType="definedSymbols"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.otherflags.376524875" name="Other flags" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.otherflags" useByScannerDiscovery="true" valueType="stringList">
<listOptionValue builtIn="false" value="-mno-unaligned-access"/>
</option>
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input.1706969497" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input"/>
</tool>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.2025162950" name="MCU GCC Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler">
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel.1929276161" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel.value.g0" valueType="enumerated"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.1710007046" name="Optimization level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.value.os" valueType="enumerated"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.includepaths.35511036" name="Include paths (-I)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.includepaths" useByScannerDiscovery="false" valueType="includePath">
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/inc"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/porting"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/src/shrd_utils/inc"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/src/shrd_utils/inc/_40nm_reg_files"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/src/ble_controller/inc"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/src/mac_controller/inc"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/inc/ot_inc"/>
<listOptionValue builtIn="false" value="../../../../../../../../Drivers/CMSIS/Include"/>
<listOptionValue builtIn="false" value="../../../../../../../../Drivers/CMSIS/Device/ST/STM32WBAxx/Include"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/config/thread"/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.definedsymbols.1504598478" name="Define symbols (-D)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.definedsymbols" useByScannerDiscovery="false" valueType="definedSymbols">
<listOptionValue builtIn="false" value="STM32WBA55xx"/>
<listOptionValue builtIn="false" value="USE_FULL_ASSERT"/>
<listOptionValue builtIn="false" value="USE_FULL_LL_DRIVER"/>
<listOptionValue builtIn="false" value="PHY_2_10_a"/>
<listOptionValue builtIn="false" value="PHY_40nm_3_00_a"/>
<listOptionValue builtIn="false" value="LOGGER_ENABLE=0"/>
<listOptionValue builtIn="false" value="LOGUARTENABLED"/>
<listOptionValue builtIn="false" value="MAC"/>
<listOptionValue builtIn="false" value="USED_RTL_VER=2"/>
<listOptionValue builtIn="false" value="OS_BAREMETAL"/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.otherflags.554638810" name="Other flags" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.otherflags" useByScannerDiscovery="true" valueType="stringList">
<listOptionValue builtIn="false" value="-mno-unaligned-access"/>
</option>
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.1745654827" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c"/>
</tool>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.985388072" name="MCU G++ Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler">
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel.986474974" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel.value.g0" valueType="enumerated"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level.2065303464" name="Optimization level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level.value.os" valueType="enumerated"/>
</tool>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.2102155186" name="MCU GCC Linker" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker"/>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.linker.1184961019" name="MCU G++ Linker" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.linker"/>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.archiver.1588347967" name="MCU GCC Archiver" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.archiver">
<outputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.archiver.output.1803639125" outputPrefix="" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.archiver.output"/>
</tool>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.size.477732692" name="MCU Size" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.size"/>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objdump.listfile.2143300665" name="MCU Output Converter list file" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objdump.listfile"/>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.hex.701178148" name="MCU Output Converter Hex" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.hex"/>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.binary.1411137376" name="MCU Output Converter Binary" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.binary"/>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.verilog.1363430085" name="MCU Output Converter Verilog" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.verilog"/>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.srec.804552226" name="MCU Output Converter Motorola S-rec" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.srec"/>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.symbolsrec.243052555" name="MCU Output Converter Motorola S-rec with symbols" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.symbolsrec"/>
</toolChain>
</folderInfo>
<sourceEntries>
<entry excluding="LinkLayer/mac_controller/sample_prtcl_test.c|LinkLayer/mac_controller/dtm.c|LinkLayer/mac_controller/coexistence.c|LinkLayer/shrd_utils/power_table.c|LinkLayer/shrd_utils/sync_nimble_osw.c|LinkLayer/shrd_utils/sync_freertos.c|LinkLayer/shrd_utils/sync_baremetal.c|LinkLayer/shrd_utils/phy/llhwc_phy_sequences_40nm_2_12_a_A1.c|LinkLayer/mac_controller/mac.c|LinkLayer/mac_controller/mac_hci.c|Middlewares|ble_controller/ble_time.c|mac_controller/mac.c|mac_controller/dtm.c|mac_controller/mac_hci.c|mac_controller/key_tbl_cfg_sec_test.c|shrd_utils/phy/llhwc_phy_sequences_40nm_2_12_a_A1.c|mac_controller/sec.c|mac_controller/ral.c|mac_controller/mac_pkt_mem_if.c|mac_controller/coexistence.c|mac_controller/sample_prtcl_test.c|mac_controller/mac_pdu_hndlr.c|shrd_utils/phy/llhwc_phy_sequences_40nm_3_00_a.c|mac_controller/radio.c|mac_controller/mac_mem_cfg.c" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.lib.release.168222971.1575901614.1500529711">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.lib.release.168222971.1575901614.1500529711" moduleId="org.eclipse.cdt.core.settings" name="Phy_15.4">
<externalSettings>
<externalSetting>
<entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/CubeIDE_LL"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/CubeIDE_LL/Phy_15.4"/>
<entry flags="RESOLVED" kind="libraryFile" name="LinkLayer15_4_CubeIDE" srcPrefixMapping="" srcRootPath=""/>
</externalSetting>
</externalSettings>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactExtension="a" artifactName="LinkLayer15_4_CubeIDE" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release" cleanCommand="rm -rf" description="" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.lib.release.168222971.1575901614.1500529711" name="Phy_15.4" parent="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.lib.release" postannouncebuildStep="Copy ${BuildArtifactFileName} in Delivery folder" postbuildStep="cp &quot;${CWD}\${BuildArtifactFileName}&quot; &quot;${CWD}\..\..&quot;">
<folderInfo id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.lib.release.168222971.1575901614.1500529711." name="/" resourcePath="">
<toolChain id="com.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.lib.release.709524443" name="MCU ARM GCC" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.lib.release">
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_mcu.1774511335" name="MCU" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_mcu" useByScannerDiscovery="true" value="STM32WBA52CGUx" valueType="string"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_cpuid.121517925" name="CPU" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_cpuid" useByScannerDiscovery="false" value="0" valueType="string"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_coreid.358917380" name="Core" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_coreid" useByScannerDiscovery="false" value="0" valueType="string"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.fpu.1120226214" name="Floating-point unit" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.fpu" useByScannerDiscovery="true" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.fpu.value.none" valueType="enumerated"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.floatabi.1986456887" name="Floating-point ABI" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.floatabi" useByScannerDiscovery="true" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.floatabi.value.hard" valueType="enumerated"/>
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform.1642377511" isAbstract="false" osList="all" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform"/>
<builder buildPath="${workspace_loc:/CubeIDE_LL}/Release" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder.996605837" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder"/>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.1778417163" name="MCU GCC Assembler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler">
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.1965642659" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.value.g0" valueType="enumerated"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.includepaths.262773621" name="Include paths (-I)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.includepaths" useByScannerDiscovery="false" valueType="includePath"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.definedsymbols.1535454467" name="Define symbols (-D)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.definedsymbols" useByScannerDiscovery="false" valueType="definedSymbols"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.otherflags.953543947" name="Other flags" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.otherflags" useByScannerDiscovery="true" valueType="stringList">
<listOptionValue builtIn="false" value="-mno-unaligned-access"/>
</option>
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input.1469374174" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input"/>
</tool>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.339041043" name="MCU GCC Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler">
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel.453902153" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel.value.g0" valueType="enumerated"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.334695317" name="Optimization level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.value.os" valueType="enumerated"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.includepaths.1263924867" name="Include paths (-I)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.includepaths" useByScannerDiscovery="false" valueType="includePath">
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/inc"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/config/ieee_15_4_basic"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/porting"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/src/shrd_utils/inc"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/src/shrd_utils/inc/_40nm_reg_files"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/src/ble_controller/inc"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/src/mac_controller/inc"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/inc/ot_inc"/>
<listOptionValue builtIn="false" value="../../../../../../../../Drivers/CMSIS/Include"/>
<listOptionValue builtIn="false" value="../../../../../../../../Drivers/CMSIS/Device/ST/STM32WBAxx/Include"/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.definedsymbols.1917002041" name="Define symbols (-D)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.definedsymbols" useByScannerDiscovery="false" valueType="definedSymbols">
<listOptionValue builtIn="false" value="STM32WBA55xx"/>
<listOptionValue builtIn="false" value="USE_FULL_ASSERT"/>
<listOptionValue builtIn="false" value="USE_FULL_LL_DRIVER"/>
<listOptionValue builtIn="false" value="PHY_2_10_a"/>
<listOptionValue builtIn="false" value="PHY_40nm_3_00_a"/>
<listOptionValue builtIn="false" value="LOGGER_ENABLE=0"/>
<listOptionValue builtIn="false" value="LOGUARTENABLED"/>
<listOptionValue builtIn="false" value="MAC=1"/>
<listOptionValue builtIn="false" value="USED_RTL_VER=2"/>
<listOptionValue builtIn="false" value="OS_BAREMETAL"/>
<listOptionValue builtIn="false" value="MAC_LAYER=1"/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.otherflags.406781926" name="Other flags" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.otherflags" useByScannerDiscovery="true" valueType="stringList">
<listOptionValue builtIn="false" value="-mno-unaligned-access"/>
</option>
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.298150360" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c"/>
</tool>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.964411783" name="MCU G++ Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler">
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel.1274026382" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel.value.g0" valueType="enumerated"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level.1144089889" name="Optimization level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level.value.os" valueType="enumerated"/>
</tool>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.1962067029" name="MCU GCC Linker" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker"/>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.linker.1015899301" name="MCU G++ Linker" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.linker"/>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.archiver.309052761" name="MCU GCC Archiver" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.archiver">
<outputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.archiver.output.61878365" outputPrefix="" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.archiver.output"/>
</tool>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.size.110844800" name="MCU Size" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.size"/>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objdump.listfile.1935855532" name="MCU Output Converter list file" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objdump.listfile"/>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.hex.1628261990" name="MCU Output Converter Hex" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.hex"/>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.binary.1680059638" name="MCU Output Converter Binary" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.binary"/>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.verilog.1224185654" name="MCU Output Converter Verilog" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.verilog"/>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.srec.1284580666" name="MCU Output Converter Motorola S-rec" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.srec"/>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.symbolsrec.1988649208" name="MCU Output Converter Motorola S-rec with symbols" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.symbolsrec"/>
</toolChain>
</folderInfo>
<sourceEntries>
<entry excluding="LinkLayer/shrd_utils/phy/llhwc_phy_sequences_40nm_2_12_a_A1.c|LinkLayer/shrd_utils/pta.c|LinkLayer/porting/bus_interface.c|LinkLayer/mac_controller/sample_prtcl_test.c|LinkLayer/mac_controller/dtm.c|LinkLayer/mac_controller/coexistence.c|LinkLayer/shrd_utils/power_table.c|LinkLayer/shrd_utils/sync_nimble_osw.c|LinkLayer/shrd_utils/sync_freertos.c|LinkLayer/shrd_utils/sync_baremetal.c|LinkLayer/mac_controller/mac_hci.c|Middlewares|ble_controller/ble_time.c|mac_controller/mac.c|mac_controller/dtm.c|mac_controller/mac_hci.c|mac_controller/key_tbl_cfg_sec_test.c|shrd_utils/phy/llhwc_phy_sequences_40nm_2_12_a_A1.c|mac_controller/sec.c|mac_controller/ral.c|mac_controller/mac_pkt_mem_if.c|mac_controller/coexistence.c|mac_controller/sample_prtcl_test.c|mac_controller/mac_pdu_hndlr.c|shrd_utils/phy/llhwc_phy_sequences_40nm_3_00_a.c|mac_controller/radio.c|mac_controller/mac_mem_cfg.c" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.lib.release.168222971.1575901614.1500529711.652731974">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.lib.release.168222971.1575901614.1500529711.652731974" moduleId="org.eclipse.cdt.core.settings" name="Raw_Mac">
<externalSettings>
<externalSetting>
<entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/CubeIDE_LL"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/CubeIDE_LL/Raw_Mac"/>
<entry flags="RESOLVED" kind="libraryFile" name="LinkLayer_RawMac_lib_CubeIDE" srcPrefixMapping="" srcRootPath=""/>
</externalSetting>
</externalSettings>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactExtension="a" artifactName="LinkLayer_RawMac_lib_CubeIDE" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release" cleanCommand="rm -rf" description="" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.lib.release.168222971.1575901614.1500529711.652731974" name="Raw_Mac" parent="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.lib.release" postannouncebuildStep="Copy ${BuildArtifactFileName} in Delivery folder" postbuildStep="cp &quot;${CWD}\${BuildArtifactFileName}&quot; &quot;${CWD}\..\..&quot;">
<folderInfo id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.lib.release.168222971.1575901614.1500529711.652731974." name="/" resourcePath="">
<toolChain id="com.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.lib.release.1230836149" name="MCU ARM GCC" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.lib.release">
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_mcu.1540308899" name="MCU" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_mcu" useByScannerDiscovery="true" value="STM32WBA52CGUx" valueType="string"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_cpuid.948763530" name="CPU" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_cpuid" useByScannerDiscovery="false" value="0" valueType="string"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_coreid.1565559321" name="Core" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_coreid" useByScannerDiscovery="false" value="0" valueType="string"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.fpu.1891748229" name="Floating-point unit" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.fpu" useByScannerDiscovery="true" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.fpu.value.none" valueType="enumerated"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.floatabi.1402637354" name="Floating-point ABI" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.floatabi" useByScannerDiscovery="true" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.floatabi.value.hard" valueType="enumerated"/>
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform.330752996" isAbstract="false" osList="all" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform"/>
<builder buildPath="${workspace_loc:/CubeIDE_LL}/Release" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder.576422291" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder"/>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.1660005244" name="MCU GCC Assembler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler">
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.1787135410" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.value.g0" valueType="enumerated"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.includepaths.1530697096" name="Include paths (-I)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.includepaths" useByScannerDiscovery="false" valueType="includePath"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.definedsymbols.27066548" name="Define symbols (-D)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.definedsymbols" useByScannerDiscovery="false" valueType="definedSymbols"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.otherflags.1006918197" name="Other flags" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.otherflags" useByScannerDiscovery="true" valueType="stringList">
<listOptionValue builtIn="false" value="-mno-unaligned-access"/>
</option>
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input.1676107074" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input"/>
</tool>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1812017333" name="MCU GCC Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler">
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel.383930479" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel.value.g0" valueType="enumerated"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.107928559" name="Optimization level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.value.os" valueType="enumerated"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.includepaths.2055857458" name="Include paths (-I)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.includepaths" useByScannerDiscovery="false" valueType="includePath">
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/inc"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/config/ieee_15_4_basic"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/porting"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/src/shrd_utils/inc"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/src/shrd_utils/inc/_40nm_reg_files"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/src/ble_controller/inc"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/src/mac_controller/inc"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/inc/ot_inc"/>
<listOptionValue builtIn="false" value="../../../../../../../../Drivers/CMSIS/Include"/>
<listOptionValue builtIn="false" value="../../../../../../../../Drivers/CMSIS/Device/ST/STM32WBAxx/Include"/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.definedsymbols.1311509942" name="Define symbols (-D)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.definedsymbols" useByScannerDiscovery="false" valueType="definedSymbols">
<listOptionValue builtIn="false" value="STM32WBA55xx"/>
<listOptionValue builtIn="false" value="USE_FULL_ASSERT"/>
<listOptionValue builtIn="false" value="USE_FULL_LL_DRIVER"/>
<listOptionValue builtIn="false" value="PHY_2_10_a"/>
<listOptionValue builtIn="false" value="PHY_40nm_3_00_a"/>
<listOptionValue builtIn="false" value="LOGGER_ENABLE=0"/>
<listOptionValue builtIn="false" value="LOGUARTENABLED"/>
<listOptionValue builtIn="false" value="MAC=1"/>
<listOptionValue builtIn="false" value="USED_RTL_VER=2"/>
<listOptionValue builtIn="false" value="OS_BAREMETAL"/>
<listOptionValue builtIn="false" value="MAC_LAYER=1"/>
<listOptionValue builtIn="false" value="RAL_ACK_ALL_RECEIVED_FRAMES_WITH_AR_BIT_SET"/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.otherflags.615907550" name="Other flags" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.otherflags" useByScannerDiscovery="true" valueType="stringList">
<listOptionValue builtIn="false" value="-mno-unaligned-access"/>
</option>
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.738353406" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c"/>
</tool>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.316809872" name="MCU G++ Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler">
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel.1471231773" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel.value.g0" valueType="enumerated"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level.1891964402" name="Optimization level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level.value.os" valueType="enumerated"/>
</tool>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.506364426" name="MCU GCC Linker" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker"/>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.linker.550368749" name="MCU G++ Linker" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.linker"/>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.archiver.1893315958" name="MCU GCC Archiver" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.archiver">
<outputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.archiver.output.573399522" outputPrefix="" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.archiver.output"/>
</tool>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.size.136667992" name="MCU Size" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.size"/>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objdump.listfile.815859859" name="MCU Output Converter list file" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objdump.listfile"/>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.hex.715034968" name="MCU Output Converter Hex" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.hex"/>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.binary.2137368362" name="MCU Output Converter Binary" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.binary"/>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.verilog.1621631345" name="MCU Output Converter Verilog" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.verilog"/>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.srec.1705835259" name="MCU Output Converter Motorola S-rec" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.srec"/>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.symbolsrec.95607202" name="MCU Output Converter Motorola S-rec with symbols" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.symbolsrec"/>
</toolChain>
</folderInfo>
<sourceEntries>
<entry excluding="LinkLayer/shrd_utils/pta.c|LinkLayer/porting/bus_interface.c|LinkLayer/mac_controller/sample_prtcl_test.c|LinkLayer/mac_controller/dtm.c|LinkLayer/mac_controller/coexistence.c|LinkLayer/shrd_utils/power_table.c|LinkLayer/shrd_utils/sync_nimble_osw.c|LinkLayer/shrd_utils/sync_freertos.c|LinkLayer/shrd_utils/sync_baremetal.c|LinkLayer/shrd_utils/phy/llhwc_phy_sequences_40nm_2_12_a_A1.c|LinkLayer/mac_controller/mac_hci.c|Middlewares|ble_controller/ble_time.c|mac_controller/mac.c|mac_controller/dtm.c|mac_controller/mac_hci.c|mac_controller/key_tbl_cfg_sec_test.c|shrd_utils/phy/llhwc_phy_sequences_40nm_2_12_a_A1.c|mac_controller/sec.c|mac_controller/ral.c|mac_controller/mac_pkt_mem_if.c|mac_controller/coexistence.c|mac_controller/sample_prtcl_test.c|mac_controller/mac_pdu_hndlr.c|shrd_utils/phy/llhwc_phy_sequences_40nm_3_00_a.c|mac_controller/radio.c|mac_controller/mac_mem_cfg.c" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="CubeIDE_LL.com.st.stm32cube.ide.mcu.gnu.managedbuild.projecttype.lib.1702792739" name="Static Library" projectType="com.st.stm32cube.ide.mcu.gnu.managedbuild.projecttype.lib"/>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
<storageModule moduleId="refreshScope" versionNumber="2">
<configuration configurationName="FULL_Cut_1"/>
<configuration configurationName="FULL_Cut_2"/>
<configuration configurationName="BASIC_Cut_2"/>
<configuration configurationName="BASIC_Cut_1"/>
<configuration configurationName="Phy_15_4"/>
<configuration configurationName="Raw_Mac"/>
<configuration configurationName="Phy_15.4">
<resource resourceType="PROJECT" workspacePath="/CubeIDE_LL"/>
</configuration>
<configuration configurationName="Debug">
<resource resourceType="PROJECT" workspacePath="/CubeIDE_LL"/>
</configuration>
<configuration configurationName="Release">
<resource resourceType="PROJECT" workspacePath="/CubeIDE_LL"/>
</configuration>
<configuration configurationName="FULL">
<resource resourceType="PROJECT" workspacePath="/CubeIDE_LL"/>
</configuration>
<configuration configurationName="BASIC">
<resource resourceType="PROJECT" workspacePath="/CubeIDE_LL"/>
</configuration>
<configuration configurationName="Thread"/>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
<storageModule moduleId="org.eclipse.cdt.core.pathentry"/>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
<scannerConfigBuildInfo instanceId="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.lib.release.168222971.1575901614;com.st.stm32cube.ide.mcu.gnu.managedbuild.config.lib.release.168222971.1575901614.;com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.2025162950;com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.1745654827">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.lib.release.168222971.1575901614.1500529711;com.st.stm32cube.ide.mcu.gnu.managedbuild.config.lib.release.168222971.1575901614.1500529711.;com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.339041043;com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.298150360">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.lib.release.168222971.1575901614.1500529711.652731974;com.st.stm32cube.ide.mcu.gnu.managedbuild.config.lib.release.168222971.1575901614.1500529711.652731974.;com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1812017333;com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.738353406">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.lib.release.168222971.100922532;com.st.stm32cube.ide.mcu.gnu.managedbuild.config.lib.release.168222971.100922532.;com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1958625225;com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.1023228660">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.lib.release.168222971;com.st.stm32cube.ide.mcu.gnu.managedbuild.config.lib.release.168222971.;com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.277943553;com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.1237219265">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.lib.debug.517873946.1234476334;com.st.stm32cube.ide.mcu.gnu.managedbuild.config.lib.debug.517873946.1234476334.;com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.402170967;com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.668012263">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.lib.debug.517873946;com.st.stm32cube.ide.mcu.gnu.managedbuild.config.lib.debug.517873946.;com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.662977711;com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.1968206538">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.lib.release.168222971.100922532.504486622;com.st.stm32cube.ide.mcu.gnu.managedbuild.config.lib.release.168222971.100922532.504486622.;com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1418855729;com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.123830732">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
</storageModule>
</cproject>

Some files were not shown because too many files have changed in this diff Show More