radio_controller_basic.c File Reference

Code file for the most basic functions that are needed for communication with the radio boards. More...

#include "radio_controller_basic.h"

Go to the source code of this file.

Functions

void WarpRadio_v1_Reset (unsigned int *baseaddress, unsigned int clkRatio)
 Start of time reset function.
void WarpRadio_v1_TxEnable (unsigned int radios)
 Enable transmit mode on radios.
void WarpRadio_v1_RxEnable (unsigned int radios)
 Enable recieve mode on radios.
void WarpRadio_v1_TxRxDisable (unsigned int radios)
 Disable transmit or receive mode.
int WarpRadio_v1_SetCenterFreq2GHz (char freqset, unsigned int radios)
 Tune the radio to a frequency in the 2.4GHz band.
char WarpRadio_v1_DIPSW (unsigned int radio)
 Read DIPSW of a radio.
int WarpRadio_v1_DACOffsetAdj (char chan, short value, unsigned int radios)
 Adjust DC offset for DAC.


Detailed Description

Code file for the most basic functions that are needed for communication with the radio boards.

Version:
1.09
Author:
Siddharth Gupta
Basic drivers for radio controller. Has all the basic functions related to sending and receiving bits over the air and changing the center frequency of transmission.

Definition in file radio_controller_basic.c.


Function Documentation

int WarpRadio_v1_DACOffsetAdj ( char  chan,
short  value,
unsigned int  radios 
)

Adjust DC offset for DAC.

Adjust the DC Offset on the I and Q channels of the DAC. Only the I or Q can be adjusted at one time. Value must be within the defined range to be correctly written to the DAC registers.

Parameters:
chan ICHAN or QCHAN, referring to the I channel or the Q channel.
value DC offset value to be written. Ranges from -1023 to 1024.
radios Radios that have their offset value set.
Returns:
INVALID_MODE if the mode is incorrect, OUT_OF_RANGE is the value given is out of the range that can be supported, WARP_SUCCESS if successful change.

Definition at line 422 of file radio_controller_basic.c.

References ICHAN, INVALID_MODE, OUT_OF_RANGE, QCHAN, radio_controller_baseaddr, RADIO_CONTROLLER_mWriteSlaveReg5, RADIO_CONTROLLER_mWriteSlaveReg6, RADIO_CONTROLLER_mWriteSlaveReg7, SLAVEMASKDAC, transmitdac(), and WARP_SUCCESS.

Referenced by warpphy_applyTxDCOCalibration().

char WarpRadio_v1_DIPSW ( unsigned int  radio  ) 

Read DIPSW of a radio.

Returns the DIPSW values of the radio specified. Can return value for only one of the radios at one time.

Parameters:
radio Radio from which to read the value.

Definition at line 391 of file radio_controller_basic.c.

References RAD1MASK, RAD2MASK, RAD3MASK, RAD4MASK, RAD_DIPSW_H_MASK, RAD_DIPSW_L_MASK, radio_controller_baseaddr, RADIO_CONTROLLER_mReadSlaveReg3, and RADIO_CONTROLLER_mReadSlaveReg4.

void WarpRadio_v1_Reset ( unsigned int *  baseaddress,
unsigned int  clkRatio 
)

Start of time reset function.

Reset all the radio boards including the radio and DAC chips along with their associated registers. Goes through a set of instructions to achieve a reset of the radios. This must be called at the start of time and affects all connected radio boards.

Parameters:
baseaddress Base address of the radio_controller core; usually defined as XPAR_RADIO_CONTROLLER_0_BASEADDR by XPS
clkRatio Ratio of bus clock to SPI clock; use 1 for 40MHz bus, 2 for 80MHz bus

Definition at line 33 of file radio_controller_basic.c.

References RAD_24PA_MASK, RAD_ADC_RX_DCS_MASK, RAD_ADC_RX_PWDNA_MASK, RAD_ADC_RX_PWDNB_MASK, RAD_RSSI_ADC_SLEEP_MASK, RAD_RXEN_CON_MASK, RAD_RXEN_MASK, RAD_RXHP_CON_MASK, RAD_RXHP_MASK, RAD_SHDN_CON_MASK, RAD_SHDN_MASK, RAD_TX_DAC_RESET_MASK, RAD_TXEN_CON_MASK, RAD_TXEN_MASK, RADIO1_ADDR, RADIO2_ADDR, RADIO3_ADDR, RADIO4_ADDR, radio_controller_baseaddr, RADIO_CONTROLLER_mReadSlaveReg0, RADIO_CONTROLLER_mReadSlaveReg1, RADIO_CONTROLLER_mWriteSlaveReg0, RADIO_CONTROLLER_mWriteSlaveReg1, RADIO_CONTROLLER_mWriteSlaveReg10, RADIO_CONTROLLER_mWriteSlaveReg11, RADIO_CONTROLLER_mWriteSlaveReg12, RADIO_CONTROLLER_mWriteSlaveReg13, RADIO_CONTROLLER_mWriteSlaveReg14, RADIO_CONTROLLER_mWriteSlaveReg15, RADIO_CONTROLLER_mWriteSlaveReg16, RADIO_CONTROLLER_mWriteSlaveReg2, RADIO_CONTROLLER_mWriteSlaveReg5, RADIO_CONTROLLER_mWriteSlaveReg6, RADIO_CONTROLLER_mWriteSlaveReg7, RADIO_CONTROLLER_mWriteSlaveReg9, REG_RAD1_BAND_SELECT, REG_RAD1_RX_CONTROL, REG_RAD1_STANDBY, REG_RAD1_TX_LINEARITY, REG_RAD2_BAND_SELECT, REG_RAD2_RX_CONTROL, REG_RAD2_STANDBY, REG_RAD2_TX_LINEARITY, REG_RAD3_BAND_SELECT, REG_RAD3_RX_CONTROL, REG_RAD3_STANDBY, REG_RAD3_TX_LINEARITY, REG_RAD4_BAND_SELECT, REG_RAD4_RX_CONTROL, REG_RAD4_STANDBY, REG_RAD4_TX_LINEARITY, SLAVEMASK, SLAVEMASKDAC, transmit, and transmitdac().

Referenced by warpphy_init().

void WarpRadio_v1_RxEnable ( unsigned int  radios  ) 

Enable recieve mode on radios.

Enables the recieve mode in the radio board. On calling this function the transmit mode is forcibly turned off.

Parameters:
radios Refers to the radios in the slots that will have their recieve mode turned on.

Definition at line 168 of file radio_controller_basic.c.

References RAD_ANTSW_MASK, RAD_RXEN_MASK, RAD_TXEN_MASK, radio_controller_baseaddr, RADIO_CONTROLLER_mReadSlaveReg0, RADIO_CONTROLLER_mReadSlaveReg1, RADIO_CONTROLLER_mWriteSlaveReg0, and RADIO_CONTROLLER_mWriteSlaveReg1.

Referenced by warpphy_disableMisoMode(), warpphy_enableMimoMode(), warpphy_enableMisoMode(), warpphy_enableSisoMode(), warpphy_init(), warpphy_pktTx(), warpphy_setSISOAntenna(), and warpphy_waitForTx().

int WarpRadio_v1_SetCenterFreq2GHz ( char  freqset,
unsigned int  radios 
)

Tune the radio to a frequency in the 2.4GHz band.

Function used to shift the center frequency on the radio within the 2.4GHz band. Also enables the 2.4GHz amplifier for the transmit state machine.

  1. 2412MHz
  2. 2417MHz
  3. 2422MHz
  4. 2427MHz
  5. 2432MHz
  6. 2437MHz
  7. 2442MHz
  8. 2447MHz
  9. 2452MHz
  10. 2457MHz
  11. 2462MHz
  12. 2467MHz
  13. 2472MHz
  14. 2484MHz

Parameters:
freqset The frequency channel to use, selected from above list
radios Defines which radios are affected by this function call.
Returns:
Returns INVALID_FREQ if given frequency set is not valid.

Definition at line 226 of file radio_controller_basic.c.

References INVALID_FREQ, RAD1MASK, RAD2MASK, RAD3MASK, RAD4MASK, RAD_24PA_MASK, RAD_5PA_MASK, radio_controller_baseaddr, RADIO_CONTROLLER_mReadSlaveReg1, RADIO_CONTROLLER_mWriteSlaveReg1, RADIO_CONTROLLER_mWriteSlaveReg7, REG_RAD1_BAND_SELECT, REG_RAD1_FRACTIONAL_DIVIDER_RATIO, REG_RAD1_INTEGER_DIVIDER_RATIO, REG_RAD2_BAND_SELECT, REG_RAD2_FRACTIONAL_DIVIDER_RATIO, REG_RAD2_INTEGER_DIVIDER_RATIO, REG_RAD3_BAND_SELECT, REG_RAD3_FRACTIONAL_DIVIDER_RATIO, REG_RAD3_INTEGER_DIVIDER_RATIO, REG_RAD4_BAND_SELECT, REG_RAD4_FRACTIONAL_DIVIDER_RATIO, REG_RAD4_INTEGER_DIVIDER_RATIO, SLAVEMASK, transmit, and transRadio().

Referenced by warpphy_setChannel(), and warpphy_setSeparateChannels().

void WarpRadio_v1_TxEnable ( unsigned int  radios  ) 

Enable transmit mode on radios.

Enables the transmit enable mode on the radios specified. Before transmit is turned on the recieve mode is turned off. Enables the TxEnable state machine that also controls turning on of the amplifiers.

Parameters:
radios Refers to the radios in the slots whose transmit mode is turned on.

Definition at line 138 of file radio_controller_basic.c.

References RAD_ANTSW_MASK, RAD_RXEN_MASK, RAD_TXEN_MASK, radio_controller_baseaddr, RADIO_CONTROLLER_mReadSlaveReg0, RADIO_CONTROLLER_mReadSlaveReg1, RADIO_CONTROLLER_mWriteSlaveReg0, and RADIO_CONTROLLER_mWriteSlaveReg1.

Referenced by warpphy_pktTx().

void WarpRadio_v1_TxRxDisable ( unsigned int  radios  ) 

Disable transmit or receive mode.

Disables the receive and/or transmit modes in the radios specified.

Parameters:
radios Refers to the radios in the slots that are affected.

Definition at line 197 of file radio_controller_basic.c.

References RAD_RXEN_MASK, RAD_TXEN_MASK, radio_controller_baseaddr, RADIO_CONTROLLER_mReadSlaveReg0, and RADIO_CONTROLLER_mWriteSlaveReg0.

Referenced by warpphy_disableMisoMode(), warpphy_enableMimoMode(), warpphy_enableMisoMode(), and warpphy_enableSisoMode().


Updated on Wed Aug 6 13:29:32 2008 WARP