alcohol2 2.0.0.0
Public function

Functions

void alcohol2_cfg_setup (alcohol2_cfg_t *cfg)
 Config Object Initialization function.
 
ALCOHOL2_RETVAL alcohol2_init (alcohol2_t *ctx, alcohol2_cfg_t *cfg)
 Initialization function.
 
void alcohol2_default_cfg (alcohol2_t *ctx)
 Click Default Configuration function.
 
void alcohol2_generic_write (alcohol2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void alcohol2_generic_read (alcohol2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
void alcohol2_write_byte (alcohol2_t *ctx, uint8_t reg, uint8_t w_data)
 Function writes one byte to the register.
 
uint8_t alcohol2_read_byte (alcohol2_t *ctx, uint8_t reg)
 Function reads one byte from the register.
 
void alcohol2_enable (alcohol2_t *ctx, uint8_t state)
 Device Enable function.
 
uint16_t alcohol2_read_alcohol (alcohol2_t *ctx)
 Function for read Alcohol data.
 
void alcohol2_wait_ready (alcohol2_t *ctx)
 Function waits until I2C is ready for the next command.
 

Detailed Description

Function Documentation

◆ alcohol2_cfg_setup()

void alcohol2_cfg_setup ( alcohol2_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.

◆ alcohol2_default_cfg()

void alcohol2_default_cfg ( alcohol2_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for Alcohol2 click.

◆ alcohol2_enable()

void alcohol2_enable ( alcohol2_t * ctx,
uint8_t state )

Device Enable function.

Parameters
ctxClick object.
stateState.

@description This function enable device.

◆ alcohol2_generic_read()

void alcohol2_generic_read ( alcohol2_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.

◆ alcohol2_generic_write()

void alcohol2_generic_write ( alcohol2_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.

◆ alcohol2_init()

ALCOHOL2_RETVAL alcohol2_init ( alcohol2_t * ctx,
alcohol2_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ alcohol2_read_alcohol()

uint16_t alcohol2_read_alcohol ( alcohol2_t * ctx)

Function for read Alcohol data.

Parameters
ctxClick object.

@description This function reads Alcohol data.

◆ alcohol2_read_byte()

uint8_t alcohol2_read_byte ( alcohol2_t * ctx,
uint8_t reg )

Function reads one byte from the register.

Parameters
ctxClick object.
regRegister address.

@description This function reads one byte from the register.

◆ alcohol2_wait_ready()

void alcohol2_wait_ready ( alcohol2_t * ctx)

Function waits until I2C is ready for the next command.

Parameters
ctxClick object.

@description This function waits until I2C is ready for the next command.

◆ alcohol2_write_byte()

void alcohol2_write_byte ( alcohol2_t * ctx,
uint8_t reg,
uint8_t w_data )

Function writes one byte to the register.

Parameters
ctxClick object.
regRegister address.
W_dataData to be written.

@description This function writes one byte to the register.