39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
73#define BTAUDIO2_CMD_MAKE_CALL 0x00
74#define BTAUDIO2_CMD_MAKE_EXTENSION_CALL 0x01
75#define BTAUDIO2_CMD_MMI_ACTION 0x02
76#define BTAUDIO2_CMD_EVENT_MASK_SETTING 0x03
77#define BTAUDIO2_CMD_MUSIC_CONTROL 0x04
78#define BTAUDIO2_CMD_CHANGE_DEVICE_NAME 0x05
79#define BTAUDIO2_CMD_CHANGE_PIN_CODE 0x06
80#define BTAUDIO2_CMD_SET_BTM_PARAM 0x07
81#define BTAUDIO2_CMD_GET_BTM_VERSION 0x08
82#define BTAUDIO2_CMD_VENDOR_AT_CMD 0x0A
83#define BTAUDIO2_CMD_AVRCP_SPEC_CMD 0x0B
84#define BTAUDIO2_CMD_AVRCP_GROUP_NAVIGATION 0x0C
85#define BTAUDIO2_CMD_READ_LINK_STATUS 0x0D
86#define BTAUDIO2_CMD_READ_PAIRING_RECORD 0x0E
87#define BTAUDIO2_CMD_READ_LOCAL_BD_ADDR 0x0F
88#define BTAUDIO2_CMD_READ_LOCAL_DEVICE_NAME 0x10
89#define BTAUDIO2_CMD_SEND_SPP_DATA 0x12
90#define BTAUDIO2_CMD_BTM_UTILITY_FUNCTION 0x13
91#define BTAUDIO2_CMD_EVENT_ACK 0x14
92#define BTAUDIO2_CMD_ADDITIONAL_PROFILE_LINK_SETUP 0x15
93#define BTAUDIO2_CMD_READ_LINKED_DEVICE_INFO 0x16
94#define BTAUDIO2_CMD_PROFILE_LINK_BACK 0x17
95#define BTAUDIO2_CMD_DISCONNECT 0x18
96#define BTAUDIO2_CMD_USER_CONFIRM_SPP_REQ_REPLY 0x1A
97#define BTAUDIO2_CMD_SET_HF_GAIN_LEVEL 0x1B
98#define BTAUDIO2_CMD_EQ_MODE_SETTING 0x1C
99#define BTAUDIO2_CMD_DSP_NR_CTRL 0x1D
100#define BTAUDIO2_CMD_GPIO_CTRL 0x1E
101#define BTAUDIO2_CMD_BT_MCU_UART_RX_BUFF_SIZE 0x1F
102#define BTAUDIO2_CMD_VOICE_PROMPT_CMD 0x20
103#define BTAUDIO2_CMD_SET_OVERALL_GAIN 0x23
104#define BTAUDIO2_CMD_READ_BTM_SETTING 0x24
105#define BTAUDIO2_CMD_READ_BTM_BATTERY_CHARGE_STATUS 0x25
106#define BTAUDIO2_CMD_MCU_UPDATE 0x26
107#define BTAUDIO2_CMD_REPORT_BATTERY_CAPACITY 0x27
108#define BTAUDIO2_CMD_LE_ANCS_SERVICE 0x28
109#define BTAUDIO2_CMD_LE_SIGNALING 0x29
110#define BTAUDIO2_CMD_MSPK_VENDOR 0x2A
111#define BTAUDIO2_CMD_READ_MSPK_LINK_STATUS 0x2B
112#define BTAUDIO2_CMD_MSPK_SYNC_AUDIO_EFFECT 0x2C
113#define BTAUDIO2_CMD_LE_GATT 0x2D
114#define BTAUDIO2_CMD_LE_APP 0x2F
115#define BTAUDIO2_CMD_DSP_RUNTIME_PROGRAM 0x30
116#define BTAUDIO2_CMD_READ_VENDOR_EEPROM 0x31
117#define BTAUDIO2_CMD_READ_IC_VERSION 0x32
118#define BTAUDIO2_CMD_READ_LINK_MODE 0x34
119#define BTAUDIO2_CMD_CONFIGURE_VENDOR_PARAM 0x35
120#define BTAUDIO2_CMD_MSPK_EXCHANGE_LINK_INFO 0x37
121#define BTAUDIO2_CMD_MSPK_SET_GIAC 0x38
122#define BTAUDIO2_CMD_READ_FEATURE_LIST 0x39
123#define BTAUDIO2_CMD_PERSONAL_MSPK_GROUP_CTRL 0x3A
124#define BTAUDIO2_CMD_TEST_DEVICE 0x3B
125#define BTAUDIO2_CMD_READ_EEPROM 0x3C
126#define BTAUDIO2_CMD_WRITE_EEPROM 0x3D
127#define BTAUDIO2_CMD_LE_SIGNALING_2 0x3E
128#define BTAUDIO2_CMD_PBAPC 0x3F
129#define BTAUDIO2_CMD_TWS 0x40
130#define BTAUDIO2_CMD_AVRCP_BROWSING 0x41
131#define BTAUDIO2_CMD_READ_PAIRED_LINK_KEY_INFO 0x42
132#define BTAUDIO2_CMD_AUDIO_TRANSCEIVER 0x44
133#define BTAUDIO2_CMD_BUTTON_MMI_SETTING 0x46
134#define BTAUDIO2_CMD_BUTTON_OPERATION 0x47
135#define BTAUDIO2_CMD_READ_BUTTON_MMI_SETTING 0x48
136#define BTAUDIO2_CMD_DFU 0x49
137#define BTAUDIO2_CMD_AVRCP_VENDOR_DEPENDENT 0x4A
138#define BTAUDIO2_CMD_CONCERT_MODE_ENDLESS_GROUPING 0x4B
139#define BTAUDIO2_CMD_READ_RUNTIME_LATENCY 0x4C
140#define BTAUDIO2_CMD_TOGGLE_AUDIO_SOURCE 0xCC
146#define BTAUDIO2_EVT_CMD_ACK 0x00
147#define BTAUDIO2_EVT_BTM_STATE 0x01
148#define BTAUDIO2_EVT_CALL_STATUS 0x02
149#define BTAUDIO2_EVT_CALL_ID 0x03
150#define BTAUDIO2_EVT_SMS_INDICATION 0x04
151#define BTAUDIO2_EVT_MISS_CALL_INDICATION 0x05
152#define BTAUDIO2_EVT_PHONE_MAX_BATTERY_LEVEL 0x06
153#define BTAUDIO2_EVT_PHONE_BATTERY_LEVEL 0x07
154#define BTAUDIO2_EVT_PHONE_ROAMING_STATUS 0x08
155#define BTAUDIO2_EVT_PHONE_MAX_SIGNAL_STRENGTH 0x09
156#define BTAUDIO2_EVT_PHONE_SIGNAL_STRENGTH 0x0A
157#define BTAUDIO2_EVT_PHONE_SERVICE_STATUS 0x0B
158#define BTAUDIO2_EVT_BATTERY_LEVEL 0x0C
159#define BTAUDIO2_EVT_CHARGER_STATUS 0x0D
160#define BTAUDIO2_EVT_RESET_TO_DEFAULT 0x0E
161#define BTAUDIO2_EVT_VOLUME_LEVEL 0x0F
162#define BTAUDIO2_EVT_EQ_MODE 0x10
163#define BTAUDIO2_EVT_LINKED_DEVICE_INFO 0x17
164#define BTAUDIO2_EVT_BTM_VERSION 0x18
165#define BTAUDIO2_EVT_CALL_LIST_REPORT 0x19
166#define BTAUDIO2_EVT_AVRCP_SPEC_RSP 0x1A
167#define BTAUDIO2_EVT_BTM_UTILITY_REQ 0x1B
168#define BTAUDIO2_EVT_VENDOR_AT_CMD_RSP 0x1C
169#define BTAUDIO2_EVT_UNKNOW_AT_RESULT 0x1D
170#define BTAUDIO2_EVT_REPORT_LINK_STATUS 0x1E
171#define BTAUDIO2_EVT_REPORT_PAIRING_RECORD 0x1F
172#define BTAUDIO2_EVT_REPORT_LOCAL_BD_ADDR 0x20
173#define BTAUDIO2_EVT_REPORT_LOCAL_DEVICE_NAME 0x21
174#define BTAUDIO2_EVT_REPORT_SPP_DATA 0x22
175#define BTAUDIO2_EVT_REPORT_LINK_BACK_STATUS 0x23
176#define BTAUDIO2_EVT_RINGTONE_FINISH_INDICATION 0x24
177#define BTAUDIO2_EVT_USER_CONFIRM_SSP_REQ 0x25
178#define BTAUDIO2_EVT_REPORT_AVRCP_VOL_CTRL 0x26
179#define BTAUDIO2_EVT_REPORT_INPUT_SIGNAL_LEVEL 0x27
180#define BTAUDIO2_EVT_REPORT_IAP_INFO 0x28
181#define BTAUDIO2_EVT_REPORT_AVRCP_ABS_VOL_CTRL 0x29
182#define BTAUDIO2_EVT_REPORT_VOICE_PROMPT_STATUS 0x2A
183#define BTAUDIO2_EVT_REPORT_TYPE_CODEC 0x2D
184#define BTAUDIO2_EVT_REPORT_TYPE_BTM_SETTING 0x2E
185#define BTAUDIO2_EVT_REPORT_MCU_UPDATE_REPLY 0x2F
186#define BTAUDIO2_EVT_REPORT_BTM_INITIAL_STATUS 0x30
187#define BTAUDIO2_EVT_REPORT_LE_ANCS_EVENT 0x31
188#define BTAUDIO2_EVT_REPORT_LE_EVENT 0x32
189#define BTAUDIO2_EVT_REPORT_MSPK_STATUS 0x33
190#define BTAUDIO2_EVT_REPORT_MSPK_VENDOR_EVENT 0x34
191#define BTAUDIO2_EVT_REPORT_MSPK_AUDIO_SETTING 0x35
192#define BTAUDIO2_EVT_REPORT_MSPK_EFFECT_STATUS 0x36
193#define BTAUDIO2_EVT_REPORT_VENDOR_EEPROM 0x37
194#define BTAUDIO2_EVT_REPORT_IC_VERSION_INFO 0x38
195#define BTAUDIO2_EVT_REPORT_CUSTOMER_GATT_ATTRIBUTE_DATA 0x39
196#define BTAUDIO2_EVT_REPORT_LINK_MODE 0x3A
197#define BTAUDIO2_EVT_REPORT_MSPK_EXCHANGE_LINK_INFO 0x3D
198#define BTAUDIO2_EVT_REPORT_BT_CLK 0x3F
199#define BTAUDIO2_EVT_REPORT_FEATURE_LIST 0x40
200#define BTAUDIO2_EVT_REPORT_TEST_RESULT 0x41
201#define BTAUDIO2_EVT_REPORT_READ_EEPROM_DATA 0x42
202#define BTAUDIO2_EVT_PBAPC_EVENT 0x43
203#define BTAUDIO2_EVT_AVRCP_BROWSING_EVENT 0x44
204#define BTAUDIO2_EVT_REPORT_PAIRED_LINK_KEY_INFO 0x45
205#define BTAUDIO2_EVT_REPORT_TWS_RX_VENDOR_EVENT 0x53
206#define BTAUDIO2_EVT_REPORT_TWS_LOCAL_DEVICE_STATUS 0x54
207#define BTAUDIO2_EVT_REPORT_TWS_VAD_DATA 0x55
208#define BTAUDIO2_EVT_REPORT_TWS_RADIO_CONDITION 0x56
209#define BTAUDIO2_EVT_REPORT_TWS_EAR_BUD_POSITION 0x57
210#define BTAUDIO2_EVT_REPORT_TWS_SECONDARY_DEVICE_STATUS 0x58
211#define BTAUDIO2_EVT_AUDIO_TRANSCEIVER_EVENT_STATUS 0x5A
212#define BTAUDIO2_EVT_READ_BUTTON_MMI_SETTING_REPLY 0x5C
213#define BTAUDIO2_EVT_AVRCP_VENDOR_DEPENDENT_RSP 0x5D
214#define BTAUDIO2_EVT_RUNTIME_LATENCY 0x5E
220#define BTAUDIO2_MMI_ADD_REMOVE_SCO_LINK 0x01
221#define BTAUDIO2_MMI_ENABLE_TEST_MODE 0x03
222#define BTAUDIO2_MMI_ACCEPT_CALL 0x04
223#define BTAUDIO2_MMI_REJECT_CALL 0x05
224#define BTAUDIO2_MMI_ENDCALL_OR_TRANSFER_TO_HEADSET 0x06
225#define BTAUDIO2_MMI_MIC_MUTE_TOGGLE 0x07
226#define BTAUDIO2_MMI_MUTE_MIC 0x08
227#define BTAUDIO2_MMI_UNMUTE_MIC 0x09
228#define BTAUDIO2_MMI_VOICE_DIAL 0x0A
229#define BTAUDIO2_MMI_CANCEL_VOICE_DIAL 0x0B
230#define BTAUDIO2_MMI_LAST_NUMBER_REDIAL 0x0C
231#define BTAUDIO2_MMI_ACTIVE_CALL_HOLD_ACCEPT_HELD_CALL 0x0D
232#define BTAUDIO2_MMI_VOICE_TRANSFER 0x0E
233#define BTAUDIO2_MMI_QUERY_CALL_LIST 0x0F
234#define BTAUDIO2_MMI_THREE_WAY_CALL 0x10
235#define BTAUDIO2_MMI_RELEASE_CALL 0x11
236#define BTAUDIO2_MMI_ACCEPT_WAITING_HOLD_CALL_RLS_ACTIVE_CALL 0x12
237#define BTAUDIO2_MMI_DISCONNECT_HF_LINK 0x17
238#define BTAUDIO2_MMI_ENABLE_AEC 0x1E
239#define BTAUDIO2_MMI_DISABLE_AEC 0x1F
240#define BTAUDIO2_MMI_SWITCH_AEC 0x20
241#define BTAUDIO2_MMI_ENABLE_AEC_RX_NOISE_REDUCTION 0x21
242#define BTAUDIO2_MMI_DISABLE_AEC_RX_NOISE_REDUCTION 0x22
243#define BTAUDIO2_MMI_SWITCH_AEC_RX_NOISE_REDUCTION 0x23
244#define BTAUDIO2_MMI_INC_MIC_GAIN 0x24
245#define BTAUDIO2_MMI_DEC_MIC_GAIN 0x25
246#define BTAUDIO2_MMI_SWITCH_PRIMARY_SECONDARY_HF_DEVICE 0x26
247#define BTAUDIO2_MMI_INCREASE_SPEAKER_GAIN 0x30
248#define BTAUDIO2_MMI_DECREASE_SPEAKER_GAIN 0x31
249#define BTAUDIO2_MMI_PLAY_PAUSE_MUSIC 0x32
250#define BTAUDIO2_MMI_STOP_MUSIC 0x33
251#define BTAUDIO2_MMI_NEXT_SONG 0x34
252#define BTAUDIO2_MMI_PREVIOUS_SONG 0x35
253#define BTAUDIO2_MMI_FAST_FORWARD 0x36
254#define BTAUDIO2_MMI_REWIND 0x37
255#define BTAUDIO2_MMI_EQ_MODE_UP 0x38
256#define BTAUDIO2_MMI_EQ_MODE_DOWN 0x39
257#define BTAUDIO2_MMI_LOCK_BUTTON 0x3A
258#define BTAUDIO2_MMI_DISCONNECT_A2DP 0x3B
259#define BTAUDIO2_MMI_NEXT_AUDIO_EFFECT 0x3C
260#define BTAUDIO2_MMI_PREVIOUS_AUDIO_EFFECT 0x3D
261#define BTAUDIO2_MMI_REPORT_CURRENT_EQ_MODE 0x3F
262#define BTAUDIO2_MMI_REPORT_CURRENT_AUDIO_EFFECT_STATUS 0x40
263#define BTAUDIO2_MMI_TOGGLE_AUDIO_PLAYBACK 0x41
264#define BTAUDIO2_MMI_POWER_ON_BUTTON_PRESS 0x51
265#define BTAUDIO2_MMI_POWER_ON_BUTTON_RELEASE 0x52
266#define BTAUDIO2_MMI_POWER_OFF_BUTTON_PRESS 0x53
267#define BTAUDIO2_MMI_POWER_OFF_BUTTON_RELEASE 0x54
268#define BTAUDIO2_MMI_RESET_EEPROM_SETTING 0x56
269#define BTAUDIO2_MMI_FORCE_SPEAKER_GAIN_TOGGLE 0x57
270#define BTAUDIO2_MMI_TOGGLE_BUTTON_IND 0x58
271#define BTAUDIO2_MMI_COMBINE_FUNCTION_0 0x59
272#define BTAUDIO2_MMI_COMBINE_FUNCTION_1 0x5A
273#define BTAUDIO2_MMI_COMBINE_FUNCTION_2 0x5B
274#define BTAUDIO2_MMI_COMBINE_FUNCTION_3 0x5C
275#define BTAUDIO2_MMI_ENTER_PAIRING_MODE 0x5D
276#define BTAUDIO2_MMI_SWITCH_POWER_OFF 0x5E
277#define BTAUDIO2_MMI_DISABLE_LED 0x5F
278#define BTAUDIO2_MMI_BUZZER_TOGGLE 0x60
279#define BTAUDIO2_MMI_DISABLE_BUZZER 0x61
280#define BTAUDIO2_MMI_ENABLE_BUZZER 0x62
281#define BTAUDIO2_MMI_TONE_CHANGE 0x63
282#define BTAUDIO2_MMI_SHS_SEND_USER_DATA_1 0x72
283#define BTAUDIO2_MMI_SHS_SEND_USER_DATA_2 0x73
284#define BTAUDIO2_MMI_SHS_SEND_USER_DATA_3 0x74
285#define BTAUDIO2_MMI_SHS_SEND_USER_DATA_4 0x75
286#define BTAUDIO2_MMI_SHS_SEND_USER_DATA_5 0x76
287#define BTAUDIO2_MMI_REPORT_CURRENT_RX_NR_STATUS 0x77
288#define BTAUDIO2_MMI_REPORT_CURRENT_TX_NR_STATUS 0x78
289#define BTAUDIO2_MMI_CANCEL_ALL_BT_PAGING 0x7A
290#define BTAUDIO2_MMI_DISCONNECT_SPP_LINK 0x7D
291#define BTAUDIO2_MMI_ENABLE_A2DP_MIX_LINE_IN 0x80
292#define BTAUDIO2_MMI_DISABLE_A2DP_MIX_LINE_IN 0x81
293#define BTAUDIO2_MMI_INCREASE_LINE_IN_INPUT_GAIN 0x82
294#define BTAUDIO2_MMI_DECREASE_LINE_IN_INPUT_GAIN 0x83
295#define BTAUDIO2_MMI_TRIGGER_MSPK_CENTRAL 0xE0
296#define BTAUDIO2_MMI_TRIGGER_MSPK_PERIPHERAL 0xE1
297#define BTAUDIO2_MMI_MSPK_ONE_KEY_CONNECT 0xE2
298#define BTAUDIO2_MMI_CANCEL_MSPK_CREATION 0xE3
299#define BTAUDIO2_MMI_TERMINATE_MSPK_LINK 0xE4
300#define BTAUDIO2_MMI_TERMINATE_MSPK_CONNECTION 0xE5
301#define BTAUDIO2_MMI_MSPK_CENTRAL_ENTER_AUX_IN_44p1K_PCM_MODE 0xE6
302#define BTAUDIO2_MMI_MSPK_CENTRAL_ENTER_AUX_IN_48K_PCM_MODE 0xE7
303#define BTAUDIO2_MMI_MSPK_CENTRAL_EXIT_AUX_IN_PCM_MODE 0xE8
304#define BTAUDIO2_MMI_MSPK_SWITCH_CHANNEL 0xEC
305#define BTAUDIO2_MMI_MSPK_POWER_OFF_ALL_SPEAKERS 0xED
306#define BTAUDIO2_MMI_MSPK_ERASE_CONCERT_MODE_RECORD 0xEF
307#define BTAUDIO2_MMI_MSPK_ENTER_STEREO_MODE 0xF4
308#define BTAUDIO2_MMI_MSPK_ENTER_CONCERT_MODE 0xF5
309#define BTAUDIO2_MMI_MSPK_ADD_THIRD_SPK 0xF6
310#define BTAUDIO2_MMI_MSPK_SOUND_SYNC 0xF7
311#define BTAUDIO2_MMI_MSPK_CSB_CONNECTED_MODE_SWITCH 0xF8
312#define BTAUDIO2_MMI_MSPK_BACK_TO_LAST_MODE 0xF9
313#define BTAUDIO2_MMI_MSPK_ONE_KEY_CONNECT_WITH_LINK_BACK 0xFA
314#define BTAUDIO2_MMI_MSPK_ONE_KEY_OP_STEREO_MODE 0xFB
315#define BTAUDIO2_MMI_MSPK_ONE_KEY_OP_CONCERT_MODE 0xFC
321#define BTAUDIO2_ACK_STATUS_CMD_COMPLETE 0x00
322#define BTAUDIO2_ACK_STATUS_CMD_DISALLOW 0x01
323#define BTAUDIO2_ACK_STATUS_CMD_UNKNOWN 0x02
324#define BTAUDIO2_ACK_STATUS_CMD_PARAM_ERR 0x03
325#define BTAUDIO2_ACK_STATUS_CMD_BTM_BUSY 0x04
326#define BTAUDIO2_ACK_STATUS_CMD_BTM_FULL 0x05
332#define BTAUDIO2_BTM_STATE_POWER_OFF 0x00
333#define BTAUDIO2_BTM_STATE_PAIRING_STATE 0x01
334#define BTAUDIO2_BTM_STATE_POWER_ON 0x02
335#define BTAUDIO2_BTM_STATE_PAIRING_SUCCESSFULL 0x03
336#define BTAUDIO2_BTM_STATE_PAIRING_FAILED 0x04
337#define BTAUDIO2_BTM_STATE_HFHS_LINK_ESTABLISHED 0x05
338#define BTAUDIO2_BTM_STATE_A2DP_LINK_ESTABLISHED 0x06
339#define BTAUDIO2_BTM_STATE_HF_LINK_DISCONNECTED 0x07
340#define BTAUDIO2_BTM_STATE_A2DP_LINK_DISCONNECTED 0x08
341#define BTAUDIO2_BTM_STATE_SCO_LINK_CONNECTED 0x09
342#define BTAUDIO2_BTM_STATE_SCO_LINK_DISCONNECTED 0x0A
343#define BTAUDIO2_BTM_STATE_AVRCP_LINK_ESTABLISHED 0x0B
344#define BTAUDIO2_BTM_STATE_AVRCP_LINK_DISCONNECTED 0x0C
345#define BTAUDIO2_BTM_STATE_STANDARD_SPP_CONNECTED 0x0D
346#define BTAUDIO2_BTM_STATE_STANDARD_SPP_IAP_DISCONNECTED 0x0E
347#define BTAUDIO2_BTM_STATE_STANDBY_STATE 0x0F
348#define BTAUDIO2_BTM_STATE_IAP_CONNECTED 0x10
349#define BTAUDIO2_BTM_STATE_ACL_DISCONNECTED 0x11
350#define BTAUDIO2_BTM_STATE_MAP_CONNECTED 0x12
351#define BTAUDIO2_BTM_STATE_MAP_OPERATION_FORBIDDEN 0x13
352#define BTAUDIO2_BTM_STATE_MAP_DISCONNECTED 0x14
353#define BTAUDIO2_BTM_STATE_ACL_CONNECTED 0x15
354#define BTAUDIO2_BTM_STATE_SPP_IAP_DISCONNECTED_NO_PROFILE 0x16
355#define BTAUDIO2_BTM_STATE_LINK_BACK_ACL 0x17
356#define BTAUDIO2_BTM_STATE_INQUIRY_STATE 0x18
357#define BTAUDIO2_BTM_STATE_UNKNOWN_AUDIO_SOURCE 0x80
358#define BTAUDIO2_BTM_STATE_AUX_IN_AUDIO_SOURCE 0x81
359#define BTAUDIO2_BTM_STATE_A2DP_AUDIO_SOURCE 0x82
365#define BTAUDIO2_VOLUME_MASK_A2DP 0x01
366#define BTAUDIO2_VOLUME_MASK_HF 0x02
367#define BTAUDIO2_VOLUME_MASK_LINE_IN 0x04
368#define BTAUDIO2_VOLUME_MASK_PCM 0x08
369#define BTAUDIO2_VOLUME_MASK_LINE_IN_INPUT 0x10
375#define BTAUDIO2_START_HEADER 0xAA
381#define BTAUDIO2_MODE_FLASH_APPLICATION 0
382#define BTAUDIO2_MODE_ROM_APPLICATION 1
383#define BTAUDIO2_MODE_FLASH_IBDK 2
384#define BTAUDIO2_MODE_ROM_IBDK 3
385#define BTAUDIO2_MODE_BOOT 4
392#define BTAUDIO2_RX_DRV_BUFFER_SIZE 300
393#define BTAUDIO2_TX_DRV_BUFFER_SIZE 300
394#define BTAUDIO2_PARAM_BUFFER_SIZE 256
412#define BTAUDIO2_MAP_MIKROBUS( cfg, mikrobus ) \
413 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
414 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
415 cfg.ean = MIKROBUS( mikrobus, MIKROBUS_AN ); \
416 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
417 cfg.sc1 = MIKROBUS( mikrobus, MIKROBUS_CS ); \
418 cfg.mfb = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
419 cfg.sc2 = MIKROBUS( mikrobus, MIKROBUS_INT );
btaudio2_eq_mode_t
BT Audio 2 Click equalizer mode selection values.
Definition btaudio2.h:521
@ BTAUDIO2_EQ_MODE_SOFT
Definition btaudio2.h:523
@ BTAUDIO2_EQ_MODE_BASS
Definition btaudio2.h:524
@ BTAUDIO2_EQ_MODE_RNB
Definition btaudio2.h:531
@ BTAUDIO2_EQ_MODE_POP
Definition btaudio2.h:529
@ BTAUDIO2_EQ_MODE_ROCK
Definition btaudio2.h:527
@ BTAUDIO2_EQ_MODE_JAZZ
Definition btaudio2.h:528
@ BTAUDIO2_EQ_MODE_TREBLE
Definition btaudio2.h:525
@ BTAUDIO2_EQ_MODE_USER1
Definition btaudio2.h:532
@ BTAUDIO2_EQ_MODE_OFF
Definition btaudio2.h:522
@ BTAUDIO2_EQ_MODE_CLASSIC
Definition btaudio2.h:526
@ BTAUDIO2_EQ_MODE_DANCE
Definition btaudio2.h:530
btaudio2_music_control_t
BT Audio 2 Click music control values.
Definition btaudio2.h:503
@ BTAUDIO2_STOP_FAST_FORWARD_OR_REWIND
Definition btaudio2.h:504
@ BTAUDIO2_REWIND
Definition btaudio2.h:507
@ BTAUDIO2_PLAY
Definition btaudio2.h:509
@ BTAUDIO2_PLAY_PAUSE_TOGGLE
Definition btaudio2.h:511
@ BTAUDIO2_FAST_FORWARD_WITH_REPEAT
Definition btaudio2.h:506
@ BTAUDIO2_STOP
Definition btaudio2.h:512
@ BTAUDIO2_FAST_FORWARD
Definition btaudio2.h:505
@ BTAUDIO2_REWIND_WITH_REPEAT
Definition btaudio2.h:508
@ BTAUDIO2_PAUSE
Definition btaudio2.h:510
btaudio2_return_value_t
BT Audio 2 Click return value data.
Definition btaudio2.h:492
@ BTAUDIO2_OK
Definition btaudio2.h:493
@ BTAUDIO2_ERROR
Definition btaudio2.h:494
#define BTAUDIO2_PARAM_BUFFER_SIZE
Definition btaudio2.h:394
#define BTAUDIO2_TX_DRV_BUFFER_SIZE
Definition btaudio2.h:393
#define BTAUDIO2_RX_DRV_BUFFER_SIZE
BT Audio 2 driver buffer size.
Definition btaudio2.h:392
err_t btaudio2_default_cfg(btaudio2_t *ctx)
BT Audio 2 default configuration function.
err_t btaudio2_send_cmd_with_ack(btaudio2_t *ctx)
BT Audio 2 send command with ack check function.
err_t btaudio2_music_control(btaudio2_t *ctx, btaudio2_music_control_t action)
BT Audio 2 music control function.
err_t btaudio2_power_off_device(btaudio2_t *ctx)
BT Audio 2 power OFF device function.
err_t btaudio2_enable_advertising(btaudio2_t *ctx)
BT Audio 2 enable advertising function.
void btaudio2_clear_events(btaudio2_t *ctx)
BT Audio 2 clear events function.
void btaudio2_cfg_setup(btaudio2_cfg_t *cfg)
BT Audio 2 configuration object setup function.
void btaudio2_send_cmd(btaudio2_t *ctx)
BT Audio 2 send command 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_wait_for_event(btaudio2_t *ctx, uint8_t opcode)
BT Audio 2 wait for event function.
err_t btaudio2_set_eq_mode(btaudio2_t *ctx, btaudio2_eq_mode_t eq_mode)
BT Audio 2 set equalizer mode 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_volume_up(btaudio2_t *ctx, uint8_t database_index, uint8_t mask)
BT Audio 2 volume up function.
err_t btaudio2_reset_to_default(btaudio2_t *ctx)
BT Audio 2 reset to default function.
err_t btaudio2_power_on_device(btaudio2_t *ctx)
BT Audio 2 power ON device function.
err_t btaudio2_read_event(btaudio2_t *ctx)
BT Audio 2 read event function.
err_t btaudio2_disable_advertising(btaudio2_t *ctx)
BT Audio 2 disable advertising 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_generic_read(btaudio2_t *ctx, uint8_t *data_out, uint16_t len)
BT Audio 2 data reading function.
void btaudio2_set_rst_pin(btaudio2_t *ctx, uint8_t state)
BT Audio 2 set RST pin function.
err_t btaudio2_enter_pairing_mode(btaudio2_t *ctx)
BT Audio 2 enter pairing mode function.
void btaudio2_reset_device(btaudio2_t *ctx)
BT Audio 2 reset device function.
void btaudio2_set_mode(btaudio2_t *ctx, uint8_t mode)
BT Audio 2 set mode function.
err_t btaudio2_init(btaudio2_t *ctx, btaudio2_cfg_t *cfg)
BT Audio 2 initialization function.
err_t btaudio2_set_device_name(btaudio2_t *ctx, uint8_t *device_name)
BT Audio 2 set device name function.
err_t btaudio2_volume_down(btaudio2_t *ctx, uint8_t database_index, uint8_t mask)
BT Audio 2 volume down function.
void btaudio2_set_mfb_pin(btaudio2_t *ctx, uint8_t state)
BT Audio 2 set MFB pin function.
BT Audio 2 Click configuration object.
Definition btaudio2.h:466
uint32_t baud_rate
Definition btaudio2.h:479
pin_name_t sc2
Definition btaudio2.h:476
pin_name_t ean
Definition btaudio2.h:472
bool uart_blocking
Definition btaudio2.h:480
pin_name_t sc1
Definition btaudio2.h:474
uart_data_bits_t data_bit
Definition btaudio2.h:481
pin_name_t tx_pin
Definition btaudio2.h:469
pin_name_t rx_pin
Definition btaudio2.h:468
uart_stop_bits_t stop_bit
Definition btaudio2.h:483
pin_name_t mfb
Definition btaudio2.h:475
uart_parity_t parity_bit
Definition btaudio2.h:482
pin_name_t rst
Definition btaudio2.h:473
BT Audio 2 Click command/event packet structure object.
Definition btaudio2.h:429
uint8_t opcode
Definition btaudio2.h:430
uint8_t param_len
Definition btaudio2.h:432
BT Audio 2 Click context object.
Definition btaudio2.h:441
digital_out_t mfb
Definition btaudio2.h:446
digital_out_t sc1
Definition btaudio2.h:445
uart_t uart
Definition btaudio2.h:450
btaudio2_packet_t event_packet
Definition btaudio2.h:457
digital_out_t sc2
Definition btaudio2.h:447
digital_out_t rst
Definition btaudio2.h:444
btaudio2_packet_t cmd_packet
Definition btaudio2.h:456
digital_out_t ean
Definition btaudio2.h:443