SHT40AD1B Part Drivers API Documentation - Core

This page documents the API of the Core component of the SHT40AD1B Part Drivers.

An overview of the driver is also available here: main_doc .

Functions

Functions

sht40ad1b_drv_status_t sht40ad1b_drv_init ( sht40ad1b_object_t * p_obj , uint32_t id )

initialize the SHT40AD1B sensor.

Parameters :
  • p_obj – the device instance object

  • id – the device instance id

Return values :

SHT40AD1B_OK – in case of success, SHT40AD1B_ERROR otherwise

sht40ad1b_drv_status_t sht40ad1b_drv_get_humidity ( sht40ad1b_object_t * p_obj , float_t * p_value )

get the SHT40AD1B humidity value.

Parameters :
  • p_obj – the device instance object

  • p_value – pointer where the humidity value is written

Return values :

SHT40AD1B_OK – in case of success, SHT40AD1B_ERROR otherwise

sht40ad1b_drv_status_t sht40ad1b_drv_get_temperature ( sht40ad1b_object_t * p_obj , float_t * p_value )

get the SHT40AD1B temperature value.

Parameters :
  • p_obj – the device instance object

  • p_value – pointer where the temperature value is written

Return values :

SHT40AD1B_OK – in case of success, SHT40AD1B_ERROR otherwise

sht40ad1b_drv_status_t sht40ad1b_serial_get ( sht40ad1b_object_t * p_obj , uint32_t * p_buffer )

get sensor serial number.

Parameters :
  • p_obj – the device instance object

  • p_serial – pointer to uint32_t where serial number will be stored

Return values :

0 – in case of success, 1 otherwise

Types

Enums

enum sht40ad1b_drv_status_t

Driver status.

Values:

enumerator SHT40AD1B_OK

Success

enumerator SHT40AD1B_ERROR

Error

Typedefs

typedef struct sht40ad1b_object_s sht40ad1b_object_t

SHT40AD1B object structure type

struct sht40ad1b_object_s

SHT40AD1B object structure.

Public Members

sht40ad1b_io_t io_ctx

IO context

enum sht40ad1b_drv_status_t

Driver status.

Values:

enumerator SHT40AD1B_OK

Success

enumerator SHT40AD1B_ERROR

Error

union sht40ad1b_axis3bit16_t
#include <sht40ad1b.h>

3-axis 16-bit union.

Public Members

int16_t i16bit [ 3 ]

Signed data

uint8_t u8bit [ 6 ]

Raw bytes

union sht40ad1b_axis1bit16_t
#include <sht40ad1b.h>

1-axis 16-bit union.

Public Members

int16_t i16bit

Signed data

uint8_t u8bit [ 2 ]

Raw bytes

union sht40ad1b_axis3bit32_t
#include <sht40ad1b.h>

3-axis 32-bit union.

Public Members

int32_t i32bit [ 3 ]

Signed data

uint8_t u8bit [ 12 ]

Raw bytes

union sht40ad1b_axis1bit32_t
#include <sht40ad1b.h>

1-axis 32-bit union.

Public Members

int32_t i32bit

Signed data

uint8_t u8bit [ 4 ]

Raw bytes

Constants and macros

Defines

SHT40AD1B_HUMIDITY_MAX 100.0f

Maximum humidity value

SHT40AD1B_I2C_BUS 0U

I2C bus ID

SHT40AD1B_I2C_ADDRESS 0x89U

I2C address