waveform3 2.0.0.0
Waveform 3 Click Driver

API for configuring and manipulating Waveform 3 Click driver. More...

Topics

 Waveform 3 Registers List
 List of registers of Waveform 3 Click driver.
 
 Waveform 3 Mode Settings
 Settings for modes of Waveform 3 Click driver.
 
 Waveform 3 FREQ Settings
 Selection for frequency channel of Waveform 3 Click driver.
 
 Waveform 3 PHASE Settings
 Selection for phase shift channel of Waveform 3 Click driver.
 
 Waveform 3 default Settings
 Default settings on reset, located in default_cfg function.
 
 Waveform 3 MikroBUS Map
 MikroBUS pin mapping of Waveform 3 Click driver.
 

Functions

void waveform3_cfg_setup (waveform3_cfg_t *cfg)
 Waveform 3 configuration object setup function.
 
err_t waveform3_init (waveform3_t *ctx, waveform3_cfg_t *cfg)
 Waveform 3 initialization function.
 
void waveform3_default_cfg (waveform3_t *ctx)
 Waveform 3 default configuration function.
 
void waveform3_write_register (waveform3_t *ctx, uint16_t data_in)
 Waveform 3 write register function.
 
void waveform3_reset (waveform3_t *ctx)
 Waveform 3 reset function.
 
uint32_t waveform3_set_freq (waveform3_t *ctx, uint32_t frequency, uint8_t freq_reg)
 Waveform 3 set frequency function.
 
uint16_t waveform3_set_phase (waveform3_t *ctx, float phase, uint8_t phase_reg)
 Waveform 3 set phase function.
 
void waveform3_set_mode (waveform3_t *ctx, uint8_t mode, uint8_t freq_reg, uint8_t phase_reg)
 Waveform 3 set mode function.
 

Detailed Description

API for configuring and manipulating Waveform 3 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

◆ waveform3_cfg_setup()

void waveform3_cfg_setup ( waveform3_cfg_t * cfg)

Waveform 3 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ waveform3_default_cfg()

void waveform3_default_cfg ( waveform3_t * ctx)

Waveform 3 default configuration function.

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

Parameters
[in]ctx: Click context object. See waveform3_t object definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ waveform3_init()

err_t waveform3_init ( waveform3_t * ctx,
waveform3_cfg_t * cfg )

Waveform 3 initialization function.

This function initializes all necessary pins and peripherals used for this click board.

Parameters
[out]ctx: Click context object. See waveform3_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See waveform3_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ waveform3_reset()

void waveform3_reset ( waveform3_t * ctx)

Waveform 3 reset function.

This function performs simple reset of AD9837 waveform generator.

Parameters
[in]ctx: Click context object. See waveform3_t object definition for detailed explanation.
Note
None.

◆ waveform3_set_freq()

uint32_t waveform3_set_freq ( waveform3_t * ctx,
uint32_t frequency,
uint8_t freq_reg )

Waveform 3 set frequency function.

This function sets desired frequency ( in Hz ) on desired freq channel.

Parameters
[in]ctx: Click context object. See waveform3_t object definition for detailed explanation.
[in]frequency: Frequency value.
[in]freq_reg: FREQx channel.
Returns
Actual calculated set frequency.
Note
If the correction coefficient is not used, it is advisable to check the return frequency value.

◆ waveform3_set_mode()

void waveform3_set_mode ( waveform3_t * ctx,
uint8_t mode,
uint8_t freq_reg,
uint8_t phase_reg )

Waveform 3 set mode function.

This function sets output mode, freq and phase channels of AD9837 waveform generator.

Parameters
[in]ctx: Click context object. See waveform3_t object definition for detailed explanation.
[in]mode: Wave output modes.
[in]freq_reg: FREQx channel.
[in]phase_reg: PHASEx channel.
Note
None.

◆ waveform3_set_phase()

uint16_t waveform3_set_phase ( waveform3_t * ctx,
float phase,
uint8_t phase_reg )

Waveform 3 set phase function.

This function sets desired phase shift ( in degrees ) on desired phase channel.

Parameters
[in]ctx: Click context object. See waveform3_t object definition for detailed explanation.
[in]phase: Phase shift value.
[in]phase_reg: PHASEx channel.
Returns
Actual set phase shift represented in integer value.
Note
None.

◆ waveform3_write_register()

void waveform3_write_register ( waveform3_t * ctx,
uint16_t data_in )

Waveform 3 write register function.

This function is used for word transfer as a core of communication.

Parameters
[in]ctx: Click context object. See waveform3_t object definition for detailed explanation.
[in]data_in: Word data.
Note
None.