dac18
2.1.0.0
|
API for configuring and manipulating DAC 18 Click driver. More...
Modules | |
DAC 18 Registers List | |
List of registers of DAC 18 Click driver. | |
DAC 18 Registers Settings | |
Settings for registers of DAC 18 Click driver. | |
DAC 18 MikroBUS Map | |
MikroBUS pin mapping of DAC 18 Click driver. | |
Functions | |
void | dac18_cfg_setup (dac18_cfg_t *cfg) |
DAC 18 configuration object setup function. More... | |
err_t | dac18_init (dac18_t *ctx, dac18_cfg_t *cfg) |
DAC 18 initialization function. More... | |
err_t | dac18_default_cfg (dac18_t *ctx) |
DAC 18 default configuration function. More... | |
err_t | dac18_generic_write (dac18_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
DAC 18 I2C writing function. More... | |
err_t | dac18_generic_read (dac18_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
DAC 18 I2C reading function. More... | |
err_t | dac18_register_write (dac18_t *ctx, uint8_t reg, uint16_t data_in) |
DAC 18 register writing function. More... | |
err_t | dac18_register_read (dac18_t *ctx, uint8_t reg, uint16_t *data_out) |
DAC 18 register reading function. More... | |
err_t | dac18_cfg_pwm_out (dac18_t *ctx, uint8_t f_sel, uint8_t c_step, uint8_t t_step) |
DAC 18 PWM OUT0 configuration function. More... | |
err_t | dac18_set_dac_code (dac18_t *ctx, uint16_t max_dc, uint16_t min_dc) |
DAC 18 set DAC code function. More... | |
err_t | dac18_set_debounce_delay (dac18_t *ctx, float delay_ms) |
DAC 18 set debounce delay function. More... | |
void | dac18_set_mode (dac18_t *ctx, uint8_t mode) |
DAC 18 set operation mode function. More... | |
uint8_t | dac18_get_gp0 (dac18_t *ctx) |
DAC 18 get GP0 pin state function. More... | |
uint8_t | dac18_get_gp1 (dac18_t *ctx) |
DAC 18 get GP1 pin state function. More... | |
uint8_t | dac18_get_gp2 (dac18_t *ctx) |
DAC 18 get GP2 pin state function. More... | |
void | dac18_get_gpi_status (dac18_t *ctx, uint8_t *gpi_status) |
DAC 18 get GPI status function. More... | |
API for configuring and manipulating DAC 18 Click driver.
err_t dac18_cfg_pwm_out | ( | dac18_t * | ctx, |
uint8_t | f_sel, | ||
uint8_t | c_step, | ||
uint8_t | t_step | ||
) |
DAC 18 PWM OUT0 configuration function.
This function configures PWM output (OUT0) for the function generator by using the I2C serial interface.
[in] | ctx | : Click context object. See dac18_t object definition for detailed explanation. |
[in] | f_sel | : Function select (sawtooth or triangular waveform). |
[in] | c_step | : Code step [0x00-0x07]. |
[in] | t_step | : Time step [0x00-0x0F]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void dac18_cfg_setup | ( | dac18_cfg_t * | cfg | ) |
DAC 18 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See dac18_cfg_t object definition for detailed explanation. |
err_t dac18_default_cfg | ( | dac18_t * | ctx | ) |
DAC 18 default configuration function.
This function executes a default configuration of DAC 18 click board.
[in] | ctx | : Click context object. See dac18_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dac18_generic_read | ( | dac18_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len | ||
) |
DAC 18 I2C reading function.
This function reads a desired number of data bytes starting from the selected register by using the I2C serial interface.
[in] | ctx | : Click context object. See dac18_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 dac18_generic_write | ( | dac18_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len | ||
) |
DAC 18 I2C writing function.
This function writes a desired number of data bytes starting from the selected register by using the I2C serial interface.
[in] | ctx | : Click context object. See dac18_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. uint8_t dac18_get_gp0 | ( | dac18_t * | ctx | ) |
DAC 18 get GP0 pin state function.
This function gets states of the GP0 pin.
[in] | ctx | : Click context object. See dac18_t object definition for detailed explanation. |
0
- Low pin state, 1
- High pin state. uint8_t dac18_get_gp1 | ( | dac18_t * | ctx | ) |
DAC 18 get GP1 pin state function.
This function gets states of the GP1 pin.
[in] | ctx | : Click context object. See dac18_t object definition for detailed explanation. |
0
- Low pin state, 1
- High pin state. uint8_t dac18_get_gp2 | ( | dac18_t * | ctx | ) |
DAC 18 get GP2 pin state function.
This function gets states of the GP2 pin.
[in] | ctx | : Click context object. See dac18_t object definition for detailed explanation. |
0
- Low pin state, 1
- High pin state. void dac18_get_gpi_status | ( | dac18_t * | ctx, |
uint8_t * | gpi_status | ||
) |
DAC 18 get GPI status function.
This function gets GPI status by reading the states of the GP0, GP1 and GP2 pins.
[in] | ctx | : Click context object. See dac18_t object definition for detailed explanation. |
[in] | gpi_status | : GPI status [0-7]. |
err_t dac18_init | ( | dac18_t * | ctx, |
dac18_cfg_t * | cfg | ||
) |
DAC 18 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See dac18_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See dac18_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dac18_register_read | ( | dac18_t * | ctx, |
uint8_t | reg, | ||
uint16_t * | data_out | ||
) |
DAC 18 register reading function.
This function reads a 16-bit starting from the selected register by using the I2C serial interface.
[in] | ctx | : Click context object. See dac18_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 dac18_register_write | ( | dac18_t * | ctx, |
uint8_t | reg, | ||
uint16_t | data_in | ||
) |
DAC 18 register writing function.
This function writes a 16-bit data to the selected register by using the I2C serial interface.
[in] | ctx | : Click context object. See dac18_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 dac18_set_dac_code | ( | dac18_t * | ctx, |
uint16_t | max_dc, | ||
uint16_t | min_dc | ||
) |
DAC 18 set DAC code function.
This function sets min and max DAC code for the function generator by using the I2C serial interface.
[in] | ctx | : Click context object. See dac18_t object definition for detailed explanation. |
[in] | f_sel | : Function select (sawtooth or triangular waveform). |
[in] | max_dc | : Maximum DAC code for the function generator. |
[in] | min_dc | : Minimum DAC code for the function generator. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dac18_set_debounce_delay | ( | dac18_t * | ctx, |
float | delay_ms | ||
) |
DAC 18 set debounce delay function.
This function sets the desired debounce delay y for the GPI pins by using the I2C serial interface.
[in] | ctx | : Click context object. See dac18_t object definition for detailed explanation. |
[in] | delay_ms | : Debounce delay in millisecond [0ms-10485.6ms]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void dac18_set_mode | ( | dac18_t * | ctx, |
uint8_t | mode | ||
) |
DAC 18 set operation mode function.
This function selects between programming and standalone modes by toggling the digital output state of the MOD pin.
[in] | ctx | : Click context object. See dac18_t object definition for detailed explanation. |
[in] | mode | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation.