Typedefs | Functions
acc_integration.h File Reference
`#include <stdbool.h>`
`#include <stdint.h>`
`#include <stdlib.h>`

Go to the source code of this file.

## Typedefs
typedef void(* | acc_integration_uart_read_func_t) (uint8_t data, uint32_t status)

## Functions
void | acc_integration_sleep_us (uint32_t time_usec)
| Sleep for a specified number of microseconds. More...
void | acc_integration_sleep_ms (uint32_t time_msec)
| Sleep for a specified number of milliseconds. More...
void | acc_integration_set_periodic_wakeup (uint32_t time_msec)
| Set up a periodic timer used to wake up the system from sleep. More...
void | acc_integration_sleep_until_periodic_wakeup (void)
| Put the system in sleep until the periodic timer triggers. More...
void * | acc_integration_mem_alloc (size_t size)
| Allocate dynamic memory. More...
void * | acc_integration_mem_calloc (size_t nmemb, size_t size)
| Allocate dynamic memory. More...
void | acc_integration_mem_free (void *ptr)
| Free dynamic memory. More...
void | acc_integration_critical_section_enter (void)
void | acc_integration_critical_section_exit (void)
uint32_t | acc_integration_get_time (void)
| Get current time. More...

## Typedef Documentation

## ◆ acc_integration_uart_read_func_t

typedef void(* acc_integration_uart_read_func_t) (uint8_t data, uint32_t status)

Definition at line 12 of file acc_integration.h.

## Function Documentation

## ◆ acc_integration_critical_section_enter()

void acc_integration_critical_section_enter | ( | void |  | ) |

Enter a critical section

Definition at line 10 of file acc_integration_cortex.c.

## ◆ acc_integration_critical_section_exit()

void acc_integration_critical_section_exit | ( | void |  | ) |

Exit a critical section

Definition at line 18 of file acc_integration_cortex.c.

## ◆ acc_integration_get_time()

uint32_t acc_integration_get_time | ( | void |  | ) |

Get current time.

It is important that this value wraps correctly and uses all bits. I.e. it should count upwards to 2^32 - 1 and then 0 again.

Returns
  Current time as milliseconds

Definition at line 626 of file acc_integration_stm32.c.

## ◆ acc_integration_mem_alloc()

void* acc_integration_mem_alloc | ( | size_t | size | ) |

Allocate dynamic memory.

Parameters

  [in] | size | The bytesize of the reuested memory block

Returns
  Returns either NULL or a unique pointer to a memory block

Examples
  acc_control_helper.c, example_bring_up.c, example_detector_distance.c, example_detector_distance_low_power_hibernate.c, example_detector_distance_low_power_off.c, example_detector_distance_with_iq_data_print.c, example_detector_presence.c, example_detector_presence_low_power_hibernate.c, example_detector_presence_low_power_off.c, example_detector_presence_multiple_configurations.c, example_diagnostic_test.c, example_service.c, example_service_low_power_sensor_disable.c, example_service_low_power_sensor_hibernate.c, example_service_multiple_configurations.c, example_service_sensor_disable.c, example_service_sensor_hibernate.c, example_service_sensor_off.c, example_service_subsweeps.c, and ref_app_tank_level.c.

Definition at line 632 of file acc_integration_stm32.c.

## ◆ acc_integration_mem_calloc()

void* acc_integration_mem_calloc | ( | size_t | nmemb,
|  | size_t | size
| ) |  |

Allocate dynamic memory.

Allocate an array of nmemb elements of size bytes each.

Parameters

  [in] | nmemb | The number of elements in the array
  [in] | size | The bytesize of the element

Returns
  Returns either NULL or a unique pointer to a memory block

Definition at line 638 of file acc_integration_stm32.c.

## ◆ acc_integration_mem_free()

void acc_integration_mem_free | ( | void * | ptr | ) |

Free dynamic memory.

Parameters

  [in] | ptr | A pointer to the memory space to be freed

Examples
  acc_control_helper.c, example_bring_up.c, example_detector_distance.c, example_detector_distance_low_power_hibernate.c, example_detector_distance_low_power_off.c, example_detector_distance_with_iq_data_print.c, example_detector_presence.c, example_detector_presence_low_power_hibernate.c, example_detector_presence_low_power_off.c, example_detector_presence_multiple_configurations.c, example_diagnostic_test.c, example_service.c, example_service_low_power_sensor_disable.c, example_service_low_power_sensor_hibernate.c, example_service_multiple_configurations.c, example_service_sensor_disable.c, example_service_sensor_hibernate.c, example_service_sensor_off.c, example_service_subsweeps.c, and ref_app_tank_level.c.

Definition at line 644 of file acc_integration_stm32.c.

## ◆ acc_integration_set_periodic_wakeup()

void acc_integration_set_periodic_wakeup | ( | uint32_t | time_msec | ) |

Set up a periodic timer used to wake up the system from sleep.

This function will start a periodic timer with the specified time. This is useful when the drift of the wakeup interval should be kept at a minimum.

If the time_msec is set to zero the periodic wakeup will be disabled.

Parameters

  time_msec | Time in milliseconds

Examples
  example_detector_distance_low_power_hibernate.c, example_detector_distance_low_power_off.c, example_detector_presence_low_power_hibernate.c, example_detector_presence_low_power_off.c, example_service_low_power_sensor_disable.c, example_service_low_power_sensor_hibernate.c, and ref_app_tank_level.c.

Definition at line 531 of file acc_integration_stm32.c.

## ◆ acc_integration_sleep_ms()

void acc_integration_sleep_ms | ( | uint32_t | time_msec | ) |

Sleep for a specified number of milliseconds.

Parameters

  time_msec | Time in milliseconds to sleep

Definition at line 501 of file acc_integration_stm32.c.

## ◆ acc_integration_sleep_until_periodic_wakeup()

void acc_integration_sleep_until_periodic_wakeup | ( | void |  | ) |

Put the system in sleep until the periodic timer triggers.

The periodic timer must be started using acc_integration_set_periodic_wakeup prior to invoking this function. The target specific implementation of this function will determine the sleep depth based on the set sleep interval and it will be a trade-off between wake-up latency and power consumption.

Examples
  example_detector_distance_low_power_hibernate.c, example_detector_distance_low_power_off.c, example_detector_presence_low_power_hibernate.c, example_detector_presence_low_power_off.c, example_service_low_power_sensor_disable.c, example_service_low_power_sensor_hibernate.c, and ref_app_tank_level.c.

Definition at line 590 of file acc_integration_stm32.c.

## ◆ acc_integration_sleep_us()

void acc_integration_sleep_us | ( | uint32_t | time_usec | ) |

Sleep for a specified number of microseconds.

Parameters

  time_usec | Time in microseconds to sleep

Definition at line 507 of file acc_integration_stm32.c.