alcohol3 2.0.0.0
Public function

Functions

void alcohol3_cfg_setup (alcohol3_cfg_t *cfg)
 Config Object Initialization function.
 
ALCOHOL3_RETVAL alcohol3_init (alcohol3_t *ctx, alcohol3_cfg_t *cfg)
 Initialization function.
 
void alcohol3_default_cfg (alcohol3_t *ctx)
 Click Default Configuration function.
 
void alcohol3_generic_write (alcohol3_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void alcohol3_generic_read (alcohol3_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
uint16_t alcohol3_get_adc_data (alcohol3_t *ctx)
 Function for read ADC data.
 
uint16_t alcohol3_get_co_in_ppm (alcohol3_t *ctx)
 Function for read CO (Carbon monoxide) data in ppm.
 
float alcohol3_get_co_in_mgl (alcohol3_t *ctx)
 Function for read CO (Carbon monoxide) data in mg/L.
 
uint16_t alcohol3_ethanol_in_ppm (alcohol3_t *ctx)
 Function for read Ethanol (C2H5OH) data in ppm.
 
float alcohol3_get_percentage_bac (alcohol3_t *ctx)
 Function for read percentage of alcohol in the blood (BAC).
 

Detailed Description

Function Documentation

◆ alcohol3_cfg_setup()

void alcohol3_cfg_setup ( alcohol3_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.

◆ alcohol3_default_cfg()

void alcohol3_default_cfg ( alcohol3_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for Alcohol3 click.

◆ alcohol3_ethanol_in_ppm()

uint16_t alcohol3_ethanol_in_ppm ( alcohol3_t * ctx)

Function for read Ethanol (C2H5OH) data in ppm.

Parameters
ctxClick object.

@description This function reads Ethanol (C2H5OH) data in ppm (1 ppm - 500 ppm).

◆ alcohol3_generic_read()

void alcohol3_generic_read ( alcohol3_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.

◆ alcohol3_generic_write()

void alcohol3_generic_write ( alcohol3_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.

◆ alcohol3_get_adc_data()

uint16_t alcohol3_get_adc_data ( alcohol3_t * ctx)

Function for read ADC data.

Parameters
ctxClick object.

@description This function reads 12bit ADC value.

◆ alcohol3_get_co_in_mgl()

float alcohol3_get_co_in_mgl ( alcohol3_t * ctx)

Function for read CO (Carbon monoxide) data in mg/L.

Parameters
ctxClick object.

@description This function reads CO (Carbon monoxide) data in mg/L.

◆ alcohol3_get_co_in_ppm()

uint16_t alcohol3_get_co_in_ppm ( alcohol3_t * ctx)

Function for read CO (Carbon monoxide) data in ppm.

Parameters
ctxClick object.

@description This function reads CO (Carbon monoxide) data in ppm (1 ppm - 1000 ppm).

◆ alcohol3_get_percentage_bac()

float alcohol3_get_percentage_bac ( alcohol3_t * ctx)

Function for read percentage of alcohol in the blood (BAC).

Parameters
ctxClick object.

@description This function reads percentage of alcohol in the blood (BAC).

◆ alcohol3_init()

ALCOHOL3_RETVAL alcohol3_init ( alcohol3_t * ctx,
alcohol3_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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