btaudio3 2.0.0.0
|
API for configuring and manipulating BT Audio 3 Click driver. More...
Topics | |
BT Audio 3 Device Settings | |
Settings for registers of BT Audio 3 Click driver. | |
BT Audio 3 MikroBUS Map | |
MikroBUS pin mapping of BT Audio 3 Click driver. | |
Functions | |
void | btaudio3_cfg_setup (btaudio3_cfg_t *cfg) |
BT Audio 3 configuration object setup function. | |
err_t | btaudio3_init (btaudio3_t *ctx, btaudio3_cfg_t *cfg) |
BT Audio 3 initialization function. | |
err_t | btaudio3_default_cfg (btaudio3_t *ctx) |
BT Audio 3 default configuration function. | |
err_t | btaudio3_generic_write (btaudio3_t *ctx, uint8_t *data_buf, uint16_t len) |
BT Audio 3 data writing function. | |
err_t | btaudio3_generic_read (btaudio3_t *ctx, uint8_t *data_buf, uint16_t max_len) |
BT Audio 3 data reading function. | |
void | btaudio3_set_mfb_pin (btaudio3_t *ctx, uint8_t state) |
BT Audio 3 set MFB pin function. | |
void | btaudio3_set_rst_pin (btaudio3_t *ctx, uint8_t state) |
BT Audio 3 set RST pin function. | |
void | btaudio3_set_application_mode (btaudio3_t *ctx) |
BT Audio 3 set application mode function. | |
void | btaudio3_set_test_mode (btaudio3_t *ctx) |
BT Audio 3 set test mode function. | |
void | btaudio3_reset_device (btaudio3_t *ctx) |
BT Audio 3 reset device function. | |
void | btaudio3_soft_mute_output (btaudio3_t *ctx) |
BT Audio 3 soft mute output function. | |
void | btaudio3_soft_unmute_output (btaudio3_t *ctx) |
BT Audio 3 soft unmute output function. | |
void | btaudio3_send_command (btaudio3_t *ctx) |
BT Audio 3 send command function. | |
err_t | btaudio3_send_command_with_ack_check (btaudio3_t *ctx) |
BT Audio 3 send command with ack check function. | |
err_t | btaudio3_read_event (btaudio3_t *ctx) |
BT Audio 3 read event function. | |
void | btaudio3_wait_for_event (btaudio3_t *ctx, uint8_t opcode) |
BT Audio 3 wait for event function. | |
void | btaudio3_clear_events (btaudio3_t *ctx) |
BT Audio 3 clear events function. | |
err_t | btaudio3_send_mmi_action (btaudio3_t *ctx, uint8_t database_index, uint8_t action) |
BT Audio 3 send MMI action function. | |
err_t | btaudio3_power_on_device (btaudio3_t *ctx) |
BT Audio 3 power ON device function. | |
err_t | btaudio3_power_off_device (btaudio3_t *ctx) |
BT Audio 3 power OFF device function. | |
err_t | btaudio3_enter_pairing_mode (btaudio3_t *ctx) |
BT Audio 3 enter pairing mode function. | |
err_t | btaudio3_reset_to_default (btaudio3_t *ctx) |
BT Audio 3 reset to default function. | |
err_t | btaudio3_set_device_name (btaudio3_t *ctx, uint8_t *device_name) |
BT Audio 3 set device name function. | |
err_t | btaudio3_music_control (btaudio3_t *ctx, btaudio3_music_control_t action) |
BT Audio 3 music control function. | |
err_t | btaudio3_make_call (btaudio3_t *ctx, uint8_t database_index, uint8_t *phone_number) |
BT Audio 3 make call function. | |
err_t | btaudio3_volume_up (btaudio3_t *ctx, uint8_t database_index, uint8_t mask) |
BT Audio 3 volume up function. | |
err_t | btaudio3_volume_down (btaudio3_t *ctx, uint8_t database_index, uint8_t mask) |
BT Audio 3 volume down function. | |
err_t | btaudio3_enable_advertising (btaudio3_t *ctx) |
BT Audio 3 enable advertising function. | |
err_t | btaudio3_disable_advertising (btaudio3_t *ctx) |
BT Audio 3 disable advertising function. | |
err_t | btaudio3_set_eq_mode (btaudio3_t *ctx, btaudio3_eq_mode_t eq_mode) |
BT Audio 3 set equalizer mode function. | |
API for configuring and manipulating BT Audio 3 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void btaudio3_cfg_setup | ( | btaudio3_cfg_t * | cfg | ) |
BT Audio 3 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See btaudio3_cfg_t object definition for detailed explanation. |
void btaudio3_clear_events | ( | btaudio3_t * | ctx | ) |
BT Audio 3 clear events function.
This function clears all events from the ring buffer. The last cleared event will be stored in the click context object.
[in] | ctx | : Click context object. See btaudio3_t object definition for detailed explanation. |
err_t btaudio3_default_cfg | ( | btaudio3_t * | ctx | ) |
BT Audio 3 default configuration function.
This function executes a default configuration of BT Audio 3 click board.
[in] | ctx | : Click context object. See btaudio3_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t btaudio3_disable_advertising | ( | btaudio3_t * | ctx | ) |
BT Audio 3 disable advertising function.
This function disables advertising of LE signaling.
[in] | ctx | : Click context object. See btaudio3_t object definition for detailed explanation. |
>=0
- Command ACK event response, -1
- Error.err_t btaudio3_enable_advertising | ( | btaudio3_t * | ctx | ) |
BT Audio 3 enable advertising function.
This function enables advertising of LE signaling.
[in] | ctx | : Click context object. See btaudio3_t object definition for detailed explanation. |
>=0
- Command ACK event response, -1
- Error.err_t btaudio3_enter_pairing_mode | ( | btaudio3_t * | ctx | ) |
BT Audio 3 enter pairing mode function.
This function enters pairing mode and waits for the pairing state BTM event to occur.
[in] | ctx | : Click context object. See btaudio3_t object definition for detailed explanation. |
>=0
- Command ACK event response, -1
- Error.err_t btaudio3_generic_read | ( | btaudio3_t * | ctx, |
uint8_t * | data_buf, | ||
uint16_t | max_len ) |
BT Audio 3 data reading function.
This function reads a desired number of data bytes by using UART serial interface.
[in] | ctx | : Click context object. See btaudio3_t object definition for detailed explanation. |
[out] | data_buf | : Output read data. |
[in] | max_len | : Number of bytes to be read. |
>0
- Number of data bytes read, <=0
- Error/Empty Ring buffer.err_t btaudio3_generic_write | ( | btaudio3_t * | ctx, |
uint8_t * | data_buf, | ||
uint16_t | len ) |
BT Audio 3 data writing function.
This function writes a desired number of data bytes by using UART serial interface.
[in] | ctx | : Click context object. See btaudio3_t object definition for detailed explanation. |
[in] | data_buf | : Data buffer for sending. |
[in] | len | : Number of bytes for sending. |
>=0
- Success, <0
- Error.err_t btaudio3_init | ( | btaudio3_t * | ctx, |
btaudio3_cfg_t * | cfg ) |
BT Audio 3 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See btaudio3_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See btaudio3_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t btaudio3_make_call | ( | btaudio3_t * | ctx, |
uint8_t | database_index, | ||
uint8_t * | phone_number ) |
BT Audio 3 make call function.
This function makes a call to the specified phone number.
[in] | ctx | : Click context object. See btaudio3_t object definition for detailed explanation. |
[in] | database_index | : Database index. |
[in] | phone_number | : Phone number (up to 19 characters). |
>=0
- Command ACK event response, -1
- Error.err_t btaudio3_music_control | ( | btaudio3_t * | ctx, |
btaudio3_music_control_t | action ) |
BT Audio 3 music control function.
This function sends a music control command with a desired action.
[in] | ctx | : Click context object. See btaudio3_t object definition for detailed explanation. |
[in] | action | : Action for music control command. See btaudio3_music_control_t enum definition for detailed explanation. |
>=0
- Command ACK event response, -1
- Error.err_t btaudio3_power_off_device | ( | btaudio3_t * | ctx | ) |
BT Audio 3 power OFF device function.
This function powers OFF the device and waits for the power OFF BTM event to occur.
[in] | ctx | : Click context object. See btaudio3_t object definition for detailed explanation. |
>=0
- Command ACK event response, -1
- Error.err_t btaudio3_power_on_device | ( | btaudio3_t * | ctx | ) |
BT Audio 3 power ON device function.
This function powers ON the device and waits for the power ON BTM event to occur.
[in] | ctx | : Click context object. See btaudio3_t object definition for detailed explanation. |
>=0
- Command ACK event response, -1
- Error.err_t btaudio3_read_event | ( | btaudio3_t * | ctx | ) |
BT Audio 3 read event function.
This function reads an event from the ring buffer and stores it in the click context object. It waits 200ms for an event, and if there's no event received it returns an error.
[in] | ctx | : Click context object. See btaudio3_t object definition for detailed explanation. |
0
- Correct event received, -1
- Error.void btaudio3_reset_device | ( | btaudio3_t * | ctx | ) |
BT Audio 3 reset device function.
This function resets the device via the RST pin.
[in] | ctx | : Click context object. See btaudio3_t object definition for detailed explanation. |
err_t btaudio3_reset_to_default | ( | btaudio3_t * | ctx | ) |
BT Audio 3 reset to default function.
This function resets the device to default state and waits for an appropriate event to occur.
[in] | ctx | : Click context object. See btaudio3_t object definition for detailed explanation. |
>=0
- Command ACK event response, -1
- Error.void btaudio3_send_command | ( | btaudio3_t * | ctx | ) |
BT Audio 3 send command function.
This function sends a desired command from the click context object.
[in] | ctx | : Click context object. See btaudio3_t object definition for detailed explanation. |
err_t btaudio3_send_command_with_ack_check | ( | btaudio3_t * | ctx | ) |
BT Audio 3 send command with ack check function.
This function sends a desired command from the click context object, and waits for the command acknowledge event, if there's no ACK event received it resends the command once again.
[in] | ctx | : Click context object. See btaudio3_t object definition for detailed explanation. |
>=0
- Command ACK event response, -1
- Error.err_t btaudio3_send_mmi_action | ( | btaudio3_t * | ctx, |
uint8_t | database_index, | ||
uint8_t | action ) |
BT Audio 3 send MMI action function.
This function sends a desired MMI action to specific index database.
[in] | ctx | : Click context object. See btaudio3_t object definition for detailed explanation. |
[in] | database_index | : Database index. |
[in] | action | : MMI action byte. |
>=0
- Command ACK event response, -1
- Error.void btaudio3_set_application_mode | ( | btaudio3_t * | ctx | ) |
BT Audio 3 set application mode function.
This function enters the application mode by setting the MOD pin to high logic state.
[in] | ctx | : Click context object. See btaudio3_t object definition for detailed explanation. |
err_t btaudio3_set_device_name | ( | btaudio3_t * | ctx, |
uint8_t * | device_name ) |
BT Audio 3 set device name function.
This function sets the local device name.
[in] | ctx | : Click context object. See btaudio3_t object definition for detailed explanation. |
[in] | device_name | : Device name (up to 32 characters). |
>=0
- Command ACK event response, -1
- Error.err_t btaudio3_set_eq_mode | ( | btaudio3_t * | ctx, |
btaudio3_eq_mode_t | eq_mode ) |
BT Audio 3 set equalizer mode function.
This function sets the equalizer mode.
[in] | ctx | : Click context object. See btaudio3_t object definition for detailed explanation. |
[in] | eq_mode | : Equalizer mode byte. See btaudio3_eq_mode_t enum definition for detailed explanation. |
>=0
- Command ACK event response, -1
- Error.void btaudio3_set_mfb_pin | ( | btaudio3_t * | ctx, |
uint8_t | state ) |
BT Audio 3 set MFB pin function.
This function sets the MFB pin to a desired logic state.
[in] | ctx | : Click context object. See btaudio3_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
void btaudio3_set_rst_pin | ( | btaudio3_t * | ctx, |
uint8_t | state ) |
BT Audio 3 set RST pin function.
This function sets the RST pin to a desired logic state.
[in] | ctx | : Click context object. See btaudio3_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
void btaudio3_set_test_mode | ( | btaudio3_t * | ctx | ) |
BT Audio 3 set test mode function.
This function enters the test mode by setting the MOD pin to low logic state.
[in] | ctx | : Click context object. See btaudio3_t object definition for detailed explanation. |
void btaudio3_soft_mute_output | ( | btaudio3_t * | ctx | ) |
BT Audio 3 soft mute output function.
This function soft mutes output by setting the SM pin to high logic state.
[in] | ctx | : Click context object. See btaudio3_t object definition for detailed explanation. |
void btaudio3_soft_unmute_output | ( | btaudio3_t * | ctx | ) |
BT Audio 3 soft unmute output function.
This function soft unmutes output by setting the SM pin to low logic state.
[in] | ctx | : Click context object. See btaudio3_t object definition for detailed explanation. |
err_t btaudio3_volume_down | ( | btaudio3_t * | ctx, |
uint8_t | database_index, | ||
uint8_t | mask ) |
BT Audio 3 volume down function.
This function decreases the volume of a specified gain mask.
[in] | ctx | : Click context object. See btaudio3_t object definition for detailed explanation. |
[in] | database_index | : Database index. |
[in] | mask | : Gain mask. |
>=0
- Command ACK event response, -1
- Error.err_t btaudio3_volume_up | ( | btaudio3_t * | ctx, |
uint8_t | database_index, | ||
uint8_t | mask ) |
BT Audio 3 volume up function.
This function increases the volume of a specified gain mask.
[in] | ctx | : Click context object. See btaudio3_t object definition for detailed explanation. |
[in] | database_index | : Database index. |
[in] | mask | : Gain mask. |
>=0
- Command ACK event response, -1
- Error.void btaudio3_wait_for_event | ( | btaudio3_t * | ctx, |
uint8_t | opcode ) |
BT Audio 3 wait for event function.
This function waits for the desired event to occur and stores it in the click context object.
[in] | ctx | : Click context object. See btaudio3_t object definition for detailed explanation. |
[in] | opcode | : Expected event opcode. |