waveform2 2.0.0.0
Waveform 2 Click Driver

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.
 

Detailed Description

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.

Function Documentation

◆ waveform2_cfg_setup()

void waveform2_cfg_setup ( waveform2_cfg_t * cfg)

Waveform 2 configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See waveform2_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ waveform2_configuration()

void waveform2_configuration ( waveform2_t * ctx,
uint16_t cfg )

Waveform 2 configuration function.

Function for writing to the config register.

Parameters
[in]ctx: Click context object. See waveform2_t object definition for detailed explanation.
[in]cfg: Configuration.
Returns
Nothing.

◆ waveform2_default_cfg()

err_t waveform2_default_cfg ( waveform2_t * ctx)

Waveform 2 default configuration function.

This function executes a default configuration of Waveform 2 click board.

Parameters
[in]ctx: Click context object. See waveform2_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ waveform2_eeprom_read_byte()

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.

Parameters
[in]ctx: Click context object. See waveform2_t object definition for detailed explanation.
[in]addr: EEPROM Address.
Returns
8-bit read data.

◆ waveform2_eeprom_read_long()

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.

Parameters
[in]ctx: Click context object. See waveform2_t object definition for detailed explanation.
[in]addr: EEPROM Address.
Returns
32-bit read data.

◆ waveform2_eeprom_read_string()

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.

Parameters
[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.
Returns
Nothing.

◆ waveform2_eeprom_read_word()

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.

Parameters
[in]ctx: Click context object. See waveform2_t object definition for detailed explanation.
[in]addr: EEPROM Address.
Returns
16-bit read data.

◆ waveform2_eeprom_write_byte()

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.

Parameters
[in]ctx: Click context object. See waveform2_t object definition for detailed explanation.
[in]addr: EEPROM Address.
[in]tx_data: (uint8_t) Data.
Returns
Nothing.

◆ waveform2_eeprom_write_long()

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.

Parameters
[in]ctx: Click context object. See waveform2_t object definition for detailed explanation.
[in]addr: EEPROM Address.
[in]tx_data(uint32_t) Data.
Returns
Nothing.

◆ waveform2_eeprom_write_string()

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.

Parameters
[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.
Returns
Nothing.

◆ waveform2_eeprom_write_word()

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.

Parameters
[in]ctx: Click context object. See waveform2_t object definition for detailed explanation.
[in]addr: EEPROM Address.
[in]tx_data(uint16_t) Data.
Returns
Nothing.

◆ waveform2_hw_reset()

void waveform2_hw_reset ( waveform2_t * ctx)

Waveform 2 hardware reset function.

Function for performing a hardware reset of the click board.

Parameters
[out]ctx: Click context object. See waveform2_t object definition for detailed explanation.
Returns
Nothing.

◆ waveform2_i2c_read()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ waveform2_i2c_write()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ waveform2_init()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ waveform2_mclk_disable()

void waveform2_mclk_disable ( waveform2_t * ctx)

Waveform 2 disable oscilator function.

Function for disabling the on board main 50MHz oscilator.

Parameters
[out]ctx: Click context object. See waveform2_t object definition for detailed explanation.
Returns
Nothing.

◆ waveform2_mclk_enable()

void waveform2_mclk_enable ( waveform2_t * ctx)

Waveform 2 enable oscilator function.

Function for enabling the on board main 50MHz oscilator.

Parameters
[out]ctx: Click context object. See waveform2_t object definition for detailed explanation.
Returns
Nothing.

◆ waveform2_output_off()

void waveform2_output_off ( waveform2_t * ctx)

Waveform 2 disable output function.

Function for disabling the output.

Parameters
[in]ctx: Click context object. See waveform2_t object definition for detailed explanation.
Returns
Nothing.

◆ waveform2_set_freq()

void waveform2_set_freq ( waveform2_t * ctx,
uint32_t freq )

Waveform 2 set frequency function.

Function for setting the output frequency.

Parameters
[in]ctx: Click context object. See waveform2_t object definition for detailed explanation.
[in]freq: Frequency data.
Returns
Nothing.

◆ waveform2_sine_output()

void waveform2_sine_output ( waveform2_t * ctx)

Waveform 2 set sine output function.

Function for setting the sine output.

Parameters
[out]ctx: Click context object. See waveform2_t object definition for detailed explanation.
Returns
Nothing.

◆ waveform2_spi_read()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ waveform2_spi_write()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ waveform2_triangle_output()

void waveform2_triangle_output ( waveform2_t * ctx)

Waveform 2 set triangle output function.

Function for setting the triangle output.

Parameters
[out]ctx: Click context object. See waveform2_t object definition for detailed explanation.
Returns
Nothing.