![]() |
RA Flexible Software Package Documentation
Release v6.1.0
|
|
Functions | |
fsp_err_t | RM_RRH46410_Open (rm_zmod4xxx_ctrl_t *const p_api_ctrl, rm_zmod4xxx_cfg_t const *const p_cfg) |
Opens and configures the RRH46410 sensor module. Implements rm_zmod4xxx_api_t::open. More... | |
fsp_err_t | RM_RRH46410_Close (rm_zmod4xxx_ctrl_t *const p_api_ctrl) |
This function should be called when close the sensor module. Implements rm_zmod4xxx_api_t::close. More... | |
fsp_err_t | RM_RRH46410_MeasurementStart (rm_zmod4xxx_ctrl_t *const p_api_ctrl) |
This function should be called when start a measurement. Implements rm_zmod4xxx_api_t::measurementStart. More... | |
fsp_err_t | RM_RRH46410_MeasurementStop (rm_zmod4xxx_ctrl_t *const p_api_ctrl) |
This function should be called when stop a measurement. Implements rm_zmod4xxx_api_t::measurementStop. More... | |
fsp_err_t | RM_RRH46410_Read (rm_zmod4xxx_ctrl_t *const p_api_ctrl, rm_zmod4xxx_raw_data_t *const p_raw_data) |
This function should be called to get measurement results after measurement finishes. To check measurement status either polling or busy/interrupt pin can be used. Implements rm_zmod4xxx_api_t::read. More... | |
fsp_err_t | RM_RRH46410_Iaq2ndGenDataCalculate (rm_zmod4xxx_ctrl_t *const p_api_ctrl, rm_zmod4xxx_raw_data_t *const p_raw_data, rm_zmod4xxx_iaq_2nd_data_t *const p_rrh46410_data) |
This function should be called when calculating gas data from measurement results. Implements rm_zmod4xxx_api_t::iaq2ndGenDataCalculate. More... | |
fsp_err_t | RM_RRH46410_PbaqDataCalculate (rm_zmod4xxx_ctrl_t *const p_api_ctrl, rm_zmod4xxx_raw_data_t *const p_raw_data, rm_zmod4xxx_pbaq_data_t *const p_rrh46410_data) |
This function should be called when calculating gas data from measurement results. Implements rm_zmod4xxx_api_t::pbaqDataCalculate. More... | |
fsp_err_t | RM_RRH46410_TemperatureAndHumiditySet (rm_zmod4xxx_ctrl_t *const p_api_ctrl, float temperature, float humidity) |
This function should be called before Read. Humidity measurements are needed for ambient compensation. temperature is not supported. Implements rm_zmod4xxx_api_t::temperatureAndHumiditySet. More... | |
Middleware to implement the RRH46410 sensor module interface. This module implements the ZMOD4XXX Middleware Interface.
RRH46410 is EOL.
This module provides an API for configuring and controlling the RRH46410 sensor module (ZMOD4410 + MCU).
I2C communication with the RRH46410 sensor module is realized by connecting with the rm_comms_i2c module.
The RRH46410 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. |
Operation Mode |
| IAQ 2nd Gen and Rel IAQ | Select operation mode. |
Configuration | Options | Default | Description |
---|---|---|---|
Name | Name must be a valid C symbol | g_rrh46410_sensor0 | Module name. |
Comms I2C Callback | Name must be a valid C symbol | rrh46410_comms_i2c_callback | A user COMMS I2C callback function can be provided. |
IRQ Callback | Name must be a valid C symbol | rrh46410_irq_callback | A user IRQ callback function can be provided. |
This module use SDA and SCL pins of I2C Master, SCI I2C and IICA Master.
RRH46410 datasheet is here.
The RRH46410 has three modes of operation.
The RRH46410 will respond to TVOC immediately upon start-up; however, a conditioning period of 48 hours followed by a sensor module restart in an ambient environment is recommended to improve stability and obtain maximum performance.
Best results are achieved with continuous operation because the module algorithm can learn about the environment over time.
Operation mode | Description | Data |
---|---|---|
IAQ 2nd Generation and Relative IAQ | Using AI for improved ppm TVOC, IAQ and eCO2 functionality (recommended for new designs). Lightweight algorithm reacts to air quality changes and outputs a relative IAQ | IAQ, TVOC[mg/m^3], EtOH[ppm], eCO2[ppm], Rel IAQ |
IAQ 2nd Generation Ultra Low Power and Relative IAQ Ultra Low Power | Using AI for improved ppm TVOC, IAQ and eCO2 functionality. Lightweight algorithm reacts to air quality changes and outputs a relative IAQ. This operation mode offers a much lower power consumption. | IAQ, TVOC[mg/m^3], EtOH[ppm], eCO2[ppm], Rel IAQ |
Public Building AQ Standard (PBAQ) | For highly accurate and consistent sensor readings to fulfill public building standards. | TVOC[mg/m^3], EtOH[ppm] |
If an RTOS is used, blocking and bus lock is available.
The RRH46410 interface expects a bus instance to be opened before opening any RRH46410 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.
Initialize with RM_RRH46410_Open().
After normal completion, start the measurement with RM_RRH46410_MeasurementStart(). An endless loop continuously checks the status of the RRH46410 sensor module and reads its data. The measurement results are subsequently processed, and the air quality values are calculated.
These are basic examples of minimal use of RRH46410 sensor implementation in an application.
IAQ 2nd Gen.
IAQ 2nd Gen. ULP
PBAQ
Data Structures | |
struct | rm_rrh46410_init_process_params_t |
struct | rm_rrh46410_instance_ctrl_t |
struct rm_rrh46410_init_process_params_t |
RRH46410 initialization process block
Data Fields | ||
---|---|---|
volatile bool | communication_finished | Communication flag for blocking. |
volatile rm_zmod4xxx_event_t | event | Callback event. |
struct rm_rrh46410_instance_ctrl_t |
RRH46410 control block
Data Fields | |
uint32_t | open |
Open flag. | |
uint8_t | write_buf [RM_RRH46410_MAX_I2C_BUF_SIZE] |
Write buffer for I2C communications. | |
uint8_t | read_buf [RM_RRH46410_MAX_I2C_BUF_SIZE] |
Read buffer for I2C communications. | |
uint8_t * | p_read_data |
Pointer to read data. This is used for checking error code and checksum in callback. | |
uint8_t | read_bytes |
Read bytes. This is used for checking error code and checksum in callback. | |
volatile uint8_t | prev_sample_id |
Previous sample ID. This is used for checking if sensor is in stabilization. | |
volatile int16_t | warmup_counts |
Counts for warning up. This is used for checking if sensor is in stabilization. | |
volatile rm_zmod4xxx_event_t | event |
Callback event. | |
rm_rrh46410_init_process_params_t | init_process_params |
For the initialization process. | |
rm_zmod4xxx_cfg_t const * | p_cfg |
Pointer of configuration block. | |
rm_comms_instance_t const * | p_comms_i2c_instance |
Pointer of I2C Communications Middleware instance structure. | |
void const * | p_irq_instance |
Pointer to IRQ instance. | |
void * | p_context |
Pointer to the user-provided context. | |
void(* | p_comms_callback )(rm_zmod4xxx_callback_args_t *p_args) |
I2C Communications callback. | |
void(* | p_irq_callback )(rm_zmod4xxx_callback_args_t *p_args) |
IRQ callback. | |
fsp_err_t RM_RRH46410_Open | ( | rm_zmod4xxx_ctrl_t *const | p_api_ctrl, |
rm_zmod4xxx_cfg_t const *const | p_cfg | ||
) |
Opens and configures the RRH46410 sensor module. Implements rm_zmod4xxx_api_t::open.
FSP_SUCCESS | RRH46410 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_TIMEOUT | Communication is timeout. |
FSP_ERR_ABORTED | Communication is aborted. |
fsp_err_t RM_RRH46410_Close | ( | rm_zmod4xxx_ctrl_t *const | p_api_ctrl | ) |
This function should be called when close the sensor module. Implements rm_zmod4xxx_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_RRH46410_MeasurementStart | ( | rm_zmod4xxx_ctrl_t *const | p_api_ctrl | ) |
This function should be called when start a measurement. Implements rm_zmod4xxx_api_t::measurementStart.
FSP_SUCCESS | Successfully started. |
FSP_ERR_ASSERTION | Null pointer passed as a parameter. |
FSP_ERR_NOT_OPEN | Module is not opened configured. |
FSP_ERR_TIMEOUT | Communication is timeout. |
FSP_ERR_ABORTED | Communication is aborted. |
fsp_err_t RM_RRH46410_MeasurementStop | ( | rm_zmod4xxx_ctrl_t *const | p_api_ctrl | ) |
This function should be called when stop a measurement. Implements rm_zmod4xxx_api_t::measurementStop.
FSP_SUCCESS | Successfully stopped. |
FSP_ERR_ASSERTION | Null pointer passed as a parameter. |
FSP_ERR_NOT_OPEN | Module is not opened configured. |
FSP_ERR_TIMEOUT | Communication is timeout. |
FSP_ERR_ABORTED | Communication is aborted. |
fsp_err_t RM_RRH46410_Read | ( | rm_zmod4xxx_ctrl_t *const | p_api_ctrl, |
rm_zmod4xxx_raw_data_t *const | p_raw_data | ||
) |
This function should be called to get measurement results after measurement finishes. To check measurement status either polling or busy/interrupt pin can be used. Implements rm_zmod4xxx_api_t::read.
FSP_SUCCESS | Successfully results are read. |
FSP_ERR_ASSERTION | Null pointer passed as a parameter. |
FSP_ERR_NOT_OPEN | Module is not opened configured. |
FSP_ERR_TIMEOUT | Communication is timeout. |
FSP_ERR_ABORTED | Communication is aborted. |
fsp_err_t RM_RRH46410_Iaq2ndGenDataCalculate | ( | rm_zmod4xxx_ctrl_t *const | p_api_ctrl, |
rm_zmod4xxx_raw_data_t *const | p_raw_data, | ||
rm_zmod4xxx_iaq_2nd_data_t *const | p_rrh46410_data | ||
) |
This function should be called when calculating gas data from measurement results. Implements rm_zmod4xxx_api_t::iaq2ndGenDataCalculate.
FSP_SUCCESS | Successfully gas data is calculated. |
FSP_ERR_ASSERTION | Null pointer passed as a parameter. |
FSP_ERR_NOT_OPEN | Module is not opened configured. |
FSP_ERR_UNSUPPORTED | Unsupported operation mode. |
FSP_ERR_SENSOR_MEASUREMENT_NOT_FINISHED | Measurement is not finished. |
fsp_err_t RM_RRH46410_PbaqDataCalculate | ( | rm_zmod4xxx_ctrl_t *const | p_api_ctrl, |
rm_zmod4xxx_raw_data_t *const | p_raw_data, | ||
rm_zmod4xxx_pbaq_data_t *const | p_rrh46410_data | ||
) |
This function should be called when calculating gas data from measurement results. Implements rm_zmod4xxx_api_t::pbaqDataCalculate.
FSP_SUCCESS | Successfully gas data is calculated. |
FSP_ERR_ASSERTION | Null pointer passed as a parameter. |
FSP_ERR_NOT_OPEN | Module is not opened configured. |
FSP_ERR_UNSUPPORTED | Unsupported operation mode. |
FSP_ERR_SENSOR_MEASUREMENT_NOT_FINISHED | Measurement is not finished. |
fsp_err_t RM_RRH46410_TemperatureAndHumiditySet | ( | rm_zmod4xxx_ctrl_t *const | p_api_ctrl, |
float | temperature, | ||
float | humidity | ||
) |
This function should be called before Read. Humidity measurements are needed for ambient compensation. temperature is not supported. Implements rm_zmod4xxx_api_t::temperatureAndHumiditySet.
FSP_SUCCESS | Successfully humidity is set. |
FSP_ERR_ASSERTION | Null pointer passed as a parameter. |
FSP_ERR_NOT_OPEN | Module is not opened configured. |