thunder
2.0.0.0
|
Functions | |
void | thunder_cfg_setup (thunder_cfg_t *cfg) |
Config Object Initialization function. More... | |
THUNDER_RETVAL | thunder_init (thunder_t *ctx, thunder_cfg_t *cfg) |
Initialization function. More... | |
void | thunder_default_cfg (thunder_t *ctx) |
Click Default Configuration function. More... | |
void | thunder_generic_transfer (thunder_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len) |
Generic transfer function. More... | |
uint8_t | thunder_write_reg (thunder_t *ctx, uint8_t reg_addr, uint8_t transfer_data) |
Generic Write function. More... | |
uint8_t | thunder_read_reg (thunder_t *ctx, uint8_t reg_addr, uint8_t *data_out, uint8_t n_bytes) |
Generic Read function. More... | |
void | thunder_send_command (thunder_t *ctx, uint8_t command) |
Command Send function. More... | |
uint8_t | thunder_check_interr (thunder_t *ctx) |
Interrupt Check function. More... | |
void | thunder_get_storm_info (thunder_t *ctx, uint32_t *energy_out, uint8_t *distance_out) |
Storm Information Get function. More... | |
uint8_t | thunder_check_irq_pin (thunder_t *ctx) |
IRQ Pin Check function. More... | |
void thunder_cfg_setup | ( | thunder_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
uint8_t thunder_check_interr | ( | thunder_t * | ctx | ) |
Interrupt Check function.
ctx | Click object. |
@description Function checks and returns the interrupt value.
uint8_t thunder_check_irq_pin | ( | thunder_t * | ctx | ) |
IRQ Pin Check function.
ctx | Click object. |
@description Function returns the value of the IRQ pin (INT).
void thunder_default_cfg | ( | thunder_t * | ctx | ) |
Click Default Configuration function.
ctx | Click object. |
@description This function executes default configuration for Thunder click.
void thunder_generic_transfer | ( | thunder_t * | ctx, |
uint8_t * | wr_buf, | ||
uint16_t | wr_len, | ||
uint8_t * | rd_buf, | ||
uint16_t | rd_len | ||
) |
Generic transfer function.
ctx | Click object. |
wr_buf | Write data buffer |
wr_len | Number of byte in write data buffer |
rd_buf | Read data buffer |
rd_len | Number of byte in read data buffer |
@description Generic SPI transfer, for sending and receiving 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 |
@description Function gets energy of the single lightning and distance estimation for the head of the storm.
THUNDER_RETVAL thunder_init | ( | thunder_t * | ctx, |
thunder_cfg_t * | cfg | ||
) |
Initialization function.
thunder | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
uint8_t thunder_read_reg | ( | thunder_t * | ctx, |
uint8_t | reg_addr, | ||
uint8_t * | data_out, | ||
uint8_t | n_bytes | ||
) |
Generic Read function.
ctx | Click object. |
reg_addr | Address which from data be read. |
data_ut | Buffer where data be stored. |
n_bytes | Number of bytes to be read. |
@description Function reads the desired number of bytes from the registers.
void thunder_send_command | ( | thunder_t * | ctx, |
uint8_t | command | ||
) |
Command Send function.
ctx | Click object. |
selCommand | 0 - Reset command, Value different from 0 - RCO calibrate command |
@description Function performs the one of two possible commands.
uint8_t thunder_write_reg | ( | thunder_t * | ctx, |
uint8_t | reg_addr, | ||
uint8_t | transfer_data | ||
) |
Generic Write function.
ctx | Click object. |
reg_addr | Address where data be written. |
transfer_data | Data to be written. |
@description Function writes one byte to the register.