acc_hal_integration_stm32cube_xm.c File Reference
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include "main.h"
#include "acc_definitions_common.h"
#include "acc_hal_definitions_a121.h"
#include "acc_hal_integration_a121.h"
#include "acc_integration.h"
#include "acc_integration_log.h"

Go to the source code of this file.

Macros

#define SENSOR_COUNT   1
 The number of sensors available on the board. More...
 
#define STM32_MAX_TRANSFER_SIZE   65535
 Size of SPI transfer buffer. More...
 

Functions

static void disable_interrupts (void)
 
static void enable_interrupts (void)
 
static void acc_hal_integration_sensor_transfer16 (acc_sensor_id_t sensor_id, uint16_t *buffer, size_t buffer_length)
 
void acc_hal_integration_sensor_supply_on (acc_sensor_id_t sensor_id)
 Power on sensor supply. More...
 
void acc_hal_integration_sensor_supply_off (acc_sensor_id_t sensor_id)
 Power off sensor supply. More...
 
void acc_hal_integration_sensor_enable (acc_sensor_id_t sensor_id)
 Enable sensor. More...
 
void acc_hal_integration_sensor_disable (acc_sensor_id_t sensor_id)
 Disable sensor. More...
 
bool acc_hal_integration_wait_for_sensor_interrupt (acc_sensor_id_t sensor_id, uint32_t timeout_ms)
 Wait for a sensor interrupt. More...
 
const acc_hal_a121_tacc_hal_rss_integration_get_implementation (void)
 Get hal implementation reference. More...
 
uint16_t acc_hal_integration_sensor_count (void)
 Get the max number of sensors the integration supports. More...
 

Variables

SPI_HandleTypeDef A121_SPI_HANDLE
 

Macro Definition Documentation

◆ SENSOR_COUNT

#define SENSOR_COUNT   1

The number of sensors available on the board.

Definition at line 27 of file acc_hal_integration_stm32cube_xm.c.

◆ STM32_MAX_TRANSFER_SIZE

#define STM32_MAX_TRANSFER_SIZE   65535

Size of SPI transfer buffer.

Definition at line 33 of file acc_hal_integration_stm32cube_xm.c.

Function Documentation

◆ acc_hal_integration_sensor_count()

uint16_t acc_hal_integration_sensor_count ( void  )

Get the max number of sensors the integration supports.

Returns
The max sensor count

Definition at line 185 of file acc_hal_integration_stm32cube_xm.c.

◆ acc_hal_integration_sensor_disable()

void acc_hal_integration_sensor_disable ( acc_sensor_id_t  sensor_id)

Disable sensor.

Parameters
[in]sensor_idThe id of the sensor to disable

Definition at line 130 of file acc_hal_integration_stm32cube_xm.c.

◆ acc_hal_integration_sensor_enable()

void acc_hal_integration_sensor_enable ( acc_sensor_id_t  sensor_id)

Enable sensor.

Any pending sensor interrupts should be cleared before returning from function. The sensor supply needs to be enabled by invoking acc_hal_integration_sensor_supply_on before calling this function.

Parameters
[in]sensor_idThe id of the sensor to enable

Definition at line 119 of file acc_hal_integration_stm32cube_xm.c.

◆ acc_hal_integration_sensor_supply_off()

void acc_hal_integration_sensor_supply_off ( acc_sensor_id_t  sensor_id)

Power off sensor supply.

Parameters
[in]sensor_idThe id of the sensor to power off

Definition at line 113 of file acc_hal_integration_stm32cube_xm.c.

◆ acc_hal_integration_sensor_supply_on()

void acc_hal_integration_sensor_supply_on ( acc_sensor_id_t  sensor_id)

Power on sensor supply.

Parameters
[in]sensor_idThe id of the sensor to power on

Definition at line 107 of file acc_hal_integration_stm32cube_xm.c.

◆ acc_hal_integration_sensor_transfer16()

static void acc_hal_integration_sensor_transfer16 ( acc_sensor_id_t  sensor_id,
uint16_t *  buffer,
size_t  buffer_length 
)
static

Definition at line 68 of file acc_hal_integration_stm32cube_xm.c.

◆ acc_hal_integration_wait_for_sensor_interrupt()

bool acc_hal_integration_wait_for_sensor_interrupt ( acc_sensor_id_t  sensor_id,
uint32_t  timeout_ms 
)

Wait for a sensor interrupt.

Parameters
[in]sensor_idThe sensor to wait for the interrupt on
[in]timeout_msThe maximum time to wait in milliseconds
Returns
True if an interrupt has occurred within timeout, false if timeout occurred

Definition at line 142 of file acc_hal_integration_stm32cube_xm.c.

◆ acc_hal_rss_integration_get_implementation()

const acc_hal_a121_t* acc_hal_rss_integration_get_implementation ( void  )

Get hal implementation reference.

Definition at line 166 of file acc_hal_integration_stm32cube_xm.c.

◆ disable_interrupts()

static void disable_interrupts ( void  )
inlinestatic

Definition at line 37 of file acc_hal_integration_stm32cube_xm.c.

◆ enable_interrupts()

static void enable_interrupts ( void  )
inlinestatic

Definition at line 43 of file acc_hal_integration_stm32cube_xm.c.

Variable Documentation

◆ A121_SPI_HANDLE

SPI_HandleTypeDef A121_SPI_HANDLE