smartsens2 2.0.0.0
|
Smart Sens 2 Click is a compact add-on board that contains a smart sensor system with an integrated IMU sensor. This board utilizes the BHI260AP, BME688, BMP390, and BMM150, an ultra-low-power programmable smart sensor, environmental and pressure sensor, and a magnetometer from Bosch Sensortec. The BHI260AP includes a powerful 32-bit MCU and a 6-axis IMU (3-axis accelerometer and 3-axis gyroscope) alongside an event-driven software framework. In addition to its internal functions also perform signal data processing from several onboard sensors performing measurements of various parameters such as an environmental and magnetic field. In addition to these primary functions, this Click boardâ„¢ allows users to select the desired serial interface, use the debug interface, and select BOOT mode.
We provide a library for the Smart Sens 2 Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
This library contains API for Smart Sens 2 Click driver.
smartsens2_cfg_setup
Config Object Initialization function. smartsens2_init
Initialization function. smartsens2_default_cfg
Click Default Configuration function. smartsens2_register_fifo_parse_callback
Function to link a callback and relevant reference when the sensor event is available in the FIFO. smartsens2_set_virt_sensor_cfg
Function to set the sample rate and latency of the virtual sensor. smartsens2_get_and_process_fifo
Function to get and process the FIFOs. This example showcases the ability of the Smart Sens 2 click board.
It has multiple examples that you can easily select with the defines at the top of the main. There are 9 examples: Euler, Quaternion, Vector (Accelerometer, Gyroscope, Magnetometer), and Environmental (Temperature, Barometer, Humidity, Gas).
The demo application is composed of two sections :
Initialization of communication modules (SPI/I2C) and additional
pins(int_pin, rst). After that going through reset sequence and checking device and product IDs, interrupt mask, and host control is set to 0, so every interrupt enabled. If boot status is OK boot sequence is initiated, depending on the defines from the library header it will use RAM or Flash type of the boot. If RAM is selected firmware image first needs to be uploaded to RAM and then it will be booted. If Flash example is selected it will try to boot firmware first if it fails it will then write firmware image to flash and then try to boot it again. When firmware boot is finished Kernel version and Feature registers will be read to check if the firmware is loaded. Then all the callback function will be registered(meta event callback and whatever type of example parser you set), and driver will update the list of virtual sensors present, and finally will configure virtual sensor that will be used in the selected example.
Wait for an interrupt to occur, then read wake-up, non-weak-up, and status FIFO.
Parse received data and run the callback parsers to show data on the USB UART.
Select one of the examples with macros at the top of the main file. Euler example is selected by default.
You can choose one of 4 type of parsers: Euler, Quaternion, Vector, Environmental. If Vector example is selected you choose one of the 3 sensors to show X, Y, and Z values: Accelerometer, Gyroscope, or Magnetometer. If Environmental example is selected you choose one of the 4 sensors: Temperature, Barometer, Humidity, or Gas.
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
Other Mikroe Libraries used in the example:
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. UART terminal is available in all MikroElektronika compilers.