RA Flexible Software Package Documentation  Release v5.6.0

 
HS400X Middleware Interface

Detailed Description

Interface for HS400X Middleware functions.

Summary

The HS400X interface provides HS400X functionality.

Data Structures

struct  rm_hs400x_callback_args_t
 
struct  rm_hs400x_resolutions_t
 
struct  rm_hs400x_raw_data_t
 
struct  rm_hs400x_sensor_data_t
 
struct  rm_hs400x_data_t
 
struct  rm_hs400x_cfg_t
 
struct  rm_hs400x_api_t
 
struct  rm_hs400x_instance_t
 

Typedefs

typedef void rm_hs400x_ctrl_t
 

Enumerations

enum  rm_hs400x_event_t
 
enum  rm_hs400x_temperature_resolution_t
 
enum  rm_hs400x_humidity_resolution_t
 
enum  rm_hs400x_periodic_measurement_frequency_t
 

Data Structure Documentation

◆ rm_hs400x_callback_args_t

struct rm_hs400x_callback_args_t

HS400X callback parameter definition

◆ rm_hs400x_resolutions_t

struct rm_hs400x_resolutions_t

HS400X resolution block

◆ rm_hs400x_raw_data_t

struct rm_hs400x_raw_data_t

HS400X raw data

Data Fields
uint8_t humidity[2] Upper 2 bits of 0st element are mask.
uint8_t temperature[2] Upper 2 bits of 0st element are mask.
uint8_t checksum Checksum.

◆ rm_hs400x_sensor_data_t

struct rm_hs400x_sensor_data_t

HS400X sensor data block

Data Fields
int16_t integer_part
int16_t decimal_part To two decimal places.

◆ rm_hs400x_data_t

struct rm_hs400x_data_t

HS400X data block

◆ rm_hs400x_cfg_t

struct rm_hs400x_cfg_t

HS400X Configuration

Data Fields

rm_hs400x_temperature_resolution_t const temperature_resolution
 Resolution for temperature.
 
rm_hs400x_humidity_resolution_t const humidity_resolution
 Resolution for humidity.
 
rm_hs400x_periodic_measurement_frequency_t const frequency
 Frequency for periodic measurement.
 
rm_comms_instance_t const * p_comms_instance
 Pointer to Communications Middleware instance.
 
void const * p_context
 Pointer to the user-provided context.
 
void const * p_extend
 Pointer to extended configuration by instance of interface.
 
void(* p_comms_callback )(rm_hs400x_callback_args_t *p_args)
 I2C Communications callback.
 

◆ rm_hs400x_api_t

struct rm_hs400x_api_t

HS400X APIs

Data Fields

fsp_err_t(* open )(rm_hs400x_ctrl_t *const p_ctrl, rm_hs400x_cfg_t const *const p_cfg)
 
fsp_err_t(* measurementStart )(rm_hs400x_ctrl_t *const p_ctrl)
 
fsp_err_t(* measurementStop )(rm_hs400x_ctrl_t *const p_ctrl)
 
fsp_err_t(* read )(rm_hs400x_ctrl_t *const p_ctrl, rm_hs400x_raw_data_t *const p_raw_data)
 
fsp_err_t(* dataCalculate )(rm_hs400x_ctrl_t *const p_ctrl, rm_hs400x_raw_data_t *const p_raw_data, rm_hs400x_data_t *const p_hs400x_data)
 
fsp_err_t(* close )(rm_hs400x_ctrl_t *const p_ctrl)
 

Field Documentation

◆ open

fsp_err_t(* rm_hs400x_api_t::open) (rm_hs400x_ctrl_t *const p_ctrl, rm_hs400x_cfg_t const *const p_cfg)

Open sensor.

Parameters
[in]p_ctrlPointer to control structure.
[in]p_cfgPointer to configuration structure.

◆ measurementStart

fsp_err_t(* rm_hs400x_api_t::measurementStart) (rm_hs400x_ctrl_t *const p_ctrl)

Start one shot measurement.

Parameters
[in]p_ctrlPointer to control structure.

◆ measurementStop

fsp_err_t(* rm_hs400x_api_t::measurementStop) (rm_hs400x_ctrl_t *const p_ctrl)

Stop a period measurement.

Parameters
[in]p_ctrlPointer to control structure.

◆ read

fsp_err_t(* rm_hs400x_api_t::read) (rm_hs400x_ctrl_t *const p_ctrl, rm_hs400x_raw_data_t *const p_raw_data)

Read ADC data from HS400X.

Parameters
[in]p_ctrlPointer to control structure.
[in]p_raw_dataPointer to raw data structure.

◆ dataCalculate

fsp_err_t(* rm_hs400x_api_t::dataCalculate) (rm_hs400x_ctrl_t *const p_ctrl, rm_hs400x_raw_data_t *const p_raw_data, rm_hs400x_data_t *const p_hs400x_data)

Calculate humidity and temperature values from ADC data.

Parameters
[in]p_ctrlPointer to control structure.
[in]p_raw_dataPointer to raw data.
[in]p_hs400x_dataPointer to HS400X data structure.

◆ close

fsp_err_t(* rm_hs400x_api_t::close) (rm_hs400x_ctrl_t *const p_ctrl)

Close HS400X.

Parameters
[in]p_ctrlPointer to control structure.

◆ rm_hs400x_instance_t

struct rm_hs400x_instance_t

HS400X instance

Data Fields
rm_hs400x_ctrl_t * p_ctrl

Pointer to the control structure for this instance

rm_hs400x_cfg_t const * p_cfg

Pointer to the configuration structure for this instance

rm_hs400x_api_t const * p_api

Pointer to the API structure for this instance

Typedef Documentation

◆ rm_hs400x_ctrl_t

typedef void rm_hs400x_ctrl_t

HS400X control block. Allocate an instance specific control block to pass into the HS400X API calls.

Enumeration Type Documentation

◆ rm_hs400x_event_t

Event in the callback function

◆ rm_hs400x_temperature_resolution_t

Resolution type for temperature

◆ rm_hs400x_humidity_resolution_t

Resolution type for humidity

◆ rm_hs400x_periodic_measurement_frequency_t

Frequency of periodic measurement

Enumerator
RM_HS400X_PERIODIC_MEASUREMENT_FREQUENCY_2HZ 

A measurement every 0.5s.

RM_HS400X_PERIODIC_MEASUREMENT_FREQUENCY_1HZ 

A measurement every 1s.

RM_HS400X_PERIODIC_MEASUREMENT_FREQUENCY_0P4HZ 

A measurement every 2.5s.