Upload
others
View
5
Download
0
Embed Size (px)
Citation preview
Si7013 Device Driver1.2
Generated by Doxygen 1.8.11
Contents
1 Introduction 1
2 Module Index 3
2.1 Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
3 Data Structure Index 5
3.1 Data Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
4 Module Documentation 7
4.1 Generic Humidity Sensor API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
4.1.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4.1.2 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4.1.3 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4.1.3.1 humidity_sensor_api_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4.1.3.2 humidity_sensor_cfg_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4.1.3.3 humidity_sensor_ctrl_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4.1.3.4 humidity_sensor_info_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4.1.3.5 humidity_sensor_instance_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4.2 Framework Layer Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
4.2.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.2.2 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.2.3 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.2.3.1 r_si7013_cfg_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.2.3.2 r_si7013_ctrl_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.2.3.3 r_si7013_info_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
iv CONTENTS
4.2.4 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.2.4.1 R_SI7013_Close(r_si7013_ctrl_t ∗const p_ctrl) . . . . . . . . . . . . . . . . . . 10
4.2.4.2 R_SI7013_Open(r_si7013_ctrl_t ∗const p_ctrl, r_si7013_cfg_t const ∗const p_cfg) 10
4.2.4.3 R_SI7013_ReadHumidity(r_si7013_ctrl_t ∗const p_ctrl, float ∗humidity) . . . . . 11
4.2.4.4 R_SI7013_ReadInfo(r_si7013_ctrl_t ∗const p_ctrl, r_si7013_info_t ∗info) . . . . 11
4.2.4.5 R_SI7013_ReadTemperature(r_si7013_ctrl_t ∗const p_ctrl, float ∗temperature) . 12
4.2.4.6 R_SI7013_Reset(r_si7013_ctrl_t ∗const p_ctrl) . . . . . . . . . . . . . . . . . . 12
4.2.4.7 R_SI7013_VersionGet(ssp_version_t ∗const p_version, bool from_temp_int) . . 12
4.2.5 Variable Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.2.5.1 g_r_si7013_temperature_api . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.3 Build Time Configurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.3.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.3.2 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.3.2.1 R_SI7013_CFG_PARAM_CHECKING_ENABLE . . . . . . . . . . . . . . . . . 14
4.3.2.2 THREADX_TICK_RATE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.4 Generic Temperature Sensor API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.4.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.4.2 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.4.3 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.4.3.1 temperature_sensor_api_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.4.3.2 temperature_sensor_cfg_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4.4.3.3 temperature_sensor_ctrl_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4.4.3.4 temperature_sensor_info_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4.4.3.5 temperature_sensor_instance_t . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Generated by Doxygen
CONTENTS v
5 Data Structure Documentation 17
5.1 st_humidity_sensor_api Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5.1.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5.1.2 Field Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5.1.2.1 close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5.1.2.2 open . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
5.1.2.3 readHumidity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
5.1.2.4 readInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
5.1.2.5 reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
5.1.2.6 versionGet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
5.2 st_humidity_sensor_cfg Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
5.2.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
5.2.2 Field Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
5.2.2.1 p_extend_cfg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
5.3 st_humidity_sensor_ctrl Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
5.3.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
5.3.2 Field Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
5.3.2.1 p_extend_ctrl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
5.4 st_humidity_sensor_info Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
5.4.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
5.5 st_humidity_sensor_instance Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
5.5.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
5.6 st_r_si7013_cfg Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
5.6.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
5.7 st_r_si7013_ctrl Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
5.7.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
5.8 st_r_si7013_info Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
5.8.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
5.9 st_temperature_sensor_api Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
5.9.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Generated by Doxygen
vi CONTENTS
5.9.2 Field Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
5.9.2.1 close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
5.9.2.2 open . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
5.9.2.3 readInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
5.9.2.4 readTemperature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
5.9.2.5 reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
5.9.2.6 versionGet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
5.10 st_temperature_sensor_cfg Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
5.10.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
5.10.2 Field Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
5.10.2.1 p_extend_cfg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
5.11 st_temperature_sensor_ctrl Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
5.11.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
5.11.2 Field Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
5.11.2.1 p_extend_ctrl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
5.12 st_temperature_sensor_info Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
5.12.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
5.13 st_temperature_sensor_instance Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 27
5.13.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Index 29
Generated by Doxygen
Chapter 1
Introduction
The driver is composed of:
• a temperature sensor generic interface;
• a humidity sensor generic interface;
• a specific implementation for the Si7013 device.
As a humidity and temperature sensor, these are the implemented functionalities:
• Read the temperature
• Read the humidity
2 Introduction
Generated by Doxygen
Chapter 2
Module Index
2.1 Modules
Here is a list of all modules:
Generic Humidity Sensor API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7Framework Layer Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Build Time Configurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Generic Temperature Sensor API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4 Module Index
Generated by Doxygen
Chapter 3
Data Structure Index
3.1 Data Structures
Here are the data structures with brief descriptions:
st_humidity_sensor_api . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17st_humidity_sensor_cfg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19st_humidity_sensor_ctrl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20st_humidity_sensor_info . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20st_humidity_sensor_instance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20st_r_si7013_cfg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21st_r_si7013_ctrl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21st_r_si7013_info . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22st_temperature_sensor_api . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22st_temperature_sensor_cfg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25st_temperature_sensor_ctrl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26st_temperature_sensor_info . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26st_temperature_sensor_instance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
6 Data Structure Index
Generated by Doxygen
Chapter 4
Module Documentation
4.1 Generic Humidity Sensor API
Interface for a generic humidity sensor device.
Data Structures
• struct st_humidity_sensor_info
• struct st_humidity_sensor_cfg
• struct st_humidity_sensor_ctrl
• struct st_humidity_sensor_api
• struct st_humidity_sensor_instance
Macros
• #define HUMIDITY_SENSOR_API_VERSION_MAJOR (1)
• #define HUMIDITY_SENSOR_API_VERSION_MINOR (2)
• #define HUMIDITY_SENSOR_INFO_SIZE (12)
Length of the allocated buffer for the sensor info.
Typedefs
• typedef struct st_humidity_sensor_info humidity_sensor_info_t
• typedef struct st_humidity_sensor_cfg humidity_sensor_cfg_t
• typedef struct st_humidity_sensor_ctrl humidity_sensor_ctrl_t
• typedef struct st_humidity_sensor_api humidity_sensor_api_t
• typedef struct st_humidity_sensor_instance humidity_sensor_instance_t
8 Module Documentation
4.1.1 Detailed Description
4.1.2 Summary
The Humidity Sensor Interface provides a common API for a generic humidity sensor's driver. The interfacesupports:
• Read the humidity.
• Read the device information.
Implemented as:
• Framework Layer Driver
4.1.3 Typedef Documentation
4.1.3.1 typedef struct st_humidity_sensor_api humidity_sensor_api_t
Humidity Sensor Driver API structure.
4.1.3.2 typedef struct st_humidity_sensor_cfg humidity_sensor_cfg_t
Humidity Sensor Driver configuration block.
4.1.3.3 typedef struct st_humidity_sensor_ctrl humidity_sensor_ctrl_t
Humidity Sensor Driver control block. DO NOT INITIALIZE
4.1.3.4 typedef struct st_humidity_sensor_info humidity_sensor_info_t
Device Info struct
4.1.3.5 typedef struct st_humidity_sensor_instance humidity_sensor_instance_t
This structure encompasses everything that is needed to use an instance of this interface.
Generated by Doxygen
4.2 Framework Layer Driver 9
4.2 Framework Layer Driver
Framework layer driver implementation for Si7013 Temperature and Humidity sensor.
Modules
• Build Time Configurations
Data Structures
• struct st_r_si7013_ctrl• struct st_r_si7013_cfg• struct st_r_si7013_info
Macros
• #define R_SI7013_CODE_VERSION_MAJOR (1)• #define R_SI7013_CODE_VERSION_MINOR (2)
Typedefs
• typedef struct st_r_si7013_ctrl r_si7013_ctrl_t• typedef struct st_r_si7013_cfg r_si7013_cfg_t• typedef struct st_r_si7013_info r_si7013_info_t
Functions
• ssp_err_t R_SI7013_Open (r_si7013_ctrl_t ∗const p_ctrl, r_si7013_cfg_t const ∗const p_cfg)
Implements: temperature_sensor_api_t::open, humidity_sensor_api_t::open.
• ssp_err_t R_SI7013_ReadTemperature (r_si7013_ctrl_t ∗const p_ctrl, float ∗temperature)
Implements temperature_sensor_api_t::readTemperature.
• ssp_err_t R_SI7013_ReadHumidity (r_si7013_ctrl_t ∗const p_ctrl, float ∗humidity)
Implements humidity_sensor_api_t::readHumidity.
• ssp_err_t R_SI7013_Reset (r_si7013_ctrl_t ∗const p_ctrl)
Implements: temperature_sensor_api_t::reset, humidity_sensor_api_t::reset.
• ssp_err_t R_SI7013_Close (r_si7013_ctrl_t ∗const p_ctrl)
Implements: temperature_sensor_api_t::close, humidity_sensor_api_t::close.
• ssp_err_t R_SI7013_VersionGet (ssp_version_t ∗const p_version, bool from_temp_int)
Implements: temperature_sensor_api_t::versionGet, humidity_sensor_api_t::versionGet.
• ssp_err_t R_SI7013_ReadInfo (r_si7013_ctrl_t ∗const p_ctrl, r_si7013_info_t ∗info)
Implements: temperature_sensor_api_t::readDevInfo, humidity_sensor_api_t::readDevInfo.
Variables
• const temperature_sensor_api_t g_r_si7013_temperature_api• const humidity_sensor_api_t g_r_si7013_humidity_api
Generated by Doxygen
10 Module Documentation
4.2.1 Detailed Description
4.2.2 Summary
This is the framework driver implemented for Si7013 external Temperature and Humidity sensor.
4.2.3 Typedef Documentation
4.2.3.1 typedef struct st_r_si7013_cfg r_si7013_cfg_t
Configuration for RTOS integrated Si7013 Driver.
4.2.3.2 typedef struct st_r_si7013_ctrl r_si7013_ctrl_t
Channel control block. DO NOT INITIALIZE. Initialization occurs when R_SI7013_Open is called
4.2.3.3 typedef struct st_r_si7013_info r_si7013_info_t
Device Info struct
4.2.4 Function Documentation
4.2.4.1 ssp_err_t R_SI7013_Close ( r_si7013_ctrl_t ∗const p_ctrl )
Return values
SSP_SUCCESS Si7013 instance successfully closed.
SSP_ERR_ASSERTION Parameter p_ctrl was NULL, or a lower level driver reported this error.
SSP_ERR_NOT_OPEN Driver is not configured. Call R_SI7013_Open.
Returns
See Common_Error_Codes or lower level drivers for other possible return codes.
Note
This function is reentrant for any panel.
Close I2C Framework Device.
4.2.4.2 ssp_err_t R_SI7013_Open ( r_si7013_ctrl_t ∗const p_ctrl, r_si7013_cfg_t const ∗const p_cfg )
Generated by Doxygen
4.2 Framework Layer Driver 11
Return values
SSP_SUCCESS Lower level drivers opened successfully.
SSP_ERR_ASSERTION A pointer parameter was NULL, or a lower level driver reported this error.
Returns
See Common_Error_Codes or lower level drivers for other possible return codes.
Note
This function is reentrant for any panel.
Asserts for info buffers size check
Store user configurations in control block.
Open I2C Framework Device.
4.2.4.3 ssp_err_t R_SI7013_ReadHumidity ( r_si7013_ctrl_t ∗const p_ctrl, float ∗ humidity )
Return values
SSP_SUCCESS Relative humidity read successfully.
SSP_ERR_ASSERTION A pointer parameter was NULL, or a lower level driver reported this error.
SSP_ERR_NOT_OPEN Driver is not configured. Call R_SI7013_Open.
SSP_ERR_ABORTED CRC check failed.
Returns
See Common_Error_Codes or lower level drivers for other possible return codes.
Note
This function is reentrant for any panel.
4.2.4.4 ssp_err_t R_SI7013_ReadInfo ( r_si7013_ctrl_t ∗const p_ctrl, r_si7013_info_t ∗ info )
Return values
SSP_SUCCESS Si7013 serial numbers and firmware version read successfully.
SSP_ERR_ASSERTION A pointer parameter was NULL, or a lower level driver reported this error.
SSP_ERR_NOT_OPEN Driver is not configured. Call R_SI7013_Open.
SSP_ERR_ABORTED CRC check failed.
Generated by Doxygen
12 Module Documentation
Returns
See Common_Error_Codes or lower level drivers for other possible return codes.
Note
This function is reentrant for any panel.
4.2.4.5 ssp_err_t R_SI7013_ReadTemperature ( r_si7013_ctrl_t ∗const p_ctrl, float ∗ temperature )
Return values
SSP_SUCCESS Temperature read successfully.
SSP_ERR_ASSERTION A pointer parameter was NULL, or a lower level driver reported this error.
SSP_ERR_NOT_OPEN Driver is not configured. Call R_SI7013_Open.
SSP_ERR_ABORTED CRC check failed.
Returns
See Common_Error_Codes or lower level drivers for other possible return codes.
Note
This function is reentrant for any panel.
4.2.4.6 ssp_err_t R_SI7013_Reset ( r_si7013_ctrl_t ∗const p_ctrl )
Return values
SSP_SUCCESS SI7013 was reset successfully.
SSP_ERR_ASSERTION Parameter p_ctrl was NULL, or a lower level driver reported this error.
SSP_ERR_NOT_OPEN Driver is not configured. Call R_SI7013_Open.
Returns
See Common_Error_Codes or lower level drivers for other possible return codes.
Note
This function is reentrant for any panel.
4.2.4.7 ssp_err_t R_SI7013_VersionGet ( ssp_version_t ∗const p_version, bool from_temp_int )
Return values
SSP_SUCCESS Version returned successfully.
SSP_ERR_ASSERTION Parameter p_version was NULL.
Generated by Doxygen
4.2 Framework Layer Driver 13
Returns
See Common_Error_Codes.
4.2.5 Variable Documentation
4.2.5.1 const temperature_sensor_api_t g_r_si7013_temperature_api
Filled in Interface API structures for this Instance.
Generated by Doxygen
14 Module Documentation
4.3 Build Time Configurations
Macros
• #define R_SI7013_CFG_PARAM_CHECKING_ENABLE (BSP_CFG_PARAM_CHECKING_ENABLE)• #define THREADX_TICK_RATE (TX_TIMER_TICKS_PER_SECOND)
4.3.1 Detailed Description
4.3.2 Macro Definition Documentation
4.3.2.1 #define R_SI7013_CFG_PARAM_CHECKING_ENABLE (BSP_CFG_PARAM_CHECKING_ENABLE)
Specify whether to include code for API parameter checking. Valid settings include:
• BSP_CFG_PARAM_CHECKING_ENABLE : Utilizes the system default setting from bsp_cfg.h
• 1 : Includes parameter checking
• 0 : Compiles out parameter checking
4.3.2.2 #define THREADX_TICK_RATE (TX_TIMER_TICKS_PER_SECOND)
Specify RTOS tick rate, used for delays computation.
Generated by Doxygen
4.4 Generic Temperature Sensor API 15
4.4 Generic Temperature Sensor API
Interface for a generic temperature sensor device.
Data Structures
• struct st_temperature_sensor_info• struct st_temperature_sensor_cfg• struct st_temperature_sensor_ctrl• struct st_temperature_sensor_api• struct st_temperature_sensor_instance
Macros
• #define TEMPERATURE_SENSOR_API_VERSION_MAJOR (1)• #define TEMPERATURE_SENSOR_API_VERSION_MINOR (2)• #define TEMPERATURE_SENSOR_INFO_SIZE (12)
Length of the allocated buffer for the sensor info.
Typedefs
• typedef struct st_temperature_sensor_info temperature_sensor_info_t• typedef struct st_temperature_sensor_cfg temperature_sensor_cfg_t• typedef struct st_temperature_sensor_ctrl temperature_sensor_ctrl_t• typedef struct st_temperature_sensor_api temperature_sensor_api_t• typedef struct st_temperature_sensor_instance temperature_sensor_instance_t
4.4.1 Detailed Description
4.4.2 Summary
The Temperature Sensor Interface provides a common API for a generic temperature sensor's driver. The interfacesupports:
• Read the temperature.
• Read the device information.
Implemented as:
• Framework Layer Driver
4.4.3 Typedef Documentation
4.4.3.1 typedef struct st_temperature_sensor_api temperature_sensor_api_t
Temperature Sensor Driver API structure.
Generated by Doxygen
16 Module Documentation
4.4.3.2 typedef struct st_temperature_sensor_cfg temperature_sensor_cfg_t
Temperature Sensor Driver configuration block.
4.4.3.3 typedef struct st_temperature_sensor_ctrl temperature_sensor_ctrl_t
Temperature Sensor Driver control block. DO NOT INITIALIZE
4.4.3.4 typedef struct st_temperature_sensor_info temperature_sensor_info_t
Device Info struct
4.4.3.5 typedef struct st_temperature_sensor_instance temperature_sensor_instance_t
This structure encompasses everything that is needed to use an instance of this interface.
Generated by Doxygen
Chapter 5
Data Structure Documentation
5.1 st_humidity_sensor_api Struct Reference
#include <humidity_sensor_api.h>
Data Fields
• ssp_err_t(∗ open )(humidity_sensor_ctrl_t ∗const p_ctrl, humidity_sensor_cfg_t const ∗const p_cfg)• ssp_err_t(∗ readHumidity )(humidity_sensor_ctrl_t ∗const p_ctrl, float ∗humidity)• ssp_err_t(∗ reset )(humidity_sensor_ctrl_t ∗const p_ctrl)• ssp_err_t(∗ close )(humidity_sensor_ctrl_t ∗const p_ctrl)• ssp_err_t(∗ versionGet )(ssp_version_t ∗const p_version)• ssp_err_t(∗ readInfo )(humidity_sensor_ctrl_t ∗const p_ctrl, humidity_sensor_info_t ∗info)
5.1.1 Detailed Description
Humidity Sensor Driver API structure.
5.1.2 Field Documentation
5.1.2.1 ssp_err_t(∗ close) (humidity_sensor_ctrl_t ∗const p_ctrl)
Close I2C channel at Framework layer.
Implemented as
• R_SI7013_H_Close()
Parameters
in p_ctrl Pointer to control block set in humidity_sensor_api_t::open.
18 Data Structure Documentation
5.1.2.2 ssp_err_t(∗ open) (humidity_sensor_ctrl_t ∗const p_ctrl, humidity_sensor_cfg_t const ∗const p_cfg)
Open Lower Level Driver and initialize internal constant values.
Implemented as
• R_SI7013_H_Open()
Parameters
in,out p_ctrl Pointer to a structure allocated by user. This control structure is initialized in this function.
in p_cfg Pointer to configuration structure. All elements of the structure must be set by user.
5.1.2.3 ssp_err_t(∗ readHumidity) (humidity_sensor_ctrl_t ∗const p_ctrl, float ∗humidity)
Begin single humidity sampling. Measured value in the relative humidity.
Implemented as
• R_SI7013_H_ReadHumidity()
Parameters
in p_ctrl Pointer to control block set in humidity_sensor_api_t::open.
in humidity Pointer in which the humidity value will be stored [%].
5.1.2.4 ssp_err_t(∗ readInfo) (humidity_sensor_ctrl_t ∗const p_ctrl, humidity_sensor_info_t ∗info)
Read Firmware version, Serial Numbers or others device specific information.
Implemented as
• R_SI7013_H_ReadInfo()
Parameters
in p_ctrl Pointer to control block set in humidity_sensor_api_t::open.
in info Pointer to the struct in which the device information will be stored.
5.1.2.5 ssp_err_t(∗ reset) (humidity_sensor_ctrl_t ∗const p_ctrl)
Reset device.
Implemented as
• R_SI7013_H_Reset()
Generated by Doxygen
5.2 st_humidity_sensor_cfg Struct Reference 19
Parameters
in p_ctrl Pointer to control block set in humidity_sensor_api_t::open.
5.1.2.6 ssp_err_t(∗ versionGet) (ssp_version_t ∗const p_version)
Gets version and stores it in provided pointer p_version.
Implemented as
• R_SI7013_H_VersionGet()
Parameters
out p_version Code and API version used stored here.
The documentation for this struct was generated from the following file:
• humidity_sensor_api.h
5.2 st_humidity_sensor_cfg Struct Reference
#include <humidity_sensor_api.h>
Data Fields
• void const ∗ p_extend_cfg
Pointer to the implementation specific configuration data.
• void const ∗const p_extend_ctrl
Pointer to the implementation specific control block.
5.2.1 Detailed Description
Humidity Sensor Driver configuration block.
5.2.2 Field Documentation
5.2.2.1 void const∗ p_extend_cfg
Implementation-specific configuration
The documentation for this struct was generated from the following file:
• humidity_sensor_api.h
Generated by Doxygen
20 Data Structure Documentation
5.3 st_humidity_sensor_ctrl Struct Reference
#include <humidity_sensor_api.h>
Data Fields
• void const ∗ p_extend_ctrl
Pointer to the implementation specific control block.
5.3.1 Detailed Description
Humidity Sensor Driver control block. DO NOT INITIALIZE
5.3.2 Field Documentation
5.3.2.1 void const∗ p_extend_ctrl
Implementation-specific configuration
The documentation for this struct was generated from the following file:
• humidity_sensor_api.h
5.4 st_humidity_sensor_info Struct Reference
#include <humidity_sensor_api.h>
Data Fields
• uint8_t buffer [HUMIDITY_SENSOR_INFO_SIZE]
Device specific info (to be casted)
5.4.1 Detailed Description
Device Info struct
The documentation for this struct was generated from the following file:
• humidity_sensor_api.h
5.5 st_humidity_sensor_instance Struct Reference
#include <humidity_sensor_api.h>
Generated by Doxygen
5.6 st_r_si7013_cfg Struct Reference 21
Data Fields
• humidity_sensor_ctrl_t ∗ p_ctrl
Pointer to the control structure for this instance.
• humidity_sensor_cfg_t const ∗ p_cfg
Pointer to the configuration structure for this instance.
• humidity_sensor_api_t const ∗ p_api
Pointer to the API structure for this instance.
5.5.1 Detailed Description
This structure encompasses everything that is needed to use an instance of this interface.
The documentation for this struct was generated from the following file:
• humidity_sensor_api.h
5.6 st_r_si7013_cfg Struct Reference
#include <r_si7013_api.h>
Data Fields
• const sf_i2c_instance_t ∗ device
I2C Framework Device.
5.6.1 Detailed Description
Configuration for RTOS integrated Si7013 Driver.
The documentation for this struct was generated from the following file:
• r_si7013_api.h
5.7 st_r_si7013_ctrl Struct Reference
#include <r_si7013_api.h>
Data Fields
• uint32_t temp_open
Used by driver to check if temperature interface is open.
• uint32_t hum_open
Used by driver to check if humidity interface is open.
• const sf_i2c_instance_t ∗ device
I2C Framework Device.
Generated by Doxygen
22 Data Structure Documentation
5.7.1 Detailed Description
Channel control block. DO NOT INITIALIZE. Initialization occurs when R_SI7013_Open is called
The documentation for this struct was generated from the following file:
• r_si7013_api.h
5.8 st_r_si7013_info Struct Reference
#include <r_si7013_api.h>
Data Fields
• uint8_t fw_ver
Firmware Version.
• uint32_t sn_a
Serial Number part A.
• uint32_t sn_b
Serial Number part B.
5.8.1 Detailed Description
Device Info struct
The documentation for this struct was generated from the following file:
• r_si7013_api.h
5.9 st_temperature_sensor_api Struct Reference
#include <temperature_sensor_api.h>
Data Fields
• ssp_err_t(∗ open )(temperature_sensor_ctrl_t ∗const p_ctrl, temperature_sensor_cfg_t const ∗const p_cfg)• ssp_err_t(∗ readTemperature )(temperature_sensor_ctrl_t ∗const p_ctrl, float ∗temperature)• ssp_err_t(∗ reset )(temperature_sensor_ctrl_t ∗const p_ctrl)• ssp_err_t(∗ close )(temperature_sensor_ctrl_t ∗const p_ctrl)• ssp_err_t(∗ versionGet )(ssp_version_t ∗const p_version)• ssp_err_t(∗ readInfo )(temperature_sensor_ctrl_t ∗const p_ctrl, temperature_sensor_info_t ∗info)
5.9.1 Detailed Description
Temperature Sensor Driver API structure.
Generated by Doxygen
5.9 st_temperature_sensor_api Struct Reference 23
5.9.2 Field Documentation
5.9.2.1 ssp_err_t(∗ close) (temperature_sensor_ctrl_t ∗const p_ctrl)
Close I2C channel at Framework layer.
Implemented as
• R_SI7013_T_Close()
Generated by Doxygen
24 Data Structure Documentation
Parameters
in p_ctrl Pointer to control block set in temperature_sensor_api_t::open.
5.9.2.2 ssp_err_t(∗ open) (temperature_sensor_ctrl_t ∗const p_ctrl, temperature_sensor_cfg_t const ∗const p_cfg)
Open Lower Level Driver and initialize internal constant values.
Implemented as
• R_SI7013_T_Open()
Parameters
in,out p_ctrl Pointer to a structure allocated by user. This control structure is initialized in this function.
in p_cfg Pointer to configuration structure. All elements of the structure must be set by user.
5.9.2.3 ssp_err_t(∗ readInfo) (temperature_sensor_ctrl_t ∗const p_ctrl, temperature_sensor_info_t ∗info)
Read Firmware version, Serial Numbers or others device specific information.
Implemented as
• R_SI7013_T_ReadInfo()
Parameters
in p_ctrl Pointer to control block set in temperature_sensor_api_t::open.
in info Pointer to the struct in which the device information will be stored.
5.9.2.4 ssp_err_t(∗ readTemperature) (temperature_sensor_ctrl_t ∗const p_ctrl, float ∗temperature)
Begin single temperature sampling. Measured value will be expressed in Celsius degree.
Implemented as
• R_SI7013_T_ReadTemperature()
Parameters
in p_ctrl Pointer to control block set in temperature_sensor_api_t::open.
in temperature Pointer in which the temperature value will be stored [°C].
Generated by Doxygen
5.10 st_temperature_sensor_cfg Struct Reference 25
5.9.2.5 ssp_err_t(∗ reset) (temperature_sensor_ctrl_t ∗const p_ctrl)
Reset device.
Implemented as
• R_SI7013_T_Reset()
Parameters
in p_ctrl Pointer to control block set in temperature_sensor_api_t::open.
5.9.2.6 ssp_err_t(∗ versionGet) (ssp_version_t ∗const p_version)
Gets version and stores it in provided pointer p_version.
Implemented as
• R_SI7013_T_VersionGet()
Parameters
out p_version Code and API version used stored here.
The documentation for this struct was generated from the following file:
• temperature_sensor_api.h
5.10 st_temperature_sensor_cfg Struct Reference
#include <temperature_sensor_api.h>
Data Fields
• void const ∗ p_extend_cfg
Pointer to the implementation specific configuration data.
• void const ∗const p_extend_ctrl
Pointer to the implementation specific control block.
5.10.1 Detailed Description
Temperature Sensor Driver configuration block.
Generated by Doxygen
26 Data Structure Documentation
5.10.2 Field Documentation
5.10.2.1 void const∗ p_extend_cfg
Implementation-specific configuration
The documentation for this struct was generated from the following file:
• temperature_sensor_api.h
5.11 st_temperature_sensor_ctrl Struct Reference
#include <temperature_sensor_api.h>
Data Fields
• void const ∗ p_extend_ctrl
Pointer to the implementation specific control block.
5.11.1 Detailed Description
Temperature Sensor Driver control block. DO NOT INITIALIZE
5.11.2 Field Documentation
5.11.2.1 void const∗ p_extend_ctrl
Implementation-specific configuration
The documentation for this struct was generated from the following file:
• temperature_sensor_api.h
5.12 st_temperature_sensor_info Struct Reference
#include <temperature_sensor_api.h>
Data Fields
• uint8_t buffer [TEMPERATURE_SENSOR_INFO_SIZE]
Device specific info (to be casted)
Generated by Doxygen
5.13 st_temperature_sensor_instance Struct Reference 27
5.12.1 Detailed Description
Device Info struct
The documentation for this struct was generated from the following file:
• temperature_sensor_api.h
5.13 st_temperature_sensor_instance Struct Reference
#include <temperature_sensor_api.h>
Data Fields
• temperature_sensor_ctrl_t ∗ p_ctrl
Pointer to the control structure for this instance.
• temperature_sensor_cfg_t const ∗ p_cfg
Pointer to the configuration structure for this instance.
• temperature_sensor_api_t const ∗ p_api
Pointer to the API structure for this instance.
5.13.1 Detailed Description
This structure encompasses everything that is needed to use an instance of this interface.
The documentation for this struct was generated from the following file:
• temperature_sensor_api.h
Generated by Doxygen
28 Data Structure Documentation
Generated by Doxygen
Index
Build Time Configurations, 14R_SI7013_CFG_PARAM_CHECKING_ENABLE,
14THREADX_TICK_RATE, 14
closest_humidity_sensor_api, 17st_temperature_sensor_api, 23
Framework Layer Driver, 9g_r_si7013_temperature_api, 13R_SI7013_Close, 10R_SI7013_Open, 10R_SI7013_ReadHumidity, 11R_SI7013_ReadInfo, 11R_SI7013_ReadTemperature, 12R_SI7013_Reset, 12R_SI7013_VersionGet, 12r_si7013_cfg_t, 10r_si7013_ctrl_t, 10r_si7013_info_t, 10
g_r_si7013_temperature_apiFramework Layer Driver, 13
Generic Humidity Sensor API, 7humidity_sensor_api_t, 8humidity_sensor_cfg_t, 8humidity_sensor_ctrl_t, 8humidity_sensor_info_t, 8humidity_sensor_instance_t, 8
Generic Temperature Sensor API, 15temperature_sensor_api_t, 15temperature_sensor_cfg_t, 15temperature_sensor_ctrl_t, 16temperature_sensor_info_t, 16temperature_sensor_instance_t, 16
humidity_sensor_api_tGeneric Humidity Sensor API, 8
humidity_sensor_cfg_tGeneric Humidity Sensor API, 8
humidity_sensor_ctrl_tGeneric Humidity Sensor API, 8
humidity_sensor_info_tGeneric Humidity Sensor API, 8
humidity_sensor_instance_tGeneric Humidity Sensor API, 8
openst_humidity_sensor_api, 17st_temperature_sensor_api, 24
p_extend_cfgst_humidity_sensor_cfg, 19st_temperature_sensor_cfg, 26
p_extend_ctrlst_humidity_sensor_ctrl, 20st_temperature_sensor_ctrl, 26
R_SI7013_CFG_PARAM_CHECKING_ENABLEBuild Time Configurations, 14
R_SI7013_CloseFramework Layer Driver, 10
R_SI7013_OpenFramework Layer Driver, 10
R_SI7013_ReadHumidityFramework Layer Driver, 11
R_SI7013_ReadInfoFramework Layer Driver, 11
R_SI7013_ReadTemperatureFramework Layer Driver, 12
R_SI7013_ResetFramework Layer Driver, 12
R_SI7013_VersionGetFramework Layer Driver, 12
r_si7013_cfg_tFramework Layer Driver, 10
r_si7013_ctrl_tFramework Layer Driver, 10
r_si7013_info_tFramework Layer Driver, 10
readHumidityst_humidity_sensor_api, 18
readInfost_humidity_sensor_api, 18st_temperature_sensor_api, 24
readTemperaturest_temperature_sensor_api, 24
resetst_humidity_sensor_api, 18st_temperature_sensor_api, 24
st_humidity_sensor_api, 17close, 17open, 17readHumidity, 18readInfo, 18reset, 18versionGet, 19
st_humidity_sensor_cfg, 19p_extend_cfg, 19
st_humidity_sensor_ctrl, 20
30 INDEX
p_extend_ctrl, 20st_humidity_sensor_info, 20st_humidity_sensor_instance, 20st_r_si7013_cfg, 21st_r_si7013_ctrl, 21st_r_si7013_info, 22st_temperature_sensor_api, 22
close, 23open, 24readInfo, 24readTemperature, 24reset, 24versionGet, 25
st_temperature_sensor_cfg, 25p_extend_cfg, 26
st_temperature_sensor_ctrl, 26p_extend_ctrl, 26
st_temperature_sensor_info, 26st_temperature_sensor_instance, 27
THREADX_TICK_RATEBuild Time Configurations, 14
temperature_sensor_api_tGeneric Temperature Sensor API, 15
temperature_sensor_cfg_tGeneric Temperature Sensor API, 15
temperature_sensor_ctrl_tGeneric Temperature Sensor API, 16
temperature_sensor_info_tGeneric Temperature Sensor API, 16
temperature_sensor_instance_tGeneric Temperature Sensor API, 16
versionGetst_humidity_sensor_api, 19st_temperature_sensor_api, 25
Generated by Doxygen