Cypress PSoC 6 Bluetooth Low Energy Middleware Library 3.60

General Description

Contains the common definitions and data structures used in the BLE.

Data Structures

struct  cy_stc_ble_stack_lib_version_t
 This structure is used to hold version information of the BLE Stack Library. More...
 
struct  cy_stc_ble_bd_addr_t
 Bluetooth Device Address type. More...
 
struct  cy_stc_ble_dle_config_param_t
 Configuration structure for Tx and Rx ACL Data Buffers required by the BLE Stack. More...
 
struct  cy_stc_ble_l2cap_config_param_t
 Configuration structure for the L2CAP buffer for data transmission. More...
 
struct  cy_stc_ble_privacy_1_2_config_param_t
 Configuration structure for LL Privacy feature. More...
 
struct  cy_stc_ble_bonded_device_list_config_param_t
 Configuration parameter for Bonded Devices List. More...
 
struct  cy_stc_ble_white_list_config_param_t
 Configuration parameter for the White List. More...
 
struct  cy_stc_ble_mxd_pa_cal_param_t
 Configuration parameter for Radio PA calibration. More...
 
struct  cy_stc_ble_stack_config_param_t
 Configuration structure for enabling selective features and passing associated parameters. More...
 
struct  cy_stc_ble_stk_app_data_buff_t
 Set of buffers to be allocated by BLE Stack for BLE Stack operation. More...
 
struct  cy_stc_ble_conn_estb_param_t
 Structure for passing the connection established parameters. More...
 
struct  cy_stc_ble_stack_mgr_mem_cfg_param_t
 BLE Stack Manager configuration structure for allocating memory pools for host and controller operation. More...
 
struct  cy_stc_ble_stack_init_info_t
 BLE Stack init parameter. More...
 
struct  cy_stc_ble_aes_cmac_generate_param_t
 Structure containing the parameters required for AES CMAC Generation. More...
 
struct  cy_stc_ble_bless_clk_cfg_params_t
 BLE clock configuration parameters. More...
 
struct  cy_stc_ble_hci_tx_packet_info_t
 Standard HCI command/data packet. More...
 
struct  cy_stc_ble_bd_addrs_t
 Bluetooth Device Addresses. More...
 
struct  cy_stc_ble_conn_handle_t
 Connection Handle. More...
 
struct  cy_stc_ble_stack_flash_param_t
 Store BLE Application Data parameter into flash. More...
 
struct  cy_stc_ble_timer_info_t
 Timer parameter. More...
 
struct  cy_stc_ble_stack_random_num_param_t
 Application-specific seed for the DRBG (Deterministic Random number generator) More...
 
struct  cy_stc_ble_tx_pwr_config_param_t
 Tx power level configuration parameters. More...
 
struct  cy_stc_ble_tx_pwr_lvl_info_t
 Tx power level parameter. More...
 
struct  cy_stc_ble_rssi_info_t
 RSSI parameter. More...
 
struct  cy_stc_ble_aes_encrypt_info_t
 AES encrypt information. More...
 
struct  cy_stc_ble_aes_ccm_encrypt_info_t
 AES CCM encrypt information. More...
 
struct  cy_stc_ble_aes_ccm_decrypt_info_t
 AES CCM decrypt information. More...
 
struct  cy_stc_ble_auth_payload_info_t
 Authentication payload information. More...
 
struct  cy_stc_ble_slave_latency_info_t
 Slave Latency Parameters. More...
 
struct  cy_stc_ble_set_data_length_info_t
 DLE Set Data Length parameter. More...
 
struct  cy_stc_ble_suggested_data_length_info_t
 DLE Suggested Data Length parameter. More...
 
struct  cy_stc_ble_channel_map_info_t
 Channel Map Parameters Information. More...
 
struct  cy_stc_ble_resolving_device_info_t
 Resolving List information of one device. More...
 
struct  cy_stc_ble_privacy_mode_info_t
 Configuration Structure for Set Privacy Mode. More...
 
struct  cy_stc_ble_peer_id_addr_t
 Random number generated from the BLE Stack. More...
 
struct  cy_stc_ble_set_phy_info_t
 Set PHY parameter. More...
 
struct  cy_stc_ble_set_suggested_phy_info_t
 Set Default PHY parameter. More...
 
struct  cy_stc_ble_data_length_param_t
 Local suggested or Max 'tx octets' and 'tx time'. More...
 
struct  cy_stc_ble_data_length_change_event_param_t
 BLE Data Length Change event parameter. More...
 
struct  cy_stc_ble_memory_request_t
 Memory request parameters. More...
 
struct  cy_stc_ble_aes_ccm_param_t
 AES CCM encrypted data information. More...
 
struct  cy_stc_ble_timeout_param_t
 Timeout event parameter. More...
 
struct  cy_stc_ble_events_param_generic_t
 Generic Event parameter structure. More...
 
struct  cy_stc_ble_phy_param_t
 Set PHY parameter. More...
 
struct  cy_stc_ble_ll_cntrl_proc_param_t
 LL control procedure param structure. More...
 
struct  cy_stc_ble_white_list_t
 White List information param. More...
 
struct  cy_stc_ble_white_list_retention_t
 White List retention structure. More...
 
struct  cy_stc_ble_rpa_list_info_t
 Resolving List information param. More...
 
struct  cy_stc_ble_resolving_list_retention_t
 Resolving List retention structure. More...
 

Typedefs

typedef void(* cy_ble_app_ev_cb_t) (cy_en_ble_event_t event, void *evParam)
 Event callback function prototype to receive events from BLE Stack.
 
typedef uint16_t(* cy_ble_hci_rx_cb_t) (uint8_t type, uint8_t *packet, uint8_t length)
 callback function prototype to receive DTM packet from Controller
 

Enumerations

enum  cy_en_ble_interrupt_callback_feature_t {
  CY_BLE_INTR_CALLBACK_NONE = (0x00),
  CY_BLE_INTR_CALLBACK_BLESS_STACK_ISR = (0x01UL << 1u),
  CY_BLE_INTR_CALLBACK_BLESS_INTR_STAT_DSM_EXITED = (0x01UL << 2u),
  CY_BLE_INTR_CALLBACK_BLELL_CONN_EXT_INTR_EARLY = (0x01UL << 3u),
  CY_BLE_INTR_CALLBACK_BLELL_CONN_INTR_CE_RX = (0x01UL << 4u),
  CY_BLE_INTR_CALLBACK_BLELL_CONN_INTR_CE_TX_ACK = (0x01UL << 5u),
  CY_BLE_INTR_CALLBACK_BLELL_CONN_INTR_CLOSE_CE = (0x01UL << 6u),
  CY_BLE_INTR_CALLBACK_BLESS_INTR_STAT_DSM_ENTERED = (0x01UL << 7u),
  CY_BLE_INTR_CALLBACK_BLELL_SCAN_INTR_ADV_RX = (0x01UL << 8u),
  CY_BLE_INTR_CALLBACK_BLELL_SCAN_INTR_SCAN_RSP_RX = (0x01UL << 9u),
  CY_BLE_INTR_CALLBACK_BLELL_ADV_INTR_CONN_REQ_RX = (0x01UL << 10UL)
}
 Interrupt callback feature. More...
 
enum  cy_en_ble_api_result_t {
  CY_BLE_SUCCESS = CY_PDL_STATUS_INFO,
  CY_BLE_INFO_FLASH_WRITE_IN_PROGRESS = CY_PDL_STATUS_INFO | CY_BLE_ID | 0x0001ul,
  CY_BLE_ERROR_INVALID_PARAMETER = CY_PDL_STATUS_ERROR | CY_BLE_ID | 0x0001ul,
  CY_BLE_ERROR_INVALID_OPERATION,
  CY_BLE_ERROR_MEMORY_ALLOCATION_FAILED,
  CY_BLE_ERROR_INSUFFICIENT_RESOURCES,
  CY_BLE_ERROR_OOB_NOT_AVAILABLE,
  CY_BLE_ERROR_NO_CONNECTION,
  CY_BLE_ERROR_NO_DEVICE_ENTITY,
  CY_BLE_ERROR_DEVICE_ALREADY_EXISTS,
  CY_BLE_ERROR_REPEATED_ATTEMPTS,
  CY_BLE_ERROR_GAP_ROLE,
  CY_BLE_ERROR_SEC_FAILED,
  CY_BLE_ERROR_L2CAP_PSM_WRONG_ENCODING,
  CY_BLE_ERROR_L2CAP_PSM_ALREADY_REGISTERED,
  CY_BLE_ERROR_L2CAP_PSM_NOT_REGISTERED,
  CY_BLE_ERROR_L2CAP_CONNECTION_ENTITY_NOT_FOUND,
  CY_BLE_ERROR_L2CAP_PSM_NOT_IN_RANGE,
  CY_BLE_ERROR_UNSUPPORTED_FEATURE_OR_PARAMETER_VALUE,
  CY_BLE_ERROR_FLASH_WRITE_NOT_PERMITED,
  CY_BLE_ERROR_FLASH_WRITE,
  CY_BLE_ERROR_MIC_AUTH_FAILED,
  CY_BLE_ERROR_HARDWARE_FAILURE,
  CY_BLE_ERROR_GATT_DB_INVALID_ATTR_HANDLE,
  CY_BLE_ERROR_NTF_DISABLED,
  CY_BLE_ERROR_IND_DISABLED,
  CY_BLE_ERROR_CONTROLLER_BUSY = CY_PDL_STATUS_ERROR | CY_BLE_ID | 0x00FEul,
  CY_BLE_ERROR_INVALID_STATE,
  CY_BLE_ERROR_MAX = CY_PDL_STATUS_ERROR | CY_BLE_ID | 0xFFFFul
}
 Common error codes received as API result. More...
 
enum  cy_en_ble_bless_pwr_lvl_t {
  CY_BLE_LL_PWR_LVL_NEG_20_DBM = -20,
  CY_BLE_LL_PWR_LVL_NEG_16_DBM = -16,
  CY_BLE_LL_PWR_LVL_NEG_12_DBM = -12,
  CY_BLE_LL_PWR_LVL_NEG_6_DBM = -6,
  CY_BLE_LL_PWR_LVL_0_DBM = 0,
  CY_BLE_LL_PWR_LVL_MAX = 4
}
 BLESS Power enum reflecting power level values supported by BLESS radio. More...
 
enum  cy_en_ble_bless_phy_ch_grp_id_t {
  CY_BLE_LL_ADV_CH_TYPE = 0x00u,
  CY_BLE_LL_CONN_CH_TYPE,
  CY_BLE_LL_MAX_CH_TYPE
}
 BLE channel group ID. More...
 
enum  cy_en_ble_bless_wco_sca_cfg_t {
  CY_BLE_LL_SCA_251_TO_500_PPM = 0x00u,
  CY_BLE_LL_SCA_151_TO_250_PPM,
  CY_BLE_LL_SCA_101_TO_150_PPM,
  CY_BLE_LL_SCA_076_TO_100_PPM,
  CY_BLE_LL_SCA_051_TO_075_PPM,
  CY_BLE_LL_SCA_031_TO_050_PPM,
  CY_BLE_LL_SCA_021_TO_030_PPM,
  CY_BLE_LL_SCA_000_TO_020_PPM,
  CY_BLE_LL_SCA_IN_PPM_INVALID
}
 BLE WCO sleep clock accuracy configuration. More...
 
enum  cy_en_ble_bless_eco_clk_div_t {
  CY_BLE_LL_ECO_CLK_DIV_1 = 0x00u,
  CY_BLE_LL_ECO_CLK_DIV_2,
  CY_BLE_LL_ECO_CLK_DIV_4,
  CY_BLE_LL_ECO_CLK_DIV_8,
  CY_BLE_LL_ECO_CLK_DIV_INVALID
}
 BLE ECO clock divider. More...
 
enum  cy_en_ble_bless_state_t {
  CY_BLE_BLESS_STATE_ACTIVE = 0x01,
  CY_BLE_BLESS_STATE_EVENT_CLOSE,
  CY_BLE_BLESS_STATE_ECO_ON,
  CY_BLE_BLESS_STATE_ECO_STABLE,
  CY_BLE_BLESS_STATE_DEEPSLEEP,
  CY_BLE_BLESS_STATE_STOPPED,
  CY_BLE_BLESS_STATE_INVALID = 0xFFu
}
 BLESS Power enum reflecting power states supported by BLESS radio.
 
enum  cy_en_ble_controller_sleep_mode_t {
  CY_BLE_CONTROLLER_SLEEP_MODE_SLEEP = 0x01u,
  CY_BLE_CONTROLLER_SLEEP_MODE_DEEPSLEEP
}
 Sleep mode which controller core is trying to enter.
 
enum  cy_en_ble_to_reason_code_t {
  CY_BLE_GAP_ADV_TO = 0x01u,
  CY_BLE_GAP_SCAN_TO,
  CY_BLE_GATT_RSP_TO,
  CY_BLE_GENERIC_APP_TO
}
 Timeout reason due to BLE Stack started timers or application stated timers. More...
 
enum  cy_en_ble_protocol_req_t {
  CY_BLE_PREPARED_WRITE_REQUEST = 0x00u,
  CY_BLE_INVALID_REQUEST
}
 BLE Stack memory request type. More...
 
enum  cy_en_ble_phy_mask_t {
  CY_BLE_PHY_MASK_LE_1M = 0x01u,
  CY_BLE_PHY_MASK_LE_2M,
  CY_BLE_PHY_MASK_LE_CODED
}
 PHY used for the connection. More...
 
enum  cy_en_ble_phy_no_pref_mask_t {
  CY_BLE_PHY_NO_PREF_MASK_NONE = 0x00u,
  CY_BLE_PHY_NO_PREF_MASK_TX,
  CY_BLE_PHY_NO_PREF_MASK_RX,
  CY_BLE_PHY_NO_PREF_MASK_BOTH_TX_RX
}
 PHY preference masks used for Cy_BLE_SetPhy() function. More...
 
enum  cy_en_ble_privacy_mode_t {
  CY_BLE_PRIVACY_MODE_NETWORK = 0x00u,
  CY_BLE_PRIVACY_MODE_DEVICE
}
 Privacy modes used for Cy_BLE_SetPrivacyMode() function. More...
 

Enumeration Type Documentation

◆ cy_en_ble_interrupt_callback_feature_t

Interrupt callback feature.

Enumerator
CY_BLE_INTR_CALLBACK_NONE 

Interrupt callback feature is disabled.

CY_BLE_INTR_CALLBACK_BLESS_STACK_ISR 

Executed on every trigger of BLESS interrupt.

CY_BLE_INTR_CALLBACK_BLESS_INTR_STAT_DSM_EXITED 

Executed when the BLESS exits BLESS deep sleep mode and enters BLESS active mode.

BLESS deep sleep exit can be triggered automatically by link layer hardware or by different BLE_PDL data transfer APIs that need BLESS to be active.

CY_BLE_INTR_CALLBACK_BLELL_CONN_EXT_INTR_EARLY 

Executed when the BLESS connection engine in slave mode detects a BLE packet that matches its access address.

CY_BLE_INTR_CALLBACK_BLELL_CONN_INTR_CE_RX 

Executed when the BLESS connection engine receives a non-empty packet from the peer device.

CY_BLE_INTR_CALLBACK_BLELL_CONN_INTR_CE_TX_ACK 

Executed when the BLESS connection engine receives an ACK packet from the peer device for the previously transmitted packet.

CY_BLE_INTR_CALLBACK_BLELL_CONN_INTR_CLOSE_CE 

Executed when the BLESS connection engine closes the connection event.

This interrupt will be executed on every connection interval for a connection, irrespective of data tx/rx state.

CY_BLE_INTR_CALLBACK_BLESS_INTR_STAT_DSM_ENTERED 

Executed when the BLESS enters deep sleep mode.

User call to Cy_SysPm_DeepSleep API will trigger BLESS deep sleep entry sequence.

CY_BLE_INTR_CALLBACK_BLELL_SCAN_INTR_ADV_RX 

Executed when the BLESS scan engine receives an advertisement packet from the peer device.

CY_BLE_INTR_CALLBACK_BLELL_SCAN_INTR_SCAN_RSP_RX 

Executed when the BLESS scan engine receives a scan response packet from the peer device in response to a scan request from the scanner.

CY_BLE_INTR_CALLBACK_BLELL_ADV_INTR_CONN_REQ_RX 

Executed when the BLESS advertisement engine receives a connection request from the peer central device.

◆ cy_en_ble_api_result_t

Common error codes received as API result.

Enumerator
CY_BLE_SUCCESS 

No Error occurred.

CY_BLE_INFO_FLASH_WRITE_IN_PROGRESS 

Flash operation in progress.

CY_BLE_ERROR_INVALID_PARAMETER 

At least one of the input parameters is invalid.

CY_BLE_ERROR_INVALID_OPERATION 

Operation is not permitted.

CY_BLE_ERROR_MEMORY_ALLOCATION_FAILED 

An internal error occurred in the BLE Stack.

CY_BLE_ERROR_INSUFFICIENT_RESOURCES 

Insufficient resources to perform requested operation.

CY_BLE_ERROR_OOB_NOT_AVAILABLE 

OOB data not available.

CY_BLE_ERROR_NO_CONNECTION 

Connection is required to perform requested operation.

Connection not present

CY_BLE_ERROR_NO_DEVICE_ENTITY 

No device entity to perform requested operation.

CY_BLE_ERROR_DEVICE_ALREADY_EXISTS 

Device cannot be added to the White List as it has already been added.

CY_BLE_ERROR_REPEATED_ATTEMPTS 

Attempted repeat operation is not allowed.

CY_BLE_ERROR_GAP_ROLE 

GAP role is incorrect.

CY_BLE_ERROR_SEC_FAILED 

Security operation failed.

CY_BLE_ERROR_L2CAP_PSM_WRONG_ENCODING 

L2CAP PSM encoding is incorrect.

CY_BLE_ERROR_L2CAP_PSM_ALREADY_REGISTERED 

L2CAP PSM has already been registered.

CY_BLE_ERROR_L2CAP_PSM_NOT_REGISTERED 

L2CAP PSM has not been registered.

CY_BLE_ERROR_L2CAP_CONNECTION_ENTITY_NOT_FOUND 

L2CAP connection entity not found.

CY_BLE_ERROR_L2CAP_PSM_NOT_IN_RANGE 

Specified PSM is out of range.

CY_BLE_ERROR_UNSUPPORTED_FEATURE_OR_PARAMETER_VALUE 

Unsupported feature or parameter value.

CY_BLE_ERROR_FLASH_WRITE_NOT_PERMITED 

Write to Flash is not permitted.

CY_BLE_ERROR_FLASH_WRITE 

Error in Flash write.

CY_BLE_ERROR_MIC_AUTH_FAILED 

MIC Authentication failure.

CY_BLE_ERROR_HARDWARE_FAILURE 

Hardware Failure.

Possible reason - BLE ECO failed to start due to one of the below:

  • LFCLK (WCO, PILO, ILO) not present
  • Radio bus failure
CY_BLE_ERROR_GATT_DB_INVALID_ATTR_HANDLE 

GATT DB error codes.

Invalid attribute handle

CY_BLE_ERROR_NTF_DISABLED 

Characteristic notifications disabled.

CY_BLE_ERROR_IND_DISABLED 

Characteristic indications disabled.

CY_BLE_ERROR_CONTROLLER_BUSY 

Controller Busy.

CY_BLE_ERROR_INVALID_STATE 

The state is not valid for current operation.

CY_BLE_ERROR_MAX 

All other errors not covered in the above list map to this error code.

◆ cy_en_ble_bless_pwr_lvl_t

BLESS Power enum reflecting power level values supported by BLESS radio.

Enumerator
CY_BLE_LL_PWR_LVL_NEG_20_DBM 

ABS PWR = -20 dBm.

CY_BLE_LL_PWR_LVL_NEG_16_DBM 

ABS PWR = -16 dBm.

CY_BLE_LL_PWR_LVL_NEG_12_DBM 

ABS PWR = -12 dBm.

CY_BLE_LL_PWR_LVL_NEG_6_DBM 

ABS PWR = -6 dBm.

CY_BLE_LL_PWR_LVL_0_DBM 

ABS PWR = 0 dBm.

CY_BLE_LL_PWR_LVL_MAX 

ABS PWR = +4 dBm as per silicon.

◆ cy_en_ble_bless_phy_ch_grp_id_t

BLE channel group ID.

Enumerator
CY_BLE_LL_ADV_CH_TYPE 

Advertisement channel type.

CY_BLE_LL_CONN_CH_TYPE 

Connection channel type.

CY_BLE_LL_MAX_CH_TYPE 

Maximum value of the cy_en_ble_bless_phy_ch_grp_id_t type.

◆ cy_en_ble_bless_wco_sca_cfg_t

BLE WCO sleep clock accuracy configuration.

Enumerator
CY_BLE_LL_SCA_251_TO_500_PPM 

BLE WCO sleep clock accuracy 251 to 500 ppm.

CY_BLE_LL_SCA_151_TO_250_PPM 

BLE WCO sleep clock accuracy 151 to 250 ppm.

CY_BLE_LL_SCA_101_TO_150_PPM 

BLE WCO sleep clock accuracy 101 to 150 ppm.

CY_BLE_LL_SCA_076_TO_100_PPM 

BLE WCO sleep clock accuracy 76 to 100 ppm.

CY_BLE_LL_SCA_051_TO_075_PPM 

BLE WCO sleep clock accuracy 51 to 75 ppm.

CY_BLE_LL_SCA_031_TO_050_PPM 

BLE WCO sleep clock accuracy 31 to 50 ppm.

CY_BLE_LL_SCA_021_TO_030_PPM 

BLE WCO sleep clock accuracy 21 to 30 ppm.

CY_BLE_LL_SCA_000_TO_020_PPM 

BLE WCO sleep clock accuracy 0 to 20 ppm.

CY_BLE_LL_SCA_IN_PPM_INVALID 

BLE WCO invalid sleep clock accuracy.

◆ cy_en_ble_bless_eco_clk_div_t

BLE ECO clock divider.

Enumerator
CY_BLE_LL_ECO_CLK_DIV_1 

Link Layer clock divider = 1.

CY_BLE_LL_ECO_CLK_DIV_2 

Link Layer clock divider = 2.

CY_BLE_LL_ECO_CLK_DIV_4 

Link Layer clock divider = 4.

CY_BLE_LL_ECO_CLK_DIV_8 

Link Layer clock divider = 8.

CY_BLE_LL_ECO_CLK_DIV_INVALID 

Invalid Link Layer clock divider.

◆ cy_en_ble_to_reason_code_t

Timeout reason due to BLE Stack started timers or application stated timers.

It is the application's responsibility to disconnect or keep the connection, depending on the type of timeout; for example, for a GATT procedure timeout: the application may choose to disconnect.

Enumerator
CY_BLE_GAP_ADV_TO 

Advertisement time set by application has expired.

CY_BLE_GAP_SCAN_TO 

Scan time set by application has expired.

CY_BLE_GATT_RSP_TO 

GATT procedure timeout.

CY_BLE_GENERIC_APP_TO 

Application procedure timeout.

◆ cy_en_ble_protocol_req_t

BLE Stack memory request type.

Enumerator
CY_BLE_PREPARED_WRITE_REQUEST 

Memory requested for prepare write request.

CY_BLE_INVALID_REQUEST 

Invalid request.

◆ cy_en_ble_phy_mask_t

PHY used for the connection.

Enumerator
CY_BLE_PHY_MASK_LE_1M 

The transmitter PHY for the connection is LE 1M.

CY_BLE_PHY_MASK_LE_2M 

The transmitter PHY for the connection is LE 2M.

CY_BLE_PHY_MASK_LE_CODED 

The transmitter PHY for the connection is LE Coded.

◆ cy_en_ble_phy_no_pref_mask_t

PHY preference masks used for Cy_BLE_SetPhy() function.

Enumerator
CY_BLE_PHY_NO_PREF_MASK_NONE 

All PHY settings are preferred by the HOST.

CY_BLE_PHY_NO_PREF_MASK_TX 

Host has no preference for TX PHY.

CY_BLE_PHY_NO_PREF_MASK_RX 

Host has no preference for RX PHY.

CY_BLE_PHY_NO_PREF_MASK_BOTH_TX_RX 

Host has no preference for both TX & RX PHY.

◆ cy_en_ble_privacy_mode_t

Privacy modes used for Cy_BLE_SetPrivacyMode() function.