moisture 2.0.0.0
|
Functions | |
void | moisture_cfg_setup (moisture_cfg_t *cfg) |
Config Object Initialization function. | |
MOISTURE_RETVAL | moisture_init (moisture_t *ctx, moisture_cfg_t *cfg) |
Initialization function. | |
void | moisture_default_cfg (moisture_t *ctx) |
Click Default Configuration function. | |
void | moisture_generic_write (moisture_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic write function. | |
void | moisture_generic_read (moisture_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic read function. | |
void | moisture_write_word (moisture_t *ctx, uint8_t reg, uint16_t data_in) |
Write word function. | |
uint16_t | moisture_read_word (moisture_t *ctx, uint8_t reg) |
Read word function. | |
void | moisture_soft_reset (moisture_t *ctx) |
Soft reset function. | |
void | moisture_cfg (moisture_t *ctx, uint16_t gain, uint16_t offset, uint16_t clk_div) |
Configure device function. | |
uint8_t | moisture_get_data (moisture_t *ctx) |
Measurement data function. | |
void | moisture_cal (moisture_t *ctx) |
Chip calibration function. | |
uint8_t | moisture_check_interrupt (moisture_t *ctx) |
Soft reset function. | |
void moisture_cal | ( | moisture_t * | ctx | ) |
Chip calibration function.
ctx | Click object. |
@description Functions is used to calibrate the device.
void moisture_cfg | ( | moisture_t * | ctx, |
uint16_t | gain, | ||
uint16_t | offset, | ||
uint16_t | clk_div ) |
Configure device function.
ctx | Click object. |
gain | Select moisture gain data. |
offset | Select offset data. |
clk_div | Select clock divider. |
@description Functions is used to configure moisture gain, offset and clock divider.
MOISTURE_REG_RESET_DEV ------------------------------------------- gain
MOISTURE_REG_SETTLE_CNT ------------------------------------------- MOISTURE_SETTLE_CNT_CFG_DEFAULT
MOISTURE_REG_RCNT ------------------------------------------- MOISTURE_RCNT_CFG_DEFAULT
MOISTURE_REG_OFFSET ------------------------------------------- offset
MOISTURE_REG_CLOCK_DIVIDERS ------------------------------------------- MOISTURE_COMBINED_VAL_CH0_DIV clk_div
MOISTURE_REG_DRIVE_CURR ------------------------------------------- MOISTURE_DRIVE_CURR_CH0
MOISTURE_REG_ERR_CFG ------------------------------------------- MOISTURE_ALL_ERR_ENABLED
MOISTURE_REG_CFG ------------------------------------------- MOISTURE_REG_CFG_DEFAULT_SETTINGS
MOISTURE_REG_MUX_CFG ------------------------------------------- MOISTURE_INPUT_DEGLITCH_FILT_BWDTH_33MHZ
void moisture_cfg_setup | ( | moisture_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
uint8_t moisture_check_interrupt | ( | moisture_t * | ctx | ) |
Soft reset function.
ctx | Click object. |
state | 0 - no interrupt / 1 - interrupt has occured. |
@description This function checks if interrupt has occured.
void moisture_default_cfg | ( | moisture_t * | ctx | ) |
Click Default Configuration function.
ctx | Click object. |
@description This function executes default configuration for Moisture click.
MOISTURE_REG_RESET_DEV ------------------------------------------- MOISTURE_OUTPUT_GAIN_x16
MOISTURE_REG_SETTLE_CNT
MOISTURE_SETTLE_CNT_CFG_DEFAULT
MOISTURE_REG_RCNT ------------------------------------------- MOISTURE_RCNT_CFG_DEFAULT
MOISTURE_REG_OFFSET
MOISTURE_DEFAULT_OFFSET
MOISTURE_REG_CLOCK_DIVIDERS ------------------------------------------- MOISTURE_COMBINED_VAL_CH0_DIV MOISTURE_CLOCK_DIVIDERS_x10
MOISTURE_REG_DRIVE_CURR
MOISTURE_DRIVE_CURR_CH0
MOISTURE_REG_ERR_CFG ------------------------------------------- MOISTURE_ALL_ERR_ENABLED
MOISTURE_REG_CFG
MOISTURE_REG_CFG_DEFAULT_SETTINGS
MOISTURE_REG_MUX_CFG ------------------------------------------- MOISTURE_INPUT_DEGLITCH_FILT_BWDTH_33MHZ
void moisture_generic_read | ( | moisture_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 moisture_generic_write | ( | moisture_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.
uint8_t moisture_get_data | ( | moisture_t * | ctx | ) |
Measurement data function.
ctx | Click object. |
moisture | Data in percent. |
@description Functions is used to measure moisture.
MOISTURE_RETVAL moisture_init | ( | moisture_t * | ctx, |
moisture_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 moisture_read_word | ( | moisture_t * | ctx, |
uint8_t | reg ) |
Read word function.
ctx | Click object. |
reg | Register which will be read. |
result | Two byte data which is read from the register. |
@description This function reads one word from the desired register.
void moisture_soft_reset | ( | moisture_t * | ctx | ) |
Soft reset function.
ctx | Click object. |
@description This function performs soft reset.
void moisture_write_word | ( | moisture_t * | ctx, |
uint8_t | reg, | ||
uint16_t | data_in ) |
Write word function.
ctx | Click object. |
reg | Register in which the data will be written. |
data_in | Data which will be written in the register. |
@description This function writes word to the desired register.