Imported more library files
Not compiling currently
This commit is contained in:
363
Libs/protocol/bluetooth/inc/sl_bgapi.h
Normal file
363
Libs/protocol/bluetooth/inc/sl_bgapi.h
Normal file
@@ -0,0 +1,363 @@
|
||||
/***************************************************************************//**
|
||||
* @brief Silicon Labs BGAPI types and macros
|
||||
*******************************************************************************
|
||||
* # License
|
||||
* <b>Copyright 2019-2020 Silicon Laboratories Inc. www.silabs.com</b>
|
||||
*******************************************************************************
|
||||
*
|
||||
* The licensor of this software is Silicon Laboratories Inc. Your use of this
|
||||
* software is governed by the terms of Silicon Labs Master Software License
|
||||
* Agreement (MSLA) available at
|
||||
* www.silabs.com/about-us/legal/master-software-license-agreement. This
|
||||
* software is distributed to you in Source Code format and is governed by the
|
||||
* sections of the MSLA applicable to Source Code.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef SL_BGAPI_H
|
||||
#define SL_BGAPI_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include "sl_status.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Macros to declare deprecated functions */
|
||||
#if defined(__IAR_SYSTEMS_ICC__)
|
||||
#define SL_BGAPI_DEPRECATED _Pragma("deprecated")
|
||||
#elif defined(__GNUC__)
|
||||
#define SL_BGAPI_DEPRECATED __attribute__((deprecated))
|
||||
#else
|
||||
#define SL_BGAPI_DEPRECATED
|
||||
#endif
|
||||
|
||||
/* Compatibility */
|
||||
#ifndef PACKSTRUCT
|
||||
/*Default packed configuration*/
|
||||
#ifdef __GNUC__
|
||||
#ifdef _WIN32
|
||||
#define PACKSTRUCT(decl) decl __attribute__((__packed__, gcc_struct))
|
||||
#else
|
||||
#define PACKSTRUCT(decl) decl __attribute__((__packed__))
|
||||
#endif
|
||||
#define ALIGNED __attribute__((aligned(0x4)))
|
||||
#elif __IAR_SYSTEMS_ICC__
|
||||
|
||||
#define PACKSTRUCT(decl) __packed decl
|
||||
|
||||
#define ALIGNED
|
||||
#elif _MSC_VER /*msvc*/
|
||||
|
||||
#define PACKSTRUCT(decl) __pragma(pack(push, 1) ) decl __pragma(pack(pop) )
|
||||
#define ALIGNED
|
||||
#else
|
||||
#define PACKSTRUCT(a) a PACKED
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* The maximum BGAPI command payload size.
|
||||
*/
|
||||
#ifndef SL_BGAPI_MAX_PAYLOAD_SIZE
|
||||
#define SL_BGAPI_MAX_PAYLOAD_SIZE 256
|
||||
#endif
|
||||
|
||||
/***************************************************************************//**
|
||||
* @addtogroup sl_bgapi_types BGAPI Types
|
||||
* @brief Common types in BGAPI protocol
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef SL_BT_TYPE_UINT8ARRARY
|
||||
#define SL_BT_TYPE_UINT8ARRARY
|
||||
/** @brief Variable-length uint8_t array. Maximum length: 255 */
|
||||
typedef struct {
|
||||
uint8_t len; /**< Number of bytes stored in @p data */
|
||||
uint8_t data[]; /**< Data bytes*/
|
||||
} uint8array;
|
||||
#endif
|
||||
|
||||
#ifndef SL_BT_TYPE_BYTE_ARRARY
|
||||
#define SL_BT_TYPE_BYTE_ARRARY
|
||||
/** @brief Variable-length int8_t array. Maximum length: 65535 */
|
||||
typedef struct {
|
||||
uint16_t len; /**< Number of bytes stored in @p data */
|
||||
int8_t data[]; /**< Data bytes*/
|
||||
} byte_array;
|
||||
#endif
|
||||
|
||||
#ifndef SL_BT_TYPE_BDADDR
|
||||
#define SL_BT_TYPE_BDADDR
|
||||
/** @brief Bluetooth address */
|
||||
typedef struct {
|
||||
uint8_t addr[6]; /**< @brief Bluetooth address in reverse byte order */
|
||||
} bd_addr;
|
||||
#endif
|
||||
|
||||
#ifndef SL_BT_TYPE_UUID128
|
||||
#define SL_BT_TYPE_UUID128
|
||||
/** @brief 128-bit UUID */
|
||||
typedef struct {
|
||||
uint8_t data[16]; /**< 128-bit UUID */
|
||||
} uuid_128;
|
||||
#endif
|
||||
|
||||
#ifndef SL_BT_TYPE_AES_KEY128
|
||||
#define SL_BT_TYPE_AES_KEY128
|
||||
/** @brief 128-bit AES key */
|
||||
typedef struct {
|
||||
uint8_t data[16]; /**< 128-bit AES key */
|
||||
} aes_key_128;
|
||||
#endif
|
||||
|
||||
#ifndef SL_BT_TYPE_UUID16
|
||||
#define SL_BT_TYPE_UUID16
|
||||
/** @brief 16-bit UUID */
|
||||
typedef struct {
|
||||
uint8_t data[2]; /**< 16-bit UUID */
|
||||
} sl_bt_uuid_16_t;
|
||||
#endif
|
||||
|
||||
#ifndef SL_BT_TYPE_UUID64
|
||||
#define SL_BT_TYPE_UUID64
|
||||
/** @brief 64-bit UUID */
|
||||
typedef struct {
|
||||
uint8_t data[8]; /**< 64-bit UUID */
|
||||
} sl_bt_uuid_64_t;
|
||||
#endif
|
||||
|
||||
/** @} */ // end addtogroup sl_bgapi_types
|
||||
/******************************************************************************/
|
||||
|
||||
/** @brief Internal function prototype for BGAPI command handlers */
|
||||
typedef void (*sl_bgapi_handler)(const void*);
|
||||
|
||||
typedef enum sl_bgapi_msg_types {
|
||||
sl_bgapi_msg_type_cmd = 0x00,
|
||||
sl_bgapi_msg_type_rsp = 0x00,
|
||||
sl_bgapi_msg_type_evt = 0x80
|
||||
} sl_bgapi_msg_types_t;
|
||||
|
||||
enum sl_bgapi_dev_types {
|
||||
sl_bgapi_dev_type_app = 0x00,
|
||||
sl_bgapi_dev_type_bt = 0x20,
|
||||
sl_bgapi_dev_type_btmesh = 0x28,
|
||||
sl_bgapi_dev_type_bgapi_debug = 0x30,
|
||||
};
|
||||
|
||||
/***************************************************************************//**
|
||||
* @addtogroup sl_bgapi_types BGAPI Types
|
||||
* @brief Common types in BGAPI protocol
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief The length of a BGAPI message header which is 4 bytes
|
||||
*/
|
||||
#define SL_BGAPI_MSG_HEADER_LEN (4)
|
||||
|
||||
/**
|
||||
* @brief The length of the BGAPI message payload of a generic error response
|
||||
*
|
||||
* See function @ref sl_bgapi_set_error_response for how to generate a generic
|
||||
* error response.
|
||||
*/
|
||||
#define SL_BGAPI_MSG_ERROR_PAYLOAD_LEN (2)
|
||||
|
||||
/**
|
||||
* @brief Get the device type of a BGAPI message
|
||||
*
|
||||
* @param HDR The header of the message as a uint32_t integer
|
||||
*/
|
||||
#define SL_BGAPI_MSG_DEVICE_TYPE(HDR) ((HDR) & 0x38)
|
||||
|
||||
/**
|
||||
* @brief Get the identifier of a BGAPI message including device type, class ID,
|
||||
* message type and message ID.
|
||||
*
|
||||
* @param HDR The header of the message as a uint32_t integer
|
||||
*/
|
||||
#define SL_BGAPI_MSG_ID(HDR) ((HDR) & 0xffff00f8)
|
||||
|
||||
/**
|
||||
* @brief Get the data payload length in a BGAPI message.
|
||||
*
|
||||
* @param HDR The header of the message as a uint32_t integer
|
||||
*/
|
||||
#define SL_BGAPI_MSG_LEN(HDR) ((((HDR) & 0x7) << 8) | (((HDR) & 0xff00) >> 8))
|
||||
|
||||
/**
|
||||
* @brief The bit indicating whether data of a BGAPI message is encrypted
|
||||
*/
|
||||
#define SL_BGAPI_BIT_ENCRYPTED (1 << 6) // Bit
|
||||
|
||||
/**
|
||||
* @brief Check whether data of a BGAPI message is encrypted.
|
||||
*
|
||||
* @param HDR The BGAPI header of the message as a uint32_t integer
|
||||
*/
|
||||
#define SL_BGAPI_MSG_ENCRYPTED(HDR) ((HDR)&SL_BGAPI_BIT_ENCRYPTED)
|
||||
|
||||
/**
|
||||
* @brief Construct a BGAPI message header from an event ID and payload length.
|
||||
*
|
||||
* It is the caller's responsibility to verify that the input values are within
|
||||
* valid range.
|
||||
*
|
||||
* @param[in] evt_id The full event ID constant, for example
|
||||
* `sl_bt_evt_system_boot_id`
|
||||
* @param[in] payload_len Length of the full BGAPI message payload
|
||||
*
|
||||
* @return The header as a `uint32_t` value
|
||||
*/
|
||||
#define SL_BGAPI_MSG_HEADER_FROM_ID_AND_LEN(evt_id, payload_len) \
|
||||
((uint32_t) (((uint32_t) (evt_id)) \
|
||||
| (((uint32_t) (payload_len) & 0x00FF) << 8) \
|
||||
| (((uint32_t) (payload_len) & 0x0700) >> 8))) \
|
||||
|
||||
/** @} */ // end addtogroup sl_bgapi_types
|
||||
/******************************************************************************/
|
||||
|
||||
/**
|
||||
* @addtogroup sl_bgapi_functions BGAPI Functions
|
||||
* @{
|
||||
*
|
||||
* @brief Functions provided by the BGAPI protocol
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Lock the BGAPI for exclusive access.
|
||||
*
|
||||
* NOTE: This function is provided for NCP/CPC components that need to handle
|
||||
* BGAPI commands and responses in their binary format in an application that
|
||||
* uses an RTOS. Normal application code that issues BGAPI commands by calling
|
||||
* API functions defined by protocol stacks must never call this function
|
||||
* directly.
|
||||
*
|
||||
* See the documentation of @ref sl_bgapi_handle_command for the full sequence
|
||||
* that must be followed when processing commands in their binary format.
|
||||
*
|
||||
* @return SL_STATUS_OK if the lock has been obtained, otherwise an error code
|
||||
*/
|
||||
sl_status_t sl_bgapi_lock(void);
|
||||
|
||||
/**
|
||||
* @brief Release the lock obtained by @ref sl_bgapi_lock
|
||||
*
|
||||
* NOTE: This function is provided for NCP/CPC components that need to handle
|
||||
* BGAPI commands and responses in their binary format in an application that
|
||||
* uses an RTOS. Normal application code that issues BGAPI commands by calling
|
||||
* API functions defined by protocol stacks must never call this function
|
||||
* directly.
|
||||
*
|
||||
* See the documentation of @ref sl_bgapi_handle_command for the full sequence
|
||||
* that must be followed when processing commands in their binary format.
|
||||
*/
|
||||
void sl_bgapi_unlock(void);
|
||||
|
||||
/**
|
||||
* @brief Handle a BGAPI command in binary format.
|
||||
*
|
||||
* NOTE: This function is provided for NCP/CPC components that need to handle
|
||||
* BGAPI commands and responses in their binary format. Normal application code
|
||||
* that issues BGAPI commands by calling API functions defined by protocol
|
||||
* stacks must never call this function directly.
|
||||
*
|
||||
* If the application uses an RTOS, the caller must protect the BGAPI handling
|
||||
* by obtaining the BGAPI lock with @ref sl_bgapi_lock, handle the command with
|
||||
* @ref sl_bgapi_handle_command, read the response from the buffer returned by
|
||||
* @ref sl_bgapi_get_command_response, and then release the lock with @ref
|
||||
* sl_bgapi_unlock. Here's an example of the full sequence that's required:
|
||||
*
|
||||
* @code
|
||||
* // Lock BGAPI for exclusive access
|
||||
* sl_status_t status = sl_bgapi_lock();
|
||||
* if (status != SL_STATUS_OK) {
|
||||
* // Locking will only fail if there are fatal unrecoverable errors with the
|
||||
* // RTOS primitives, so caller may choose to just assert in case of errors.
|
||||
* }
|
||||
*
|
||||
* // Process the command
|
||||
* sl_bgapi_handle_command(hdr, data);
|
||||
*
|
||||
* // Read the response
|
||||
* void *rsp = sl_bgapi_get_command_response();
|
||||
* uint32_t rsp_header = *((uint32_t *)rsp);
|
||||
* size_t rsp_len = SL_BGAPI_MSG_LEN(rsp_header) + SL_BGAPI_MSG_HEADER_LEN;
|
||||
* // Send the `rsp_len` bytes of response starting from `rsp`
|
||||
*
|
||||
* // Finally unlock the BGAPI to allow other commands to proceed
|
||||
* sl_bgapi_unlock();
|
||||
* @endcode
|
||||
*
|
||||
* Empty stub implementations are provided for @ref sl_bgapi_lock and @ref
|
||||
* sl_bgapi_unlock, so the same sequence can be used for all NCP/CPC
|
||||
* implementations even if an RTOS is not present.
|
||||
*
|
||||
* @param[in] hdr The BGAPI command header
|
||||
* @param[in] data The payload data associated with the command
|
||||
*/
|
||||
void sl_bgapi_handle_command(uint32_t hdr, const void* data);
|
||||
|
||||
/**
|
||||
* @brief Get the response of a handled BGAPI command.
|
||||
*
|
||||
* NOTE: This function is provided for NCP/CPC components that need to handle
|
||||
* BGAPI commands and responses in their binary format. Normal application code
|
||||
* that issues BGAPI commands by calling API functions defined by protocol
|
||||
* stacks must never call this function directly.
|
||||
*
|
||||
* See the documentation of @ref sl_bgapi_handle_command for the full sequence
|
||||
* that must be followed when processing commands in their binary format.
|
||||
*
|
||||
* @return Pointer to the BGAPI response structure that was filled when the
|
||||
* command was executed in @ref sl_bgapi_handle_command.
|
||||
*/
|
||||
void* sl_bgapi_get_command_response(void);
|
||||
|
||||
/**
|
||||
* @brief Set a generic error response to the specified buffer.
|
||||
*
|
||||
* NOTE: This function is provided for NCP/CPC components that need to handle
|
||||
* BGAPI commands and responses in their binary format. Normal application code
|
||||
* that issues BGAPI commands by calling API functions defined by protocol
|
||||
* stacks must never call this function directly.
|
||||
*
|
||||
* This function is available for NCP components that have detected fatal errors
|
||||
* in command processing (for example have failed to receive a complete command
|
||||
* message from the NCP host) and need to generate an error response without
|
||||
* going through the normal BGAPI command processing.
|
||||
*
|
||||
* @param[in] command_hdr The header of the command that we are responding to.
|
||||
* It is possible in certain types of failures that the NCP implementation
|
||||
* does not even have the full command header. In these cases it is
|
||||
* recommended that the NCP implementation sets the unavailable bytes of the
|
||||
* header to value zero to avoid transmitting uninitialized bytes. BGAPI
|
||||
* commands are processed one command at a time and the recipient will be able
|
||||
* to handle the error response even if it's missing the device ID, the class
|
||||
* ID, or the command ID.
|
||||
*
|
||||
* @param[in] result The value to set to the @p result field of the error
|
||||
* response.
|
||||
*
|
||||
* @param[out] response The response buffer to fill
|
||||
*
|
||||
* @param[in] response_buf_size The size of the response buffer. The caller must
|
||||
* provide a buffer that has at least @ref SL_BGAPI_MSG_HEADER_LEN + @ref
|
||||
* SL_BGAPI_MSG_ERROR_PAYLOAD_LEN bytes available.
|
||||
*/
|
||||
void sl_bgapi_set_error_response(uint32_t command_hdr,
|
||||
uint16_t result,
|
||||
void *response,
|
||||
size_t response_buf_size);
|
||||
|
||||
/** @} */ // end addtogroup sl_bgapi_functions
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
15979
Libs/protocol/bluetooth/inc/sl_bt_api.h
Normal file
15979
Libs/protocol/bluetooth/inc/sl_bt_api.h
Normal file
File diff suppressed because it is too large
Load Diff
77
Libs/protocol/bluetooth/inc/sl_bt_api_compatibility.h
Normal file
77
Libs/protocol/bluetooth/inc/sl_bt_api_compatibility.h
Normal file
@@ -0,0 +1,77 @@
|
||||
/***************************************************************************//**
|
||||
* @brief BT API source code compatibility for deprecated items
|
||||
*******************************************************************************
|
||||
* # License
|
||||
* <b>Copyright 2020 Silicon Laboratories Inc. www.silabs.com</b>
|
||||
*******************************************************************************
|
||||
*
|
||||
* The licensor of this software is Silicon Laboratories Inc. Your use of this
|
||||
* software is governed by the terms of Silicon Labs Master Software License
|
||||
* Agreement (MSLA) available at
|
||||
* www.silabs.com/about-us/legal/master-software-license-agreement. This
|
||||
* software is distributed to you in Source Code format and is governed by the
|
||||
* sections of the MSLA applicable to Source Code.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef SL_BT_API_COMPATIBILITY_H
|
||||
#define SL_BT_API_COMPATIBILITY_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Deprecated and replaced by sl_bt_gap_phy_t.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
sl_bt_gap_1m_phy = 0x1, /**< (0x1) 1M PHY */
|
||||
sl_bt_gap_2m_phy = 0x2, /**< (0x2) 2M PHY */
|
||||
sl_bt_gap_coded_phy = 0x4, /**< (0x4) Coded PHY, 125k (S=8) or 500k (S=2) */
|
||||
sl_bt_gap_any_phys = 0xff /**< (0xff) Any PHYs the device supports */
|
||||
} sl_bt_gap_phy_type_t;
|
||||
|
||||
/**
|
||||
* Deprecated and replaced by sl_bt_gap_phy_coding_t.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
sl_bt_gap_1m_phy_uncoded = 0x1, /**< (0x1) 1M PHY */
|
||||
sl_bt_gap_2m_phy_uncoded = 0x2, /**< (0x2) 2M PHY */
|
||||
sl_bt_gap_coded_phy_125k = 0x4, /**< (0x4) 125k Coded PHY (S=8) */
|
||||
sl_bt_gap_coded_phy_500k = 0x8 /**< (0x8) 500k Coded PHY (S=2) */
|
||||
} sl_bt_gap_phy_and_coding_type_t;
|
||||
|
||||
/**
|
||||
* Deprecated and replaced by sl_bt_legacy_advertiser_connection_mode_t and
|
||||
* sl_bt_extended_advertiser_connection_mode_t.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
sl_bt_advertiser_non_connectable = 0x0, /**< (0x0) Non-connectable
|
||||
non-scannable */
|
||||
sl_bt_advertiser_connectable_scannable = 0x2, /**< (0x2) Undirected
|
||||
connectable scannable.
|
||||
This mode can only be
|
||||
used in legacy
|
||||
advertising PDUs. */
|
||||
sl_bt_advertiser_scannable_non_connectable = 0x3, /**< (0x3) Undirected
|
||||
scannable
|
||||
(Non-connectable but
|
||||
responds to scan
|
||||
requests) */
|
||||
sl_bt_advertiser_connectable_non_scannable = 0x4 /**< (0x4) Undirected
|
||||
connectable
|
||||
non-scannable. This
|
||||
mode can only be used
|
||||
in extended advertising
|
||||
PDUs. */
|
||||
} sl_bt_advertiser_connection_mode_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
82
Libs/protocol/bluetooth/inc/sl_bt_ll_config.h
Normal file
82
Libs/protocol/bluetooth/inc/sl_bt_ll_config.h
Normal file
@@ -0,0 +1,82 @@
|
||||
/***************************************************************************//**
|
||||
* @brief Bluetooth Link Layer configuration
|
||||
*******************************************************************************
|
||||
* # License
|
||||
* <b>Copyright 2023 Silicon Laboratories Inc. www.silabs.com</b>
|
||||
*******************************************************************************
|
||||
*
|
||||
* SPDX-License-Identifier: Zlib
|
||||
*
|
||||
* The licensor of this software is Silicon Laboratories Inc.
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any damages
|
||||
* arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any purpose,
|
||||
* including commercial applications, and to alter it and redistribute it
|
||||
* freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you must not
|
||||
* claim that you wrote the original software. If you use this software
|
||||
* in a product, an acknowledgment in the product documentation would be
|
||||
* appreciated but is not required.
|
||||
* 2. Altered source versions must be plainly marked as such, and must not be
|
||||
* misrepresented as being the original software.
|
||||
* 3. This notice may not be removed or altered from any source distribution.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef SL_BT_BLUETOOTH_LL_PRIORITIES_DEFINED
|
||||
#define SL_BT_BLUETOOTH_LL_PRIORITIES_DEFINED
|
||||
|
||||
typedef struct {
|
||||
uint8_t scan_min;
|
||||
uint8_t scan_max;
|
||||
uint8_t adv_min;
|
||||
uint8_t adv_max;
|
||||
uint8_t conn_min;
|
||||
uint8_t conn_max;
|
||||
uint8_t init_min;
|
||||
uint8_t init_max;
|
||||
uint8_t rail_mapping_offset;
|
||||
uint8_t rail_mapping_range;
|
||||
uint8_t _reserved;
|
||||
uint8_t adv_step;
|
||||
uint8_t scan_step;
|
||||
uint8_t pawr_tx_min;
|
||||
uint8_t pawr_tx_max;
|
||||
uint8_t pawr_rx_min;
|
||||
uint8_t pawr_rx_max;
|
||||
} sl_bt_bluetooth_ll_priorities;
|
||||
|
||||
//Default priority configuration
|
||||
#define SL_BT_BLUETOOTH_PRIORITIES_DEFAULT { 191, 143, 175, 127, 135, 0, 55, 15, 16, 16, 0, 4, 4, 15, 5, 20, 10 }
|
||||
|
||||
#define SL_BT_BLUETOOTH_PA_AUTOMODE 0xff
|
||||
#define SL_BT_BLUETOOTH_HIGHEST_PA 0xfe
|
||||
#define SL_BT_BLUETOOTH_RAIL_UTIL_PA 0xfd
|
||||
|
||||
#include "sl_common.h"
|
||||
SL_PACK_START(1)
|
||||
typedef struct {
|
||||
int8_t golden_rssi_min_1m; //<! Golden range lowest RSSI for 1M PHY.
|
||||
int8_t golden_rssi_max_1m; //<! Golden range highest RSSI for 1M PHY.
|
||||
|
||||
int8_t golden_rssi_min_2m; //<! Golden range lowest RSSI for 2M PHY.
|
||||
int8_t golden_rssi_max_2m; //<! Golden range highest RSSI for 2M PHY.
|
||||
|
||||
int8_t golden_rssi_min_coded_s8; //<! Golden range lowest RSSI for Coded PHY w/ S=8.
|
||||
int8_t golden_rssi_max_coded_s8; //<! Golden range highest RSSI for Coded PHY w/ S=8.
|
||||
|
||||
int8_t golden_rssi_min_coded_s2; //<! Golden range lowest RSSI for Coded PHY w/ S=2.
|
||||
int8_t golden_rssi_max_coded_s2; //<! Golden range highest RSSI for Coded PHY w/ S=2.
|
||||
|
||||
uint8_t activate_power_control;
|
||||
} SL_ATTRIBUTE_PACKED sl_bt_ll_power_control_config_t;
|
||||
SL_PACK_END()
|
||||
|
||||
#define SL_BT_USE_MAX_POWER_LEVEL_SUPPORTED_BY_RADIO 0x7fff
|
||||
#define SL_BT_USE_MIN_POWER_LEVEL_SUPPORTED_BY_RADIO 0x7fff
|
||||
|
||||
#endif
|
||||
150
Libs/protocol/bluetooth/inc/sl_bt_rtos_adaptation.h
Normal file
150
Libs/protocol/bluetooth/inc/sl_bt_rtos_adaptation.h
Normal file
@@ -0,0 +1,150 @@
|
||||
/***************************************************************************//**
|
||||
* @file
|
||||
* @brief Adaptation for running Bluetooth in RTOS
|
||||
*******************************************************************************
|
||||
* # License
|
||||
* <b>Copyright 2018 Silicon Laboratories Inc. www.silabs.com</b>
|
||||
*******************************************************************************
|
||||
*
|
||||
* The licensor of this software is Silicon Laboratories Inc. Your use of this
|
||||
* software is governed by the terms of Silicon Labs Master Software License
|
||||
* Agreement (MSLA) available at
|
||||
* www.silabs.com/about-us/legal/master-software-license-agreement. This
|
||||
* software is distributed to you in Source Code format and is governed by the
|
||||
* sections of the MSLA applicable to Source Code.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef SL_BT_RTOS_ADAPTATION_H
|
||||
#define SL_BT_RTOS_ADAPTATION_H
|
||||
|
||||
#include "sl_bt_api.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/***************************************************************************//**
|
||||
* @addtogroup bluetooth_rtos_adaptation Bluetooth RTOS adaptation
|
||||
* @{
|
||||
*
|
||||
* @brief Bluetooth RTOS adaptation
|
||||
*
|
||||
* The Bluetooth RTOS adaptation component implements the relevant interfaces
|
||||
* for running the Bluetooth stack in an RTOS. The component creates the
|
||||
* required RTOS synchronization primitives and tasks for the Bluetooth stack
|
||||
* and handles the inter-process communication (IPC) required when the
|
||||
* application calls a BGAPI command.
|
||||
*
|
||||
* If the Bluetooth Event System IPC component (`bluetooth_event_system_ipc`) is
|
||||
* included in the application, Bluetooth events are delivered using the IPC
|
||||
* mechanism provided by the `event_system` component. See @ref
|
||||
* bluetooth_event_system for the description of that mechanism. In this
|
||||
* configuration no event task is created by the RTOS adaptation.
|
||||
*
|
||||
* If the Bluetooth Event System IPC component (`bluetooth_event_system_ipc`) is
|
||||
* not included in the application, the RTOS adaptation component creates an
|
||||
* event task that delivers the events to the application as direct callbacks to
|
||||
* sl_bt_process_event() and sl_bt_on_event() functions.
|
||||
*
|
||||
* To guarantee thread safety and avoid the risk of deadlocks, the Bluetooth
|
||||
* RTOS adaptation implementation makes the following promises with regard to
|
||||
* the locking mechanism provided in the API:
|
||||
*
|
||||
* 1. The stack will never directly call sl_bt_process_event() or
|
||||
* sl_bt_on_event() from within the same callstack that is calling a command
|
||||
* function. The callbacks always come from a processing loop in an event
|
||||
* task created for this purpose.
|
||||
*
|
||||
* 2. The stack uses @ref sl_bgapi_lock() and @ref sl_bgapi_unlock() to
|
||||
* synchronize the handling of individual BGAPI commands, and the application
|
||||
* must never directly call these. Individual BGAPI commands are safe to be
|
||||
* called from multiple threads without additional locking. See @ref
|
||||
* sl_bt_bluetooth_pend() for description of when an application needs to use
|
||||
* additional locking to guarantee atomicity across multiple commands.
|
||||
*
|
||||
* 3. The stack will never internally obtain the @ref sl_bt_bluetooth_pend()
|
||||
* lock. It is safe for the application to obtain the lock also from within
|
||||
* the sl_bt_on_event() callback.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Initialize Bluetooth RTOS Adaptation
|
||||
*
|
||||
* This function is called automatically at the right time in the generated
|
||||
* initialization sequence. The application does not need to and must not call
|
||||
* this function directly.
|
||||
*
|
||||
* @return SL_STATUS_OK if succeeds, otherwise error
|
||||
*/
|
||||
sl_status_t sl_bt_rtos_init();
|
||||
|
||||
/**
|
||||
* @brief Obtain the Bluetooth host stack command lock
|
||||
*
|
||||
* Starting from Gecko SDK v3.1.2, all BGAPI command functions have automatic
|
||||
* locking to make them thread-safe. Using @ref sl_bt_bluetooth_pend() and @ref
|
||||
* sl_bt_bluetooth_post() is therefore no longer required for individual calls
|
||||
* to the BGAPI.
|
||||
*
|
||||
* The application only needs to use @ref sl_bt_bluetooth_pend() and @ref
|
||||
* sl_bt_bluetooth_post() to protect sections of code where multiple commands
|
||||
* need to be performed atomically in a thread-safe manner. This includes cases
|
||||
* such as using @ref sl_bt_system_data_buffer_write() to write data to the
|
||||
* system buffer followed by a call to @ref
|
||||
* sl_bt_extended_advertiser_set_long_data() to set that data to an advertiser
|
||||
* set. To synchronize access to the shared system buffer, the application would
|
||||
* need to lock by calling @ref sl_bt_bluetooth_pend() before @ref
|
||||
* sl_bt_system_data_buffer_write(), and release the lock by calling @ref
|
||||
* sl_bt_bluetooth_post() after @ref sl_bt_extended_advertiser_set_long_data().
|
||||
*
|
||||
* @return SL_STATUS_OK if mutex has been obtained
|
||||
*/
|
||||
sl_status_t sl_bt_bluetooth_pend();
|
||||
|
||||
/**
|
||||
* @brief Release the Bluetooth host stack command lock
|
||||
*
|
||||
* See @ref sl_bt_bluetooth_pend() for description of how an application needs
|
||||
* to use the locking to guarantee thread-safety.
|
||||
*
|
||||
* @return SL_STATUS_OK the mutex has been released
|
||||
*/
|
||||
sl_status_t sl_bt_bluetooth_post();
|
||||
|
||||
/** @cond DOXYGEN_INCLUDE_INTERNAL */
|
||||
|
||||
/**
|
||||
* @brief Hooks for API, called from tasks using Bluetooth API
|
||||
*/
|
||||
void sli_bt_cmd_handler_rtos_delegate(uint32_t header, sl_bgapi_handler handler, const void* payload);
|
||||
|
||||
/**
|
||||
* @brief Called by Bluetooth stack to wake up the link layer task
|
||||
*/
|
||||
void sli_bt_rtos_ll_callback(void);
|
||||
|
||||
/**
|
||||
* @brief Called by Bluetooth stack to wake up the host stack task
|
||||
*/
|
||||
void sli_bt_rtos_stack_callback(void);
|
||||
|
||||
/**
|
||||
* @brief Called by system initialization when kernel is starting.
|
||||
*/
|
||||
void sli_bt_rtos_adaptation_kernel_start();
|
||||
|
||||
/**
|
||||
* @brief Called by Bluetooth Event System IPC to mark an event as handled
|
||||
*/
|
||||
void sli_bt_rtos_set_event_handled();
|
||||
|
||||
/** @endcond */ // DOXYGEN_INCLUDE_INTERNAL
|
||||
|
||||
/** @} end bluetooth_rtos_adaptation */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif //SL_BT_RTOS_ADAPTATION_H
|
||||
86
Libs/protocol/bluetooth/inc/sl_bt_stack_config.h
Normal file
86
Libs/protocol/bluetooth/inc/sl_bt_stack_config.h
Normal file
@@ -0,0 +1,86 @@
|
||||
/***************************************************************************//**
|
||||
* @brief Bluetooth stack configuration
|
||||
*******************************************************************************
|
||||
* # License
|
||||
* <b>Copyright 2020 Silicon Laboratories Inc. www.silabs.com</b>
|
||||
*******************************************************************************
|
||||
*
|
||||
* The licensor of this software is Silicon Laboratories Inc. Your use of this
|
||||
* software is governed by the terms of Silicon Labs Master Software License
|
||||
* Agreement (MSLA) available at
|
||||
* www.silabs.com/about-us/legal/master-software-license-agreement. This
|
||||
* software is distributed to you in Source Code format and is governed by the
|
||||
* sections of the MSLA applicable to Source Code.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef SL_BT_STACK_CONFIG_H
|
||||
#define SL_BT_STACK_CONFIG_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include "sl_bt_ll_config.h"
|
||||
|
||||
typedef struct {
|
||||
uint32_t max_buffer_memory; //!< Maximum number of bytes to use for data buffers
|
||||
uint32_t linklayer_config;
|
||||
sl_bt_bluetooth_ll_priorities * linklayer_priorities; //Priority configuration, if NULL uses default values
|
||||
}sl_bt_stack_config_t;
|
||||
|
||||
/** Flag indicating Bluetooth runs in RTOS */
|
||||
#define SL_BT_CONFIG_FLAG_RTOS 256
|
||||
|
||||
/** Flag indicating Bluetooth can allow EM2 with inaccurate LF clock */
|
||||
#define SL_BT_CONFIG_FLAG_INACCURATE_LFCLK_EM2 512
|
||||
|
||||
/**
|
||||
* <b>Deprecated</b> and replaced by @ref sli_bt_linklayer_wakeup_t implemented
|
||||
* by the bluetooth_host_adaptation component.
|
||||
*/
|
||||
typedef void (*sl_bt_priority_schedule_callback)(void);
|
||||
|
||||
/**
|
||||
* <b>Deprecated</b> and replaced by @ref sli_bt_host_wakeup_t implemented
|
||||
* by the bluetooth_host_adaptation component.
|
||||
*/
|
||||
typedef void (*sl_bt_stack_schedule_callback)(void);
|
||||
|
||||
#define SL_BT_RF_CONFIG_ANTENNA (1 << 0)
|
||||
typedef struct {
|
||||
int16_t tx_gain; // RF TX gain. Unit: 0.1 dBm. For example, -20 means -2.0 dBm (signal loss).
|
||||
int16_t rx_gain; // RF RX gain. Unit: 0.1 dBm.
|
||||
uint8_t flags; // bit 0 is enabling antenna config, other bits 1-7 are reserved.
|
||||
uint8_t antenna; // A configuration for antenna selection.
|
||||
// Value should be come from RAIL_AntennaSel_t enum.
|
||||
// See antenna path selection in RAIL rail_chip_specific.h.
|
||||
int16_t tx_min_power; // Minimum TX power level. Unit: 0.1 dBm.
|
||||
int16_t tx_max_power; // Maximum TX power level. Unit: 0.1 dBm.
|
||||
} sl_bt_rf_config_t;
|
||||
|
||||
typedef struct {
|
||||
uint32_t config_flags;
|
||||
sl_bt_stack_config_t bluetooth;
|
||||
|
||||
// GATT database (pointer of "sli_bt_gattdb_t*" type)
|
||||
const void* gattdb;
|
||||
|
||||
/**
|
||||
* <b>Deprecated</b> and replaced by @ref sli_bt_host_adaptation_linklayer_wakeup
|
||||
* implemented by the bluetooth_host_adaptation component.
|
||||
*
|
||||
* Callback for priority scheduling, used for RTOS support.
|
||||
*/
|
||||
sl_bt_priority_schedule_callback scheduler_callback;
|
||||
|
||||
/**
|
||||
* <b>Deprecated</b> and replaced by @ref sli_bt_host_adaptation_host_wakeup
|
||||
* implemented by the bluetooth_host_adaptation component.
|
||||
*
|
||||
* Callback for requesting Bluetooth stack scheduling, used for RTOS support.
|
||||
*/
|
||||
sl_bt_stack_schedule_callback stack_schedule_callback;
|
||||
|
||||
uint8_t max_timers; // Max number of soft timers, up to 16, the application will use through SL_BT_API. Default: 4
|
||||
sl_bt_rf_config_t rf;
|
||||
}sl_bt_configuration_t;
|
||||
|
||||
#endif
|
||||
38
Libs/protocol/bluetooth/inc/sl_bt_stack_init.h
Normal file
38
Libs/protocol/bluetooth/inc/sl_bt_stack_init.h
Normal file
@@ -0,0 +1,38 @@
|
||||
/***************************************************************************//**
|
||||
* @brief Initialization APIs for Bluetooth stack
|
||||
*******************************************************************************
|
||||
* # License
|
||||
* <b>Copyright 2019 Silicon Laboratories Inc. www.silabs.com</b>
|
||||
*******************************************************************************
|
||||
*
|
||||
* The licensor of this software is Silicon Laboratories Inc. Your use of this
|
||||
* software is governed by the terms of Silicon Labs Master Software License
|
||||
* Agreement (MSLA) available at
|
||||
* www.silabs.com/about-us/legal/master-software-license-agreement. This
|
||||
* software is distributed to you in Source Code format and is governed by the
|
||||
* sections of the MSLA applicable to Source Code.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef SL_BT_STACK_INIT_H
|
||||
#define SL_BT_STACK_INIT_H
|
||||
|
||||
#include "sl_status.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Initialize the Bluetooth stack.
|
||||
*
|
||||
* @return SL_STATUS_OK if the initialization was successful; Other error code
|
||||
* indicates a failure.
|
||||
*/
|
||||
sl_status_t sl_bt_stack_init();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
22
Libs/protocol/bluetooth/inc/sl_bt_types.h
Normal file
22
Libs/protocol/bluetooth/inc/sl_bt_types.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/***************************************************************************//**
|
||||
* @brief Deprecated Bluetooth API data type header
|
||||
*******************************************************************************
|
||||
* # License
|
||||
* <b>Copyright 2019-2020 Silicon Laboratories Inc. www.silabs.com</b>
|
||||
*******************************************************************************
|
||||
*
|
||||
* The licensor of this software is Silicon Laboratories Inc. Your use of this
|
||||
* software is governed by the terms of Silicon Labs Master Software License
|
||||
* Agreement (MSLA) available at
|
||||
* www.silabs.com/about-us/legal/master-software-license-agreement. This
|
||||
* software is distributed to you in Source Code format and is governed by the
|
||||
* sections of the MSLA applicable to Source Code.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
/*
|
||||
* "sl_bt_types.h" is deprecated and replaced by "sl_bt_api.h". We include
|
||||
* "sl_bt_api.h" here to maintain source code compatibility with files that only
|
||||
* include "sl_bt_types.h".
|
||||
*/
|
||||
#include "sl_bt_api.h"
|
||||
84
Libs/protocol/bluetooth/inc/sl_bt_version.h
Normal file
84
Libs/protocol/bluetooth/inc/sl_bt_version.h
Normal file
@@ -0,0 +1,84 @@
|
||||
/***************************************************************************//**
|
||||
* @brief Bluetooth stack version definition
|
||||
*******************************************************************************
|
||||
* # License
|
||||
* <b>Copyright 2022 Silicon Laboratories Inc. www.silabs.com</b>
|
||||
*******************************************************************************
|
||||
*
|
||||
* The licensor of this software is Silicon Laboratories Inc. Your use of this
|
||||
* software is governed by the terms of Silicon Labs Master Software License
|
||||
* Agreement (MSLA) available at
|
||||
* www.silabs.com/about-us/legal/master-software-license-agreement. This
|
||||
* software is distributed to you in Source Code format and is governed by the
|
||||
* sections of the MSLA applicable to Source Code.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef SL_BT_VERSION_H
|
||||
#define SL_BT_VERSION_H
|
||||
|
||||
/***************************************************************************//**
|
||||
* @addtogroup sl_bt_version Bluetooth SDK version
|
||||
* @brief Bluetooth SDK version information
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief The major number of Bluetooth SDK version
|
||||
*
|
||||
* An increment indicates incompatible Bluetooth API changes.
|
||||
*/
|
||||
#define SL_BT_VERSION_MAJOR 9
|
||||
|
||||
/**
|
||||
* @brief The minor number of Bluetooth SDK version
|
||||
*
|
||||
* An increment indicates new backwards compatible functionalities.
|
||||
*/
|
||||
#define SL_BT_VERSION_MINOR 0
|
||||
|
||||
/**
|
||||
* @brief The patch number of Bluetooth SDK version
|
||||
*
|
||||
* An increment indicates backwards compatible bug fixes.
|
||||
*/
|
||||
#define SL_BT_VERSION_PATCH 1
|
||||
|
||||
/**
|
||||
* @brief The build number which the Bluetooth SDK was created from
|
||||
*/
|
||||
#define SL_BT_VERSION_BUILD 341
|
||||
|
||||
/**
|
||||
* @brief The hash value of the build the Bluetooth SDK was created from
|
||||
*/
|
||||
#define SL_BT_VERSION_HASH {0x4d,0x9c,0xee,0x3e,0x47,0x47,0x76,0xad,0x6d,0x0c,0xc3,0x0c,0xe5,0x8c,0x68,0x88,0xd9,0xd6,0x50,0xd4}
|
||||
|
||||
/**
|
||||
* Deprecated and replaced by SL_BT_VERSION_MAJOR
|
||||
*/
|
||||
#define BG_VERSION_MAJOR SL_BT_VERSION_MAJOR
|
||||
|
||||
/**
|
||||
* Deprecated and replaced by SL_BT_VERSION_MINOR
|
||||
*/
|
||||
#define BG_VERSION_MINOR SL_BT_VERSION_MINOR
|
||||
|
||||
/**
|
||||
* Deprecated and replaced by SL_BT_VERSION_PATCH
|
||||
*/
|
||||
#define BG_VERSION_PATCH SL_BT_VERSION_PATCH
|
||||
|
||||
/**
|
||||
* Deprecated and replaced by SL_BT_VERSION_BUILD
|
||||
*/
|
||||
#define BG_VERSION_BUILD SL_BT_VERSION_BUILD
|
||||
|
||||
/**
|
||||
* Deprecated and replaced by SL_BT_VERSION_HASH
|
||||
*/
|
||||
#define BG_VERSION_HASH SL_BT_VERSION_HASH
|
||||
|
||||
/** @} */ // end addtogroup sl_bt_version
|
||||
|
||||
#endif
|
||||
107
Libs/protocol/bluetooth/inc/sli_bgapi.h
Normal file
107
Libs/protocol/bluetooth/inc/sli_bgapi.h
Normal file
@@ -0,0 +1,107 @@
|
||||
/***************************************************************************//**
|
||||
* @brief Silicon Labs internal API provided by the BGAPI protocol
|
||||
*******************************************************************************
|
||||
* # License
|
||||
* <b>Copyright 2024 Silicon Laboratories Inc. www.silabs.com</b>
|
||||
*******************************************************************************
|
||||
*
|
||||
* The licensor of this software is Silicon Laboratories Inc. Your use of this
|
||||
* software is governed by the terms of Silicon Labs Master Software License
|
||||
* Agreement (MSLA) available at
|
||||
* www.silabs.com/about-us/legal/master-software-license-agreement. This
|
||||
* software is distributed to you in Source Code format and is governed by the
|
||||
* sections of the MSLA applicable to Source Code.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef SLI_BGAPI_H
|
||||
#define SLI_BGAPI_H
|
||||
|
||||
#include "sl_status.h"
|
||||
#include "sl_bgapi.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/** @cond DOXYGEN_INCLUDE_INTERNAL */
|
||||
|
||||
/***************************************************************************//**
|
||||
* @addtogroup sli_bgapi BGAPI Protocol internal API
|
||||
* @{
|
||||
*
|
||||
* @brief Silicon Labs internal API to the BGAPI Protocol
|
||||
*
|
||||
* The BGAPI Protocol provides some services that are needed internally by
|
||||
* Silicon Labs components. The APIs provided by this file must not be used by
|
||||
* application code.
|
||||
*/
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Silicon Labs internal types for the BGAPI protocol
|
||||
|
||||
/**
|
||||
* @brief Type definition for the command handler delegate function.
|
||||
*
|
||||
* The command handler delegate is used by the BGAPI protocol to handle a
|
||||
* command. The default delegate @ref sli_bgapi_cmd_handler_delegate executes
|
||||
* the BGAPI command handler function as a direct function call. The RTOS
|
||||
* adaptation uses @ref sli_bgapi_set_cmd_handler_delegate to set a special
|
||||
* delegate that handles the required inter-process communication (IPC) when an
|
||||
* RTOS is used.
|
||||
*
|
||||
* @param[in] header The BGAPI command header of the command to process
|
||||
* @param[in] handler The handler function to process the BGAPI command
|
||||
* @param[in] payload The BGAPI command payload data of the command to process
|
||||
*/
|
||||
typedef void sli_bgapi_cmd_handler_delegate_t (uint32_t header,
|
||||
sl_bgapi_handler handler,
|
||||
const void* payload);
|
||||
|
||||
#define SLI_BGAPI_BUFFER_SIZE (SL_BGAPI_MSG_HEADER_LEN + SL_BGAPI_MAX_PAYLOAD_SIZE)
|
||||
|
||||
/**
|
||||
* @brief The default command handler delegate function.
|
||||
*/
|
||||
sli_bgapi_cmd_handler_delegate_t sli_bgapi_cmd_handler_delegate;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Silicon Labs internal functions to control the BGAPI protocol
|
||||
|
||||
/**
|
||||
* @brief Set the BGAPI command handler delegate.
|
||||
*
|
||||
* @param[in] cmd_handler_delegate Pointer to the command handler delegate function
|
||||
*/
|
||||
void sli_bgapi_set_cmd_handler_delegate(sli_bgapi_cmd_handler_delegate_t *cmd_handler_delegate);
|
||||
|
||||
/**
|
||||
* @brief Pop an event out of the BGAPI event queue of a specific device.
|
||||
*
|
||||
* @param[in] dev_type The BGAPI device to pop events from
|
||||
* @param[in] event_buffer_size The size of the supplied event buffer
|
||||
* @param[out] event_buffer The event buffer to receive the popped event
|
||||
*
|
||||
* @return SL_STATUS_OK if successful, otherwise an error code
|
||||
*/
|
||||
sl_status_t sli_bgapi_pop_event(uint8_t dev_type,
|
||||
size_t event_buffer_size,
|
||||
void *event_buffer);
|
||||
|
||||
/**
|
||||
* @brief Set the BGAPI command/response buffer.
|
||||
*
|
||||
* @param[in] buffer The buffer to use for BGAPI command/response data
|
||||
* @return The previous buffer
|
||||
*/
|
||||
void *sli_bgapi_set_buffer(void *buffer);
|
||||
|
||||
/** @} end sli_bgapi */
|
||||
|
||||
/** @endcond */ // DOXYGEN_INCLUDE_INTERNAL
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // SLI_BGAPI_H
|
||||
33
Libs/protocol/bluetooth/inc/sli_bt_accept_list_config.h
Normal file
33
Libs/protocol/bluetooth/inc/sli_bt_accept_list_config.h
Normal file
@@ -0,0 +1,33 @@
|
||||
/***************************************************************************//**
|
||||
* @file
|
||||
* @brief Configuration types for "accept_list"
|
||||
*******************************************************************************
|
||||
* # License
|
||||
* <b>Copyright 2023 Silicon Laboratories Inc. www.silabs.com</b>
|
||||
*******************************************************************************
|
||||
*
|
||||
* The licensor of this software is Silicon Laboratories Inc. Your use of this
|
||||
* software is governed by the terms of Silicon Labs Master Software License
|
||||
* Agreement (MSLA) available at
|
||||
* www.silabs.com/about-us/legal/master-software-license-agreement. This
|
||||
* software is distributed to you in Source Code format and is governed by the
|
||||
* sections of the MSLA applicable to Source Code.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef SLI_BT_ACCEPT_LIST_CONFIG_H
|
||||
#define SLI_BT_ACCEPT_LIST_CONFIG_H
|
||||
|
||||
#include "sli_bt_config_defs.h"
|
||||
|
||||
/**
|
||||
* @brief Configuration structure used by "accept_list"
|
||||
*
|
||||
* See "sl_bt_accept_list_config.h" for detailed description of each
|
||||
* configuration parameter.
|
||||
*/
|
||||
typedef struct {
|
||||
uint8_t accept_list_size; ///< Set to value of SL_BT_CONFIG_ACCEPT_LIST_SIZE
|
||||
} sli_bt_accept_list_config_t;
|
||||
|
||||
#endif // SLI_BT_ACCEPT_LIST_CONFIG_H
|
||||
30
Libs/protocol/bluetooth/inc/sli_bt_advertiser_config.h
Normal file
30
Libs/protocol/bluetooth/inc/sli_bt_advertiser_config.h
Normal file
@@ -0,0 +1,30 @@
|
||||
/***************************************************************************//**
|
||||
* @file sli_bt_advertiser_config.h
|
||||
* @brief Configuration types for "advertiser"
|
||||
*******************************************************************************
|
||||
* # License
|
||||
* <b>Copyright 2021 Silicon Laboratories Inc. www.silabs.com</b>
|
||||
*******************************************************************************
|
||||
*
|
||||
* The licensor of this software is Silicon Laboratories Inc. Your use of this
|
||||
* software is governed by the terms of Silicon Labs Master Software License
|
||||
* Agreement (MSLA) available at
|
||||
* www.silabs.com/about-us/legal/master-software-license-agreement. This
|
||||
* software is distributed to you in Source Code format and is governed by the
|
||||
* sections of the MSLA applicable to Source Code.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef SLI_BT_ADVERTISER_CONFIG_H
|
||||
#define SLI_BT_ADVERTISER_CONFIG_H
|
||||
|
||||
#include "sli_bt_config_defs.h"
|
||||
|
||||
/**
|
||||
* @brief Configuration structure used by "advertiser"
|
||||
*/
|
||||
typedef struct {
|
||||
uint8_t max_advertisers; ///< Set to value of SL_BT_CONFIG_MAX_ADVERTISERS
|
||||
} sli_bt_advertiser_config_t;
|
||||
|
||||
#endif // SLI_BT_ADVERTISER_CONFIG_H
|
||||
216
Libs/protocol/bluetooth/inc/sli_bt_config_defs.h
Normal file
216
Libs/protocol/bluetooth/inc/sli_bt_config_defs.h
Normal file
@@ -0,0 +1,216 @@
|
||||
/***************************************************************************//**
|
||||
* @brief Internal types and defines for Bluetooth configuration
|
||||
*******************************************************************************
|
||||
* # License
|
||||
* <b>Copyright 2021 Silicon Laboratories Inc. www.silabs.com</b>
|
||||
*******************************************************************************
|
||||
*
|
||||
* The licensor of this software is Silicon Laboratories Inc. Your use of this
|
||||
* software is governed by the terms of Silicon Labs Master Software License
|
||||
* Agreement (MSLA) available at
|
||||
* www.silabs.com/about-us/legal/master-software-license-agreement. This
|
||||
* software is distributed to you in Source Code format and is governed by the
|
||||
* sections of the MSLA applicable to Source Code.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef SLI_BT_CONFIG_DEFS_H
|
||||
#define SLI_BT_CONFIG_DEFS_H
|
||||
|
||||
#include "sl_status.h"
|
||||
|
||||
/** @brief Forward declaration of the internal feature structure */
|
||||
struct sli_bt_feature;
|
||||
|
||||
/** @brief Forward declaration of the internal BGAPI class structure */
|
||||
struct sli_bgapi_class;
|
||||
|
||||
/**
|
||||
* @brief Forward declaration of internal feature config structure
|
||||
*
|
||||
* Note that this is only used as an opaque type that is never instantiated
|
||||
* directly. The actual configuration structure is defined and populated in
|
||||
* feature-specific files.
|
||||
*/
|
||||
struct sli_bt_feature_config;
|
||||
|
||||
/** @brief Structure to specify the use of a feature and its configuration */
|
||||
struct sli_bt_feature_use {
|
||||
const struct sli_bt_feature *feature; /**< Pointer to the feature definition */
|
||||
const struct sli_bt_feature_config *config; /**< Pointer to the feature-specific configuration */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Macro that expands to the name of a BGAPI class structure
|
||||
*
|
||||
* @param[in] category_name Short category name string without quotes, for
|
||||
* example bt, btmesh, or btctrl
|
||||
* @param[in] class_name Short class name string without quotes, for example
|
||||
* advertiser or connection
|
||||
*/
|
||||
#define SLI_BT_BGAPI_CLASS_NAME(category_name, class_name, mode) \
|
||||
sli_bgapi_class_ ## category_name ## _ ## class_name ## _ ## mode
|
||||
|
||||
/**
|
||||
* @brief Macro to forward declare a BGAPI class structure
|
||||
*/
|
||||
#define SLI_BT_DECLARE_BGAPI_CLASS(category_name, class_name) \
|
||||
extern const struct sli_bgapi_class SLI_BT_BGAPI_CLASS_NAME(category_name, class_name, full); \
|
||||
extern const struct sli_bgapi_class SLI_BT_BGAPI_CLASS_NAME(category_name, class_name, optimized)
|
||||
|
||||
#ifdef SL_BT_API_FULL
|
||||
/**
|
||||
* @brief Macro to declare the use of a BGAPI class
|
||||
*
|
||||
* This macro is used by stack-specific initialization code to declare the use
|
||||
* of a BGAPI class in the array of used BGAPI classes.
|
||||
*
|
||||
* @param[in] category_name Short category name string without quotes, for
|
||||
* example bt, btmesh, or btctrl
|
||||
* @param[in] class_name Short class name string without quotes, for example
|
||||
* advertiser or connection
|
||||
*/
|
||||
#define SLI_BT_USE_BGAPI_CLASS(category_name, class_name) \
|
||||
& SLI_BT_BGAPI_CLASS_NAME(category_name, class_name, full)
|
||||
#else
|
||||
#define SLI_BT_USE_BGAPI_CLASS(category_name, class_name) \
|
||||
& SLI_BT_BGAPI_CLASS_NAME(category_name, class_name, optimized)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Macro that expands to the name of a feature definition structure
|
||||
*
|
||||
* @param[in] category_name Short category name string without quotes, for
|
||||
* example bt, btmesh, or btctrl
|
||||
* @param[in] feature_name Short feature name string without quotes, for example
|
||||
* advertiser or connection
|
||||
* @param[in] init_mode Feature initialization mode without quotes: init_always
|
||||
* or on_demand
|
||||
*/
|
||||
#define SLI_BT_FEATURE_DEFINITION_NAME(category_name, feature_name, init_mode) \
|
||||
sli_feature_ ## category_name ## _ ## feature_name ## _ ## init_mode
|
||||
|
||||
/**
|
||||
* @brief Macro that expands to the name of a feature configuration structure
|
||||
*
|
||||
* @param[in] category_name Short category name string without quotes, for
|
||||
* example bt, btmesh, or btctrl
|
||||
* @param[in] feature_name Short feature name string without quotes, for example
|
||||
* advertiser or connection
|
||||
*/
|
||||
#define SLI_BT_FEATURE_CONFIG_NAME(category_name, feature_name) \
|
||||
sli_feature_ ## category_name ## _ ## feature_name ## _config
|
||||
|
||||
/**
|
||||
* @brief Macro to forward declare a feature definition structure
|
||||
*
|
||||
* @param[in] category_name Short category name string without quotes, for
|
||||
* example bt, btmesh, or btctrl
|
||||
* @param[in] feature_name Short feature name string without quotes, for example
|
||||
* advertiser or connection
|
||||
*/
|
||||
#define SLI_BT_DECLARE_FEATURE(category_name, feature_name) \
|
||||
extern const struct sli_bt_feature SLI_BT_FEATURE_DEFINITION_NAME(category_name, feature_name, init_always); \
|
||||
extern const struct sli_bt_feature SLI_BT_FEATURE_DEFINITION_NAME(category_name, feature_name, on_demand)
|
||||
|
||||
/**
|
||||
* @brief Macro to forward declare an instance of a feature configuration structure
|
||||
*
|
||||
* This macro is used by stack-specific initialization code to declare relevant
|
||||
* configuration structures before populating the array of optional features.
|
||||
*
|
||||
* @param[in] category_name Short category name string without quotes, for
|
||||
* example bt, btmesh, or btctrl
|
||||
* @param[in] feature_name Short feature name string without quotes, for example
|
||||
* advertiser or connection
|
||||
*/
|
||||
#define SLI_BT_DECLARE_FEATURE_CONFIG(category_name, feature_name) \
|
||||
extern const struct sli_bt_feature_config SLI_BT_FEATURE_CONFIG_NAME(category_name, feature_name)
|
||||
|
||||
/**
|
||||
* @brief Macro to define an instance of a feature configuration structure
|
||||
*
|
||||
* This macro is used by the internal feature-specific configuration files
|
||||
* `sli_bt_*_config.c` to define an instance of the feature configuration
|
||||
* structure. The intended use is to assign the value directly. For example:
|
||||
*
|
||||
* @code
|
||||
* SLI_BT_DEFINE_FEATURE_CONFIG(bt, advertiser, sli_bt_advertiser_config_t) = {
|
||||
* .max_advertisers = SL_BT_CONFIG_MAX_ADVERTISERS
|
||||
* };
|
||||
* @endcode
|
||||
*
|
||||
* @param[in] category_name Short category name string without quotes, for
|
||||
* example bt, btmesh, or btctrl
|
||||
* @param[in] feature_name Short feature name string without quotes, for example
|
||||
* advertiser or connection
|
||||
* @param[in] type The C language type of the configuration, for example
|
||||
* sli_bt_advertiser_config_t
|
||||
*/
|
||||
#define SLI_BT_DEFINE_FEATURE_CONFIG(category_name, feature_name, type) \
|
||||
const type SLI_BT_FEATURE_CONFIG_NAME(category_name, feature_name)
|
||||
|
||||
/**
|
||||
* @brief Internal helper to implement @ref SLI_BT_USE_FEATURE
|
||||
*
|
||||
* This macro provides the extra layer of indirection that's needed to expand
|
||||
* `SLI_BT_INIT_MODE` before it's used as a parameter to @ref
|
||||
* SLI_BT_FEATURE_DEFINITION_NAME(). Files that define feature uses should
|
||||
* invoke @ref SLI_BT_USE_FEATURE() instead of this helper.
|
||||
*/
|
||||
#define SLI_BT_USE_FEATURE_MODE(category_name, feature_name, init_mode) \
|
||||
{ &SLI_BT_FEATURE_DEFINITION_NAME(category_name, feature_name, init_mode), NULL }
|
||||
|
||||
/**
|
||||
* @brief Macro to declare the use of an optional feature that has no configuration
|
||||
*
|
||||
* This macro is used by stack-specific initialization code to declare the use
|
||||
* of a feature in the array of optional features.
|
||||
*
|
||||
* Files that invoke this macro must define `SLI_BT_INIT_MODE` to either
|
||||
* init_always or on_demand to decide the initialization mode of all features.
|
||||
* When the init_always mode is used, the de-init functions are omitted to
|
||||
* eliminate code that's not needed in the build.
|
||||
*
|
||||
* @param[in] category_name Short category name string without quotes, for
|
||||
* example bt, btmesh, or btctrl
|
||||
* @param[in] feature_name Short feature name string without quotes, for example
|
||||
* advertiser or connection
|
||||
*/
|
||||
#define SLI_BT_USE_FEATURE(category_name, feature_name) \
|
||||
SLI_BT_USE_FEATURE_MODE(category_name, feature_name, SLI_BT_INIT_MODE)
|
||||
|
||||
/**
|
||||
* @brief Internal helper to implement @ref SLI_BT_USE_FEATURE_WITH_CONFIG
|
||||
*
|
||||
* This macro provides the extra layer of indirection that's needed to expand
|
||||
* `SLI_BT_INIT_MODE` before it's used as a parameter to @ref
|
||||
* SLI_BT_FEATURE_DEFINITION_NAME(). Files that define feature uses should
|
||||
* invoke @ref SLI_BT_USE_FEATURE_WITH_CONFIG() instead of this helper.
|
||||
*/
|
||||
#define SLI_BT_USE_FEATURE_MODE_WITH_CONFIG(category_name, feature_name, init_mode, config_name) \
|
||||
{ &SLI_BT_FEATURE_DEFINITION_NAME(category_name, feature_name, init_mode), &config_name }
|
||||
|
||||
/**
|
||||
* @brief Macro to declare the use of an optional feature with configuration
|
||||
*
|
||||
* This macro is used by stack-specific initialization code to declare the use
|
||||
* of a feature in the array of optional features.
|
||||
*
|
||||
* Files that invoke this macro must define `SLI_BT_INIT_MODE` to either
|
||||
* init_always or on_demand to decide the initialization mode of all features.
|
||||
* When the init_always mode is used, the de-init functions are omitted to
|
||||
* eliminate code that's not needed in the build.
|
||||
*
|
||||
* @param[in] category_name Short category name string without quotes, for
|
||||
* example bt, btmesh, or btctrl
|
||||
* @param[in] feature_name Short feature name string without quotes, for example
|
||||
* advertiser or connection
|
||||
* @param[in] config_name The name of the configuration structure. The caller
|
||||
* should use @ref SLI_BT_FEATURE_CONFIG_NAME() to get the name of the
|
||||
* configuration structure.
|
||||
*/
|
||||
#define SLI_BT_USE_FEATURE_WITH_CONFIG(category_name, feature_name, config_name) \
|
||||
SLI_BT_USE_FEATURE_MODE_WITH_CONFIG(category_name, feature_name, SLI_BT_INIT_MODE, config_name)
|
||||
|
||||
#endif // SLI_BT_CONFIG_DEFS_H
|
||||
31
Libs/protocol/bluetooth/inc/sli_bt_connection_config.h
Normal file
31
Libs/protocol/bluetooth/inc/sli_bt_connection_config.h
Normal file
@@ -0,0 +1,31 @@
|
||||
/***************************************************************************//**
|
||||
* @file sli_bt_connection_config.h
|
||||
* @brief Configuration types for "connection"
|
||||
*******************************************************************************
|
||||
* # License
|
||||
* <b>Copyright 2021 Silicon Laboratories Inc. www.silabs.com</b>
|
||||
*******************************************************************************
|
||||
*
|
||||
* The licensor of this software is Silicon Laboratories Inc. Your use of this
|
||||
* software is governed by the terms of Silicon Labs Master Software License
|
||||
* Agreement (MSLA) available at
|
||||
* www.silabs.com/about-us/legal/master-software-license-agreement. This
|
||||
* software is distributed to you in Source Code format and is governed by the
|
||||
* sections of the MSLA applicable to Source Code.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef SLI_BT_CONNECTION_CONFIG_H
|
||||
#define SLI_BT_CONNECTION_CONFIG_H
|
||||
|
||||
#include "sli_bt_config_defs.h"
|
||||
|
||||
/**
|
||||
* @brief Configuration structure used by "connection"
|
||||
*/
|
||||
typedef struct {
|
||||
uint8_t max_connections; ///< Set to value of SL_BT_CONFIG_MAX_CONNECTIONS_SUM
|
||||
uint16_t data_len; ///< Set to value of SL_BT_CONFIG_CONNECTION_DATA_LENGTH
|
||||
} sli_bt_connection_config_t;
|
||||
|
||||
#endif // SLI_BT_CONNECTION_CONFIG_H
|
||||
30
Libs/protocol/bluetooth/inc/sli_bt_dynamic_gattdb_config.h
Normal file
30
Libs/protocol/bluetooth/inc/sli_bt_dynamic_gattdb_config.h
Normal file
@@ -0,0 +1,30 @@
|
||||
/***************************************************************************//**
|
||||
* @file sli_bt_dynamic_gattdb_config.h
|
||||
* @brief Configuration types for "dynamic_gattdb"
|
||||
*******************************************************************************
|
||||
* # License
|
||||
* <b>Copyright 2021 Silicon Laboratories Inc. www.silabs.com</b>
|
||||
*******************************************************************************
|
||||
*
|
||||
* The licensor of this software is Silicon Laboratories Inc. Your use of this
|
||||
* software is governed by the terms of Silicon Labs Master Software License
|
||||
* Agreement (MSLA) available at
|
||||
* www.silabs.com/about-us/legal/master-software-license-agreement. This
|
||||
* software is distributed to you in Source Code format and is governed by the
|
||||
* sections of the MSLA applicable to Source Code.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef SLI_BT_DYNAMIC_GATTDB_CONFIG_H
|
||||
#define SLI_BT_DYNAMIC_GATTDB_CONFIG_H
|
||||
|
||||
#include "sli_bt_config_defs.h"
|
||||
|
||||
/**
|
||||
* @brief Configuration structure used by "dynamic_gattdb"
|
||||
*/
|
||||
typedef struct {
|
||||
uint8_t max_dynamic_gattdbs; ///< Set to value of SL_BT_CONFIG_MAX_DYNAMIC_GATTDBS_SUM
|
||||
} sli_bt_dynamic_gattdb_config_t;
|
||||
|
||||
#endif // SLI_BT_DYNAMIC_GATTDB_CONFIG_H
|
||||
108
Libs/protocol/bluetooth/inc/sli_bt_gattdb_def.h
Normal file
108
Libs/protocol/bluetooth/inc/sli_bt_gattdb_def.h
Normal file
@@ -0,0 +1,108 @@
|
||||
/***************************************************************************//**
|
||||
* @brief Bluetooth GATT database structure definition
|
||||
*******************************************************************************
|
||||
* # License
|
||||
* <b>Copyright 2018 Silicon Laboratories Inc. www.silabs.com</b>
|
||||
*******************************************************************************
|
||||
*
|
||||
* The licensor of this software is Silicon Laboratories Inc. Your use of this
|
||||
* software is governed by the terms of Silicon Labs Master Software License
|
||||
* Agreement (MSLA) available at
|
||||
* www.silabs.com/about-us/legal/master-software-license-agreement. This
|
||||
* software is distributed to you in Source Code format and is governed by the
|
||||
* sections of the MSLA applicable to Source Code.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef SLI_BT_GATT_DEF_H
|
||||
#define SLI_BT_GATT_DEF_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
typedef struct {
|
||||
uint16_t len; //size of buffer
|
||||
uint8_t data[];
|
||||
} sli_bt_gattdb_value_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t properties; //Characteristic properties, same as in characteristic descriptor gatt_char_prop
|
||||
uint16_t max_len; //Maximum length of data in buffer
|
||||
uint16_t len; //current size of data in buffer
|
||||
uint8_t data[]; //size is max_len
|
||||
} sli_bt_gattdb_attribute_chrvalue_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t flags; //client characteristic flags allowed 1-notification, 2-indication)
|
||||
uint8_t clientconfig_index; // index to client config.
|
||||
} sli_bt_gattdb_attribute_config_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t properties; //Characteristic properties, same as in characteristic descriptor gatt_char_prop
|
||||
uint16_t char_uuid; // characteristic UUID handle
|
||||
} sli_bt_gattdb_attribute_characteristic_t;
|
||||
|
||||
typedef struct {
|
||||
uint16_t start; //Included Service Attribute Handle
|
||||
uint16_t end; //End Group Handle
|
||||
} sli_bt_gattdb_attribute_service_include_t;
|
||||
|
||||
typedef struct {
|
||||
uint16_t handle;
|
||||
uint16_t uuid;
|
||||
uint16_t permissions; //gatt_attribute_permission
|
||||
uint16_t caps; // Capability bit flags
|
||||
uint8_t datatype; //Just use uint8_t Do not use enum type, may cause compatibility troubles
|
||||
uint8_t state;
|
||||
union {
|
||||
const sli_bt_gattdb_value_t *constdata; //generic constant data
|
||||
sli_bt_gattdb_attribute_chrvalue_t *dynamicdata; //Modifiable data
|
||||
sli_bt_gattdb_attribute_config_t configdata;
|
||||
sli_bt_gattdb_attribute_characteristic_t characteristic;
|
||||
sli_bt_gattdb_attribute_service_include_t service_include;
|
||||
};
|
||||
} sli_bt_gattdb_attribute_t;
|
||||
|
||||
struct sli_bt_gattdb_s {
|
||||
const sli_bt_gattdb_attribute_t *attributes;
|
||||
uint16_t attribute_table_size;
|
||||
uint16_t attribute_num;
|
||||
const uint16_t *uuid16;
|
||||
uint16_t uuid16_table_size;
|
||||
uint16_t uuid16_num;
|
||||
const uint8_t *uuid128;
|
||||
uint16_t uuid128_table_size;
|
||||
uint16_t uuid128_num;
|
||||
uint8_t num_ccfg;
|
||||
uint16_t caps_mask;
|
||||
uint16_t enabled_caps;
|
||||
};
|
||||
|
||||
typedef struct sli_bt_gattdb_s sli_bt_gattdb_t;
|
||||
|
||||
extern const sli_bt_gattdb_t *static_gattdb;
|
||||
|
||||
/**
|
||||
* @addtogroup dynamic_gatt_config
|
||||
*
|
||||
* Dynamic GATT database configuration.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Flag indicating GATT caching should be enabled. When enabled, a Generic
|
||||
* Attribute Profile Service will be created in database if one doesn't exist.
|
||||
**/
|
||||
#define SLI_BT_GATTDB_CONFIG_FLAG_ENABLE_GATT_CACHING (0x01)
|
||||
|
||||
/**
|
||||
* Flag indicating the static database should be included if one exists.
|
||||
*/
|
||||
#define SLI_BT_GATTDB_CONFIG_FLAG_INCLUDE_STATIC_DB (0X02)
|
||||
|
||||
typedef struct {
|
||||
uint32_t flags;
|
||||
} sli_bt_gattdb_config_t;
|
||||
|
||||
/** @} (end addtogroup dynamic_gatt_config) */
|
||||
|
||||
#endif
|
||||
127
Libs/protocol/bluetooth/inc/sli_bt_host_adaptation.h
Normal file
127
Libs/protocol/bluetooth/inc/sli_bt_host_adaptation.h
Normal file
@@ -0,0 +1,127 @@
|
||||
/***************************************************************************//**
|
||||
* @brief System adaptation layer used internally by Bluetooth host stack
|
||||
*******************************************************************************
|
||||
* # License
|
||||
* <b>Copyright 2023 Silicon Laboratories Inc. www.silabs.com</b>
|
||||
*******************************************************************************
|
||||
*
|
||||
* The licensor of this software is Silicon Laboratories Inc. Your use of this
|
||||
* software is governed by the terms of Silicon Labs Master Software License
|
||||
* Agreement (MSLA) available at
|
||||
* www.silabs.com/about-us/legal/master-software-license-agreement. This
|
||||
* software is distributed to you in Source Code format and is governed by the
|
||||
* sections of the MSLA applicable to Source Code.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef SLI_BT_HOST_ADAPTATION_H
|
||||
#define SLI_BT_HOST_ADAPTATION_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include "sl_status.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/***************************************************************************//**
|
||||
* @addtogroup sli_bt_host_adaptation
|
||||
* @{
|
||||
*
|
||||
* @brief System adaptation layer used internally by Bluetooth host stack
|
||||
*
|
||||
* The functions provided by this file are used by the Bluetooth host stack to
|
||||
* perform operations that cannot be performed using device-agnostic APIs from
|
||||
* within the Bluetooth libraries. These are typically operations that depend on
|
||||
* the target device or the Platform configuration. The application does not
|
||||
* need to and must not call these functions directly.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
/**
|
||||
* @brief Function prototype for waking up the Bluetooth link layer task
|
||||
*/
|
||||
typedef void sli_bt_linklayer_wakeup_t (void);
|
||||
|
||||
/**
|
||||
* @brief Function prototype for waking up the Bluetooth host task
|
||||
*/
|
||||
typedef void sli_bt_host_wakeup_t (void);
|
||||
|
||||
/**
|
||||
* @brief Pointer to the function that wakes up the Bluetooth linklayer task
|
||||
*/
|
||||
extern sli_bt_linklayer_wakeup_t *const sli_bt_host_adaptation_linklayer_wakeup;
|
||||
|
||||
/**
|
||||
* @brief Pointer to the function that wakes up the Bluetooth host task
|
||||
*/
|
||||
extern sli_bt_host_wakeup_t *const sli_bt_host_adaptation_host_wakeup;
|
||||
|
||||
/**
|
||||
* @brief Initialize the device interrupts in a baremetal app
|
||||
*
|
||||
* This is called once during the boot time initialization.
|
||||
*/
|
||||
void sli_bt_host_adaptation_init_interrupts(void);
|
||||
|
||||
/**
|
||||
* @brief Get the bootloader version information
|
||||
*
|
||||
* @param[out] bootloader_version Set to the bootloader version number if a
|
||||
* bootloader is available
|
||||
*
|
||||
* @return SL_STATUS_OK if a bootloader is available and the version was
|
||||
* obtained. SL_STATUS_NOT_AVAILABLE if the application does not use a
|
||||
* bootloader.
|
||||
*/
|
||||
sl_status_t sli_bt_host_adaptation_get_bootloader_version(uint32_t *bootloader_version);
|
||||
|
||||
/**
|
||||
* @brief Reset the chip
|
||||
*
|
||||
* This function never returns.
|
||||
*/
|
||||
void sli_bt_host_adaptation_chip_reset(void);
|
||||
|
||||
/**
|
||||
* @brief Write a custom Bluetooth identity address into the Bluetooth region of NVM3
|
||||
*
|
||||
* @param[in] address_type Address type sl_bt_gap_public_address or sl_bt_gap_static_address
|
||||
* @param[in] address Pointer to the address to write into NVM3
|
||||
* @return SL_STATUS_OK if the operation succeeded
|
||||
*/
|
||||
sl_status_t sli_bt_host_adaptation_write_custom_address(uint8_t address_type,
|
||||
const uint8_t *address);
|
||||
|
||||
/**
|
||||
* @brief Load custom Bluetooth identity address from NVM3
|
||||
*
|
||||
* The operation succeeds if both the custom address and address type entries exist in NVM3.
|
||||
*
|
||||
* @param[out] address_type Pointer to return the address type value read from NVM3. Value 0
|
||||
* indicates the address is a public device address, and 1 indicates the address
|
||||
* is a static device address.
|
||||
* @param[out] address Pointer to return the address read from NVM3
|
||||
* @return SL_STATUS_OK if the operation succeeded
|
||||
*/
|
||||
sl_status_t sli_bt_host_adaptation_read_custom_address(uint8_t *address_type,
|
||||
uint8_t *address);
|
||||
|
||||
/**
|
||||
* @brief Set HFXO CTUNE using the value stored in the Bluetooth space of NVM3
|
||||
*
|
||||
* Setting the HFXO CTUNE with this method is deprecated. Currently the functionality is
|
||||
* provided for keeping backwards compatibility with legacy SDKs, and the support will be
|
||||
* discontinued in future SDK releases. The recommended method is to store CTUNE value in the
|
||||
* MFG_CTUNE token.
|
||||
*/
|
||||
void sli_bt_host_adaptation_read_and_set_ctune();
|
||||
|
||||
/** @} end sli_bt_host_adaptation */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // SLI_BT_HOST_ADAPTATION_H
|
||||
33
Libs/protocol/bluetooth/inc/sli_bt_l2cap_config.h
Normal file
33
Libs/protocol/bluetooth/inc/sli_bt_l2cap_config.h
Normal file
@@ -0,0 +1,33 @@
|
||||
/***************************************************************************//**
|
||||
* @file sli_bt_l2cap_config.h
|
||||
* @brief Configuration types for "l2cap"
|
||||
*******************************************************************************
|
||||
* # License
|
||||
* <b>Copyright 2021 Silicon Laboratories Inc. www.silabs.com</b>
|
||||
*******************************************************************************
|
||||
*
|
||||
* The licensor of this software is Silicon Laboratories Inc. Your use of this
|
||||
* software is governed by the terms of Silicon Labs Master Software License
|
||||
* Agreement (MSLA) available at
|
||||
* www.silabs.com/about-us/legal/master-software-license-agreement. This
|
||||
* software is distributed to you in Source Code format and is governed by the
|
||||
* sections of the MSLA applicable to Source Code.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef SLI_BT_L2CAP_CONFIG_H
|
||||
#define SLI_BT_L2CAP_CONFIG_H
|
||||
|
||||
#include "sli_bt_config_defs.h"
|
||||
|
||||
/**
|
||||
* @brief Configuration structure used by "l2cap"
|
||||
*
|
||||
* See "sl_bluetooth_l2cap_config.h" for detailed description of each
|
||||
* configuration parameter.
|
||||
*/
|
||||
typedef struct {
|
||||
uint8_t max_l2cap_coc_channels; ///< Set to value of SL_BT_CONFIG_USER_L2CAP_COC_CHANNELS
|
||||
} sli_bt_l2cap_config_t;
|
||||
|
||||
#endif // SLI_BT_L2CAP_CONFIG_H
|
||||
33
Libs/protocol/bluetooth/inc/sli_bt_pawr_advertiser_config.h
Normal file
33
Libs/protocol/bluetooth/inc/sli_bt_pawr_advertiser_config.h
Normal file
@@ -0,0 +1,33 @@
|
||||
/***************************************************************************//**
|
||||
* @file sli_bt_pawr_advertiser_config.h
|
||||
* @brief Configuration types for "pawr_advertiser"
|
||||
*******************************************************************************
|
||||
* # License
|
||||
* <b>Copyright 2021 Silicon Laboratories Inc. www.silabs.com</b>
|
||||
*******************************************************************************
|
||||
*
|
||||
* The licensor of this software is Silicon Laboratories Inc. Your use of this
|
||||
* software is governed by the terms of Silicon Labs Master Software License
|
||||
* Agreement (MSLA) available at
|
||||
* www.silabs.com/about-us/legal/master-software-license-agreement. This
|
||||
* software is distributed to you in Source Code format and is governed by the
|
||||
* sections of the MSLA applicable to Source Code.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef SLI_BT_PAWR_ADVERTISER_CONFIG_H
|
||||
#define SLI_BT_PAWR_ADVERTISER_CONFIG_H
|
||||
|
||||
#include "sli_bt_config_defs.h"
|
||||
|
||||
/**
|
||||
* @brief Configuration structure used by "pawr_advertiser"
|
||||
*
|
||||
* See "sl_bt_pawr_advertiser_config.h" for detailed description of each
|
||||
* configuration parameter.
|
||||
*/
|
||||
typedef struct {
|
||||
uint8_t max_pawr_advertisers; ///< Set to value of SL_BT_CONFIG_MAX_PAWR_ADVERTISERS
|
||||
} sli_bt_pawr_advertiser_config_t;
|
||||
|
||||
#endif // SLI_BT_PAWR_ADVERTISER_CONFIG_H
|
||||
@@ -0,0 +1,33 @@
|
||||
/***************************************************************************//**
|
||||
* @file sli_bt_periodic_advertiser_config.h
|
||||
* @brief Configuration types for "periodic_advertiser"
|
||||
*******************************************************************************
|
||||
* # License
|
||||
* <b>Copyright 2021 Silicon Laboratories Inc. www.silabs.com</b>
|
||||
*******************************************************************************
|
||||
*
|
||||
* The licensor of this software is Silicon Laboratories Inc. Your use of this
|
||||
* software is governed by the terms of Silicon Labs Master Software License
|
||||
* Agreement (MSLA) available at
|
||||
* www.silabs.com/about-us/legal/master-software-license-agreement. This
|
||||
* software is distributed to you in Source Code format and is governed by the
|
||||
* sections of the MSLA applicable to Source Code.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef SLI_BT_PERIODIC_ADVERTISER_CONFIG_H
|
||||
#define SLI_BT_PERIODIC_ADVERTISER_CONFIG_H
|
||||
|
||||
#include "sli_bt_config_defs.h"
|
||||
|
||||
/**
|
||||
* @brief Configuration structure used by "periodic_advertiser"
|
||||
*
|
||||
* See "sl_bt_periodic_advertiser_config.h" for detailed description of each
|
||||
* configuration parameter.
|
||||
*/
|
||||
typedef struct {
|
||||
uint8_t max_periodic_advertisers; ///< Set to value of SL_BT_CONFIG_MAX_PERIODIC_ADVERTISERS
|
||||
} sli_bt_periodic_advertiser_config_t;
|
||||
|
||||
#endif // SLI_BT_PERIODIC_ADVERTISER_CONFIG_H
|
||||
33
Libs/protocol/bluetooth/inc/sli_bt_sync_config.h
Normal file
33
Libs/protocol/bluetooth/inc/sli_bt_sync_config.h
Normal file
@@ -0,0 +1,33 @@
|
||||
/***************************************************************************//**
|
||||
* @file sli_bt_sync_config.h
|
||||
* @brief Configuration types for "sync"
|
||||
*******************************************************************************
|
||||
* # License
|
||||
* <b>Copyright 2021 Silicon Laboratories Inc. www.silabs.com</b>
|
||||
*******************************************************************************
|
||||
*
|
||||
* The licensor of this software is Silicon Laboratories Inc. Your use of this
|
||||
* software is governed by the terms of Silicon Labs Master Software License
|
||||
* Agreement (MSLA) available at
|
||||
* www.silabs.com/about-us/legal/master-software-license-agreement. This
|
||||
* software is distributed to you in Source Code format and is governed by the
|
||||
* sections of the MSLA applicable to Source Code.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef SLI_BT_SYNC_CONFIG_H
|
||||
#define SLI_BT_SYNC_CONFIG_H
|
||||
|
||||
#include "sli_bt_config_defs.h"
|
||||
|
||||
/**
|
||||
* @brief Configuration structure used by "sync"
|
||||
*
|
||||
* See "sl_bt_sync_config.h" for detailed description of each configuration
|
||||
* parameter.
|
||||
*/
|
||||
typedef struct {
|
||||
uint8_t max_periodic_syncs; ///< Set to value of SL_BT_CONFIG_MAX_PERIODIC_ADVERTISING_SYNC
|
||||
} sli_bt_sync_config_t;
|
||||
|
||||
#endif // SLI_BT_SYNC_CONFIG_H
|
||||
Reference in New Issue
Block a user