waveform2 2.0.0.0
|
API for configuring and manipulating Waveform 2 Click driver. More...
Topics | |
Waveform 2 Registers Settings | |
Settings for registers of Waveform 2 Click driver. | |
Waveform 2 MikroBUS Map | |
MikroBUS pin mapping of Waveform 2 Click driver. | |
Functions | |
void | waveform2_cfg_setup (waveform2_cfg_t *cfg) |
Waveform 2 configuration object setup function. | |
err_t | waveform2_init (waveform2_t *ctx, waveform2_cfg_t *cfg) |
Waveform 2 initialization function. | |
err_t | waveform2_default_cfg (waveform2_t *ctx) |
Waveform 2 default configuration function. | |
err_t | waveform2_i2c_write (waveform2_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
Waveform 2 I2C writing function. | |
err_t | waveform2_i2c_read (waveform2_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
Waveform 2 I2C reading function. | |
err_t | waveform2_spi_write (waveform2_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
Waveform 2 SPI writing function. | |
err_t | waveform2_spi_read (waveform2_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
Waveform 2 SPI reading function. | |
uint8_t | waveform2_eeprom_read_byte (waveform2_t *ctx, uint16_t addr) |
Waveform 2 read byte function. | |
uint16_t | waveform2_eeprom_read_word (waveform2_t *ctx, uint16_t addr) |
Waveform 2 read word function. | |
uint32_t | waveform2_eeprom_read_long (waveform2_t *ctx, uint16_t addr) |
Waveform 2 read long function. | |
void | waveform2_eeprom_read_string (waveform2_t *ctx, uint16_t addr, uint8_t *data_buf, uint16_t len) |
Waveform 2 read string function. | |
void | waveform2_eeprom_write_byte (waveform2_t *ctx, uint16_t addr, uint8_t tx_data) |
Waveform 2 write bute function. | |
void | waveform2_eeprom_write_word (waveform2_t *ctx, uint16_t addr, uint16_t tx_data) |
Waveform 2 write word function. | |
void | waveform2_eeprom_write_long (waveform2_t *ctx, uint16_t addr, uint32_t tx_data) |
Waveform 2 write long function. | |
void | waveform2_eeprom_write_string (waveform2_t *ctx, uint16_t addr, uint8_t *data_buf, uint16_t len) |
Waveform 2 write string function. | |
void | waveform2_mclk_enable (waveform2_t *ctx) |
Waveform 2 enable oscilator function. | |
void | waveform2_mclk_disable (waveform2_t *ctx) |
Waveform 2 disable oscilator function. | |
void | waveform2_hw_reset (waveform2_t *ctx) |
Waveform 2 hardware reset function. | |
void | waveform2_set_freq (waveform2_t *ctx, uint32_t freq) |
Waveform 2 set frequency function. | |
void | waveform2_configuration (waveform2_t *ctx, uint16_t cfg) |
Waveform 2 configuration function. | |
void | waveform2_sine_output (waveform2_t *ctx) |
Waveform 2 set sine output function. | |
void | waveform2_triangle_output (waveform2_t *ctx) |
Waveform 2 set triangle output function. | |
void | waveform2_output_off (waveform2_t *ctx) |
Waveform 2 disable output function. | |
API for configuring and manipulating Waveform 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 waveform2_cfg_setup | ( | waveform2_cfg_t * | cfg | ) |
Waveform 2 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See waveform2_cfg_t object definition for detailed explanation. |
void waveform2_configuration | ( | waveform2_t * | ctx, |
uint16_t | cfg ) |
Waveform 2 configuration function.
Function for writing to the config register.
[in] | ctx | : Click context object. See waveform2_t object definition for detailed explanation. |
[in] | cfg | : Configuration. |
err_t waveform2_default_cfg | ( | waveform2_t * | ctx | ) |
Waveform 2 default configuration function.
This function executes a default configuration of Waveform 2 click board.
[in] | ctx | : Click context object. See waveform2_t object definition for detailed explanation. |
0
- Success, -1
- Error.uint8_t waveform2_eeprom_read_byte | ( | waveform2_t * | ctx, |
uint16_t | addr ) |
Waveform 2 read byte function.
Finction for reading a byte from the on board EEPROM memory.
[in] | ctx | : Click context object. See waveform2_t object definition for detailed explanation. |
[in] | addr | : EEPROM Address. |
uint32_t waveform2_eeprom_read_long | ( | waveform2_t * | ctx, |
uint16_t | addr ) |
Waveform 2 read long function.
Finction for reading a long word from the on board EEPROM memory.
[in] | ctx | : Click context object. See waveform2_t object definition for detailed explanation. |
[in] | addr | : EEPROM Address. |
void waveform2_eeprom_read_string | ( | waveform2_t * | ctx, |
uint16_t | addr, | ||
uint8_t * | data_buf, | ||
uint16_t | len ) |
Waveform 2 read string function.
Finction for reading a string from the on board EEPROM memory.
[in] | ctx | : Click context object. See waveform2_t object definition for detailed explanation. |
[in] | addr | : EEPROM Address. |
[out] | data_buf | : Data buffer. |
[in] | len | : Number of data in the buffer. |
uint16_t waveform2_eeprom_read_word | ( | waveform2_t * | ctx, |
uint16_t | addr ) |
Waveform 2 read word function.
Finction for reading a word from the on board EEPROM memory.
[in] | ctx | : Click context object. See waveform2_t object definition for detailed explanation. |
[in] | addr | : EEPROM Address. |
void waveform2_eeprom_write_byte | ( | waveform2_t * | ctx, |
uint16_t | addr, | ||
uint8_t | tx_data ) |
Waveform 2 write bute function.
Function for writing a byte to the on board EEPROM memory.
[in] | ctx | : Click context object. See waveform2_t object definition for detailed explanation. |
[in] | addr | : EEPROM Address. |
[in] | tx_data | : (uint8_t) Data. |
void waveform2_eeprom_write_long | ( | waveform2_t * | ctx, |
uint16_t | addr, | ||
uint32_t | tx_data ) |
Waveform 2 write long function.
Function for writing a long word to the on board EEPROM memory.
[in] | ctx | : Click context object. See waveform2_t object definition for detailed explanation. |
[in] | addr | : EEPROM Address. |
[in] | tx_data | (uint32_t) Data. |
void waveform2_eeprom_write_string | ( | waveform2_t * | ctx, |
uint16_t | addr, | ||
uint8_t * | data_buf, | ||
uint16_t | len ) |
Waveform 2 write string function.
Function for writing a string to the on board EEPROM memory.
[in] | ctx | : Click context object. See waveform2_t object definition for detailed explanation. |
[in] | addr | : EEPROM Address. |
[in] | data_buf | : Data buffer. |
[in] | len | : Number of data for read. |
void waveform2_eeprom_write_word | ( | waveform2_t * | ctx, |
uint16_t | addr, | ||
uint16_t | tx_data ) |
Waveform 2 write word function.
Function for writing a word to the on board EEPROM memory.
[in] | ctx | : Click context object. See waveform2_t object definition for detailed explanation. |
[in] | addr | : EEPROM Address. |
[in] | tx_data | (uint16_t) Data. |
void waveform2_hw_reset | ( | waveform2_t * | ctx | ) |
Waveform 2 hardware reset function.
Function for performing a hardware reset of the click board.
[out] | ctx | : Click context object. See waveform2_t object definition for detailed explanation. |
err_t waveform2_i2c_read | ( | waveform2_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
Waveform 2 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 waveform2_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.err_t waveform2_i2c_write | ( | waveform2_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
Waveform 2 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 waveform2_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.err_t waveform2_init | ( | waveform2_t * | ctx, |
waveform2_cfg_t * | cfg ) |
Waveform 2 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See waveform2_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See waveform2_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.void waveform2_mclk_disable | ( | waveform2_t * | ctx | ) |
Waveform 2 disable oscilator function.
Function for disabling the on board main 50MHz oscilator.
[out] | ctx | : Click context object. See waveform2_t object definition for detailed explanation. |
void waveform2_mclk_enable | ( | waveform2_t * | ctx | ) |
Waveform 2 enable oscilator function.
Function for enabling the on board main 50MHz oscilator.
[out] | ctx | : Click context object. See waveform2_t object definition for detailed explanation. |
void waveform2_output_off | ( | waveform2_t * | ctx | ) |
Waveform 2 disable output function.
Function for disabling the output.
[in] | ctx | : Click context object. See waveform2_t object definition for detailed explanation. |
void waveform2_set_freq | ( | waveform2_t * | ctx, |
uint32_t | freq ) |
Waveform 2 set frequency function.
Function for setting the output frequency.
[in] | ctx | : Click context object. See waveform2_t object definition for detailed explanation. |
[in] | freq | : Frequency data. |
void waveform2_sine_output | ( | waveform2_t * | ctx | ) |
Waveform 2 set sine output function.
Function for setting the sine output.
[out] | ctx | : Click context object. See waveform2_t object definition for detailed explanation. |
err_t waveform2_spi_read | ( | waveform2_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
Waveform 2 SPI reading function.
This function reads a desired number of data bytes starting from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See waveform2_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.err_t waveform2_spi_write | ( | waveform2_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
Waveform 2 SPI writing function.
This function writes a desired number of data bytes starting from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See waveform2_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.void waveform2_triangle_output | ( | waveform2_t * | ctx | ) |
Waveform 2 set triangle output function.
Function for setting the triangle output.
[out] | ctx | : Click context object. See waveform2_t object definition for detailed explanation. |