RZG Flexible Software Package Documentation  Release v2.1.0

 
HS300X Middleware Interface

Detailed Description

Interface for HS300X Middleware functions.

Summary

The HS300X interface provides HS300X functionality.

The HS300X interface can be implemented by:

Data Structures

struct  rm_hs300x_callback_args_t
 
struct  rm_hs300x_raw_data_t
 
struct  rm_hs300x_sensor_data_t
 
struct  rm_hs300x_data_t
 
struct  rm_hs300x_cfg_t
 
struct  rm_hs300x_api_t
 
struct  rm_hs300x_instance_t
 

Typedefs

typedef void rm_hs300x_ctrl_t
 

Enumerations

enum  rm_hs300x_event_t
 
enum  rm_hs300x_data_type_t
 
enum  rm_hs300x_resolution_t
 

Data Structure Documentation

◆ rm_hs300x_callback_args_t

struct rm_hs300x_callback_args_t

HS300X callback parameter definition

◆ rm_hs300x_raw_data_t

struct rm_hs300x_raw_data_t

HS300X raw data

Data Fields
uint8_t humidity[2] Upper 2 bits of 0th element are data status.
uint8_t temperature[2] Lower 2 bits of 1st element are mask.

◆ rm_hs300x_sensor_data_t

struct rm_hs300x_sensor_data_t

HS300X sensor data block

Data Fields
int16_t integer_part
int16_t decimal_part To two decimal places.

◆ rm_hs300x_data_t

struct rm_hs300x_data_t

HS300X data block

◆ rm_hs300x_cfg_t

struct rm_hs300x_cfg_t

HS300X Configuration

Data Fields

rm_comms_instance_t const * p_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_callback )(rm_hs300x_callback_args_t *p_args)
 Pointer to callback function.
 

◆ rm_hs300x_api_t

struct rm_hs300x_api_t

HS300X APIs

Data Fields

fsp_err_t(* open )(rm_hs300x_ctrl_t *const p_ctrl, rm_hs300x_cfg_t const *const p_cfg)
 
fsp_err_t(* measurementStart )(rm_hs300x_ctrl_t *const p_ctrl)
 
fsp_err_t(* read )(rm_hs300x_ctrl_t *const p_ctrl, rm_hs300x_raw_data_t *const p_raw_data)
 
fsp_err_t(* dataCalculate )(rm_hs300x_ctrl_t *const p_ctrl, rm_hs300x_raw_data_t *const p_raw_data, rm_hs300x_data_t *const p_hs300x_data)
 
fsp_err_t(* programmingModeEnter )(rm_hs300x_ctrl_t *const p_ctrl)
 
fsp_err_t(* resolutionChange )(rm_hs300x_ctrl_t *const p_ctrl, rm_hs300x_data_type_t const data_type, rm_hs300x_resolution_t const resolution)
 
fsp_err_t(* sensorIdGet )(rm_hs300x_ctrl_t *const p_ctrl, uint32_t *const p_sensor_id)
 
fsp_err_t(* programmingModeExit )(rm_hs300x_ctrl_t *const p_ctrl)
 
fsp_err_t(* close )(rm_hs300x_ctrl_t *const p_ctrl)
 

Field Documentation

◆ open

fsp_err_t(* rm_hs300x_api_t::open) (rm_hs300x_ctrl_t *const p_ctrl, rm_hs300x_cfg_t const *const p_cfg)

Open sensor.

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

◆ measurementStart

fsp_err_t(* rm_hs300x_api_t::measurementStart) (rm_hs300x_ctrl_t *const p_ctrl)

Start a measurement.

Implemented as
Parameters
[in]p_ctrlPointer to control structure.

◆ read

fsp_err_t(* rm_hs300x_api_t::read) (rm_hs300x_ctrl_t *const p_ctrl, rm_hs300x_raw_data_t *const p_raw_data)

Read ADC data from HS300X.

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

◆ dataCalculate

fsp_err_t(* rm_hs300x_api_t::dataCalculate) (rm_hs300x_ctrl_t *const p_ctrl, rm_hs300x_raw_data_t *const p_raw_data, rm_hs300x_data_t *const p_hs300x_data)

Calculate humidity and temperature values from ADC data.

Implemented as
Parameters
[in]p_ctrlPointer to control structure.
[in]p_raw_dataPointer to raw data.
[in]p_hs300x_dataPointer to HS300X data structure.

◆ programmingModeEnter

fsp_err_t(* rm_hs300x_api_t::programmingModeEnter) (rm_hs300x_ctrl_t *const p_ctrl)

Enter the programming mode.

Implemented as
Parameters
[in]p_ctrlPointer to control structure.

◆ resolutionChange

fsp_err_t(* rm_hs300x_api_t::resolutionChange) (rm_hs300x_ctrl_t *const p_ctrl, rm_hs300x_data_type_t const data_type, rm_hs300x_resolution_t const resolution)

Change the sensor resolution.

Implemented as
Parameters
[in]p_ctrlPointer to control structure.
[in]data_typeData type of HS300X.
[in]resolutionResolution type of HS300X.

◆ sensorIdGet

fsp_err_t(* rm_hs300x_api_t::sensorIdGet) (rm_hs300x_ctrl_t *const p_ctrl, uint32_t *const p_sensor_id)

Get the sensor ID.

Implemented as
Parameters
[in]p_ctrlPointer to control structure.
[in]p_sensor_idPointer to sensor ID of HS300X.

◆ programmingModeExit

fsp_err_t(* rm_hs300x_api_t::programmingModeExit) (rm_hs300x_ctrl_t *const p_ctrl)

Exit the programming mode.

Implemented as
Parameters
[in]p_ctrlPointer to control structure.

◆ close

fsp_err_t(* rm_hs300x_api_t::close) (rm_hs300x_ctrl_t *const p_ctrl)

Close HS300X.

Implemented as
Parameters
[in]p_ctrlPointer to control structure.

◆ rm_hs300x_instance_t

struct rm_hs300x_instance_t

HS300X instance

Data Fields
rm_hs300x_ctrl_t * p_ctrl

Pointer to the control structure for this instance

rm_hs300x_cfg_t const * p_cfg

Pointer to the configuration structure for this instance

rm_hs300x_api_t const * p_api

Pointer to the API structure for this instance

Typedef Documentation

◆ rm_hs300x_ctrl_t

typedef void rm_hs300x_ctrl_t

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

Implemented as

Enumeration Type Documentation

◆ rm_hs300x_event_t

Event in the callback function

◆ rm_hs300x_data_type_t

Data type of HS300X

◆ rm_hs300x_resolution_t

Resolution type of HS300X