Smart Sens Click example.
Description
This example showcases the ability of the Smart Sens click board. It has multiple examples that you can easily select with the defines at the top of the main. There are 5 examples: Euler, Quaternion, and Vector (Accelerometer, Gyroscope, Magnetometer).
The demo application is composed of two sections :
Application Init
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.
Application Task
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.
- Note
- 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 3 type of parsers: Euler, Quaternion, Vector. If Vector example is selected you choose one of the 3 sensors to show X, Y, and Z values: Accelerometer, Gyroscope, or Magnetometer.
- Author
- MikroE Team