Increase frequency precision in DMA
This commit is contained in:
parent
78c51aa372
commit
2925373382
4 changed files with 4 additions and 4 deletions
|
@ -161,7 +161,7 @@ int clkgpio::SetFrequency(double Frequency)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
uint32_t clkgpio::GetMasterFrac(int Frequency)
|
uint32_t clkgpio::GetMasterFrac(double Frequency)
|
||||||
{
|
{
|
||||||
if(ModulateFromMasterPLL)
|
if(ModulateFromMasterPLL)
|
||||||
{
|
{
|
||||||
|
|
|
@ -163,7 +163,7 @@ class clkgpio:public gpio
|
||||||
int SetCenterFrequency(uint64_t Frequency,int Bandwidth);
|
int SetCenterFrequency(uint64_t Frequency,int Bandwidth);
|
||||||
int ComputeBestLO(uint64_t Frequency,int Bandwidth);
|
int ComputeBestLO(uint64_t Frequency,int Bandwidth);
|
||||||
int SetMasterMultFrac(uint32_t Mult,uint32_t Frac);
|
int SetMasterMultFrac(uint32_t Mult,uint32_t Frac);
|
||||||
uint32_t GetMasterFrac(int Frequency);
|
uint32_t GetMasterFrac(double Frequency);
|
||||||
void enableclk(int gpio);
|
void enableclk(int gpio);
|
||||||
void disableclk(int gpio);
|
void disableclk(int gpio);
|
||||||
|
|
||||||
|
|
|
@ -106,7 +106,7 @@ void ngfmdmasync::SetDmaAlgo()
|
||||||
//fprintf(stderr,"Last cbp : src %x dest %x next %x\n",cbp->src,cbp->dst,cbp->next);
|
//fprintf(stderr,"Last cbp : src %x dest %x next %x\n",cbp->src,cbp->dst,cbp->next);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ngfmdmasync::SetFrequencySample(uint32_t Index,int Frequency)
|
void ngfmdmasync::SetFrequencySample(uint32_t Index,double Frequency)
|
||||||
{
|
{
|
||||||
Index=Index%buffersize;
|
Index=Index%buffersize;
|
||||||
sampletab[Index]=(0x5A<<24)|GetMasterFrac(Frequency);
|
sampletab[Index]=(0x5A<<24)|GetMasterFrac(Frequency);
|
||||||
|
|
|
@ -16,7 +16,7 @@ class ngfmdmasync:public bufferdma,public clkgpio,public pwmgpio,public pcmgpio
|
||||||
void SetDmaAlgo();
|
void SetDmaAlgo();
|
||||||
|
|
||||||
void SetPhase(bool inversed);
|
void SetPhase(bool inversed);
|
||||||
void SetFrequencySample(uint32_t Index,int Frequency);
|
void SetFrequencySample(uint32_t Index,double Frequency);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue