waveform2 2.0.0.0
waveform2.h File Reference

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

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

Go to the source code of this file.

Data Structures

struct  waveform2_s
 Waveform 2 Click context object. More...
 
struct  waveform2_cfg_t
 Waveform 2 Click configuration object. More...
 

Macros

#define WAVEFORM2_CFG_B28_MSK   0x2000
 Waveform 2 description setting.
 
#define WAVEFORM2_CFG_HLB_MSK   0x1000
 
#define WAVEFORM2_CFG_FSEL_MSK   0x0800
 
#define WAVEFORM2_CFG_PSEK_MSK   0x0400
 
#define WAVEFORM2_CFG_PIN_SW_MSK   0x0200
 
#define WAVEFORM2_CFG_RESET_MSK   0x0100
 
#define WAVEFORM2_CFG_SLEEP1_MSK   0x0080
 
#define WAVEFORM2_CFG_SLEEP12_MSK   0x0040
 
#define WAVEFORM2_CFG_OPBITEN_MSK   0x0020
 
#define WAVEFORM2_CFG_SIGN_PIB_MSK   0x0010
 
#define WAVEFORM2_CFG_DIV2_MSK   0x0008
 
#define WAVEFORM2_CFG_MODE_MSK   0x0002
 
#define OUTPUT_TRIANGLE   0x01
 
#define OUTPUT_SINUSOID   0x00
 
#define WAVEFORM2_DEVICE_SLAVE_ADDR_GND   0x50
 Waveform 2 device address setting.
 
#define WAVEFORM2_DEVICE_SLAVE_ADDR_VCC   0x51
 
#define WAVEFORM2_SET_DATA_SAMPLE_EDGE   SET_SPI_DATA_SAMPLE_EDGE
 Data sample selection.
 
#define WAVEFORM2_SET_DATA_SAMPLE_MIDDLE   SET_SPI_DATA_SAMPLE_MIDDLE
 
#define WAVEFORM2_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Typedefs

typedef struct waveform2_s waveform2_t
 Waveform 2 Click context object.
 

Enumerations

enum  waveform2_return_value_t { WAVEFORM2_OK = 0 , WAVEFORM2_ERROR = -1 }
 Waveform 2 Click return value data. More...
 

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

This file contains API for Waveform 2 Click Driver.

Typedef Documentation

◆ waveform2_t

typedef struct waveform2_s waveform2_t

Waveform 2 Click context object.

Context object definition of Waveform 2 Click driver.

Enumeration Type Documentation

◆ waveform2_return_value_t

Waveform 2 Click return value data.

Predefined enum values for driver return values.

Enumerator
WAVEFORM2_OK 
WAVEFORM2_ERROR