FreeRTOS: Common I/O
AWS IoT Common I/O library
Return to main page ↑
iot_tsensor.h File Reference

File for the APIs of TempSensor called by application layer. More...

#include <stdint.h>

Go to the source code of this file.

Macros

#define IOT_TSENSOR_SUCCESS   ( 0 )
 Return values used by tsensor driver. More...
 
#define IOT_TSENSOR_INVALID_VALUE   ( 1 )
 
#define IOT_TSENSOR_DISABLED   ( 2 )
 
#define IOT_TSENSOR_CLOSED   ( 3 )
 
#define IOT_TSENSOR_GET_TEMP_FAILED   ( 4 )
 
#define IOT_TSENSOR_SET_FAILED   ( 5 )
 
#define IOT_TSENSOR_NOT_SUPPORTED   ( 6 )
 

Typedefs

typedef struct IotTsensorDescriptor_t * IotTsensorHandle_t
 IotTsensorHandle_t type is the tsensor handle returned by calling iot_tsensor_open() this is initialized in open and returned to caller. Caller must pass this pointer to the rest of the APIs.
 
typedef void(* IotTsensorCallback_t) (IotTsensorStatus_t xStatus, void *pvUserContext)
 The callback function for completion of Tsensor operation. More...
 

Enumerations

enum  IotTsensorStatus_t { eTsensorMinThresholdReached, eTsensorMaxThresholdReached }
 tsensor threshold reached status More...
 
enum  IotTsensorIoctlRequest_t {
  eTsensorSetMinThreshold, eTsensorSetMaxThreshold, eTsensorGetMinThreshold, eTsensorGetMaxThreshold,
  eTsensorPerformCalibration
}
 Ioctl request types. More...
 

Functions

IotTsensorHandle_t iot_tsensor_open (int32_t lTsensorInstance)
 iot_tsensor_open is used to initialize the temperature sensor. It sets up the clocks and power etc, if the sensor is internal and sets up the communication channel if the sensor is external. More...
 
void iot_tsensor_set_callback (IotTsensorHandle_t const xTsensorHandle, IotTsensorCallback_t xCallback, void *pvUserContext)
 Set the callback to be called when a threshold is reached on the sensor. The caller must set the threshold level using IOCTL before the callback can be called. More...
 
int32_t iot_tsensor_enable (IotTsensorHandle_t const xTsensorHandle)
 iot_tsensor_enable is used to enable the temperature sensor to start reading the temperature and trigger thresholds (if any were set and supported) More...
 
int32_t iot_tsensor_disable (IotTsensorHandle_t const xTsensorHandle)
 iot_tsensor_disable is used to disable the temperature sensor which stops monitoring the temperature. More...
 
int32_t iot_tsensor_get_temp (IotTsensorHandle_t const xTsensorHandle, int32_t *plTemp)
 iot_tsensor_get_temp is used to get the current temperature read from the sensor. More...
 
int32_t iot_tsensor_ioctl (IotTsensorHandle_t const xTsensorHandle, IotTsensorIoctlRequest_t xRequest, void *const pvBuffer)
 iot_tsensor_ioctl is used to set tsensor configuration and tsensor properties like minimum threshold, maximum threshold value, etc. Supported IOCTL requests are defined in aws_hal_Tsensor_Ioctl_Request_t More...
 
int32_t iot_tsensor_close (IotTsensorHandle_t const xTsensorHandle)
 iot_tsensor_close is used to de-initialize Tsensor. More...
 

Detailed Description

File for the APIs of TempSensor called by application layer.