pir 2.0.0.0
|
Functions | |
void | pir_cfg_setup (pir_cfg_t *cfg) |
Config Object Initialization function. | |
PIR_RETVAL | pir_init (pir_t *ctx, pir_cfg_t *cfg) |
Initialization function. | |
void | pir_generic_write (pir_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic write function. | |
void | pir_generic_read (pir_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic read function. | |
uint16_t | pir_get_adc (pir_t *ctx) |
Reading 12bit ADC value. | |
uint16_t | pir_reg_read (pir_t *ctx) |
Reading register. | |
float | pir_get_mili_volt (pir_t *ctx, uint16_t ref_voltage) |
Reading ADC data in mili Volts. | |
float | pir_scale_results (pir_t *ctx, uint16_t in_val, uint16_t out_min, uint16_t out_max) |
Scaling ADC results. | |
void pir_cfg_setup | ( | pir_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
void pir_generic_read | ( | pir_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 pir_generic_write | ( | pir_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.
uint16_t pir_get_adc | ( | pir_t * | ctx | ) |
Reading 12bit ADC value.
ctx | Click object. |
This function reads single ADC conversion data
float pir_get_mili_volt | ( | pir_t * | ctx, |
uint16_t | ref_voltage ) |
Reading ADC data in mili Volts.
ctx | Click object. |
ref_voltage | reference voltage in miliVolts (3300 or 5000 miliVolts). |
This function reads 12bit ADC data and convets it to miliVolts
PIR_RETVAL pir_init | ( | pir_t * | ctx, |
pir_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 pir_reg_read | ( | pir_t * | ctx | ) |
Reading register.
ctx | Click object. |
This function reads register
float pir_scale_results | ( | pir_t * | ctx, |
uint16_t | in_val, | ||
uint16_t | out_min, | ||
uint16_t | out_max ) |
Scaling ADC results.
ctx | Click object. |
in_val | ADC conversion raw data |
out_min | lower limit of output data |
out_max | upper limit of output data |
This function scales ADC conversion data (inVal) to desired range (from outMin to outMax) and returns scaled data (outVal)