#include "driver/irq.h"
{
return device;
}
{
(void)device;
}
{
print(
"%4d.%06d s; Range: %5d mm; Amplitude: %4d LSB; Quality: %3d; Status: %d\n",
}
{
const uint8_t a = (uint8_t)((value >> 24) & 0xFFU);
const uint8_t b = (uint8_t)((value >> 16) & 0xFFU);
const uint8_t c = (uint8_t)(value & 0xFFFFU);
print(
"\n##### AFBR-S50 API - Advanced Example #########################\n"
" API Version: v%d.%d.%d\n"
" Chip ID: %d\n"
" Module: %s\n"
"###############################################################\n\n",
a, b, c, id, m);
}
{
HardwareInit();
PrintDeviceInfo(device);
for (;;)
{
{
PrintResults(&res);
}
}
}
int main(void)
Application entry point.
Definition main.c:48
This file is part of the AFBR-S50 API.
status_t MeasurementReadyCallback(status_t status, argus_hnd_t *argus)
char const * Argus_GetModuleName(argus_hnd_t *hnd)
Gets the name string of the module.
status_t Argus_Init(argus_hnd_t *hnd, s2pi_slave_t spi_slave)
Initializes the device with default measurement mode.
uint32_t Argus_GetChipID(argus_hnd_t *hnd)
Gets the unique identification number of the chip.
argus_hnd_t * Argus_CreateHandle(void)
Creates a new device data handle object to store all internal states.
struct argus_hnd_t argus_hnd_t
Definition argus_def.h:284
int32_t s2pi_slave_t
Definition argus_api.h:67
uint32_t Argus_GetAPIVersion(void)
Gets the version number of the current API library.
status_t Argus_SetConfigurationFrameTime(argus_hnd_t *hnd, uint32_t value)
Sets the frame time to a specified device.
#define UQ12_4_ONE
Definition fp_def.h:237
#define Q9_22_ONE
Definition fp_def.h:547
void IRQ_UNLOCK(void)
Enable IRQ Interrupts.
void IRQ_LOCK(void)
Disable IRQ Interrupts.
status_t print(const char *fmt_s,...)
A printf-like function to print formatted data to an debugging interface.
Definition sci_log.c:106
status_t Argus_EvaluateData(argus_hnd_t *hnd, argus_results_t *res)
Evaluates measurement data from the raw sensor readout data.
status_t Argus_StartMeasurementTimer(argus_hnd_t *hnd, argus_measurement_ready_callback_t cb)
Starts the timer based measurement cycle asynchronously.
int32_t status_t
Type used for all status and error return values.
Definition argus_status.h:70
@ STATUS_OK
Definition argus_status.h:80
@ ERROR_FAIL
Definition argus_status.h:95
static status_t status
Definition argus_xtalk_cal_cli.c:140
static volatile uint8_t myDataReadyEvents
Definition main.c:96
void HandleError(status_t status, bool stop, char const *msg)
A callback function from the example code whenever an error occurs.
Definition main.c:62
#define SPI_SLAVE
Definition examples.h:102
uint8_t SignalQuality
Definition argus_res.h:87
q9_22_t Range
Definition argus_res.h:75
uq12_4_t Amplitude
Definition argus_res.h:81
The measurement results data structure.
Definition argus_res.h:216
ltc_t TimeStamp
Definition argus_res.h:225
status_t Status
Definition argus_res.h:221
argus_results_bin_t Bin
Definition argus_res.h:269
uint32_t usec
Definition time.h:77
uint32_t sec
Definition time.h:73