FreeRTOS:
Common I/O
AWS IoT Common I/O library
|
Return to main page ↑ |
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... | |
#define IOT_TSENSOR_SUCCESS ( 0 ) |
Return values used by tsensor driver.
TempSensor operation completed successfully.
#define IOT_TSENSOR_INVALID_VALUE ( 1 ) |
At least one parameter is invalid.
#define IOT_TSENSOR_DISABLED ( 2 ) |
TempSensor is disabled.
#define IOT_TSENSOR_CLOSED ( 3 ) |
TempSensor instance is not open.
#define IOT_TSENSOR_GET_TEMP_FAILED ( 4 ) |
TempSensor failed to get the temperature.
#define IOT_TSENSOR_SET_FAILED ( 5 ) |
TempSensor set threshold operation failed.
#define IOT_TSENSOR_NOT_SUPPORTED ( 6 ) |
TempSensor operation not supported.
typedef void( * IotTsensorCallback_t) (IotTsensorStatus_t xStatus, void *pvUserContext) |
The callback function for completion of Tsensor operation.
[in] | xStatus | tsensor threshold reached status |
[in] | pvUserContext | user provid context |
enum IotTsensorStatus_t |
Ioctl request types.
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.
[in] | lTsensorInstance | The instance of the tsensor to initialize. The instance number is platform specific. i,e if you have more than one temperature ensors, then 2 instances point to 2 different sensors. |
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.
[in] | xTsensorHandle | Handle to tsensor driver returned in open() call |
[in] | xCallback | The callback function to be called on completion of transaction. |
[in] | pvUserContext | user provid context |
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)
[in] | xTsensorHandle | Handle to tsensor driver returned in iot_tsensor_open |
int32_t iot_tsensor_disable | ( | IotTsensorHandle_t const | xTsensorHandle | ) |
iot_tsensor_disable is used to disable the temperature sensor which stops monitoring the temperature.
[in] | xTsensorHandle | Handle to tsensor driver returned in iot_tsensor_open |
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.
[in] | xTsensorHandle | handle to tsensor driver returned in iot_tsensor_open |
[out] | plTemp | temperature read from the sensor. |
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
[in] | xTsensorHandle | handle to tsensor driver returned in iot_tsensor_open |
[in] | xRequest | configuration request. |
[in,out] | pvBuffer | buffer holding tsensor set and get values. |
int32_t iot_tsensor_close | ( | IotTsensorHandle_t const | xTsensorHandle | ) |
iot_tsensor_close is used to de-initialize Tsensor.
[in] | xTsensorHandle | handle to tsensor driver returned in iot_tsensor_open |