antopwm2 2.1.0.0
|
API for configuring and manipulating AN to PWM 2 Click driver. More...
Topics | |
AN to PWM 2 Registers Settings | |
Settings for registers of AN to PWM 2 Click driver. | |
AN to PWM 2 MikroBUS Map | |
MikroBUS pin mapping of AN to PWM 2 Click driver. | |
Functions | |
void | antopwm2_cfg_setup (antopwm2_cfg_t *cfg) |
AN to PWM 2 configuration object setup function. | |
err_t | antopwm2_init (antopwm2_t *ctx, antopwm2_cfg_t *cfg) |
AN to PWM 2 initialization function. | |
err_t | antopwm2_set_digipot (antopwm2_t *ctx, uint8_t wiper) |
AN to PWM 2 set digipot function. | |
err_t | antopwm2_read_digipot (antopwm2_t *ctx, uint8_t *data_out) |
AN to PWM 2 read digipot function. | |
err_t | antopwm2_set_digipot_otp (antopwm2_t *ctx, uint8_t wiper) |
AN to PWM 2 set digipot otp function. | |
err_t | antopwm2_set_frequency (antopwm2_t *ctx, uint32_t freq) |
AN to PWM 2 set frequency function. | |
err_t | antopwm2_set_frequency_otp (antopwm2_t *ctx, uint32_t freq) |
AN to PWM 2 set frequency otp function. | |
uint8_t | antopwm2_get_int_pin (antopwm2_t *ctx) |
AN to PWM 2 get int pin function. | |
API for configuring and manipulating AN to PWM 2 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void antopwm2_cfg_setup | ( | antopwm2_cfg_t * | cfg | ) |
AN to PWM 2 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See antopwm2_cfg_t object definition for detailed explanation. |
uint8_t antopwm2_get_int_pin | ( | antopwm2_t * | ctx | ) |
AN to PWM 2 get int pin function.
This function returns the INT pin logic state.
[in] | ctx | : Click context object. See antopwm2_t object definition for detailed explanation. |
err_t antopwm2_init | ( | antopwm2_t * | ctx, |
antopwm2_cfg_t * | cfg ) |
AN to PWM 2 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See antopwm2_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See antopwm2_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t antopwm2_read_digipot | ( | antopwm2_t * | ctx, |
uint8_t * | data_out ) |
AN to PWM 2 read digipot function.
This function reads a digipot wiper position and status by using I2C serial interface.
[in] | ctx | : Click context object. See antopwm2_t object definition for detailed explanation. |
[out] | data_out | : Output data read: B7-B6 -> status, B5-B0 -> wiper position. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t antopwm2_set_digipot | ( | antopwm2_t * | ctx, |
uint8_t | wiper ) |
AN to PWM 2 set digipot function.
This function sets a digipot wiper position by using I2C serial interface.
[in] | ctx | : Click context object. See antopwm2_t object definition for detailed explanation. |
[in] | wiper | : Digipot wiper to be set (0-63). |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t antopwm2_set_digipot_otp | ( | antopwm2_t * | ctx, |
uint8_t | wiper ) |
AN to PWM 2 set digipot otp function.
This function sets a digipot wiper position in OTP mode by using I2C serial interface.
[in] | ctx | : Click context object. See antopwm2_t object definition for detailed explanation. |
[in] | wiper | : Digipot wiper to be set (0-63). |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t antopwm2_set_frequency | ( | antopwm2_t * | ctx, |
uint32_t | freq ) |
AN to PWM 2 set frequency function.
This function sets a frequency output in a range from 500kHz to 1MHz by setting the digipot resistance.
[in] | ctx | : Click context object. See antopwm2_t object definition for detailed explanation. |
[in] | freq | : Frequency in Hz to be set (500000-1000000). |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t antopwm2_set_frequency_otp | ( | antopwm2_t * | ctx, |
uint32_t | freq ) |
AN to PWM 2 set frequency otp function.
This function sets a frequency output in a range from 500kHz to 1MHz by setting the digipot resistance in OTP mode.
[in] | ctx | : Click context object. See antopwm2_t object definition for detailed explanation. |
[in] | freq | : Frequency in Hz to be set (500000-1000000). |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.