view DDSBes.h @ 45:b47b97cfd050

Fix output frequency read back in DDS Fox driver The FTW registry value was read back wrong due to an integer overflow in the conversion from bytes string to double. This should fix the "jumps" seen in the application of the frequency dedrifting.
author Daniele Nicolodi <daniele.nicolodi@obspm.fr>
date Wed, 10 Oct 2012 12:14:01 +0200
parents d9aae7d7f2c6
children
line wrap: on
line source

//
// Title:       DDSBes.h
// Purpose:     header for the Besancon DDS crypto-class
//
// Created on:  by YLC
// Copyright:   syrte. All Rights Reserved.
//
//==============================================================================

#ifndef __DDSBES_H__
#define __DDSBES_H__

#ifdef __cplusplus
    extern "C" {
#endif


// DDSBes_Data : the data of crypto class DDSBesancon

typedef struct {
	double ClockFrequency ;		 // in Hz
	double Frequency ; 			 // the real frequency (in Hz) which is at the DDS output
	double Amplitude ;
	} DDSBes_Data ;


/************** Member Function Declarations (Private) **************/

static int delai(int t);
static int Strb_adress(unsigned char ad);
static int Strb_data(unsigned char da);
static int Strb_nWrite(void);
static int Strb_Update(void);
static int Strb_MReset(void);


/************** Member Function Declarations (Public) **************/

extern void DDSBes_Initialize(DDSBes_Data * Instance);
extern void DDSBes_Close(DDSBes_Data * Instance);
extern void DDSBes_SetClockFrequency(DDSBes_Data * Instance, double ClockFrequency);
extern void DDSBes_SetFrequency(DDSBes_Data * Instance, double Frequency); // In Instance->Frequency, the real output frequency is stored
																		   // (<> from requested frequency due to rounding effect
extern void DDSBes_SetAmplitude(DDSBes_Data * Instance, int Amplitude);

#ifdef __cplusplus
    }
#endif

#endif  /* ndef __DDSBES_H__ */