Function xensiv_pas_gas_co2_init(xensiv_pas_gas_t *, xensiv_pas_gas_interface_t, void *)

Function Documentation

int32_t xensiv_pas_gas_co2_init(xensiv_pas_gas_t *dev, xensiv_pas_gas_interface_t itf, void *ctx)

Initializes the XENSIV™ PAS GAS CO2 device. It initializes the dev structure, verifies the integrity of the communication layer of the serial communication interface, and checks whether the sensor is ready.

Parameters:
  • dev[inout] Pointer to a XENSIV™ PAS GAS CO2 sensor device structure allocated by the user, but the init function will initialize its contents

  • itf[in] Communication interface (I2C/UART)

  • ctx[in] Pointer to the platform-specific specific protocol communication handler

Returns:

XENSIV_PAS_GAS_OK if the initialization was successful; an error indicating what went wrong otherwise