thunder 2.0.0.0
|
Functions | |
void | thunder_cfg_setup (thunder_cfg_t *cfg) |
Config Object Initialization function. | |
err_t | thunder_init (thunder_t *ctx, thunder_cfg_t *cfg) |
Initialization function. | |
void | thunder_default_cfg (thunder_t *ctx) |
Click Default Configuration function. | |
err_t | thunder_generic_write (thunder_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
Generic write function. | |
err_t | thunder_generic_read (thunder_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
Generic read function. | |
err_t | thunder_write_reg (thunder_t *ctx, uint8_t reg, uint8_t data_in) |
Write reg function. | |
err_t | thunder_read_reg (thunder_t *ctx, uint8_t reg, uint8_t *data_out) |
Read reg function. | |
void | thunder_send_command (thunder_t *ctx, uint8_t command) |
Command Send function. | |
uint8_t | thunder_check_int (thunder_t *ctx) |
Interrupt Check function. | |
void | thunder_get_storm_info (thunder_t *ctx, uint32_t *energy_out, uint8_t *distance_out) |
Storm Information Get function. | |
uint8_t | thunder_check_irq_pin (thunder_t *ctx) |
IRQ Pin Check function. | |
void thunder_cfg_setup | ( | thunder_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
This function initializes click configuration structure to init state.
uint8_t thunder_check_int | ( | thunder_t * | ctx | ) |
Interrupt Check function.
ctx | Click object. |
Function checks and returns the interrupt value.
uint8_t thunder_check_irq_pin | ( | thunder_t * | ctx | ) |
IRQ Pin Check function.
ctx | Click object. |
Function returns the value of the IRQ pin (INT).
void thunder_default_cfg | ( | thunder_t * | ctx | ) |
Click Default Configuration function.
ctx | Click object. |
This function executes default configuration for Thunder click.
err_t thunder_generic_read | ( | thunder_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
Generic read function.
ctx | Click object. |
reg | Register address |
data_out | Read data buffer |
len | Number of byte in read data buffer |
Generic SPI read, for receiving packages
err_t thunder_generic_write | ( | thunder_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
Generic write function.
ctx | Click object. |
reg | Register address |
data_in | Write data buffer |
len | Number of byte in write data buffer |
Generic SPI write, for sending packages
void thunder_get_storm_info | ( | thunder_t * | ctx, |
uint32_t * | energy_out, | ||
uint8_t * | distance_out ) |
Storm Information Get function.
ctx | Click object. |
energy_out | Energy of the single lightning |
distance_out | Distance estimation for the head of the storm |
Function gets energy of the single lightning and distance estimation for the head of the storm.
err_t thunder_init | ( | thunder_t * | ctx, |
thunder_cfg_t * | cfg ) |
Initialization function.
thunder | Click object. |
cfg | Click configuration structure. |
This function initializes all necessary pins and peripherals used for this click.
err_t thunder_read_reg | ( | thunder_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out ) |
Read reg function.
ctx | Click object. |
reg | Address which from data be read. |
data_out | Buffer where data be stored. |
Function reads a data byte from the registers.
void thunder_send_command | ( | thunder_t * | ctx, |
uint8_t | command ) |
Command Send function.
ctx | Click object. |
command | 0 - Reset command, Value different from 0 - RCO calibrate command |
Function performs the one of two possible commands.
err_t thunder_write_reg | ( | thunder_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in ) |
Write reg function.
ctx | Click object. |
reg | Address where data be written. |
data_in | Data to be written. |
Function writes one byte to the register.