noise 2.0.0.0
|
Functions | |
void | noise_cfg_setup (noise_cfg_t *cfg) |
Config Object Initialization function. | |
err_t | noise_init (noise_t *ctx, noise_cfg_t *cfg) |
Initialization function. | |
void | noise_default_cfg (noise_t *ctx) |
Click Default Configuration function. | |
void | noise_write_cmd_reg (noise_t *ctx, uint16_t cmd_data) |
Write to Command Register. | |
err_t | noise_set_cmd_reg (noise_t *ctx, uint8_t configuration, uint16_t threshold) |
Set Command Register. | |
void | noise_set_state (noise_t *ctx, uint8_t state) |
Enable/disable click. | |
void | noise_reset (noise_t *ctx) |
Reset Click. | |
uint8_t | noise_check_int_pin (noise_t *ctx) |
Get INT pin state. | |
err_t | noise_read_an_pin_value (noise_t *ctx, uint16_t *data_out) |
Noise read AN pin value function. | |
err_t | noise_read_an_pin_voltage (noise_t *ctx, float *data_out) |
Noise read AN pin voltage level function. | |
void noise_cfg_setup | ( | noise_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
This function initializes click configuration structure to init state.
uint8_t noise_check_int_pin | ( | noise_t * | ctx | ) |
Get INT pin state.
ctx | Click object. |
This function gets int pin state.
void noise_default_cfg | ( | noise_t * | ctx | ) |
Click Default Configuration function.
ctx | Click object. |
This function performs default configuration for Noise click. Typically, it's setting threshold to default value.
err_t noise_init | ( | noise_t * | ctx, |
noise_cfg_t * | cfg ) |
Initialization function.
ctx | Click object. |
cfg | Click configuration structure. |
This function initializes all necessary pins and peripherals used for this click.
err_t noise_read_an_pin_value | ( | noise_t * | ctx, |
uint16_t * | data_out ) |
Noise read AN pin value function.
This function reads results of AD conversion of the AN pin.
[in] | ctx | : Click context object. See noise_t object definition for detailed explanation. |
[out] | data_out | : Output ADC result. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t noise_read_an_pin_voltage | ( | noise_t * | ctx, |
float * | data_out ) |
Noise read AN pin voltage level function.
This function reads results of AD conversion of the AN pin and converts them to proportional voltage level.
[in] | ctx | : Click context object. See noise_t object definition for detailed explanation. |
[out] | data_out | : Output voltage level of the analog pin [V]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void noise_reset | ( | noise_t * | ctx | ) |
Reset Click.
ctx | Click object. |
This function performs click reset.
err_t noise_set_cmd_reg | ( | noise_t * | ctx, |
uint8_t | configuration, | ||
uint16_t | threshold ) |
Set Command Register.
ctx | Click object. |
configuration | Configuration. |
threshold | Threshold. |
This function sets command register.
Threshold is integer from [0, 4095] segment. When measured noise level is above threshold, alarm is triggered.
void noise_set_state | ( | noise_t * | ctx, |
uint8_t | state ) |
Enable/disable click.
ctx | Click object. |
state | State to set click on. |
This function switches click on or off.
void noise_write_cmd_reg | ( | noise_t * | ctx, |
uint16_t | cmd_data ) |
Write to Command Register.
ctx | Click object. |
cmd_data | Command and data to send. |
This function writes data to click's command register.