ldc
2.0.0.0
|
API for configuring and manipulating LDC Click driver. More...
Modules | |
LDC Registers List | |
List of registers of LDC Click driver. | |
LDC Registers Settings | |
Settings for registers of LDC Click driver. | |
LDC MikroBUS Map | |
MikroBUS pin mapping of LDC Click driver. | |
Functions | |
void | ldc_cfg_setup (ldc_cfg_t *cfg) |
LDC configuration object setup function. More... | |
err_t | ldc_init (ldc_t *ctx, ldc_cfg_t *cfg) |
LDC initialization function. More... | |
err_t | ldc_default_cfg (ldc_t *ctx) |
LDC default configuration function. More... | |
err_t | ldc_generic_write (ldc_t *ctx, uint8_t reg, uint16_t tx_data) |
LDC I2C writing function. More... | |
err_t | ldc_generic_read (ldc_t *ctx, uint8_t reg, uint16_t *rx_data) |
LDC I2C reading function. More... | |
uint8_t | ldc_get_interrupt (ldc_t *ctx) |
Get interrupt pin status. More... | |
void | ldc_set_shut_down (ldc_t *ctx, uint8_t state) |
Set shut down pin status. More... | |
err_t | ldc_get_frequency (ldc_t *ctx, uint8_t channel, uint16_t divider, float *frequency) |
Get frequency value calulated for specific channel. More... | |
float | ldc_calculate_inductance (float frequency) |
Calculate inductance relative to frequency. More... | |
API for configuring and manipulating LDC Click driver.
float ldc_calculate_inductance | ( | float | frequency | ) |
Calculate inductance relative to frequency.
This function calculates inductance relative to forwarded frequency.
[in] | ctx | : Click context object. See ldc_t object definition for detailed explanation. |
[in] | frequency | : Current sensor frequency. |
void ldc_cfg_setup | ( | ldc_cfg_t * | cfg | ) |
LDC configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See ldc_cfg_t object definition for detailed explanation. |
err_t ldc_default_cfg | ( | ldc_t * | ctx | ) |
LDC default configuration function.
This function executes a default configuration of LDC click board.
[in] | ctx | : Click context object. See ldc_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t ldc_generic_read | ( | ldc_t * | ctx, |
uint8_t | reg, | ||
uint16_t * | rx_data | ||
) |
LDC I2C reading function.
This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See ldc_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | rx_buf | : Output read data. |
[in] | rx_len | : Number of bytes to be read. |
0
- Success, -1
- Error.err_t ldc_generic_write | ( | ldc_t * | ctx, |
uint8_t | reg, | ||
uint16_t | tx_data | ||
) |
LDC I2C writing function.
This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See ldc_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | tx_buf | : Data to be written. |
[in] | tx_len | : Number of bytes to be written. |
0
- Success, -1
- Error.err_t ldc_get_frequency | ( | ldc_t * | ctx, |
uint8_t | channel, | ||
uint16_t | divider, | ||
float * | frequency | ||
) |
Get frequency value calulated for specific channel.
This function reads a data from data channel and calculates frequency relative to selected divider.
[in] | ctx | : Click context object. See ldc_t object definition for detailed explanation. |
[in] | channel | : Channel data register to read from. |
[in] | divider | : Divider set for selected channel. |
[out] | frequency | : Calculated frequency in MHz. |
0
- Success, -1
- Error, -2
- Under-range, -3
- Over-range, -4
- Watchdog.uint8_t ldc_get_interrupt | ( | ldc_t * | ctx | ) |
Get interrupt pin status.
This function reads int_pin status.
[in] | ctx | : Click context object. See ldc_t object definition for detailed explanation. |
LDC initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See ldc_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See ldc_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.