pmic
2.1.0.0
|
API for configuring and manipulating PMIC Click driver. More...
Modules | |
PMIC Registers List | |
List of registers of PMIC Click driver. | |
PMIC Registers Settings | |
Settings for registers of PMIC Click driver. | |
PMIC MikroBUS Map | |
MikroBUS pin mapping of PMIC Click driver. | |
Functions | |
void | pmic_cfg_setup (pmic_cfg_t *cfg) |
PMIC configuration object setup function. More... | |
err_t | pmic_init (pmic_t *ctx, pmic_cfg_t *cfg) |
PMIC initialization function. More... | |
err_t | pmic_default_cfg (pmic_t *ctx) |
PMIC default configuration function. More... | |
err_t | pmic_reg_write (pmic_t *ctx, uint16_t reg, uint8_t *data_in, uint8_t len) |
PMIC reg write function. More... | |
err_t | pmic_reg_read (pmic_t *ctx, uint16_t reg, uint8_t *data_out, uint8_t len) |
PMIC reg read function. More... | |
err_t | pmic_reg_write_byte (pmic_t *ctx, uint16_t reg, uint8_t data_in) |
PMIC reg write byte function. More... | |
err_t | pmic_reg_read_byte (pmic_t *ctx, uint16_t reg, uint8_t *data_out) |
PMIC reg read byte function. More... | |
uint8_t | pmic_get_int_pin (pmic_t *ctx) |
PMIC get int pin function. More... | |
err_t | pmic_wait_for_event (pmic_t *ctx, uint16_t evt_set_reg, uint8_t bit_mask) |
PMIC wait for event function. More... | |
err_t | pmic_get_vbat (pmic_t *ctx, uint16_t *vbat) |
PMIC get vbat function. More... | |
err_t | pmic_get_vbus (pmic_t *ctx, uint16_t *vbus) |
PMIC get vbus function. More... | |
err_t | pmic_get_vsys (pmic_t *ctx, uint16_t *vsys) |
PMIC get vsys function. More... | |
err_t | pmic_set_charging_current (pmic_t *ctx, uint16_t current) |
PMIC set charging current function. More... | |
API for configuring and manipulating PMIC Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void pmic_cfg_setup | ( | pmic_cfg_t * | cfg | ) |
PMIC configuration object setup function.
This function initializes Click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See pmic_cfg_t object definition for detailed explanation. |
err_t pmic_default_cfg | ( | pmic_t * | ctx | ) |
PMIC default configuration function.
This function executes a default configuration of PMIC Click board.
[in] | ctx | : Click context object. See pmic_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t pmic_get_int_pin | ( | pmic_t * | ctx | ) |
PMIC get int pin function.
This function returns the INT pin logic state.
[in] | ctx | : Click context object. See pmic_t object definition for detailed explanation. |
err_t pmic_get_vbat | ( | pmic_t * | ctx, |
uint16_t * | vbat | ||
) |
PMIC get vbat function.
This function reads the VBAT measurement results in millivolts.
[in] | ctx | : Click context object. See pmic_t object definition for detailed explanation. |
[in] | vbat | : VBAT measurement in millivolts. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t pmic_get_vbus | ( | pmic_t * | ctx, |
uint16_t * | vbus | ||
) |
PMIC get vbus function.
This function reads the VBUS measurement results in millivolts.
[in] | ctx | : Click context object. See pmic_t object definition for detailed explanation. |
[in] | vbus | : VBUS measurement in millivolts. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t pmic_get_vsys | ( | pmic_t * | ctx, |
uint16_t * | vsys | ||
) |
PMIC get vsys function.
This function reads the VSYS measurement results in millivolts.
[in] | ctx | : Click context object. See pmic_t object definition for detailed explanation. |
[in] | vsys | : VSYS measurement in millivolts. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t pmic_init | ( | pmic_t * | ctx, |
pmic_cfg_t * | cfg | ||
) |
PMIC initialization function.
This function initializes all necessary pins and peripherals used for this Click board.
[out] | ctx | : Click context object. See pmic_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See pmic_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t pmic_reg_read | ( | pmic_t * | ctx, |
uint16_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len | ||
) |
PMIC reg read 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 pmic_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | data_out | : Output read data. |
[in] | len | : Number of bytes to be read. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t pmic_reg_read_byte | ( | pmic_t * | ctx, |
uint16_t | reg, | ||
uint8_t * | data_out | ||
) |
PMIC reg read byte function.
This function reads a data byte from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See pmic_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t pmic_reg_write | ( | pmic_t * | ctx, |
uint16_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len | ||
) |
PMIC reg write 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 pmic_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | data_in | : Data to be written. |
[in] | len | : Number of bytes to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t pmic_reg_write_byte | ( | pmic_t * | ctx, |
uint16_t | reg, | ||
uint8_t | data_in | ||
) |
PMIC reg write byte function.
This function writes a data byte to the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See pmic_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | data_in | : Data to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t pmic_set_charging_current | ( | pmic_t * | ctx, |
uint16_t | current | ||
) |
PMIC set charging current function.
This function sets the charging current limit.
[in] | ctx | : Click context object. See pmic_t object definition for detailed explanation. |
[in] | current | : Current limit from 32mA to 800mA in 2mA steps. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t pmic_wait_for_event | ( | pmic_t * | ctx, |
uint16_t | evt_set_reg, | ||
uint8_t | bit_mask | ||
) |
PMIC wait for event function.
This function waits for a desired bits to be set in the selected event set register.
[in] | ctx | : Click context object. See pmic_t object definition for detailed explanation. |
[in] | evt_set_reg | : Event set register address. |
[in] | bit_mask | : Bit mask to wait for. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.