LibDriver AD9833
Loading...
Searching...
No Matches
driver_ad9833.h File Reference

driver ad9833 header file More...

#include <math.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
Include dependency graph for driver_ad9833.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ad9833_handle_s
 ad9833 handle structure definition More...
struct  ad9833_info_s
 ad9833 information structure definition More...

Macros

#define DRIVER_AD9833_LINK_INIT(HANDLE, STRUCTURE)
 initialize ad9833_handle_t structure
#define DRIVER_AD9833_LINK_SPI_INIT(HANDLE, FUC)
 link spi_init function
#define DRIVER_AD9833_LINK_SPI_DEINIT(HANDLE, FUC)
 link spi_deinit function
#define DRIVER_AD9833_LINK_SPI_WRITE_CMD(HANDLE, FUC)
 link spi_write_cmd function
#define DRIVER_AD9833_LINK_DELAY_MS(HANDLE, FUC)
 link delay_ms function
#define DRIVER_AD9833_LINK_DEBUG_PRINT(HANDLE, FUC)
 link debug_print function

Typedefs

typedef struct ad9833_handle_s ad9833_handle_t
 ad9833 handle structure definition
typedef struct ad9833_info_s ad9833_info_t
 ad9833 information structure definition

Enumerations

enum  ad9833_bool_t { AD9833_BOOL_FALSE = 0x00 , AD9833_BOOL_TRUE = 0x01 }
 ad9833 bool enumeration definition More...
enum  ad9833_number_t { AD9833_NUMBER_0 = 0x00 , AD9833_NUMBER_1 = 0x01 }
 ad9833 number enumeration definition More...
enum  ad9833_output_mode_t { AD9833_OUTPUT_MODE_SIN = 0x00 , AD9833_OUTPUT_MODE_TRI = 0x02 , AD9833_OUTPUT_MODE_DAC_HALF = 0x04 , AD9833_OUTPUT_MODE_DAC = 0x05 }
 ad9833 output mode enumeration definition More...

Functions

uint8_t ad9833_info (ad9833_info_t *info)
 get chip's information
uint8_t ad9833_init (ad9833_handle_t *handle)
 initialize the chip
uint8_t ad9833_deinit (ad9833_handle_t *handle)
 close the chip
uint8_t ad9833_set_used_frequency_register (ad9833_handle_t *handle, ad9833_number_t number)
 set the used frequency register
uint8_t ad9833_set_used_phase_register (ad9833_handle_t *handle, ad9833_number_t number)
 set the used phase register
uint8_t ad9833_set_frequency (ad9833_handle_t *handle, ad9833_number_t number, uint32_t freq)
 set the frequency
uint8_t ad9833_set_frequency_lsb (ad9833_handle_t *handle, ad9833_number_t number, uint16_t freq)
 set the frequency lsb
uint8_t ad9833_set_frequency_msb (ad9833_handle_t *handle, ad9833_number_t number, uint16_t freq)
 set the frequency msb
uint8_t ad9833_frequency_convert_to_register (ad9833_handle_t *handle, double hz, uint32_t *reg)
 convert the frequency to the register raw data
uint8_t ad9833_frequency_convert_to_data (ad9833_handle_t *handle, uint32_t reg, double *hz)
 convert the register raw data to frequency
uint8_t ad9833_set_phase (ad9833_handle_t *handle, ad9833_number_t number, uint16_t phase)
 set the phase
uint8_t ad9833_phase_convert_to_register (ad9833_handle_t *handle, double rad, uint16_t *reg)
 convert the phase to the register raw data
uint8_t ad9833_phase_convert_to_data (ad9833_handle_t *handle, uint16_t reg, double *rad)
 convert the register raw data to phase
uint8_t ad9833_reset (ad9833_handle_t *handle)
 reset the chip
uint8_t ad9833_set_dac_power_down (ad9833_handle_t *handle, ad9833_bool_t enable)
 enable or disable dac power down
uint8_t ad9833_set_internal_clock_disable (ad9833_handle_t *handle, ad9833_bool_t enable)
 enable or disable internal clock disable
uint8_t ad9833_set_output_mode (ad9833_handle_t *handle, ad9833_output_mode_t mode)
 set output mode
uint8_t ad9833_set_reg (ad9833_handle_t *handle, uint16_t value)
 set the chip register

Detailed Description

driver ad9833 header file

Copyright (c) 2015 - present LibDriver All rights reserved

The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Version
1.0.0
Author
Shifeng Li
Date
2024-04-15

history

Date Version Author Description
2024/04/15 1.0 Shifeng Li first upload

Definition in file driver_ad9833.h.