btaudio2 2.1.0.0
btaudio2.h File Reference

This file contains API for BT Audio 2 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_uart.h"

Go to the source code of this file.

Data Structures

struct  btaudio2_packet_t
 BT Audio 2 Click command/event packet structure object. More...
 
struct  btaudio2_t
 BT Audio 2 Click context object. More...
 
struct  btaudio2_cfg_t
 BT Audio 2 Click configuration object. More...
 

Macros

#define BTAUDIO2_CMD_MAKE_CALL   0x00
 BT Audio 2 commands OP code list.
 
#define BTAUDIO2_CMD_MAKE_EXTENSION_CALL   0x01
 
#define BTAUDIO2_CMD_MMI_ACTION   0x02
 
#define BTAUDIO2_CMD_EVENT_MASK_SETTING   0x03
 
#define BTAUDIO2_CMD_MUSIC_CONTROL   0x04
 
#define BTAUDIO2_CMD_CHANGE_DEVICE_NAME   0x05
 
#define BTAUDIO2_CMD_CHANGE_PIN_CODE   0x06
 
#define BTAUDIO2_CMD_SET_BTM_PARAM   0x07
 
#define BTAUDIO2_CMD_GET_BTM_VERSION   0x08
 
#define BTAUDIO2_CMD_VENDOR_AT_CMD   0x0A
 
#define BTAUDIO2_CMD_AVRCP_SPEC_CMD   0x0B
 
#define BTAUDIO2_CMD_AVRCP_GROUP_NAVIGATION   0x0C
 
#define BTAUDIO2_CMD_READ_LINK_STATUS   0x0D
 
#define BTAUDIO2_CMD_READ_PAIRING_RECORD   0x0E
 
#define BTAUDIO2_CMD_READ_LOCAL_BD_ADDR   0x0F
 
#define BTAUDIO2_CMD_READ_LOCAL_DEVICE_NAME   0x10
 
#define BTAUDIO2_CMD_SEND_SPP_DATA   0x12
 
#define BTAUDIO2_CMD_BTM_UTILITY_FUNCTION   0x13
 
#define BTAUDIO2_CMD_EVENT_ACK   0x14
 
#define BTAUDIO2_CMD_ADDITIONAL_PROFILE_LINK_SETUP   0x15
 
#define BTAUDIO2_CMD_READ_LINKED_DEVICE_INFO   0x16
 
#define BTAUDIO2_CMD_PROFILE_LINK_BACK   0x17
 
#define BTAUDIO2_CMD_DISCONNECT   0x18
 
#define BTAUDIO2_CMD_USER_CONFIRM_SPP_REQ_REPLY   0x1A
 
#define BTAUDIO2_CMD_SET_HF_GAIN_LEVEL   0x1B
 
#define BTAUDIO2_CMD_EQ_MODE_SETTING   0x1C
 
#define BTAUDIO2_CMD_DSP_NR_CTRL   0x1D
 
#define BTAUDIO2_CMD_GPIO_CTRL   0x1E
 
#define BTAUDIO2_CMD_BT_MCU_UART_RX_BUFF_SIZE   0x1F
 
#define BTAUDIO2_CMD_VOICE_PROMPT_CMD   0x20
 
#define BTAUDIO2_CMD_SET_OVERALL_GAIN   0x23
 
#define BTAUDIO2_CMD_READ_BTM_SETTING   0x24
 
#define BTAUDIO2_CMD_READ_BTM_BATTERY_CHARGE_STATUS   0x25
 
#define BTAUDIO2_CMD_MCU_UPDATE   0x26
 
#define BTAUDIO2_CMD_REPORT_BATTERY_CAPACITY   0x27
 
#define BTAUDIO2_CMD_LE_ANCS_SERVICE   0x28
 
#define BTAUDIO2_CMD_LE_SIGNALING   0x29
 
#define BTAUDIO2_CMD_MSPK_VENDOR   0x2A
 
#define BTAUDIO2_CMD_READ_MSPK_LINK_STATUS   0x2B
 
#define BTAUDIO2_CMD_MSPK_SYNC_AUDIO_EFFECT   0x2C
 
#define BTAUDIO2_CMD_LE_GATT   0x2D
 
#define BTAUDIO2_CMD_LE_APP   0x2F
 
#define BTAUDIO2_CMD_DSP_RUNTIME_PROGRAM   0x30
 
#define BTAUDIO2_CMD_READ_VENDOR_EEPROM   0x31
 
#define BTAUDIO2_CMD_READ_IC_VERSION   0x32
 
#define BTAUDIO2_CMD_READ_LINK_MODE   0x34
 
#define BTAUDIO2_CMD_CONFIGURE_VENDOR_PARAM   0x35
 
#define BTAUDIO2_CMD_MSPK_EXCHANGE_LINK_INFO   0x37
 
#define BTAUDIO2_CMD_MSPK_SET_GIAC   0x38
 
#define BTAUDIO2_CMD_READ_FEATURE_LIST   0x39
 
#define BTAUDIO2_CMD_PERSONAL_MSPK_GROUP_CTRL   0x3A
 
#define BTAUDIO2_CMD_TEST_DEVICE   0x3B
 
#define BTAUDIO2_CMD_READ_EEPROM   0x3C
 
#define BTAUDIO2_CMD_WRITE_EEPROM   0x3D
 
#define BTAUDIO2_CMD_LE_SIGNALING_2   0x3E
 
#define BTAUDIO2_CMD_PBAPC   0x3F
 
#define BTAUDIO2_CMD_TWS   0x40
 
#define BTAUDIO2_CMD_AVRCP_BROWSING   0x41
 
#define BTAUDIO2_CMD_READ_PAIRED_LINK_KEY_INFO   0x42
 
#define BTAUDIO2_CMD_AUDIO_TRANSCEIVER   0x44
 
#define BTAUDIO2_CMD_BUTTON_MMI_SETTING   0x46
 
#define BTAUDIO2_CMD_BUTTON_OPERATION   0x47
 
#define BTAUDIO2_CMD_READ_BUTTON_MMI_SETTING   0x48
 
#define BTAUDIO2_CMD_DFU   0x49
 
#define BTAUDIO2_CMD_AVRCP_VENDOR_DEPENDENT   0x4A
 
#define BTAUDIO2_CMD_CONCERT_MODE_ENDLESS_GROUPING   0x4B
 
#define BTAUDIO2_CMD_READ_RUNTIME_LATENCY   0x4C
 
#define BTAUDIO2_CMD_TOGGLE_AUDIO_SOURCE   0xCC
 
#define BTAUDIO2_EVT_CMD_ACK   0x00
 BT Audio 2 events OP code list.
 
#define BTAUDIO2_EVT_BTM_STATE   0x01
 
#define BTAUDIO2_EVT_CALL_STATUS   0x02
 
#define BTAUDIO2_EVT_CALL_ID   0x03
 
#define BTAUDIO2_EVT_SMS_INDICATION   0x04
 
#define BTAUDIO2_EVT_MISS_CALL_INDICATION   0x05
 
#define BTAUDIO2_EVT_PHONE_MAX_BATTERY_LEVEL   0x06
 
#define BTAUDIO2_EVT_PHONE_BATTERY_LEVEL   0x07
 
#define BTAUDIO2_EVT_PHONE_ROAMING_STATUS   0x08
 
#define BTAUDIO2_EVT_PHONE_MAX_SIGNAL_STRENGTH   0x09
 
#define BTAUDIO2_EVT_PHONE_SIGNAL_STRENGTH   0x0A
 
#define BTAUDIO2_EVT_PHONE_SERVICE_STATUS   0x0B
 
#define BTAUDIO2_EVT_BATTERY_LEVEL   0x0C
 
#define BTAUDIO2_EVT_CHARGER_STATUS   0x0D
 
#define BTAUDIO2_EVT_RESET_TO_DEFAULT   0x0E
 
#define BTAUDIO2_EVT_VOLUME_LEVEL   0x0F
 
#define BTAUDIO2_EVT_EQ_MODE   0x10
 
#define BTAUDIO2_EVT_LINKED_DEVICE_INFO   0x17
 
#define BTAUDIO2_EVT_BTM_VERSION   0x18
 
#define BTAUDIO2_EVT_CALL_LIST_REPORT   0x19
 
#define BTAUDIO2_EVT_AVRCP_SPEC_RSP   0x1A
 
#define BTAUDIO2_EVT_BTM_UTILITY_REQ   0x1B
 
#define BTAUDIO2_EVT_VENDOR_AT_CMD_RSP   0x1C
 
#define BTAUDIO2_EVT_UNKNOW_AT_RESULT   0x1D
 
#define BTAUDIO2_EVT_REPORT_LINK_STATUS   0x1E
 
#define BTAUDIO2_EVT_REPORT_PAIRING_RECORD   0x1F
 
#define BTAUDIO2_EVT_REPORT_LOCAL_BD_ADDR   0x20
 
#define BTAUDIO2_EVT_REPORT_LOCAL_DEVICE_NAME   0x21
 
#define BTAUDIO2_EVT_REPORT_SPP_DATA   0x22
 
#define BTAUDIO2_EVT_REPORT_LINK_BACK_STATUS   0x23
 
#define BTAUDIO2_EVT_RINGTONE_FINISH_INDICATION   0x24
 
#define BTAUDIO2_EVT_USER_CONFIRM_SSP_REQ   0x25
 
#define BTAUDIO2_EVT_REPORT_AVRCP_VOL_CTRL   0x26
 
#define BTAUDIO2_EVT_REPORT_INPUT_SIGNAL_LEVEL   0x27
 
#define BTAUDIO2_EVT_REPORT_IAP_INFO   0x28
 
#define BTAUDIO2_EVT_REPORT_AVRCP_ABS_VOL_CTRL   0x29
 
#define BTAUDIO2_EVT_REPORT_VOICE_PROMPT_STATUS   0x2A
 
#define BTAUDIO2_EVT_REPORT_TYPE_CODEC   0x2D
 
#define BTAUDIO2_EVT_REPORT_TYPE_BTM_SETTING   0x2E
 
#define BTAUDIO2_EVT_REPORT_MCU_UPDATE_REPLY   0x2F
 
#define BTAUDIO2_EVT_REPORT_BTM_INITIAL_STATUS   0x30
 
#define BTAUDIO2_EVT_REPORT_LE_ANCS_EVENT   0x31
 
#define BTAUDIO2_EVT_REPORT_LE_EVENT   0x32
 
#define BTAUDIO2_EVT_REPORT_MSPK_STATUS   0x33
 
#define BTAUDIO2_EVT_REPORT_MSPK_VENDOR_EVENT   0x34
 
#define BTAUDIO2_EVT_REPORT_MSPK_AUDIO_SETTING   0x35
 
#define BTAUDIO2_EVT_REPORT_MSPK_EFFECT_STATUS   0x36
 
#define BTAUDIO2_EVT_REPORT_VENDOR_EEPROM   0x37
 
#define BTAUDIO2_EVT_REPORT_IC_VERSION_INFO   0x38
 
#define BTAUDIO2_EVT_REPORT_CUSTOMER_GATT_ATTRIBUTE_DATA   0x39
 
#define BTAUDIO2_EVT_REPORT_LINK_MODE   0x3A
 
#define BTAUDIO2_EVT_REPORT_MSPK_EXCHANGE_LINK_INFO   0x3D
 
#define BTAUDIO2_EVT_REPORT_BT_CLK   0x3F
 
#define BTAUDIO2_EVT_REPORT_FEATURE_LIST   0x40
 
#define BTAUDIO2_EVT_REPORT_TEST_RESULT   0x41
 
#define BTAUDIO2_EVT_REPORT_READ_EEPROM_DATA   0x42
 
#define BTAUDIO2_EVT_PBAPC_EVENT   0x43
 
#define BTAUDIO2_EVT_AVRCP_BROWSING_EVENT   0x44
 
#define BTAUDIO2_EVT_REPORT_PAIRED_LINK_KEY_INFO   0x45
 
#define BTAUDIO2_EVT_REPORT_TWS_RX_VENDOR_EVENT   0x53
 
#define BTAUDIO2_EVT_REPORT_TWS_LOCAL_DEVICE_STATUS   0x54
 
#define BTAUDIO2_EVT_REPORT_TWS_VAD_DATA   0x55
 
#define BTAUDIO2_EVT_REPORT_TWS_RADIO_CONDITION   0x56
 
#define BTAUDIO2_EVT_REPORT_TWS_EAR_BUD_POSITION   0x57
 
#define BTAUDIO2_EVT_REPORT_TWS_SECONDARY_DEVICE_STATUS   0x58
 
#define BTAUDIO2_EVT_AUDIO_TRANSCEIVER_EVENT_STATUS   0x5A
 
#define BTAUDIO2_EVT_READ_BUTTON_MMI_SETTING_REPLY   0x5C
 
#define BTAUDIO2_EVT_AVRCP_VENDOR_DEPENDENT_RSP   0x5D
 
#define BTAUDIO2_EVT_RUNTIME_LATENCY   0x5E
 
#define BTAUDIO2_MMI_ADD_REMOVE_SCO_LINK   0x01
 BT Audio 2 MMI actions list.
 
#define BTAUDIO2_MMI_ENABLE_TEST_MODE   0x03
 
#define BTAUDIO2_MMI_ACCEPT_CALL   0x04
 
#define BTAUDIO2_MMI_REJECT_CALL   0x05
 
#define BTAUDIO2_MMI_ENDCALL_OR_TRANSFER_TO_HEADSET   0x06
 
#define BTAUDIO2_MMI_MIC_MUTE_TOGGLE   0x07
 
#define BTAUDIO2_MMI_MUTE_MIC   0x08
 
#define BTAUDIO2_MMI_UNMUTE_MIC   0x09
 
#define BTAUDIO2_MMI_VOICE_DIAL   0x0A
 
#define BTAUDIO2_MMI_CANCEL_VOICE_DIAL   0x0B
 
#define BTAUDIO2_MMI_LAST_NUMBER_REDIAL   0x0C
 
#define BTAUDIO2_MMI_ACTIVE_CALL_HOLD_ACCEPT_HELD_CALL   0x0D
 
#define BTAUDIO2_MMI_VOICE_TRANSFER   0x0E
 
#define BTAUDIO2_MMI_QUERY_CALL_LIST   0x0F
 
#define BTAUDIO2_MMI_THREE_WAY_CALL   0x10
 
#define BTAUDIO2_MMI_RELEASE_CALL   0x11
 
#define BTAUDIO2_MMI_ACCEPT_WAITING_HOLD_CALL_RLS_ACTIVE_CALL   0x12
 
#define BTAUDIO2_MMI_DISCONNECT_HF_LINK   0x17
 
#define BTAUDIO2_MMI_ENABLE_AEC   0x1E
 
#define BTAUDIO2_MMI_DISABLE_AEC   0x1F
 
#define BTAUDIO2_MMI_SWITCH_AEC   0x20
 
#define BTAUDIO2_MMI_ENABLE_AEC_RX_NOISE_REDUCTION   0x21
 
#define BTAUDIO2_MMI_DISABLE_AEC_RX_NOISE_REDUCTION   0x22
 
#define BTAUDIO2_MMI_SWITCH_AEC_RX_NOISE_REDUCTION   0x23
 
#define BTAUDIO2_MMI_INC_MIC_GAIN   0x24
 
#define BTAUDIO2_MMI_DEC_MIC_GAIN   0x25
 
#define BTAUDIO2_MMI_SWITCH_PRIMARY_SECONDARY_HF_DEVICE   0x26
 
#define BTAUDIO2_MMI_INCREASE_SPEAKER_GAIN   0x30
 
#define BTAUDIO2_MMI_DECREASE_SPEAKER_GAIN   0x31
 
#define BTAUDIO2_MMI_PLAY_PAUSE_MUSIC   0x32
 
#define BTAUDIO2_MMI_STOP_MUSIC   0x33
 
#define BTAUDIO2_MMI_NEXT_SONG   0x34
 
#define BTAUDIO2_MMI_PREVIOUS_SONG   0x35
 
#define BTAUDIO2_MMI_FAST_FORWARD   0x36
 
#define BTAUDIO2_MMI_REWIND   0x37
 
#define BTAUDIO2_MMI_EQ_MODE_UP   0x38
 
#define BTAUDIO2_MMI_EQ_MODE_DOWN   0x39
 
#define BTAUDIO2_MMI_LOCK_BUTTON   0x3A
 
#define BTAUDIO2_MMI_DISCONNECT_A2DP   0x3B
 
#define BTAUDIO2_MMI_NEXT_AUDIO_EFFECT   0x3C
 
#define BTAUDIO2_MMI_PREVIOUS_AUDIO_EFFECT   0x3D
 
#define BTAUDIO2_MMI_REPORT_CURRENT_EQ_MODE   0x3F
 
#define BTAUDIO2_MMI_REPORT_CURRENT_AUDIO_EFFECT_STATUS   0x40
 
#define BTAUDIO2_MMI_TOGGLE_AUDIO_PLAYBACK   0x41
 
#define BTAUDIO2_MMI_POWER_ON_BUTTON_PRESS   0x51
 
#define BTAUDIO2_MMI_POWER_ON_BUTTON_RELEASE   0x52
 
#define BTAUDIO2_MMI_POWER_OFF_BUTTON_PRESS   0x53
 
#define BTAUDIO2_MMI_POWER_OFF_BUTTON_RELEASE   0x54
 
#define BTAUDIO2_MMI_RESET_EEPROM_SETTING   0x56
 
#define BTAUDIO2_MMI_FORCE_SPEAKER_GAIN_TOGGLE   0x57
 
#define BTAUDIO2_MMI_TOGGLE_BUTTON_IND   0x58
 
#define BTAUDIO2_MMI_COMBINE_FUNCTION_0   0x59
 
#define BTAUDIO2_MMI_COMBINE_FUNCTION_1   0x5A
 
#define BTAUDIO2_MMI_COMBINE_FUNCTION_2   0x5B
 
#define BTAUDIO2_MMI_COMBINE_FUNCTION_3   0x5C
 
#define BTAUDIO2_MMI_ENTER_PAIRING_MODE   0x5D
 
#define BTAUDIO2_MMI_SWITCH_POWER_OFF   0x5E
 
#define BTAUDIO2_MMI_DISABLE_LED   0x5F
 
#define BTAUDIO2_MMI_BUZZER_TOGGLE   0x60
 
#define BTAUDIO2_MMI_DISABLE_BUZZER   0x61
 
#define BTAUDIO2_MMI_ENABLE_BUZZER   0x62
 
#define BTAUDIO2_MMI_TONE_CHANGE   0x63
 
#define BTAUDIO2_MMI_SHS_SEND_USER_DATA_1   0x72
 
#define BTAUDIO2_MMI_SHS_SEND_USER_DATA_2   0x73
 
#define BTAUDIO2_MMI_SHS_SEND_USER_DATA_3   0x74
 
#define BTAUDIO2_MMI_SHS_SEND_USER_DATA_4   0x75
 
#define BTAUDIO2_MMI_SHS_SEND_USER_DATA_5   0x76
 
#define BTAUDIO2_MMI_REPORT_CURRENT_RX_NR_STATUS   0x77
 
#define BTAUDIO2_MMI_REPORT_CURRENT_TX_NR_STATUS   0x78
 
#define BTAUDIO2_MMI_CANCEL_ALL_BT_PAGING   0x7A
 
#define BTAUDIO2_MMI_DISCONNECT_SPP_LINK   0x7D
 
#define BTAUDIO2_MMI_ENABLE_A2DP_MIX_LINE_IN   0x80
 
#define BTAUDIO2_MMI_DISABLE_A2DP_MIX_LINE_IN   0x81
 
#define BTAUDIO2_MMI_INCREASE_LINE_IN_INPUT_GAIN   0x82
 
#define BTAUDIO2_MMI_DECREASE_LINE_IN_INPUT_GAIN   0x83
 
#define BTAUDIO2_MMI_TRIGGER_MSPK_CENTRAL   0xE0
 
#define BTAUDIO2_MMI_TRIGGER_MSPK_PERIPHERAL   0xE1
 
#define BTAUDIO2_MMI_MSPK_ONE_KEY_CONNECT   0xE2
 
#define BTAUDIO2_MMI_CANCEL_MSPK_CREATION   0xE3
 
#define BTAUDIO2_MMI_TERMINATE_MSPK_LINK   0xE4
 
#define BTAUDIO2_MMI_TERMINATE_MSPK_CONNECTION   0xE5
 
#define BTAUDIO2_MMI_MSPK_CENTRAL_ENTER_AUX_IN_44p1K_PCM_MODE   0xE6
 
#define BTAUDIO2_MMI_MSPK_CENTRAL_ENTER_AUX_IN_48K_PCM_MODE   0xE7
 
#define BTAUDIO2_MMI_MSPK_CENTRAL_EXIT_AUX_IN_PCM_MODE   0xE8
 
#define BTAUDIO2_MMI_MSPK_SWITCH_CHANNEL   0xEC
 
#define BTAUDIO2_MMI_MSPK_POWER_OFF_ALL_SPEAKERS   0xED
 
#define BTAUDIO2_MMI_MSPK_ERASE_CONCERT_MODE_RECORD   0xEF
 
#define BTAUDIO2_MMI_MSPK_ENTER_STEREO_MODE   0xF4
 
#define BTAUDIO2_MMI_MSPK_ENTER_CONCERT_MODE   0xF5
 
#define BTAUDIO2_MMI_MSPK_ADD_THIRD_SPK   0xF6
 
#define BTAUDIO2_MMI_MSPK_SOUND_SYNC   0xF7
 
#define BTAUDIO2_MMI_MSPK_CSB_CONNECTED_MODE_SWITCH   0xF8
 
#define BTAUDIO2_MMI_MSPK_BACK_TO_LAST_MODE   0xF9
 
#define BTAUDIO2_MMI_MSPK_ONE_KEY_CONNECT_WITH_LINK_BACK   0xFA
 
#define BTAUDIO2_MMI_MSPK_ONE_KEY_OP_STEREO_MODE   0xFB
 
#define BTAUDIO2_MMI_MSPK_ONE_KEY_OP_CONCERT_MODE   0xFC
 
#define BTAUDIO2_ACK_STATUS_CMD_COMPLETE   0x00
 BT Audio 2 command ACK status bytes.
 
#define BTAUDIO2_ACK_STATUS_CMD_DISALLOW   0x01
 
#define BTAUDIO2_ACK_STATUS_CMD_UNKNOWN   0x02
 
#define BTAUDIO2_ACK_STATUS_CMD_PARAM_ERR   0x03
 
#define BTAUDIO2_ACK_STATUS_CMD_BTM_BUSY   0x04
 
#define BTAUDIO2_ACK_STATUS_CMD_BTM_FULL   0x05
 
#define BTAUDIO2_BTM_STATE_POWER_OFF   0x00
 BT Audio 2 BTM status bytes.
 
#define BTAUDIO2_BTM_STATE_PAIRING_STATE   0x01
 
#define BTAUDIO2_BTM_STATE_POWER_ON   0x02
 
#define BTAUDIO2_BTM_STATE_PAIRING_SUCCESSFULL   0x03
 
#define BTAUDIO2_BTM_STATE_PAIRING_FAILED   0x04
 
#define BTAUDIO2_BTM_STATE_HFHS_LINK_ESTABLISHED   0x05
 
#define BTAUDIO2_BTM_STATE_A2DP_LINK_ESTABLISHED   0x06
 
#define BTAUDIO2_BTM_STATE_HF_LINK_DISCONNECTED   0x07
 
#define BTAUDIO2_BTM_STATE_A2DP_LINK_DISCONNECTED   0x08
 
#define BTAUDIO2_BTM_STATE_SCO_LINK_CONNECTED   0x09
 
#define BTAUDIO2_BTM_STATE_SCO_LINK_DISCONNECTED   0x0A
 
#define BTAUDIO2_BTM_STATE_AVRCP_LINK_ESTABLISHED   0x0B
 
#define BTAUDIO2_BTM_STATE_AVRCP_LINK_DISCONNECTED   0x0C
 
#define BTAUDIO2_BTM_STATE_STANDARD_SPP_CONNECTED   0x0D
 
#define BTAUDIO2_BTM_STATE_STANDARD_SPP_IAP_DISCONNECTED   0x0E
 
#define BTAUDIO2_BTM_STATE_STANDBY_STATE   0x0F
 
#define BTAUDIO2_BTM_STATE_IAP_CONNECTED   0x10
 
#define BTAUDIO2_BTM_STATE_ACL_DISCONNECTED   0x11
 
#define BTAUDIO2_BTM_STATE_MAP_CONNECTED   0x12
 
#define BTAUDIO2_BTM_STATE_MAP_OPERATION_FORBIDDEN   0x13
 
#define BTAUDIO2_BTM_STATE_MAP_DISCONNECTED   0x14
 
#define BTAUDIO2_BTM_STATE_ACL_CONNECTED   0x15
 
#define BTAUDIO2_BTM_STATE_SPP_IAP_DISCONNECTED_NO_PROFILE   0x16
 
#define BTAUDIO2_BTM_STATE_LINK_BACK_ACL   0x17
 
#define BTAUDIO2_BTM_STATE_INQUIRY_STATE   0x18
 
#define BTAUDIO2_BTM_STATE_UNKNOWN_AUDIO_SOURCE   0x80
 
#define BTAUDIO2_BTM_STATE_AUX_IN_AUDIO_SOURCE   0x81
 
#define BTAUDIO2_BTM_STATE_A2DP_AUDIO_SOURCE   0x82
 
#define BTAUDIO2_VOLUME_MASK_A2DP   0x01
 BT Audio 2 Volume control mask bytes.
 
#define BTAUDIO2_VOLUME_MASK_HF   0x02
 
#define BTAUDIO2_VOLUME_MASK_LINE_IN   0x04
 
#define BTAUDIO2_VOLUME_MASK_PCM   0x08
 
#define BTAUDIO2_VOLUME_MASK_LINE_IN_INPUT   0x10
 
#define BTAUDIO2_START_HEADER   0xAA
 BT Audio 2 header byte.
 
#define BTAUDIO2_MODE_FLASH_APPLICATION   0
 BT Audio 2 operating mode setting.
 
#define BTAUDIO2_MODE_ROM_APPLICATION   1
 
#define BTAUDIO2_MODE_FLASH_IBDK   2
 
#define BTAUDIO2_MODE_ROM_IBDK   3
 
#define BTAUDIO2_MODE_BOOT   4
 
#define BTAUDIO2_RX_DRV_BUFFER_SIZE   300
 BT Audio 2 driver buffer size.
 
#define BTAUDIO2_TX_DRV_BUFFER_SIZE   300
 
#define BTAUDIO2_PARAM_BUFFER_SIZE   256
 
#define BTAUDIO2_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  btaudio2_return_value_t { BTAUDIO2_OK = 0 , BTAUDIO2_ERROR = -1 }
 BT Audio 2 Click return value data. More...
 
enum  btaudio2_music_control_t {
  BTAUDIO2_STOP_FAST_FORWARD_OR_REWIND = 0 , BTAUDIO2_FAST_FORWARD , BTAUDIO2_FAST_FORWARD_WITH_REPEAT , BTAUDIO2_REWIND ,
  BTAUDIO2_REWIND_WITH_REPEAT , BTAUDIO2_PLAY , BTAUDIO2_PAUSE , BTAUDIO2_PLAY_PAUSE_TOGGLE ,
  BTAUDIO2_STOP
}
 BT Audio 2 Click music control values. More...
 
enum  btaudio2_eq_mode_t {
  BTAUDIO2_EQ_MODE_OFF = 0 , BTAUDIO2_EQ_MODE_SOFT , BTAUDIO2_EQ_MODE_BASS , BTAUDIO2_EQ_MODE_TREBLE ,
  BTAUDIO2_EQ_MODE_CLASSIC , BTAUDIO2_EQ_MODE_ROCK , BTAUDIO2_EQ_MODE_JAZZ , BTAUDIO2_EQ_MODE_POP ,
  BTAUDIO2_EQ_MODE_DANCE , BTAUDIO2_EQ_MODE_RNB , BTAUDIO2_EQ_MODE_USER1
}
 BT Audio 2 Click equalizer mode selection values. More...
 

Functions

void btaudio2_cfg_setup (btaudio2_cfg_t *cfg)
 BT Audio 2 configuration object setup function.
 
err_t btaudio2_init (btaudio2_t *ctx, btaudio2_cfg_t *cfg)
 BT Audio 2 initialization function.
 
err_t btaudio2_default_cfg (btaudio2_t *ctx)
 BT Audio 2 default configuration function.
 
err_t btaudio2_generic_write (btaudio2_t *ctx, uint8_t *data_in, uint16_t len)
 BT Audio 2 data writing function.
 
err_t btaudio2_generic_read (btaudio2_t *ctx, uint8_t *data_out, uint16_t len)
 BT Audio 2 data reading function.
 
void btaudio2_set_mfb_pin (btaudio2_t *ctx, uint8_t state)
 BT Audio 2 set MFB pin function.
 
void btaudio2_set_rst_pin (btaudio2_t *ctx, uint8_t state)
 BT Audio 2 set RST pin function.
 
void btaudio2_set_mode (btaudio2_t *ctx, uint8_t mode)
 BT Audio 2 set mode function.
 
void btaudio2_reset_device (btaudio2_t *ctx)
 BT Audio 2 reset device function.
 
void btaudio2_send_cmd (btaudio2_t *ctx)
 BT Audio 2 send command function.
 
err_t btaudio2_send_cmd_with_ack (btaudio2_t *ctx)
 BT Audio 2 send command with ack check function.
 
err_t btaudio2_read_event (btaudio2_t *ctx)
 BT Audio 2 read event function.
 
err_t btaudio2_wait_for_event (btaudio2_t *ctx, uint8_t opcode)
 BT Audio 2 wait for event function.
 
void btaudio2_clear_events (btaudio2_t *ctx)
 BT Audio 2 clear events function.
 
err_t btaudio2_send_mmi_action (btaudio2_t *ctx, uint8_t database_index, uint8_t action)
 BT Audio 2 send MMI action function.
 
err_t btaudio2_power_on_device (btaudio2_t *ctx)
 BT Audio 2 power ON device function.
 
err_t btaudio2_power_off_device (btaudio2_t *ctx)
 BT Audio 2 power OFF device function.
 
err_t btaudio2_enter_pairing_mode (btaudio2_t *ctx)
 BT Audio 2 enter pairing mode function.
 
err_t btaudio2_reset_to_default (btaudio2_t *ctx)
 BT Audio 2 reset to default function.
 
err_t btaudio2_set_device_name (btaudio2_t *ctx, uint8_t *device_name)
 BT Audio 2 set device name function.
 
err_t btaudio2_music_control (btaudio2_t *ctx, btaudio2_music_control_t action)
 BT Audio 2 music control function.
 
err_t btaudio2_make_call (btaudio2_t *ctx, uint8_t database_index, uint8_t *phone_number)
 BT Audio 2 make call function.
 
err_t btaudio2_volume_up (btaudio2_t *ctx, uint8_t database_index, uint8_t mask)
 BT Audio 2 volume up function.
 
err_t btaudio2_volume_down (btaudio2_t *ctx, uint8_t database_index, uint8_t mask)
 BT Audio 2 volume down function.
 
err_t btaudio2_enable_advertising (btaudio2_t *ctx)
 BT Audio 2 enable advertising function.
 
err_t btaudio2_disable_advertising (btaudio2_t *ctx)
 BT Audio 2 disable advertising function.
 
err_t btaudio2_set_eq_mode (btaudio2_t *ctx, btaudio2_eq_mode_t eq_mode)
 BT Audio 2 set equalizer mode function.
 

Detailed Description

This file contains API for BT Audio 2 Click Driver.

Enumeration Type Documentation

◆ btaudio2_eq_mode_t

BT Audio 2 Click equalizer mode selection values.

Predefined enum values for equalizer mode selection.

Enumerator
BTAUDIO2_EQ_MODE_OFF 
BTAUDIO2_EQ_MODE_SOFT 
BTAUDIO2_EQ_MODE_BASS 
BTAUDIO2_EQ_MODE_TREBLE 
BTAUDIO2_EQ_MODE_CLASSIC 
BTAUDIO2_EQ_MODE_ROCK 
BTAUDIO2_EQ_MODE_JAZZ 
BTAUDIO2_EQ_MODE_POP 
BTAUDIO2_EQ_MODE_DANCE 
BTAUDIO2_EQ_MODE_RNB 
BTAUDIO2_EQ_MODE_USER1 

◆ btaudio2_music_control_t

BT Audio 2 Click music control values.

Predefined enum values for music control.

Enumerator
BTAUDIO2_STOP_FAST_FORWARD_OR_REWIND 
BTAUDIO2_FAST_FORWARD 
BTAUDIO2_FAST_FORWARD_WITH_REPEAT 
BTAUDIO2_REWIND 
BTAUDIO2_REWIND_WITH_REPEAT 
BTAUDIO2_PLAY 
BTAUDIO2_PAUSE 
BTAUDIO2_PLAY_PAUSE_TOGGLE 
BTAUDIO2_STOP 

◆ btaudio2_return_value_t

BT Audio 2 Click return value data.

Predefined enum values for driver return values.

Enumerator
BTAUDIO2_OK 
BTAUDIO2_ERROR