Macros | Functions | Variables
acc_exploration_server_stm32.c File Reference
`#include <stdarg.h>`
`#include <stdbool.h>`
`#include <stdint.h>`
`#include <stdio.h>`
`#include <string.h>`
`#include "main.h"`
`#include "acc_exploration_server_base.h"`
`#include "acc_exploration_server_stm32.h"`
`#include "acc_integration.h"`
`#include "acc_integration_log.h"`

Go to the source code of this file.

## Macros
#define | MODULE "exploration_server_stm32"
#define | LOG_BUFFER_MAX_SIZE 150
#define | STM32_EXPLORATION_SERVER_MAX_BAUDRATE 2000000
#define | UART_DMA_BUFFER_SIZE (8192)

## Functions
static void | uart_wait_for_tx_done (void)
static void | write_to_client_uart (const void *data, uint32_t size)
| Write data to client (UART) More...
static void | restart_input (void)
| Restart input of new command. More...
static void | set_baudrate (uint32_t baudrate)
static uint32_t | get_tick (void)
void | acc_exploration_server_stm32_init (const char *hw, char *buffer, size_t buffer_size)
| Init the stm32 exploration server. More...
void | acc_exploration_server_stm32_main (void)
| Start the stm32 exploration server. More...
void | HAL_UART_ErrorCallback (UART_HandleTypeDef *huart)
void | HAL_UART_TxCpltCallback (UART_HandleTypeDef *h_uart)
void | acc_integration_log (acc_log_level_t level, const char *module, const char *format,...)
| Log function. More...
int | acconeer_main (int argc, char *argv[])
| Assembly test example. More...

## Variables
UART_HandleTypeDef | EXPLORATION_SERVER_UART_HANDLE
static char * | command_buffer = NULL
static size_t | command_buffer_size = 0
static volatile bool | uart_tx_active = false
static uint8_t | uart_dma_buffer [(8192)]
static char | exploration_server_command_buffer [4096]
static const exploration_server_interface_t | server_if
| Server interface functions. More...

## Macro Definition Documentation

## ◆ LOG_BUFFER_MAX_SIZE

#define LOG_BUFFER_MAX_SIZE 150

Definition at line 22 of file acc_exploration_server_stm32.c.

## ◆ MODULE

#define MODULE "exploration_server_stm32"

Definition at line 20 of file acc_exploration_server_stm32.c.

## ◆ STM32_EXPLORATION_SERVER_MAX_BAUDRATE

#define STM32_EXPLORATION_SERVER_MAX_BAUDRATE 2000000

Definition at line 24 of file acc_exploration_server_stm32.c.

## ◆ UART_DMA_BUFFER_SIZE

#define UART_DMA_BUFFER_SIZE (8192)

Definition at line 31 of file acc_exploration_server_stm32.c.

## Function Documentation

## ◆ acc_exploration_server_stm32_init()

void acc_exploration_server_stm32_init | ( | const char * | hw,
|  | char * | buffer,
|  | size_t | buffer_size
| ) |  |

Init the stm32 exploration server.

Parameters

  [in] | hw | The name of the hardware platform
  [in] | buffer | The buffer used for receiving commands from the client
  [in] | buffer_size | The size of the command buffer

Definition at line 132 of file acc_exploration_server_stm32.c.

## ◆ acc_exploration_server_stm32_main()

void acc_exploration_server_stm32_main | ( | void |  | ) |

Start the stm32 exploration server.

The embedded exploration server for STM32 can stream UART input data directly into the input buffer.

Setup DMA into buffer with buffer_size.

Definition at line 140 of file acc_exploration_server_stm32.c.

## ◆ acc_integration_log()

void acc_integration_log | ( | acc_log_level_t | level,
|  | const char * | module,
|  | const char * | format,
|  |  | ...
| ) |  |

Log function.

This log function can be used as a complement to for example printf. It adds useful information to the log such as time and log level

Parameters

  [in] | level | The severity level for the log
  [in] | module | The name of the SW module from where the log is called
  [in] | format | The information to be logged, same format as for printf

Definition at line 207 of file acc_exploration_server_stm32.c.

## ◆ acconeer_main()

int acconeer_main | ( | int | argc,
|  | char * | argv[]
| ) |  |

Assembly test example.

Touchless button application.

Tank level reference application.

Smart presence reference application.

Parking application.

Breathing example application.

Waste level application.

Vibration example.

Surface velocity example application.

Service subsweeps example.

Service multple configurations example.

Low power service example.

Service sensor calibration caching example.

Service example.

Processing subtract adaptive background example.

Processing static presence example.

Processing peak interpolation example.

Processing noncoherent mean example.

Processing coherent mean example.

Processing amplitude example.

hand motion application

Detector presence example with multiple configurations.

Low power detector presence example.

Detector presence example.

Detector distance example with iq data print.

Distance detector low power example.

Detector distance with calibration caching example.

Detector distance example.

Control helper example.

Cargo application.

Returns
  Returns EXIT_SUCCESS if successful, otherwise EXIT_FAILURE

Test if measure on wake up is enable Do a measurement if the the detector is ready (configured and calibrated)

Definition at line 230 of file acc_exploration_server_stm32.c.

## ◆ get_tick()

static uint32_t get_tick | ( | void |  | ) |
| static

Definition at line 115 of file acc_exploration_server_stm32.c.

## ◆ HAL_UART_ErrorCallback()

void HAL_UART_ErrorCallback | ( | UART_HandleTypeDef * | huart | ) |

Definition at line 187 of file acc_exploration_server_stm32.c.

## ◆ HAL_UART_TxCpltCallback()

void HAL_UART_TxCpltCallback | ( | UART_HandleTypeDef * | h_uart | ) |

Definition at line 199 of file acc_exploration_server_stm32.c.

## ◆ restart_input()

static void restart_input | ( | void |  | ) |
| static

Restart input of new command.

Stop previous reception Clear buffer Re-start receive after a line has been received.

Definition at line 85 of file acc_exploration_server_stm32.c.

## ◆ set_baudrate()

static void set_baudrate | ( | uint32_t | baudrate | ) |
| static

Definition at line 98 of file acc_exploration_server_stm32.c.

## ◆ uart_wait_for_tx_done()

static void uart_wait_for_tx_done | ( | void |  | ) |
| static

Definition at line 38 of file acc_exploration_server_stm32.c.

## ◆ write_to_client_uart()

static void write_to_client_uart | ( | const void * | data,
|  | uint32_t | size
| ) |  |
| static

Write data to client (UART)

Parameters

  [in] | data | pointer to data
  [in] | size | data size in bytes

Definition at line 62 of file acc_exploration_server_stm32.c.

## Variable Documentation

## ◆ command_buffer

char* command_buffer = NULL
| static

Definition at line 28 of file acc_exploration_server_stm32.c.

## ◆ command_buffer_size

size_t command_buffer_size = 0
| static

Definition at line 29 of file acc_exploration_server_stm32.c.

## ◆ exploration_server_command_buffer

char exploration_server_command_buffer[4096]
| static

Definition at line 36 of file acc_exploration_server_stm32.c.

## ◆ EXPLORATION_SERVER_UART_HANDLE

UART_HandleTypeDef EXPLORATION_SERVER_UART_HANDLE

## ◆ server_if

const exploration_server_interface_t server_if
| static

Initial value:
= {
.write = write_to_client_uart,
.restart_input = restart_input,
.set_baudrate = set_baudrate,
.max_baudrate = 2000000 ,
.get_tick = get_tick,
.ticks_per_second = 1000,
}

Server interface functions.

Definition at line 123 of file acc_exploration_server_stm32.c.

## ◆ uart_dma_buffer

uint8_t uart_dma_buffer[(8192)]
| static

Definition at line 34 of file acc_exploration_server_stm32.c.

## ◆ uart_tx_active

volatile bool uart_tx_active = false
| static

Definition at line 33 of file acc_exploration_server_stm32.c.

set_baudrate
static void set_baudrate(uint32_t baudrate)
Definition: acc_exploration_server_stm32.c:98
write_to_client_uart
static void write_to_client_uart(const void *data, uint32_t size)
Write data to client (UART)
Definition: acc_exploration_server_stm32.c:62
get_tick
static uint32_t get_tick(void)
Definition: acc_exploration_server_stm32.c:115
restart_input
static void restart_input(void)
Restart input of new command.
Definition: acc_exploration_server_stm32.c:85