alcohol2
2.0.0.0
|
Functions | |
ALCOHOL2_RETVAL | alcohol2_init (alcohol2_t *ctx, alcohol2_cfg_t *cfg) |
Initialization function. More... | |
void | alcohol2_default_cfg (alcohol2_t *ctx) |
Click Default Configuration function. More... | |
void | alcohol2_generic_write (alcohol2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic write function. More... | |
void | alcohol2_generic_read (alcohol2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic read function. More... | |
void | alcohol2_write_byte (alcohol2_t *ctx, uint8_t reg, uint8_t w_data) |
Function writes one byte to the register. More... | |
uint8_t | alcohol2_read_byte (alcohol2_t *ctx, uint8_t reg) |
Function reads one byte from the register. More... | |
void | alcohol2_enable (alcohol2_t *ctx, uint8_t state) |
Device Enable function. More... | |
uint16_t | alcohol2_read_alcohol (alcohol2_t *ctx) |
Function for read Alcohol data. More... | |
void | alcohol2_wait_ready (alcohol2_t *ctx) |
Function waits until I2C is ready for the next command. More... | |
void alcohol2_default_cfg | ( | alcohol2_t * | ctx | ) |
Click Default Configuration function.
ctx | Click object. |
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. |
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 |
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. |
This function writes data to the desired register.
ALCOHOL2_RETVAL alcohol2_init | ( | alcohol2_t * | ctx, |
alcohol2_cfg_t * | cfg | ||
) |
Initialization function.
alcohol2 | Click object. |
cfg | Click configuration structure. |
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. |
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. |
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. |
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. |
This function writes one byte to the register.