ldc 2.0.0.0
|
API for configuring and manipulating LDC Click driver. More...
Topics | |
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. | |
err_t | ldc_init (ldc_t *ctx, ldc_cfg_t *cfg) |
LDC initialization function. | |
err_t | ldc_default_cfg (ldc_t *ctx) |
LDC default configuration function. | |
err_t | ldc_generic_write (ldc_t *ctx, uint8_t reg, uint16_t tx_data) |
LDC I2C writing function. | |
err_t | ldc_generic_read (ldc_t *ctx, uint8_t reg, uint16_t *rx_data) |
LDC I2C reading function. | |
uint8_t | ldc_get_interrupt (ldc_t *ctx) |
Get interrupt pin status. | |
void | ldc_set_shut_down (ldc_t *ctx, uint8_t state) |
Set shut down pin status. | |
err_t | ldc_get_frequency (ldc_t *ctx, uint8_t channel, uint16_t divider, float *frequency) |
Get frequency value calulated for specific channel. | |
float | ldc_calculate_inductance (float frequency) |
Calculate inductance relative to frequency. | |
API for configuring and manipulating LDC Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
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.