Provides the ModusToolbox(TM) interface to the XENSIV(TM) BGT60TRxx 60GHz FMCW radar sensors library and the implementation of the platform functions using the PSoC(TM) 6 HAL.
The following snippet initializes an SPI instance and the BGT60TRxx.
The following snippet demonstrates how to read data from the sensor.
Data Structures | |
struct | xensiv_bgt60trxx_mtb_iface_t |
Structure holding the XENSIV(TM) BGT60TRxx ModusToolbox(TM) interface. More... | |
struct | xensiv_bgt60trxx_mtb_t |
Structure holding the XENSIV(TM) BGT60TRxx ModusToolbox(TM) object. More... | |
Macros | |
#define | CY_RSLT_MODULE_BOARD_HARDWARE_XENSIV_BGT60TRXX 0x01CC |
Module identifier for the XENSIV(TM) BGT60TRxx radar sensor library. More... | |
#define | XENSIV_BGT60TRXX_RSLT_ERR_COMM (CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CY_RSLT_MODULE_BOARD_HARDWARE_XENSIV_BGT60TRXX, XENSIV_BGT60TRXX_STATUS_COM_ERROR)) |
Result code indicating a communication error. More... | |
#define | XENSIV_BGT60TRXX_RSLT_ERR_UNKNOWN_DEVICE (CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CY_RSLT_MODULE_BOARD_HARDWARE_XENSIV_BGT60TRXX, XENSIV_BGT60TRXX_STATUS_DEV_ERROR)) |
Result code indicating an unsupported device error. More... | |
#define | XENSIV_BGT60TRXX_RSLT_ERR_INTPIN_INUSE (CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CY_RSLT_MODULE_BOARD_HARDWARE_XENSIV_BGT60TRXX, 0x100)) |
An attempt was made to reconfigure the interrupt pin. | |
Functions | |
cy_rslt_t | xensiv_bgt60trxx_mtb_init (xensiv_bgt60trxx_mtb_t *obj, cyhal_spi_t *spi, cyhal_gpio_t selpin, cyhal_gpio_t rstpin, const uint32_t *regs, size_t len) |
Initializes the XENSIV(TM) BGT60TRxx sensor. More... | |
cy_rslt_t | xensiv_bgt60trxx_mtb_interrupt_init (xensiv_bgt60trxx_mtb_t *obj, uint16_t fifo_limit, cyhal_gpio_t irqpin, uint8_t intr_priority, cyhal_gpio_event_callback_t callback, void *callback_arg) |
Configures a GPIO pin as an interrupt for the XENSIV(TM) BGT60TRxx. More... | |
void | xensiv_bgt60trxx_mtb_free (xensiv_bgt60trxx_mtb_t *obj) |
Frees up any resources allocated by the XENSIV(TM) BGT60TRxx as part of xensiv_bgt60trxx_mtb_init() More... | |
struct xensiv_bgt60trxx_mtb_iface_t |
struct xensiv_bgt60trxx_mtb_t |
Data Fields | ||
---|---|---|
xensiv_bgt60trxx_t | dev | sensor object |
xensiv_bgt60trxx_mtb_iface_t | iface | interface object for communication |
#define CY_RSLT_MODULE_BOARD_HARDWARE_XENSIV_BGT60TRXX 0x01CC |
Module identifier for the XENSIV(TM) BGT60TRxx radar sensor library.
Asset(s): (sensor-XENSIV(TM)-bgt60trxx)
#define XENSIV_BGT60TRXX_RSLT_ERR_COMM (CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CY_RSLT_MODULE_BOARD_HARDWARE_XENSIV_BGT60TRXX, XENSIV_BGT60TRXX_STATUS_COM_ERROR)) |
Result code indicating a communication error.
#define XENSIV_BGT60TRXX_RSLT_ERR_UNKNOWN_DEVICE (CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CY_RSLT_MODULE_BOARD_HARDWARE_XENSIV_BGT60TRXX, XENSIV_BGT60TRXX_STATUS_DEV_ERROR)) |
Result code indicating an unsupported device error.
cy_rslt_t xensiv_bgt60trxx_mtb_init | ( | xensiv_bgt60trxx_mtb_t * | obj, |
cyhal_spi_t * | spi, | ||
cyhal_gpio_t | selpin, | ||
cyhal_gpio_t | rstpin, | ||
const uint32_t * | regs, | ||
size_t | len | ||
) |
Initializes the XENSIV(TM) BGT60TRxx sensor.
The provided pins will be initialized by this function. If the reset pin is used (rstpin
) the function will generate a hardware reset sequence. The SPI slave select pin (selpin
) is expected to be controlled by this driver, not the SPI block itself. This allows the driver to issue multiple read/write requests back to back.
The function initializes a sensor object using the configuration register list.
Refer Code snippets for more information.
[in,out] | obj | Pointer to the BGT60TRxx ModusToolbox(TM) object. The caller must allocate the memory for this object but the init function will initialize its contents. |
[in] | spi | Pointer to an initialized SPI HAL object using Standard Motorola SPI Mode 0 (CPOL=0, CPHA=0) with MSB first |
[in] | selpin | Pin connected to the SPI_CSN pin of the sensor. |
[in] | rstpin | Pin connected to the SPI_DIO3 pin of the sensor. |
[in] | regs | Pointer to the configuration registers list. |
[in] | len | Length of the configuration registers list. |
cy_rslt_t xensiv_bgt60trxx_mtb_interrupt_init | ( | xensiv_bgt60trxx_mtb_t * | obj, |
uint16_t | fifo_limit, | ||
cyhal_gpio_t | irqpin, | ||
uint8_t | intr_priority, | ||
cyhal_gpio_event_callback_t | callback, | ||
void * | callback_arg | ||
) |
Configures a GPIO pin as an interrupt for the XENSIV(TM) BGT60TRxx.
Initializes and configures the pin (irqpin
) as an interrupt input. Configures the XENSIV(TM) BGT60TRxx to trigger an interrupt after the number of fifo_limit words are stored in the BGT60TRxx FIFO. Each FIFO word corresponds to two ADC samples.
Refer Code snippets for more information.
[in,out] | obj | Pointer to the BGT60TRxx ModusToolbox(TM) object. |
[in] | fifo_limit | Number of words stored in FIFO that will trigger an interrupt. |
[in] | irqpin | Pin connected to the IRQ pin of the sensor. |
[in] | intr_priority | The priority for NVIC interrupt events. |
[in] | callback | The function to call when the specified event happens. Pass NULL to unregister the handler. |
[in] | callback_arg | Generic argument that will be provided to the callback when called, can be NULL |
void xensiv_bgt60trxx_mtb_free | ( | xensiv_bgt60trxx_mtb_t * | obj | ) |
Frees up any resources allocated by the XENSIV(TM) BGT60TRxx as part of xensiv_bgt60trxx_mtb_init()
[in] | obj | Pointer to the BGT60TRxx ModusToolbox(TM) object. |