no2  2.0.0.0
Functions
Public function

Functions

void no2_cfg_setup (no2_cfg_t *cfg)
 Config Object Initialization function. More...
 
NO2_RETVAL no2_init (no2_t *ctx, no2_cfg_t *cfg)
 Initialization function. More...
 
void no2_default_cfg (no2_t *ctx)
 Click Default Configuration function. More...
 
void no2_generic_write (no2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function. More...
 
void no2_generic_read (no2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function. More...
 
void no2_write_byte (no2_t *ctx, uint8_t reg, uint8_t dev_data)
 Function writes one byte to the register. More...
 
uint8_t no2_read_byte (no2_t *ctx, uint8_t reg)
 Function reads one byte from the register. More...
 
void no2_enable (no2_t *ctx, uint8_t state)
 Device Enable function. More...
 
uint16_t no2_read_adc (no2_t *ctx)
 Function for read ADC sensor data. More...
 
float no2_get_no_2_ppm (no2_t *ctx)
 Get NO2 Data function. More...
 
void no2_wait_ready (no2_t *ctx)
 Function waits until I2C is ready for the next command. More...
 

Detailed Description

Function Documentation

◆ no2_cfg_setup()

void no2_cfg_setup ( no2_cfg_t cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ no2_default_cfg()

void no2_default_cfg ( no2_t ctx)

Click Default Configuration function.

Parameters
ctxClick object.
Note
     Set: NO2_MODECN_REG
  • NO2_DEEP_SLEEP_MODE Set: NO2_LOCK_REG
  • NO2_WRITE_MODE Set: NO2_TIACN_REG
  • NO2_EXT_TIA_RES |
  • NO2_100_OHM_LOAD_RES Set: NO2_REFCN_REG
  • NO2_VREF_INT |
  • NO2_50_PERCENTS_INT_ZERO |
  • NO2_BIAS_POL_NEGATIVE |
  • NO2_0_PERCENTS_BIAS

@description This function executes default configuration for No2 click.

◆ no2_enable()

void no2_enable ( no2_t ctx,
uint8_t  state 
)

Device Enable function.

Parameters
ctxClick object.
stateValue of pin RST

◆ no2_generic_read()

void no2_generic_read ( no2_t ctx,
uint8_t  reg,
uint8_t *  data_buf,
uint8_t  len 
)

Generic read function.

Parameters
ctxClick object.
regRegister address.
data_bufOutput data buf
lenNumber of the bytes to be read

@description This function reads data from the desired register.

◆ no2_generic_write()

void no2_generic_write ( no2_t ctx,
uint8_t  reg,
uint8_t *  data_buf,
uint8_t  len 
)

Generic write function.

Parameters
ctxClick object.
regRegister address.
data_bufData buf to be written.
lenNumber of the bytes in data buf.

@description This function writes data to the desired register.

◆ no2_get_no_2_ppm()

float no2_get_no_2_ppm ( no2_t ctx)

Get NO2 Data function.

Parameters
ctxClick object.

@description NO2 data in ppm.

◆ no2_init()

NO2_RETVAL no2_init ( no2_t ctx,
no2_cfg_t cfg 
)

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

@description This function initializes all necessary pins and peripherals used for this click.

◆ no2_read_adc()

uint16_t no2_read_adc ( no2_t ctx)

Function for read ADC sensor data.

Parameters
ctxClick object.

@description 12bit ADC value

◆ no2_read_byte()

uint8_t no2_read_byte ( no2_t ctx,
uint8_t  reg 
)

Function reads one byte from the register.

Parameters
ctxClick object.
regAddress which from data be read

@description data that is read from the registry

◆ no2_wait_ready()

void no2_wait_ready ( no2_t ctx)

Function waits until I2C is ready for the next command.

Parameters
ctxClick object.

◆ no2_write_byte()

void no2_write_byte ( no2_t ctx,
uint8_t  reg,
uint8_t  dev_data 
)

Function writes one byte to the register.

Parameters
ctxClick object.
regAddress where data be written
dev_dataData to be written