btaudio4 2.2.0
Loading...
Searching...
No Matches
main.c File Reference

BT Audio 4 Click Example. More...

#include "board.h"
#include "log.h"
#include "btaudio4.h"

Macros

#define APP_BUFFER_SIZE   200
#define PROCESS_BUFFER_SIZE   100
#define READ_RESPONSE_TIMEOUT_MS   120000

Functions

void application_init (void)
void application_task (void)
int main (void)

Detailed Description

BT Audio 4 Click Example.

Description

This example demonstrates how to communicate with the BT Audio 4 Click board over UART. It initializes the device, resets it, retrieves the device name, and then continuously processes and logs any incoming UART messages from the device.

The demo application is composed of two sections :

Application Init

Initializes the logger and the BT Audio 4 Click driver, performs a device reset, and reads the device name.

Application Task

Continuously processes UART data received from the Click board and logs it to the terminal. Acts as a passive receiver of incoming messages, useful for monitoring notifications.

Additional Function

  • static void btaudio4_clear_app_buf ( void )
  • static void btaudio4_log_app_buf ( void )
  • static err_t btaudio4_process ( btaudio4_t *ctx )
  • static err_t btaudio4_read_response ( btaudio4_t *ctx, uint8_t *rsp )
Author
Stefan Filipovic

Macro Definition Documentation

◆ APP_BUFFER_SIZE

#define APP_BUFFER_SIZE   200

◆ PROCESS_BUFFER_SIZE

#define PROCESS_BUFFER_SIZE   100

◆ READ_RESPONSE_TIMEOUT_MS

#define READ_RESPONSE_TIMEOUT_MS   120000

Function Documentation

◆ application_init()

void application_init ( void )

< Logger config object.

< Click config object.

Logger initialization. Default baud rate: 115200 Default log level: LOG_LEVEL_DEBUG

Note
If USB_UART_RX and USB_UART_TX are defined as HAL_PIN_NC, you will need to define them manually for log to work. See LOG_MAP_USB_UART macro definition for detailed explanation.

◆ application_task()

void application_task ( void )

◆ main()

int main ( void )