LibDriver ENS160
Loading...
Searching...
No Matches
ens160 basic driver function

ens160 basic driver modules More...

Collaboration diagram for ens160 basic driver function:

Data Structures

struct  ens160_handle_s
 ens160 handle structure definition More...
struct  ens160_info_s
 ens160 information structure definition More...

Typedefs

typedef struct ens160_handle_s ens160_handle_t
 ens160 handle structure definition
typedef struct ens160_info_s ens160_info_t
 ens160 information structure definition

Enumerations

enum  ens160_interface_t { ENS160_INTERFACE_IIC = 0x00 , ENS160_INTERFACE_SPI = 0x01 }
 ens160 interface enumeration definition More...
enum  ens160_address_t { ENS160_ADDRESS_0 = (0x52 << 1) , ENS160_ADDRESS_1 = (0x53 << 1) }
 ens160 address enumeration definition More...
enum  ens160_bool_t { ENS160_BOOL_FALSE = 0x00 , ENS160_BOOL_TRUE = 0x01 }
 ens160 bool enumeration definition More...
enum  ens160_mode_t { ENS160_MODE_DEEP_SLEEP = 0x00 , ENS160_MODE_IDLE = 0x01 , ENS160_MODE_STANDARD = 0x02 }
 ens160 mode enumeration definition More...
enum  ens160_pin_polarity_t { ENS160_PIN_POLARITY_LOW = 0x00 , ENS160_PIN_POLARITY_HIGH = 0x01 }
 ens160 pin polarity enumeration definition More...
enum  ens160_pin_drive_t { ENS160_PIN_DRIVE_OPEN_DRAIN = 0x00 , ENS160_PIN_DRIVE_PUSH_PULL = 0x01 }
 ens160 pin drive enumeration definition More...
enum  ens160_status_t {
  ENS160_STATUS_RUNNING = (1 << 7) , ENS160_STATUS_ERROR = (1 << 6) , ENS160_STATUS_NORMAL = (0 << 2) , ENS160_STATUS_WARM_UP = (1 << 2) ,
  ENS160_STATUS_START_UP = (2 << 2) , ENS160_STATUS_INVALID = (3 << 2) , ENS160_STATUS_NEWDAT = (1 << 1) , ENS160_STATUS_NEWGPR = (1 << 0)
}
 ens160 status enumeration definition More...

Functions

uint8_t ens160_info (ens160_info_t *info)
 get chip's information
uint8_t ens160_set_interface (ens160_handle_t *handle, ens160_interface_t interface)
 set the chip interface
uint8_t ens160_get_interface (ens160_handle_t *handle, ens160_interface_t *interface)
 get the chip interface
uint8_t ens160_set_addr_pin (ens160_handle_t *handle, ens160_address_t addr_pin)
 set the iic address pin
uint8_t ens160_get_addr_pin (ens160_handle_t *handle, ens160_address_t *addr_pin)
 get the iic address pin
uint8_t ens160_irq_handler (ens160_handle_t *handle)
 irq handler
uint8_t ens160_init (ens160_handle_t *handle)
 initialize the chip
uint8_t ens160_deinit (ens160_handle_t *handle)
 close the chip
uint8_t ens160_read_aqi (ens160_handle_t *handle, uint8_t *uba)
 read aqi
uint8_t ens160_read_tvoc (ens160_handle_t *handle, uint16_t *tvoc_ppb)
 read tvoc
uint8_t ens160_read_eco2 (ens160_handle_t *handle, uint16_t *eco2_ppm)
 read eco2
uint8_t ens160_read_etoh (ens160_handle_t *handle, uint16_t *etoh_ppb)
 read etoh
uint8_t ens160_set_mode (ens160_handle_t *handle, ens160_mode_t mode)
 set mode
uint8_t ens160_get_mode (ens160_handle_t *handle, ens160_mode_t *mode)
 get mode
uint8_t ens160_soft_reset (ens160_handle_t *handle)
 soft reset
uint8_t ens160_set_interrupt_pin_polarity (ens160_handle_t *handle, ens160_pin_polarity_t polarity)
 set interrupt pin polarity
uint8_t ens160_get_interrupt_pin_polarity (ens160_handle_t *handle, ens160_pin_polarity_t *polarity)
 get interrupt pin polarity
uint8_t ens160_set_interrupt_pin_drive (ens160_handle_t *handle, ens160_pin_drive_t drive)
 set interrupt pin drive
uint8_t ens160_get_interrupt_pin_drive (ens160_handle_t *handle, ens160_pin_drive_t *drive)
 get interrupt pin drive
uint8_t ens160_set_general_purpose_read_interrupt_pin_asserted (ens160_handle_t *handle, ens160_bool_t enable)
 set general purpose read interrupt pin asserted
uint8_t ens160_get_general_purpose_read_interrupt_pin_asserted (ens160_handle_t *handle, ens160_bool_t *enable)
 get general purpose read interrupt pin asserted
uint8_t ens160_set_data_interrupt_pin_asserted (ens160_handle_t *handle, ens160_bool_t enable)
 set data interrupt pin asserted
uint8_t ens160_get_data_interrupt_pin_asserted (ens160_handle_t *handle, ens160_bool_t *enable)
 get data interrupt pin asserted
uint8_t ens160_set_interrupt (ens160_handle_t *handle, ens160_bool_t enable)
 enable or disable interrupt
uint8_t ens160_get_interrupt (ens160_handle_t *handle, ens160_bool_t *enable)
 get interrupt
uint8_t ens160_nop (ens160_handle_t *handle)
 nop
uint8_t ens160_get_app_version (ens160_handle_t *handle, uint8_t *major, uint8_t *minor, uint8_t *release)
 get app version
uint8_t ens160_clear (ens160_handle_t *handle)
 clear
uint8_t ens160_set_temperature_compensation (ens160_handle_t *handle, uint16_t raw)
 set temperature compensation
uint8_t ens160_get_temperature_compensation (ens160_handle_t *handle, uint16_t *raw)
 get temperature compensation
uint8_t ens160_set_humidity_compensation (ens160_handle_t *handle, uint16_t raw)
 set humidity compensation
uint8_t ens160_get_humidity_compensation (ens160_handle_t *handle, uint16_t *raw)
 get humidity compensation
uint8_t ens160_get_status (ens160_handle_t *handle, uint8_t *status)
 get status
uint8_t ens160_get_calculation_temperature (ens160_handle_t *handle, uint16_t *raw)
 get calculation temperature
uint8_t ens160_get_calculation_humidity (ens160_handle_t *handle, uint16_t *raw)
 get calculation humidity
uint8_t ens160_get_checksum (ens160_handle_t *handle, uint8_t *checksum)
 get checksum
uint8_t ens160_set_params (ens160_handle_t *handle, uint8_t params[8])
 set params
uint8_t ens160_get_params (ens160_handle_t *handle, uint8_t params[8])
 get params
uint8_t ens160_get_params_output (ens160_handle_t *handle, uint8_t params[8])
 get params output
uint8_t ens160_temperature_convert_to_register (ens160_handle_t *handle, float celsius_deg, uint16_t *reg)
 convert the temperature to the register raw data
uint8_t ens160_temperature_convert_to_data (ens160_handle_t *handle, uint16_t reg, float *celsius_deg)
 convert the register raw data to the temperature
uint8_t ens160_humidity_convert_to_register (ens160_handle_t *handle, float percentage, uint16_t *reg)
 convert the humidity to the register raw data
uint8_t ens160_humidity_convert_to_data (ens160_handle_t *handle, uint16_t reg, float *percentage)
 convert the register raw data to the humidity
uint8_t ens160_resistance_convert_to_register (ens160_handle_t *handle, float ohm, uint16_t *reg)
 convert the resistance to the register raw data
uint8_t ens160_resistance_convert_to_data (ens160_handle_t *handle, uint16_t reg, float *ohm)
 convert the register raw data to the resistance
uint8_t ens160_resistance_split (ens160_handle_t *handle, uint8_t raw[8], uint16_t *resistance0, uint16_t *resistance1, uint16_t *resistance2, uint16_t *resistance3)
 resistance split

Detailed Description

ens160 basic driver modules

Typedef Documentation

◆ ens160_handle_t

ens160 handle structure definition

◆ ens160_info_t

typedef struct ens160_info_s ens160_info_t

ens160 information structure definition

Enumeration Type Documentation

◆ ens160_address_t

ens160 address enumeration definition

Enumerator
ENS160_ADDRESS_0 

MISO connected to the GND

ENS160_ADDRESS_1 

MISO connected to the VCC

Definition at line 71 of file driver_ens160.h.

◆ ens160_bool_t

ens160 bool enumeration definition

Enumerator
ENS160_BOOL_FALSE 

false

ENS160_BOOL_TRUE 

true

Definition at line 80 of file driver_ens160.h.

◆ ens160_interface_t

ens160 interface enumeration definition

Enumerator
ENS160_INTERFACE_IIC 

iic interface

ENS160_INTERFACE_SPI 

spi interface

Definition at line 62 of file driver_ens160.h.

◆ ens160_mode_t

ens160 mode enumeration definition

Enumerator
ENS160_MODE_DEEP_SLEEP 

deep sleep mode

ENS160_MODE_IDLE 

idle mode

ENS160_MODE_STANDARD 

standard mode

Definition at line 89 of file driver_ens160.h.

◆ ens160_pin_drive_t

ens160 pin drive enumeration definition

Enumerator
ENS160_PIN_DRIVE_OPEN_DRAIN 

open drain

ENS160_PIN_DRIVE_PUSH_PULL 

push-pull

Definition at line 108 of file driver_ens160.h.

◆ ens160_pin_polarity_t

ens160 pin polarity enumeration definition

Enumerator
ENS160_PIN_POLARITY_LOW 

active low

ENS160_PIN_POLARITY_HIGH 

active high

Definition at line 99 of file driver_ens160.h.

◆ ens160_status_t

ens160 status enumeration definition

Enumerator
ENS160_STATUS_RUNNING 

running

ENS160_STATUS_ERROR 

an error is detected

ENS160_STATUS_NORMAL 

normal operation

ENS160_STATUS_WARM_UP 

warm - up phase

ENS160_STATUS_START_UP 

initial start - up phase

ENS160_STATUS_INVALID 

invalid output

ENS160_STATUS_NEWDAT 

a new data is available in the data register

ENS160_STATUS_NEWGPR 

a new data is available in the gpr read register

Definition at line 117 of file driver_ens160.h.

Function Documentation

◆ ens160_clear()

uint8_t ens160_clear ( ens160_handle_t * handle)

clear

Parameters
[in]*handlepointer to an ens160 handle structure
Returns
status code
  • 0 success
  • 1 clear failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 872 of file driver_ens160.c.

◆ ens160_deinit()

uint8_t ens160_deinit ( ens160_handle_t * handle)

close the chip

Parameters
[in]*handlepointer to an ens160 handle structure
Returns
status code
  • 0 success
  • 1 iic or spi deinit failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 power down failed
Note
none

Definition at line 1933 of file driver_ens160.c.

◆ ens160_get_addr_pin()

uint8_t ens160_get_addr_pin ( ens160_handle_t * handle,
ens160_address_t * addr_pin )

get the iic address pin

Parameters
[in]*handlepointer to an ens160 handle structure
[out]*addr_pinpointer to an address pin buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
Note
none

Definition at line 226 of file driver_ens160.c.

◆ ens160_get_app_version()

uint8_t ens160_get_app_version ( ens160_handle_t * handle,
uint8_t * major,
uint8_t * minor,
uint8_t * release )

get app version

Parameters
[in]*handlepointer to an ens160 handle structure
[out]*majorpointer to a major buffer
[out]*minorpointer to a minor buffer
[out]*releasepointer to a release buffer
Returns
status code
  • 0 success
  • 1 get app version failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 815 of file driver_ens160.c.

◆ ens160_get_calculation_humidity()

uint8_t ens160_get_calculation_humidity ( ens160_handle_t * handle,
uint16_t * raw )

get calculation humidity

Parameters
[in]*handlepointer to an ens160 handle structure
[out]*rawpointer to a raw data buffer
Returns
status code
  • 0 success
  • 1 get calculation humidity failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1293 of file driver_ens160.c.

◆ ens160_get_calculation_temperature()

uint8_t ens160_get_calculation_temperature ( ens160_handle_t * handle,
uint16_t * raw )

get calculation temperature

Parameters
[in]*handlepointer to an ens160 handle structure
[out]*rawpointer to a raw data buffer
Returns
status code
  • 0 success
  • 1 get calculation temperature failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1256 of file driver_ens160.c.

◆ ens160_get_checksum()

uint8_t ens160_get_checksum ( ens160_handle_t * handle,
uint8_t * checksum )

get checksum

Parameters
[in]*handlepointer to an ens160 handle structure
[out]*checksumpointer to a checksum buffer
Returns
status code
  • 0 success
  • 1 get checksum failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1330 of file driver_ens160.c.

◆ ens160_get_data_interrupt_pin_asserted()

uint8_t ens160_get_data_interrupt_pin_asserted ( ens160_handle_t * handle,
ens160_bool_t * enable )

get data interrupt pin asserted

Parameters
[in]*handlepointer to an ens160 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get data interrupt pin asserted failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 656 of file driver_ens160.c.

◆ ens160_get_general_purpose_read_interrupt_pin_asserted()

uint8_t ens160_get_general_purpose_read_interrupt_pin_asserted ( ens160_handle_t * handle,
ens160_bool_t * enable )

get general purpose read interrupt pin asserted

Parameters
[in]*handlepointer to an ens160 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get general purpose read interrupt pin asserted failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 573 of file driver_ens160.c.

◆ ens160_get_humidity_compensation()

uint8_t ens160_get_humidity_compensation ( ens160_handle_t * handle,
uint16_t * raw )

get humidity compensation

Parameters
[in]*handlepointer to an ens160 handle structure
[out]*rawpointer to a raw data buffer
Returns
status code
  • 0 success
  • 1 get humidity compensation failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1034 of file driver_ens160.c.

◆ ens160_get_interface()

uint8_t ens160_get_interface ( ens160_handle_t * handle,
ens160_interface_t * interface )

get the chip interface

Parameters
[in]*handlepointer to an ens160 handle structure
[out]*interfacepointer to a chip interface buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
Note
none

Definition at line 184 of file driver_ens160.c.

◆ ens160_get_interrupt()

uint8_t ens160_get_interrupt ( ens160_handle_t * handle,
ens160_bool_t * enable )

get interrupt

Parameters
[in]*handlepointer to an ens160 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get interrupt failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 739 of file driver_ens160.c.

◆ ens160_get_interrupt_pin_drive()

uint8_t ens160_get_interrupt_pin_drive ( ens160_handle_t * handle,
ens160_pin_drive_t * drive )

get interrupt pin drive

Parameters
[in]*handlepointer to an ens160 handle structure
[out]*drivepointer to a pin drive buffer
Returns
status code
  • 0 success
  • 1 get interrupt pin drive failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 490 of file driver_ens160.c.

◆ ens160_get_interrupt_pin_polarity()

uint8_t ens160_get_interrupt_pin_polarity ( ens160_handle_t * handle,
ens160_pin_polarity_t * polarity )

get interrupt pin polarity

Parameters
[in]*handlepointer to an ens160 handle structure
[out]*polaritypointer to an interrupt polarity buffer
Returns
status code
  • 0 success
  • 1 get interrupt pin polarity failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 407 of file driver_ens160.c.

◆ ens160_get_mode()

uint8_t ens160_get_mode ( ens160_handle_t * handle,
ens160_mode_t * mode )

get mode

Parameters
[in]*handlepointer to an ens160 handle structure
[out]*modepointer to a chip mode buffer
Returns
status code
  • 0 success
  • 1 get mode failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 287 of file driver_ens160.c.

◆ ens160_get_params()

uint8_t ens160_get_params ( ens160_handle_t * handle,
uint8_t params[8] )

get params

Parameters
[in]*handlepointer to an ens160 handle structure
[out]*paramspointer to a params buffer
Returns
status code
  • 0 success
  • 1 get params failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1402 of file driver_ens160.c.

◆ ens160_get_params_output()

uint8_t ens160_get_params_output ( ens160_handle_t * handle,
uint8_t params[8] )

get params output

Parameters
[in]*handlepointer to an ens160 handle structure
[out]*paramspointer to a params buffer
Returns
status code
  • 0 success
  • 1 get params output failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1437 of file driver_ens160.c.

◆ ens160_get_status()

uint8_t ens160_get_status ( ens160_handle_t * handle,
uint8_t * status )

get status

Parameters
[in]*handlepointer to an ens160 handle structure
[out]*statuspointer to a status buffer
Returns
status code
  • 0 success
  • 1 get status failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1071 of file driver_ens160.c.

◆ ens160_get_temperature_compensation()

uint8_t ens160_get_temperature_compensation ( ens160_handle_t * handle,
uint16_t * raw )

get temperature compensation

Parameters
[in]*handlepointer to an ens160 handle structure
[out]*rawpointer to a raw data buffer
Returns
status code
  • 0 success
  • 1 get temperature compensation failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 958 of file driver_ens160.c.

◆ ens160_humidity_convert_to_data()

uint8_t ens160_humidity_convert_to_data ( ens160_handle_t * handle,
uint16_t reg,
float * percentage )

convert the register raw data to the humidity

Parameters
[in]*handlepointer to an ens160 handle structure
[in]regregister raw data
[out]*percentagepointer to a humidity percentage buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1553 of file driver_ens160.c.

◆ ens160_humidity_convert_to_register()

uint8_t ens160_humidity_convert_to_register ( ens160_handle_t * handle,
float percentage,
uint16_t * reg )

convert the humidity to the register raw data

Parameters
[in]*handlepointer to an ens160 handle structure
[in]percentagehumidity percentage
[out]*regpointer to a register raw buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1526 of file driver_ens160.c.

◆ ens160_info()

uint8_t ens160_info ( ens160_info_t * info)

get chip's information

Parameters
[out]*infopointer to an ens160 info structure
Returns
status code
  • 0 success
  • 2 handle is NULL
Note
none

Definition at line 2027 of file driver_ens160.c.

◆ ens160_init()

uint8_t ens160_init ( ens160_handle_t * handle)

initialize the chip

Parameters
[in]*handlepointer to an ens160 handle structure
Returns
status code
  • 0 success
  • 1 spi or iic initialization failed
  • 2 handle is NULL
  • 3 linked functions is NULL
  • 4 id is invalid
Note
none

Definition at line 1809 of file driver_ens160.c.

◆ ens160_irq_handler()

uint8_t ens160_irq_handler ( ens160_handle_t * handle)

irq handler

Parameters
[in]*handlepointer to an ens160 handle structure
Returns
status code
  • 0 success
  • 1 run failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
ENS160_STATUS_NEWDAT dat[0] AQI dat[1] TVOC in ppb dat[2] ECO2 in ppm dat[3] ETOH in ppb ENS160_STATUS_NEWGPR dat[0] resistance0 raw dat[1] resistance1 raw dat[2] resistance2 raw dat[3] resistance3 raw

Definition at line 1677 of file driver_ens160.c.

◆ ens160_nop()

uint8_t ens160_nop ( ens160_handle_t * handle)

nop

Parameters
[in]*handlepointer to an ens160 handle structure
Returns
status code
  • 0 success
  • 1 nop failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 775 of file driver_ens160.c.

◆ ens160_read_aqi()

uint8_t ens160_read_aqi ( ens160_handle_t * handle,
uint8_t * uba )

read aqi

Parameters
[in]*handlepointer to an ens160 handle structure
[out]*ubapointer to a uba buffer
Returns
status code
  • 0 success
  • 1 read aqi failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1108 of file driver_ens160.c.

◆ ens160_read_eco2()

uint8_t ens160_read_eco2 ( ens160_handle_t * handle,
uint16_t * eco2_ppm )

read eco2

Parameters
[in]*handlepointer to an ens160 handle structure
[out]*eco2_ppmpointer to a eco2 buffer
Returns
status code
  • 0 success
  • 1 read eco2 failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1182 of file driver_ens160.c.

◆ ens160_read_etoh()

uint8_t ens160_read_etoh ( ens160_handle_t * handle,
uint16_t * etoh_ppb )

read etoh

Parameters
[in]*handlepointer to an ens160 handle structure
[out]*etoh_ppbpointer to a etoh buffer
Returns
status code
  • 0 success
  • 1 read etoh failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1219 of file driver_ens160.c.

◆ ens160_read_tvoc()

uint8_t ens160_read_tvoc ( ens160_handle_t * handle,
uint16_t * tvoc_ppb )

read tvoc

Parameters
[in]*handlepointer to an ens160 handle structure
[out]*tvoc_ppbpointer to a tvoc buffer
Returns
status code
  • 0 success
  • 1 read tvoc failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1145 of file driver_ens160.c.

◆ ens160_resistance_convert_to_data()

uint8_t ens160_resistance_convert_to_data ( ens160_handle_t * handle,
uint16_t reg,
float * ohm )

convert the register raw data to the resistance

Parameters
[in]*handlepointer to an ens160 handle structure
[in]regregister raw data
[out]*ohmpointer to an ohm buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1607 of file driver_ens160.c.

◆ ens160_resistance_convert_to_register()

uint8_t ens160_resistance_convert_to_register ( ens160_handle_t * handle,
float ohm,
uint16_t * reg )

convert the resistance to the register raw data

Parameters
[in]*handlepointer to an ens160 handle structure
[in]ohmresistance in ohm
[out]*regpointer to a register raw buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1580 of file driver_ens160.c.

◆ ens160_resistance_split()

uint8_t ens160_resistance_split ( ens160_handle_t * handle,
uint8_t raw[8],
uint16_t * resistance0,
uint16_t * resistance1,
uint16_t * resistance2,
uint16_t * resistance3 )

resistance split

Parameters
[in]*handlepointer to an ens160 handle structure
[in]*rawpointer to a raw data buffer
[out]*resistance0pointer to a resistance0 buffer
[out]*resistance1pointer to a resistance1 buffer
[out]*resistance2pointer to a resistance2 buffer
[out]*resistance3pointer to a resistance3 buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1637 of file driver_ens160.c.

◆ ens160_set_addr_pin()

uint8_t ens160_set_addr_pin ( ens160_handle_t * handle,
ens160_address_t addr_pin )

set the iic address pin

Parameters
[in]*handlepointer to an ens160 handle structure
[in]addr_pinaddress pin
Returns
status code
  • 0 success
  • 2 handle is NULL
Note
none

Definition at line 205 of file driver_ens160.c.

◆ ens160_set_data_interrupt_pin_asserted()

uint8_t ens160_set_data_interrupt_pin_asserted ( ens160_handle_t * handle,
ens160_bool_t enable )

set data interrupt pin asserted

Parameters
[in]*handlepointer to an ens160 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set data interrupt pin asserted failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 610 of file driver_ens160.c.

◆ ens160_set_general_purpose_read_interrupt_pin_asserted()

uint8_t ens160_set_general_purpose_read_interrupt_pin_asserted ( ens160_handle_t * handle,
ens160_bool_t enable )

set general purpose read interrupt pin asserted

Parameters
[in]*handlepointer to an ens160 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set general purpose read interrupt pin asserted failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 527 of file driver_ens160.c.

◆ ens160_set_humidity_compensation()

uint8_t ens160_set_humidity_compensation ( ens160_handle_t * handle,
uint16_t raw )

set humidity compensation

Parameters
[in]*handlepointer to an ens160 handle structure
[in]rawraw data
Returns
status code
  • 0 success
  • 1 set humidity compensation failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 995 of file driver_ens160.c.

◆ ens160_set_interface()

uint8_t ens160_set_interface ( ens160_handle_t * handle,
ens160_interface_t interface )

set the chip interface

Parameters
[in]*handlepointer to an ens160 handle structure
[in]interfacechip interface
Returns
status code
  • 0 success
  • 2 handle is NULL
Note
none

Definition at line 163 of file driver_ens160.c.

◆ ens160_set_interrupt()

uint8_t ens160_set_interrupt ( ens160_handle_t * handle,
ens160_bool_t enable )

enable or disable interrupt

Parameters
[in]*handlepointer to an ens160 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set interrupt failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 693 of file driver_ens160.c.

◆ ens160_set_interrupt_pin_drive()

uint8_t ens160_set_interrupt_pin_drive ( ens160_handle_t * handle,
ens160_pin_drive_t drive )

set interrupt pin drive

Parameters
[in]*handlepointer to an ens160 handle structure
[in]drivepin drive
Returns
status code
  • 0 success
  • 1 set interrupt pin drive failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 444 of file driver_ens160.c.

◆ ens160_set_interrupt_pin_polarity()

uint8_t ens160_set_interrupt_pin_polarity ( ens160_handle_t * handle,
ens160_pin_polarity_t polarity )

set interrupt pin polarity

Parameters
[in]*handlepointer to an ens160 handle structure
[in]polarityinterrupt polarity
Returns
status code
  • 0 success
  • 1 set interrupt pin polarity failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 361 of file driver_ens160.c.

◆ ens160_set_mode()

uint8_t ens160_set_mode ( ens160_handle_t * handle,
ens160_mode_t mode )

set mode

Parameters
[in]*handlepointer to an ens160 handle structure
[in]modechip mode
Returns
status code
  • 0 success
  • 1 set mode failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 249 of file driver_ens160.c.

◆ ens160_set_params()

uint8_t ens160_set_params ( ens160_handle_t * handle,
uint8_t params[8] )

set params

Parameters
[in]*handlepointer to an ens160 handle structure
[in]*paramspointer to a params buffer
Returns
status code
  • 0 success
  • 1 set params failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1367 of file driver_ens160.c.

◆ ens160_set_temperature_compensation()

uint8_t ens160_set_temperature_compensation ( ens160_handle_t * handle,
uint16_t raw )

set temperature compensation

Parameters
[in]*handlepointer to an ens160 handle structure
[in]rawraw data
Returns
status code
  • 0 success
  • 1 set temperature compensation failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 919 of file driver_ens160.c.

◆ ens160_soft_reset()

uint8_t ens160_soft_reset ( ens160_handle_t * handle)

soft reset

Parameters
[in]*handlepointer to an ens160 handle structure
Returns
status code
  • 0 success
  • 1 soft reset failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 323 of file driver_ens160.c.

◆ ens160_temperature_convert_to_data()

uint8_t ens160_temperature_convert_to_data ( ens160_handle_t * handle,
uint16_t reg,
float * celsius_deg )

convert the register raw data to the temperature

Parameters
[in]*handlepointer to an ens160 handle structure
[in]regregister raw data
[out]*celsius_degpointer to a celsius degrees buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1499 of file driver_ens160.c.

◆ ens160_temperature_convert_to_register()

uint8_t ens160_temperature_convert_to_register ( ens160_handle_t * handle,
float celsius_deg,
uint16_t * reg )

convert the temperature to the register raw data

Parameters
[in]*handlepointer to an ens160 handle structure
[in]celsius_degcelsius degrees
[out]*regpointer to a register raw buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1472 of file driver_ens160.c.