Wavebubble 2010 Firmware
Defines | Functions

pll.h File Reference

PLL header file. More...

Go to the source code of this file.

Defines

#define pll_set_rf(x, n)   pll_set_freq(x, n, 0x1);
#define pll_set_if(x, n)   pll_set_freq(x, n, 0x4);
#define PLLCLK_DDR   DDRD
#define PLLCLK_PORT   PORTD
#define PLLCLK   PD5
#define PLLDATA_DDR   DDRD
#define PLLDATA_PORT   PORTD
#define PLLDATA   PD6
#define PLLLE_DDR   DDRB
#define PLLLE_PORT   PORTB
#define PLLLE   PB0
#define PLL_RFIN_DDR   DDRC
#define PLL_IFIN_DDR   DDRC
#define PLL_RFIN   PC0
#define PLL_IFIN   PC5
#define PLL_RFIN_PIN   PINC
#define PLL_IFIN_PIN   PINC
#define PLL_RFIN_PORT   PORTC
#define PLL_IFIN_PORT   PORTC

Functions

void pll_tx (uint32_t data, uint8_t addr)
 Send data word to PLL.
void pll_init (void)
 Init PLL.
void pll_set_rcounter (uint16_t rcounter)
 Set reference counter.
void pll_set_freq (uint16_t rf_freq, uint8_t prescaler, uint8_t reg)
uint8_t tune_rf (uint16_t freq)
 Tune PLL RF stage.
uint8_t tune_if (uint16_t freq)
 Tune PLL IF stage.
uint8_t tune_rf_band (uint16_t min, uint16_t max, uint8_t vco_num)
 Tune specific RF band.

Detailed Description

PLL header file.

Definition in file pll.h.


Define Documentation

#define PLL_IFIN   PC5

Definition at line 25 of file pll.h.

#define PLL_IFIN_DDR   DDRC

Definition at line 23 of file pll.h.

#define PLL_IFIN_PIN   PINC

Definition at line 27 of file pll.h.

#define PLL_IFIN_PORT   PORTC

Definition at line 29 of file pll.h.

#define PLL_RFIN   PC0

Definition at line 24 of file pll.h.

#define PLL_RFIN_DDR   DDRC

Definition at line 22 of file pll.h.

#define PLL_RFIN_PIN   PINC

Definition at line 26 of file pll.h.

#define PLL_RFIN_PORT   PORTC

Definition at line 28 of file pll.h.

#define pll_set_if (   x,
 
)    pll_set_freq(x, n, 0x4);

Definition at line 8 of file pll.h.

#define pll_set_rf (   x,
 
)    pll_set_freq(x, n, 0x1);

Definition at line 7 of file pll.h.

#define PLLCLK   PD5

Definition at line 12 of file pll.h.

#define PLLCLK_DDR   DDRD

Definition at line 10 of file pll.h.

#define PLLCLK_PORT   PORTD

Definition at line 11 of file pll.h.

#define PLLDATA   PD6

Definition at line 16 of file pll.h.

#define PLLDATA_DDR   DDRD

Definition at line 14 of file pll.h.

#define PLLDATA_PORT   PORTD

Definition at line 15 of file pll.h.

#define PLLLE   PB0

Definition at line 20 of file pll.h.

#define PLLLE_DDR   DDRB

Definition at line 18 of file pll.h.

#define PLLLE_PORT   PORTB

Definition at line 19 of file pll.h.


Function Documentation

void pll_init ( void  )

Init PLL.

Initialize PLL.

Definition at line 19 of file pll.c.

void pll_set_freq ( uint16_t  rf_freq,
uint8_t  prescaler,
uint8_t  reg 
)

Definition at line 100 of file pll.c.

void pll_set_rcounter ( uint16_t  rcounter)

Set reference counter.

Set PLL reference counter.

Definition at line 94 of file pll.c.

void pll_tx ( uint32_t  data,
uint8_t  addr 
)

Send data word to PLL.

Parameters:
dataData word to send
addrPLL register to store data

Definition at line 49 of file pll.c.

uint8_t tune_if ( uint16_t  freq)

Tune PLL IF stage.

Find PWM value for specific frequency.

Parameters:
freqFrequency to tune
Returns:
OCR1 PWM value for given frequeny.

Definition at line 196 of file pll.c.

uint8_t tune_rf ( uint16_t  freq)

Tune PLL RF stage.

Find PWM value for specific frequency.

Parameters:
freqFrequency to tune
Returns:
OCR1 PWM value for given frequeny.

Definition at line 142 of file pll.c.

uint8_t tune_rf_band ( uint16_t  min,
uint16_t  max,
uint8_t  vco_num 
)

Tune specific RF band.

Parameters:
minMinimum band frequency
maxmaximum band frequency
vco_numNumber of VCO to tune
Returns:
Average tuning value

Definition at line 250 of file pll.c.