RA Flexible Software Package Documentation
Release v5.7.0
|
|
Functions | |
fsp_err_t | RM_FS2012_Open (rm_fsxxxx_ctrl_t *const p_api_ctrl, rm_fsxxxx_cfg_t const *const p_cfg) |
Opens and configures the FS2012 Middle module. Implements rm_fsxxxx_api_t::open. More... | |
fsp_err_t | RM_FS2012_Close (rm_fsxxxx_ctrl_t *const p_api_ctrl) |
Disables specified FS2012 control block. Implements rm_fsxxxx_api_t::close. More... | |
fsp_err_t | RM_FS2012_Read (rm_fsxxxx_ctrl_t *const p_api_ctrl, rm_fsxxxx_raw_data_t *const p_raw_data) |
Reads ADC data from FS2012. Implements rm_fsxxxx_api_t::read. More... | |
fsp_err_t | RM_FS2012_DataCalculate (rm_fsxxxx_ctrl_t *const p_api_ctrl, rm_fsxxxx_raw_data_t *const p_raw_data, rm_fsxxxx_data_t *const p_fs2012_data) |
Calculates flow from ADC data. Unit of Gas flow is SLPM (Standard liter per minute) Unit of Liquid flow is SCCM (Standard cubic centimeter per minute) Implements rm_fsxxxx_api_t::dataCalculate. More... | |
Middleware to implement the FS2012 sensor interface. This module implements the FSXXXX Middleware Interface.
FS2012 is EOL.
The FS2012 sensor interface implementation has the following key features:
Configuration | Options | Default | Description |
---|---|---|---|
Parameter Checking |
| Default (BSP) | If selected code for parameter checking is included in the build. |
Device Type |
| FS2012-1100-NG | Select FS2012 device type. |
Configuration | Options | Default | Description |
---|---|---|---|
Name | Name must be a valid C symbol | g_fs2012_sensor0 | Module name. |
Callback | Name must be a valid C symbol | fs2012_callback | A user callback function can be provided. |
This module uses SDA and SCL pins of I2C Master and SCI I2C.
FS2012 datasheet is here. The module only supports FS2012-1020-NG and FS2012-1100-NG.
If an RTOS is used, blocking and bus lock is available.
The FS2012 interface expects a bus instance to be opened before opening any FS2012 device. The interface will handle switching between devices on the bus but will not open or close the bus instance. The user should open the bus with the appropriate I2C Master Interface open call.
This is a basic example of minimal use of FS2012 sensor implementation in an application.
Data Structures | |
struct | rm_fs2012_instance_ctrl_t |
struct rm_fs2012_instance_ctrl_t |
FS2012 Control Block
Data Fields | |
uint32_t | open |
Open flag. | |
rm_fsxxxx_cfg_t const * | p_cfg |
Pointer to FS2012 Configuration. | |
rm_comms_instance_t const * | p_comms_i2c_instance |
Pointer of I2C Communications Middleware instance structure. | |
void const * | p_context |
Pointer to the user-provided context. | |
fsp_err_t RM_FS2012_Open | ( | rm_fsxxxx_ctrl_t *const | p_api_ctrl, |
rm_fsxxxx_cfg_t const *const | p_cfg | ||
) |
Opens and configures the FS2012 Middle module. Implements rm_fsxxxx_api_t::open.
Example:
FSP_SUCCESS | FS2012 successfully configured. |
FSP_ERR_ASSERTION | Null pointer, or one or more configuration options is invalid. |
FSP_ERR_ALREADY_OPEN | Module is already open. This module can only be opened once. |
fsp_err_t RM_FS2012_Close | ( | rm_fsxxxx_ctrl_t *const | p_api_ctrl | ) |
Disables specified FS2012 control block. Implements rm_fsxxxx_api_t::close.
FSP_SUCCESS | Successfully closed. |
FSP_ERR_ASSERTION | Null pointer passed as a parameter. |
FSP_ERR_NOT_OPEN | Module is not open. |
fsp_err_t RM_FS2012_Read | ( | rm_fsxxxx_ctrl_t *const | p_api_ctrl, |
rm_fsxxxx_raw_data_t *const | p_raw_data | ||
) |
Reads ADC data from FS2012. Implements rm_fsxxxx_api_t::read.
FSP_SUCCESS | Successfully data decoded. |
FSP_ERR_ASSERTION | Null pointer, or one or more configuration options is invalid. |
FSP_ERR_NOT_OPEN | Module is not open. |
fsp_err_t RM_FS2012_DataCalculate | ( | rm_fsxxxx_ctrl_t *const | p_api_ctrl, |
rm_fsxxxx_raw_data_t *const | p_raw_data, | ||
rm_fsxxxx_data_t *const | p_fs2012_data | ||
) |
Calculates flow from ADC data. Unit of Gas flow is SLPM (Standard liter per minute) Unit of Liquid flow is SCCM (Standard cubic centimeter per minute) Implements rm_fsxxxx_api_t::dataCalculate.
FSP_SUCCESS | Successfully data decoded. |
FSP_ERR_ASSERTION | Null pointer, or one or more configuration options is invalid. |
FSP_ERR_NOT_OPEN | Module is not open. |