waveform3 2.0.0.0
waveform3.h File Reference

This file contains API for Waveform 3 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_spi_master.h"

Go to the source code of this file.

Data Structures

struct  waveform3_t
 Waveform 3 Click context object. More...
 
struct  waveform3_cfg_t
 Waveform 3 Click configuration object. More...
 

Macros

#define WAVEFORM3_REG_B28_BIT   1 << 13
 Waveform 3 B28 register bit.
 
#define WAVEFORM3_REG_HLB_BIT   1 << 12
 Waveform 3 HLB register bit.
 
#define WAVEFORM3_REG_FSEL_BIT   1 << 11
 Waveform 3 FSEL register bit.
 
#define WAVEFORM3_REG_PSEL_BIT   1 << 10
 Waveform 3 PSEL register bit.
 
#define WAVEFORM3_REG_RESET_BIT   1 << 8
 Waveform 3 RESET register bit.
 
#define WAVEFORM3_REG_SLEEP1_BIT   1 << 7
 Waveform 3 SLEEP1 register bit.
 
#define WAVEFORM3_REG_SLEEP12_BIT   1 << 6
 Waveform 3 SLEEP12 register bit.
 
#define WAVEFORM3_REG_OPBITEN_BIT   1 << 5
 Waveform 3 OPBITEN register bit.
 
#define WAVEFORM3_REG_DIV2_BIT   1 << 3
 Waveform 3 DIV2 register bit.
 
#define WAVEFORM3_REG_MODE_BIT   1 << 1
 Waveform 3 MODE register bit.
 
#define WAVEFORM3_REG_RESET_CLEAR   0x0000
 Waveform 3 RESET register bit.
 
#define WAVEFORM3_CFG_MODE_SINUSOIDAL   0x00
 Waveform 3 sinusoidal output mode.
 
#define WAVEFORM3_CFG_MODE_TRIANGLE   0x01
 Waveform 3 triangle output mode.
 
#define WAVEFORM3_CFG_MODE_DAC_2   0x02
 Waveform 3 DAC divided by 2 output mode.
 
#define WAVEFORM3_CFG_MODE_DAC   0x03
 Waveform 3 DAC output mode.
 
#define WAVEFORM3_CFG_FREQ_REG0   0x00
 Waveform 3 FREQ0 channel select.
 
#define WAVEFORM3_CFG_FREQ_REG1   0x01
 Waveform 3 FREQ1 channel select.
 
#define WAVEFORM3_CFG_PHASE_REG0   0x00
 Waveform 3 PHASE0 channel select.
 
#define WAVEFORM3_CFG_PHASE_REG1   0x01
 Waveform 3 PHASE1 channel select.
 
#define WAVEFORM3_DEFAULT_FREQ0   0
 Waveform 3 default FREQ0 value.
 
#define WAVEFORM3_DEFAULT_FREQ1   0
 Waveform 3 default FREQ1 value.
 
#define WAVEFORM3_DEFAULT_PHASE0   0
 Waveform 3 default PHASE0 value.
 
#define WAVEFORM3_DEFAULT_PHASE1   0
 Waveform 3 default PHASE1 value.
 
#define WAVEFORM3_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  waveform3_return_value_t { WAVEFORM3_OK = 0 , WAVEFORM3_ERROR = -1 }
 Waveform 3 Click return value data. More...
 

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

This file contains API for Waveform 3 Click Driver.

Enumeration Type Documentation

◆ waveform3_return_value_t

Waveform 3 Click return value data.

Predefined enum values for driver return values.

Enumerator
WAVEFORM3_OK 
WAVEFORM3_ERROR