ranging_base.h

Ranging module.

Copyright

Copyright (C) 2020 SPARK Microsystems International Inc. All rights reserved.

License

This source code is proprietary and subject to the SPARK Microsystems Software EULA found in this package in file EULA.txt.

Author

SPARK FW Team.

Defines

RANGING_SLOPE 7.319151806640625f
RANGING_SCALING 1000

Functions

void ranging_base_get_propagation_delay_array(ranging_master_slave_info_t *ranging_data, uint16_t size, float *raw_prop_delay)

Get propagation delays given an array.

Parameters
  • ranging_data – [in] Ranging data array.

  • size – [in] Size of arrays.

  • raw_prop_delay – [out] Propagation delay array.

float ranging_base_calculate_average(float *data, uint16_t size)

Get an average removing value below a threshold.

Parameters
  • data – [in] Data to average.

  • size – [in] Size of the data to average.

Returns

Average of data.

float ranging_base_convert_to_distance(float prop_delay, float offset)

Get propagation delay for distance calculation.

Parameters
  • prop_delay – [in] Propagation delay value.

  • offset – [in] Offset value.

Returns

Distance in meters.

struct ranging_info_t
#include <ranging_base.h>

Ranging informations.

Public Members

int8_t phase1

Phase information #1

int8_t phase2

Phase information #2

int8_t phase3

Phase information #3

int8_t phase4

Phase information #4

uint8_t rx_waited1

Receiver time waited (MSB)

uint8_t rx_waited0

Receiver time waited (LSB)

struct ranging_frame_t
#include <ranging_base.h>

Ranging information sent over the air.

Public Members

ranging_info_t ranging_info

Ranging informations structure

uint8_t count

Number of ranging informations exchange between slave and master

struct ranging_master_slave_info_t
#include <ranging_base.h>

Internal master and slave ranging info structure.

Public Members

ranging_info_t slave_info
ranging_info_t master_info