= '''Analog Devices AD9775 Control Library''' = [[BR]] = Full Code = '''[source:/PlatformSupport/WARP_Libraries/warpdac_ad9775.c warpdac_ad9775.c]''' [[BR]]This file provides functions for controlling the WARP radio board's DAC chip. = Documentation = == Functions == For all functions the input variable ''baseaddr'' is the base address of the SPI Core. '''[source:/PlatformSupport/WARP_Libraries/warpdac_ad9775.c@latest#L110 void WarpDac_InitializeSPI(unsigned int* baseaddr)]''' [[BR]]Initializes the SPI controller for DAC functions. This function must be called before calling any other DAC functions. '''[source:/PlatformSupport/WARP_Libraries/warpdac_ad9775.c@latest#L120 void WarpDac_InitializeDAC(unsigned int* baseaddr, unsigned char dacs)]''' [[BR]]This function must be called at the beginning of the program to make necessary changes in some of the registersof the DAC. Initializes the DACs specified in ''dacs'', the 8 bit value where the 4 least significant bits choose the DAC to initialize. '''[source:/PlatformSupport/WARP_Libraries/warpdac_ad9775.c@latest#L144 void WarpDac_Reset(unsigned int* baseaddr, unsigned char dacs)]''' [[BR]]Resets the DAC registers to their default values. Calls WarpDac_InitializeDAC, so there is no need to repeat it in the code. ''dacs'' is an 8 bit value where the 4 least significant bits choose the DAC to reset. '''[source:/PlatformSupport/WARP_Libraries/warpdac_ad9775.c@latest#L158 int WarpDac_Sleep(unsigned int* baseaddr, char mode, unsigned char dacs)]''' [[BR]]Will take the specified DACs either in (''mode=1'') or out (''mode=0'') of sleep mode. ''dacs'' is an 8 bit value where the 4 least significant bits choose the DAC to alter. '''[source:/PlatformSupport/WARP_Libraries/warpdac_ad9775.c@latest#L206 int WarpDac_FineGainAdj(unsigned int* baseaddr, char chan, unsigned char value, unsigned char dacs)]''' [[BR]]Adjusts the fine gain of either the I (''chan=ICHAN'') or the Q (''chan=QCHAN'') channel. The variable ''value'' is sent to the registers as specified by the channel setting. ''dacs'' is an 8 bit value where the 4 least significant bits choose the DAC to alter. Returns ''INVALID_MODE'' if the mode is incorrect. Returns ''WARP_SUCCESS'' if change is successful. '''[source:/PlatformSupport/WARP_Libraries/warpdac_ad9775.c@latest#L256 int WarpDac_CoarseGainAdj(unsigned int* baseaddr, char chan, unsigned char value, unsigned char dacs)]''' [[BR]]Adjusts the coarse gain of either the I (''chan=ICHAN'') or the Q (''chan=QCHAN'') channel. The variable ''value'' is sent to the registers as specified by the channel setting. ''dacs'' is an 8 bit value where the 4 least significant bits choose the DAC to alter. Returns ''INVALID_MODE'' if the mode is incorrect. Returns ''WARP_SUCCESS'' if change is successful. '''[source:/PlatformSupport/WARP_Libraries/warpdac_ad9775.c@latest#L306 int WarpDac_OffsetAdj(unsigned int* baseaddr, char chan, short value, unsigned char dacs)]''' [[BR]]Adjusts the DC offset of either the I (''chan=ICHAN'') or the Q (''chan=QCHAN'') channel. The variable ''value'' is sent to the registers as specified by the channel setting. ''value'' has a range from -1024 to 1023. ''dacs'' is an 8 bit value where the 4 least significant bits choose the DAC to alter. Returns ''INVALID_MODE'' if the mode is incorrect. Returns ''WARP_SUCCESS'' if change is successful.