waveform4 2.0.0.0
|
API for configuring and manipulating Waveform 4 Click driver. More...
Topics | |
Waveform 4 Registers List | |
List of registers of Waveform 4 Click driver. | |
Waveform 4 Registers Settings | |
Settings for registers of Waveform 4 Click driver. | |
Waveform 4 MikroBUS Map | |
MikroBUS pin mapping of Waveform 4 Click driver. | |
Functions | |
void | waveform4_cfg_setup (waveform4_cfg_t *cfg) |
Waveform 4 configuration object setup function. | |
err_t | waveform4_init (waveform4_t *ctx, waveform4_cfg_t *cfg) |
Waveform 4 initialization function. | |
err_t | waveform4_default_cfg (waveform4_t *ctx) |
Waveform 4 default configuration function. | |
err_t | waveform4_write_registers (waveform4_t *ctx, uint16_t reg, uint16_t *data_in, uint8_t len) |
Waveform 4 data writing function. | |
err_t | waveform4_read_registers (waveform4_t *ctx, uint16_t reg, uint16_t *data_out, uint8_t len) |
Waveform 4 data reading function. | |
err_t | waveform4_write_register (waveform4_t *ctx, uint16_t reg, uint16_t data_in) |
Waveform 4 single data writing function. | |
err_t | waveform4_read_register (waveform4_t *ctx, uint16_t reg, uint16_t *data_out) |
Waveform 4 single data reading function. | |
void | waveform4_set_rst_pin (waveform4_t *ctx, uint8_t state) |
Waveform 4 set RST pin function. | |
void | waveform4_set_trg_pin (waveform4_t *ctx, uint8_t state) |
Waveform 4 set TRG pin function. | |
void | waveform4_reset_registers (waveform4_t *ctx) |
Waveform 4 reset registers function. | |
err_t | waveform4_start_pattern (waveform4_t *ctx) |
Waveform 4 start pattern function. | |
err_t | waveform4_stop_pattern (waveform4_t *ctx) |
Waveform 4 stop pattern function. | |
err_t | waveform4_update_settings (waveform4_t *ctx) |
Waveform 4 update settings function. | |
err_t | waveform4_write_sram (waveform4_t *ctx, uint16_t address, uint16_t *data_in, uint16_t len) |
Waveform 4 write sram function. | |
err_t | waveform4_read_sram (waveform4_t *ctx, uint16_t address, uint16_t *data_out, uint16_t len) |
Waveform 4 read sram function. | |
err_t | waveform4_set_frequency (waveform4_t *ctx, uint32_t freq) |
Waveform 4 set frequency function. | |
err_t | waveform4_set_gain (waveform4_t *ctx, uint8_t channel, float gain) |
Waveform 4 set gain function. | |
err_t | waveform4_set_wave_output (waveform4_t *ctx, uint8_t channel, uint8_t wave) |
Waveform 4 set wave output function. | |
API for configuring and manipulating Waveform 4 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void waveform4_cfg_setup | ( | waveform4_cfg_t * | cfg | ) |
Waveform 4 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See waveform4_cfg_t object definition for detailed explanation. |
err_t waveform4_default_cfg | ( | waveform4_t * | ctx | ) |
Waveform 4 default configuration function.
This function executes a default configuration of Waveform 4 click board.
[in] | ctx | : Click context object. See waveform4_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t waveform4_init | ( | waveform4_t * | ctx, |
waveform4_cfg_t * | cfg ) |
Waveform 4 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See waveform4_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See waveform4_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t waveform4_read_register | ( | waveform4_t * | ctx, |
uint16_t | reg, | ||
uint16_t * | data_out ) |
Waveform 4 single data reading function.
This function reads a single data byte from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See waveform4_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error.err_t waveform4_read_registers | ( | waveform4_t * | ctx, |
uint16_t | reg, | ||
uint16_t * | data_out, | ||
uint8_t | len ) |
Waveform 4 data 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 waveform4_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 waveform4_read_sram | ( | waveform4_t * | ctx, |
uint16_t | address, | ||
uint16_t * | data_out, | ||
uint16_t | len ) |
Waveform 4 read sram function.
This function reads a desired number of data bytes from the SRAM starting from the selected memory address.
[in] | ctx | : Click context object. See waveform4_t object definition for detailed explanation. |
[in] | address | : SRAM memory address [0x6000,0x6FFF]. |
[out] | data_out | : Output data read. |
[in] | len | : Number of bytes to be read. |
0
- Success, -1
- Error.void waveform4_reset_registers | ( | waveform4_t * | ctx | ) |
Waveform 4 reset registers function.
This function resets all registers to default values.
[in] | ctx | : Click context object. See waveform4_t object definition for detailed explanation. |
err_t waveform4_set_frequency | ( | waveform4_t * | ctx, |
uint32_t | freq ) |
Waveform 4 set frequency function.
This function sets the sine and cosine (DDS) waves output frequency.
[in] | ctx | : Click context object. See waveform4_t object definition for detailed explanation. |
[in] | freq | : Frequency in Hz ( up to 125MHz ). |
0
- Success, -1
- Error.err_t waveform4_set_gain | ( | waveform4_t * | ctx, |
uint8_t | channel, | ||
float | gain ) |
Waveform 4 set gain function.
This function sets the gain level of a desired channel.
[in] | ctx | : Click context object. See waveform4_t object definition for detailed explanation. |
[in] | channel | : Channel number [0,3]. |
[in] | gain | : Gain level [-2,2]. |
0
- Success, -1
- Error.void waveform4_set_rst_pin | ( | waveform4_t * | ctx, |
uint8_t | state ) |
Waveform 4 set RST pin function.
This function sets the RST pin to a desired logic state.
[in] | ctx | : Click context object. See waveform4_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
void waveform4_set_trg_pin | ( | waveform4_t * | ctx, |
uint8_t | state ) |
Waveform 4 set TRG pin function.
This function sets the TRG pin to a desired logic state.
[in] | ctx | : Click context object. See waveform4_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
err_t waveform4_set_wave_output | ( | waveform4_t * | ctx, |
uint8_t | channel, | ||
uint8_t | wave ) |
Waveform 4 set wave output function.
This function sets a desired output signal wave to the selected channel.
[in] | ctx | : Click context object. See waveform4_t object definition for detailed explanation. |
[in] | channel | : Channel number [0,3]. |
[in] | wave | :
|
0
- Success, -1
- Error.err_t waveform4_start_pattern | ( | waveform4_t * | ctx | ) |
Waveform 4 start pattern function.
This function starts pattern generation by setting the RUN bit to 1 and the TRG pin low logic state.
[in] | ctx | : Click context object. See waveform4_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t waveform4_stop_pattern | ( | waveform4_t * | ctx | ) |
Waveform 4 stop pattern function.
This function stops pattern generation by setting the RUN bit to 0 and the TRG pin high logic state.
[in] | ctx | : Click context object. See waveform4_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t waveform4_update_settings | ( | waveform4_t * | ctx | ) |
Waveform 4 update settings function.
This function updates all SPI setting with new configuration by setting RAMUPDATE bit to 1.
[in] | ctx | : Click context object. See waveform4_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t waveform4_write_register | ( | waveform4_t * | ctx, |
uint16_t | reg, | ||
uint16_t | data_in ) |
Waveform 4 single data writing function.
This function writes a single data byte to the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See waveform4_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | data_in | : Data to be written. |
0
- Success, -1
- Error.err_t waveform4_write_registers | ( | waveform4_t * | ctx, |
uint16_t | reg, | ||
uint16_t * | data_in, | ||
uint8_t | len ) |
Waveform 4 data 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 waveform4_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 waveform4_write_sram | ( | waveform4_t * | ctx, |
uint16_t | address, | ||
uint16_t * | data_in, | ||
uint16_t | len ) |
Waveform 4 write sram function.
This function writes a desired number of data bytes to the SRAM starting from the selected memory address.
[in] | ctx | : Click context object. See waveform4_t object definition for detailed explanation. |
[in] | address | : SRAM memory address [0x6000,0x6FFF]. |
[in] | data_in | : Data to be written. |
[in] | len | : Number of bytes to be written. |
0
- Success, -1
- Error.