XENSIV™ BGT60TRxx radar sensor platform functions.
To adapt the driver to your platform, you need to provide an implementation for the functions declared in this file. See the example implementation in xensiv_bgt60trxx_mtb.c using the PSoC™ 6 HAL.
◆ xensiv_bgt60trxx_platform_rst_set()
void xensiv_bgt60trxx_platform_rst_set |
( |
const void * |
iface, |
|
|
bool |
val |
|
) |
| |
Platform-specific function that sets the output value of the RST pin.
- Parameters
-
[in] | iface | Platform SPI interface object |
[in] | val | The value to be set (high = true, low = false) |
◆ xensiv_bgt60trxx_platform_spi_cs_set()
void xensiv_bgt60trxx_platform_spi_cs_set |
( |
const void * |
iface, |
|
|
bool |
val |
|
) |
| |
Platform-specific function that that sets the output value of the SPI CS pin.
- Parameters
-
[in] | iface | Platform SPI interface object |
[in] | val | The value to be set (high = true, low = false) |
◆ xensiv_bgt60trxx_platform_spi_transfer()
int32_t xensiv_bgt60trxx_platform_spi_transfer |
( |
void * |
iface, |
|
|
uint8_t * |
tx_data, |
|
|
uint8_t * |
rx_data, |
|
|
uint32_t |
len |
|
) |
| |
Platform-specific function that performs a SPI write/read transfer to the register file of the sensor.
Synchronously write a block of data out and receive a block of data in. If the data that will be received is not important, pass NULL as rx_data. If the data that will be transmitted is not important, pass NULL as tx_data. Note that passing NULL as rxBuffer and txBuffer are considered invalid cases.
- Parameters
-
[in] | iface | Platform SPI interface object. |
[in] | tx_data | The pointer of the buffer with data to transmit. |
[in] | rx_data | The pointer to the buffer to store received data. |
[in] | len | The number of data elements to transmit and receive. |
- Returns
- XENSIV_BGT60TRXX_STATUS_OK if the transfer is completed without errors, otherwise returns XENSIV_BGT60TRXX_STATUS_COM_ERROR.
◆ xensiv_bgt60trxx_platform_spi_fifo_read()
int32_t xensiv_bgt60trxx_platform_spi_fifo_read |
( |
void * |
iface, |
|
|
uint16_t * |
rx_data, |
|
|
uint32_t |
len |
|
) |
| |
Platform-specific function that performs a SPI burst read to receive a block of data from sensor FIFO.
ADC samples are stored in the sensor FIFO using 12bits. It is expected to use SPI read transfers with a word length of 12bits. It is expected to drive TX high while data is read in from RX.
- Parameters
-
[in] | iface | Platform SPI interface object. |
[in] | rx_data | The pointer to the buffer to store the received data. |
[in] | len | The number of FIFO data elements of 12bits to receive. |
- Returns
- XENSIV_BGT60TRXX_STATUS_OK if the read is completed without errors, otherwise returns XENSIV_BGT60TRXX_STATUS_COM_ERROR.
◆ xensiv_bgt60trxx_platform_delay()
void xensiv_bgt60trxx_platform_delay |
( |
uint32_t |
ms | ) |
|
Platform-specific function that waits for a specified time period in milliseconds.
- Parameters
-
[in] | ms | Number of milliseconds to wait for. |
◆ xensiv_bgt60trxx_platform_word_reverse()
uint32_t xensiv_bgt60trxx_platform_word_reverse |
( |
uint32_t |
x | ) |
|
Platform-specific function to reverse the byte order (32 bits).
A sample implementation would look like
return (((x & 0x000000ffUL) << 24) |
((x & 0x0000ff00UL) << 8) |
((x & 0x00ff0000UL) >> 8) |
((x & 0xff000000UL) >> 24));
- Parameters
-
- Returns
- Reversed value.
◆ xensiv_bgt60trxx_platform_assert()
void xensiv_bgt60trxx_platform_assert |
( |
bool |
expr | ) |
|
Platform-specific function that implements a runtime assertion; used to verify the assumptions made by the program and take appropriate actions if the assumption is false.
- Parameters
-
[in] | expr | Expression to be verified. |