Figure 5-2 shows what includes in an USS demo project.
- Common folder: this includes the USS DC drivers,
protocol, utility and command handler. Use one I2C port and an interrupt pin for the
communication between the MCU and USS DC. Also prepare an UART interface in this part of
code. This can be used for users to build a GUI. Currently, the USS DC does not support
using UART communication.
- Driverlib folder: this includes the driver
library for the MSP430 peripherals.
- Hal folder: the hal_adc includes hardware
abstraction layer for ADC functions such as using the integrated 12bit SAR ADC for
internal temperature sensor capture and external input voltage capture. The hal_lcd
includes hardware abstraction layer for FH-1138P segmented LCD. The hal_system includes
hardware abstraction layer for MSP system including clocks, watchdog and GPIOs. The
hal_uart includes hardware abstraction layer for UART communication.
- IQMathLib and QMathLib folder: the MSP IQmath and
Qmath Libraries are a collection of highly optimized and high-precision mathematical
functions for C programmers to seamlessly port a floating-point algorithm into fixed-point
code on MSP430 and MSP432 devices. These routines are typically used in computationally
intensive real-time applications where best execution speed, high accuracy and ultra-low
energy are critical. By using the IQmath and Qmath libraries, users can achieve execution
speeds considerably faster and energy consumption considerably lower than equivalent code
written using floating-point math.
- USS_Config folder: all modifications to USS SW
library are contained in USS_userConfig.h. The USS_userConfig.c contains all temporary
buffer used by the library. The lookup tables are used for interpolation method used in
the USS library. The calibration header file contains the flow rate calibration data.
Users can use USS DC to generate all these header files with custom configuration for
certain applications. Then, replace the original one in the project and rebuild and
program the project with the new generated header files. MCu does not need to reconfigure
these parameters for tests this way.
- USSLibGUIApp folder: this folder handles the
interaction between USS library and USS DC. The main loop of the project also handles in
USSLibGUIApp.c. Users can add an application code in main loop.
- UssSWLib folder: this folder contains the USS
library and the header file. The ussSwLib.h header file contains all USS library enums,
structs, macros, function and global variables definitions. The comments in this header
file are also very important for the users to have a better understanding of each
variable.
- Linker file: the lnk_msp430fr6047.cmd tells
compiler where to put the program, data and other things like interrupt vectors in the
MSP430 memory space. The linker file in the demo project has been modified to fit the
requirement of USS library.