current6 2.0.0.0
|
API for configuring and manipulating Current 6 Click driver. More...
Topics | |
Current 6 Registers List | |
List of registers of Current 6 Click driver. | |
Current 6 Registers Settings | |
Settings for registers of Current 6 Click driver. | |
Current 6 MikroBUS Map | |
MikroBUS pin mapping of Current 6 Click driver. | |
Functions | |
void | current6_cfg_setup (current6_cfg_t *cfg) |
Current 6 configuration object setup function. | |
err_t | current6_init (current6_t *ctx, current6_cfg_t *cfg) |
Current 6 initialization function. | |
err_t | current6_default_cfg (current6_t *ctx) |
Current 6 default configuration function. | |
err_t | current6_write_byte (current6_t *ctx, uint8_t reg, uint8_t data_in) |
Current 6 write byte function. | |
err_t | current6_read_byte (current6_t *ctx, uint8_t reg, uint8_t *data_out) |
Current 6 read byte function. | |
err_t | current6_write_word (current6_t *ctx, uint8_t reg, uint16_t data_in) |
Current 6 write word function. | |
err_t | current6_read_word (current6_t *ctx, uint8_t reg, uint16_t *data_out) |
Current 6 read word function. | |
err_t | current6_read_32 (current6_t *ctx, uint32_t *data_out) |
Current 6 read 32-bit function. | |
uint8_t | current6_get_alert_pin (current6_t *ctx) |
Current 6 get alert pin function. | |
err_t | current6_read_data (current6_t *ctx, float *voltage, float *current) |
Current 6 read data function. | |
err_t | current6_get_status (current6_t *ctx, uint16_t *status) |
Current 6 get status function. | |
err_t | current6_enable_pec (current6_t *ctx) |
PEC Enable function. | |
err_t | current6_disable_pec (current6_t *ctx) |
PEC Disable function. | |
void | current6_enable_device (current6_t *ctx) |
Current 6 enable device function. | |
void | current6_disable_device (current6_t *ctx) |
Current 6 disable device function. | |
API for configuring and manipulating Current 6 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void current6_cfg_setup | ( | current6_cfg_t * | cfg | ) |
Current 6 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See current6_cfg_t object definition for detailed explanation. |
err_t current6_default_cfg | ( | current6_t * | ctx | ) |
Current 6 default configuration function.
This function executes a default configuration of Current 6 click board.
[in] | ctx | : Click context object. See current6_t object definition for detailed explanation. |
0
- Success, -1
- Error.void current6_disable_device | ( | current6_t * | ctx | ) |
Current 6 disable device function.
This function disables the device by setting the EN pin to low logic state.
[in] | ctx | : Click context object. See current6_t object definition for detailed explanation. |
err_t current6_disable_pec | ( | current6_t * | ctx | ) |
PEC Disable function.
This function disables PEC.
[in] | ctx | : Click context object. See current6_t object definition for detailed explanation. |
0
- Success, -1
- Error. void current6_enable_device | ( | current6_t * | ctx | ) |
Current 6 enable device function.
This function enables the device by setting the EN pin to high logic state.
[in] | ctx | : Click context object. See current6_t object definition for detailed explanation. |
err_t current6_enable_pec | ( | current6_t * | ctx | ) |
PEC Enable function.
This function enables PEC.
[in] | ctx | : Click context object. See current6_t object definition for detailed explanation. |
0
- Success, -1
- Error. uint8_t current6_get_alert_pin | ( | current6_t * | ctx | ) |
Current 6 get alert pin function.
This function returns the alert pin logic state.
[in] | ctx | : Click context object. See current6_t object definition for detailed explanation. |
err_t current6_get_status | ( | current6_t * | ctx, |
uint16_t * | status ) |
Current 6 get status function.
This function reads and clears the status register.
[in] | ctx | : Click context object. See current6_t object definition for detailed explanation. |
[out] | status | : Status register value before clearing. |
0
- Success, -1
- Error.err_t current6_init | ( | current6_t * | ctx, |
current6_cfg_t * | cfg ) |
Current 6 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See current6_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See current6_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t current6_read_32 | ( | current6_t * | ctx, |
uint32_t * | data_out ) |
Current 6 read 32-bit function.
This function reads four bytes of data from the 32-bit data register by using I2C serial interface.
[in] | ctx | : Click context object. See current6_t object definition for detailed explanation. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error.err_t current6_read_byte | ( | current6_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out ) |
Current 6 read byte function.
This function reads one byte of data from the selected byte register by using I2C serial interface.
[in] | ctx | : Click context object. See current6_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error.err_t current6_read_data | ( | current6_t * | ctx, |
float * | voltage, | ||
float * | current ) |
Current 6 read data function.
This function reads the input voltage and current measurement values.
[in] | ctx | : Click context object. See current6_t object definition for detailed explanation. |
[out] | voltage | : Voltage in Volts. |
[out] | current | : Current in Ampers. |
0
- Success, -1
- Error.err_t current6_read_word | ( | current6_t * | ctx, |
uint8_t | reg, | ||
uint16_t * | data_out ) |
Current 6 read word function.
This function reads two bytes of data from the selected word register by using I2C serial interface.
[in] | ctx | : Click context object. See current6_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error.err_t current6_write_byte | ( | current6_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in ) |
Current 6 write byte function.
This function writes one byte of data to the selected byte register by using I2C serial interface.
[in] | ctx | : Click context object. See current6_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | data_in | : Data to be written. |
0
- Success, -1
- Error.err_t current6_write_word | ( | current6_t * | ctx, |
uint8_t | reg, | ||
uint16_t | data_in ) |
Current 6 write word function.
This function writes two bytes of data to the selected word register by using I2C serial interface.
[in] | ctx | : Click context object. See current6_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | data_in | : Data to be written. |
0
- Success, -1
- Error.