alcohol2 2.0.0.0
|
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. | |
void alcohol2_cfg_setup | ( | alcohol2_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
void alcohol2_default_cfg | ( | alcohol2_t * | ctx | ) |
Click Default Configuration function.
ctx | Click object. |
@description This function executes default configuration for Alcohol2 click.
void alcohol2_enable | ( | alcohol2_t * | ctx, |
uint8_t | state ) |
Device Enable function.
ctx | Click object. |
state | State. |
@description This function enable device.
void alcohol2_generic_read | ( | alcohol2_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic read function.
ctx | Click object. |
reg | Register address. |
data_buf | Output data buf |
len | Number of the bytes to be read |
@description This function reads data from the desired register.
void alcohol2_generic_write | ( | alcohol2_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic write function.
ctx | Click object. |
reg | Register address. |
data_buf | Data buf to be written. |
len | Number of the bytes in data buf. |
@description This function writes data to the desired register.
ALCOHOL2_RETVAL alcohol2_init | ( | alcohol2_t * | ctx, |
alcohol2_cfg_t * | cfg ) |
Initialization function.
ctx | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
uint16_t alcohol2_read_alcohol | ( | alcohol2_t * | ctx | ) |
Function for read Alcohol data.
ctx | Click object. |
@description This function reads Alcohol data.
uint8_t alcohol2_read_byte | ( | alcohol2_t * | ctx, |
uint8_t | reg ) |
Function reads one byte from the register.
ctx | Click object. |
reg | Register address. |
@description This function reads one byte from the register.
void alcohol2_wait_ready | ( | alcohol2_t * | ctx | ) |
Function waits until I2C is ready for the next command.
ctx | Click object. |
@description This function waits until I2C is ready for the next command.
void alcohol2_write_byte | ( | alcohol2_t * | ctx, |
uint8_t | reg, | ||
uint8_t | w_data ) |
Function writes one byte to the register.
ctx | Click object. |
reg | Register address. |
W_data | Data to be written. |
@description This function writes one byte to the register.