wiki:warpradio_max2829.c

Maxim MAX2829 Control Library

The documentation for the library is included below.

warpradio_max2829.c

This file provides functions for controlling the WARP radio board's ADC and RF transceiver chips.

References
baseaddr refers to the base address of the SPI core.
radbaseaddr is the base address of the Radio Controller peripheral.
radios is the value applied to the Slave Select Register to select the radios.

void WARPRadio_InitializeSPI(unsigned int* baseaddr)
Initializes the SPI controller. This function must be called before any radio setup functions can be used. baseaddr refers to the base address of the SPI core.

void WarpRadio_InitializeRadio(unsigned int* baseaddr, unsigned int* radbaseaddr, unsigned char radios)
Initiates the selected radios. This function must be called at the start of the program and needs to be called only once. baseaddr refers to the base address of the SPI core. radbaseaddr is the base address of the Radio Controller peripheral. radios is the value applied to select the desired radios.

void WarpRadio_RxEnable(unsigned int* baseaddr, unsigned int* radbaseaddr, unsigned char radios)
Enables the receive mode in the radio board. Forcibly turns off the transmit mode and amplifiers. baseaddr refers to the base address of the SPI core. radbaseaddr is the base address of the Radio Controller peripheral. radios is the value applied to select the radios to be enabled.

void WarpRadio_RxDisable(unsigned int* baseaddr, unsigned int* radbaseaddr, unsigned char radios)
Disables receive mode in the specified radios. baseaddr refers to the base address of the SPI core. radbaseaddr is the base address of the Radio Controller peripheral. radios is the value applied to select the desired radios to be disabled.

void WarpRadio_24AmpEnable(unsigned int* baseaddr, unsigned int* radbaseaddr, unsigned char radios)
Turns on the 2.4GHz amplifier for the radios selected based on the value applied in radios. baseaddr refers to the base address of the SPI core. radbaseaddr is the base address of the Radio Controller peripheral.

void WarpRadio_24AmpDisable(unsigned int* baseaddr, unsigned int* radbaseaddr, unsigned char radios)
Turns off the 2.4GHz amplifier for the radios selected based on the value applied in radios. baseaddr refers to the base address of the SPI core. radbaseaddr is the base address of the Radio Controller peripheral.

void WarpRadio_TxEnable(unsigned int* baseaddr, unsigned int* radbaseaddr, unsigned char radios)
Enables the transmit mode on the Radios specified. Turns off the 2.4GHz and the 5Ghz amplifiers. radios refers to the Radios in the slots whose transmit mode is turned on. baseaddr refers to the base address of the SPI core. radbaseaddr is the base address of the Radio Controller peripheral. radios is the parameter used to specify for which radios to enable transmit mode.

void WarpRadio_TxDisable(unsigned int* baseaddr, unsigned int* radbaseaddr, unsigned char radios)
Disables the transmit mode on the Radios specified and turns off both amplifiers. This function also disable the receive mode. radios refers to the Radios in the slots whose transmit mode is turned off. baseaddr refers to the base address of the SPI core. radbaseaddr is the base address of the Radio Controller peripheral. radios is the parameter used to specify for which radios to disable the transmit mode.

void WarpRadio_SHDNEnable(unsigned int* baseaddr, unsigned int* radbaseaddr, unsigned char radios)
Shuts down the radios specified. Forcibly turns off transmit and receive modes and shuts down amplifiers. radios refers to the Radios in the slots affected . baseaddr refers to the base address of the SPI core. radbaseaddr is the base address of the Radio Controller peripheral. radios is the parameter used to specify which radios to shutdown.

void WarpRadio_SHDNDisable(unsigned int* baseaddr, unsigned int* radbaseaddr, unsigned char radios)
Takes the specified radios out of shutdown mode. Does not enable receive or transmit modes. radios refers to the Radios in the slots affected . baseaddr refers to the base address of the SPI core. radbaseaddr is the base address of the Radio Controller peripheral. radios is the parameter used to specify which radios to remove from shutdown mode.

void WarpRadio_Reset(unsigned int* baseaddr, unsigned int* radbaseaddr, unsigned char radios)
Reset the radio board registers that are specified in 'radios'. Goes through a set of instructions to achieve a reset of the radios. baseaddr refers to the base address of the SPI core. radbaseaddr is the base address of the Radio Controller peripheral. radios refers to the

void WarpRadio_RxHpEnable(unsigned int* baseaddr, unsigned int* radbaseaddr, unsigned char radios)
Enable the RXHP bit in the 'radios' specified. baseaddr refers to the base address of the SPI core. radbaseaddr is the base address of the Radio Controller peripheral.

void WarpRadio_RxHpDisable(unsigned int* baseaddr, unsigned int* radbaseaddr, unsigned char radios)
Disable the RXHP bit in the 'radios' specified. baseaddr refers to the base address of the SPI core. radbaseaddr is the base address of the Radio Controller peripheral.

int WarpRadio_SetCenterFreq2GHz(unsigned int* baseaddr, char freqset, unsigned char radios)
Function used to shift the center frequency within the 2.4GHz band. radios signifies which Radios are affected by this function call. baseaddr refers to the base address of the SPI core.
freqset defines to which frequency to shift.

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

Returns INVALID_FREQ if given freqset is not valid.

int WarpRadio_SetCenterFreq5GHz(unsigned int* baseaddr, char freqset, unsigned char radios)
Function used to shift the center frequency within the 5GHz band. radios signifies which Radios are affected by this function call. baseaddr refers to the base address of the SPI core.
freqset defines to which frequency to shift.

1: 5180 MHz
2: 5200 MHz
3: 5220 MHz
4: 5240 MHz
5: 5260 MHz
6: 5280 MHz
7: 5300 MHz
8: 5320 MHz
9: 5500 MHz
10: 5520 MHz
11: 5540 MHz
12: 5560 MHz
13: 5580 MHz
14: 5600 MHz
15: 5620 MHz
16: 5640 MHz
17: 5660 MHz
18: 5680 MHz
19: 5700 MHz
20: 5745 MHz
21: 5765 MHz
22: 5785 MHz
23: 5805 MHz

Returns INVALID_FREQ if given freqset is not valid.

void WarpRadio_TxCalibration(unsigned int* baseaddr, unsigned char radios)
Put the radio into transmit calibration mode. 'radios' refers to the radios that will be put into calibration. The affected radios will be forcibly removed from receive calibration mode. baseaddr refers to the base address of the SPI core.

void WarpRadio_RxCalibration(unsigned int* baseaddr, unsigned char radios)
Put the radio into receive calibration mode. 'radios' refers to the radios that will be put into calibration. The affected radios will be forcibly removed from transmit calibration mode. baseaddr refers to the base address of the SPI core.

void WarpRadio_NoCalibration(unsigned int* baseaddr, unsigned char radios)
Takes the specified radios out of both transmit and receive calibration mode. radios refers to the Radios in the affected slots. baseaddr refers to the base address of the SPI core.

int WarpRadio_TxCalGain(unsigned int* baseaddr, char gain, unsigned char radios)
Sets the gain for Transmitter I/Q Calibration LO Leakage and Sideband-Detector Gain Control. Returns NOT_IN_CALIBRATION if any of the radios for which the gain is being set in not in calibration mode. Returns WARP_SUCCESS if value changed successfully. To be in calibration mode set TxCalibration.
gain sets the level of gain.

gain =

0: -> 8db
1: -> 18db
2: -> 24db
3: -> 34db

Returns INVALID_GAIN if the value set to gain is not valid.
baseaddr refers to the base address of the SPI core.

int WarpRadio_SetMimoMode(unsigned int* baseaddr, char mode, unsigned char radios)
Function enables or disables the MIMO mode for the specified radios. mode = 0 turns off MIMO mode while mode = 1 enables the MIMO mode. Returns INVALID_MODE if mode is wrong or returns WARP_SUCCESS if successful. baseaddr refers to the base address of the SPI core.

int WarpRadio_RssiHighBandwidth(unsigned int* baseaddr, char mode, unsigned char radios)
This function is to enable or disable the RSSI High Bandwidth for the radios specified. mode=0 disables the state and mode=1 enables it. baseaddr refers to the base address of the SPI core.

void WarpRadio_TxLpfCornFreqCoarseAdj(unsigned int* baseaddr, char value, unsigned char radios)
Set the Transmit Low Pass Filter Corner Frequency. This is the Coarse adjustment for the frequency and affects the radios specified.
value is the adjustment parameter.

value =

00: undefined
01: 12MHz (nominal mode)
10: 18MHz (turbo mode 1)
11: 24MHz (turbo mode 2)

baseaddr refers to the base address of the SPI core.

void WarpRadio_RxLpfCornFreqCoarseAdj(unsigned int* baseaddr, char value, unsigned char radios)
Set the Receive Low Pass Filter Corner Frequency. This is the Coarse adjustment for the frequency and affects the radios specified.
value is the adjustment parameter.

value =

00: 7.5MHz
01: 9.5MHz (nominal mode)
10: 14MHz (turbo mode 1)
11: 18MHz (turbo mode 2)

baseaddr refers to the base address of the SPI core.

int WarpRadio_RxLpfCornFreqFineAdj(unsigned int* baseaddr, char value, unsigned char radios)
Set the Receive Low Pass Filter Corner Frequency. This is the Fine adjustment for the frequency and affects only the radios specified.
value is the adjustment parameter.

value =

000: 90%
001: 95%
010: 100%
011: 105%
100: 110%
101-111: not applicable

Returns OUT_OF_RANGE is value is out of range.
baseaddr refers to the base address of the SPI core.

void WarpRadio_RxHighPassCornerFreq(unsigned int* baseaddr, char value, unsigned char radios)
Set the Recieve Highpass Filter Corner Frequency when RXHP=0. Affected Slots are defined in radios
value is the adjustment parameter.
value =

0: 100Hz
1: 30kHz

baseaddr refers to the base address of the SPI core.

int WarpRadio_SerialRxGain(unsigned int* baseaddr, short mode, unsigned char radios)
Enable or disable Receive VGA Gain Programming serially. Affects radios specified.
mode =

0: Receive VGA Gain programmed with external digital inputs.
1: Receive VGA Gain programmed with serial data bits in RxGain Register

Returns INVALID_MODE is the mode is an invalid input.
baseaddr refers to the base address of the SPI core.

int WarpRadio_SerialTxGain(unsigned int* baseaddr, short mode, unsigned char radios)
Enable or disable Transmit VGA Gain Programming serially. Affects radios specified.
mode =

0: Transmit VGA Gain programmed with external digital inputs.
1: Transmit VGA Gain programmed with serial data bits in TxGain Register

Returns INVALID_MODE is the mode is an invalid input.
baseaddr refers to the base address of the SPI core.

void WarpRadio_BaseBandTxGain(unsigned int* baseaddr, char value, unsigned char radios)
Set the Transmit Baseband Gain. Affects only the radios specified.
value =

00: max baseband gain -5db
01: max baseband gain -3db
10: max baseband gain -1.5db
11: max baseband gain

baseaddr refers to the base address of the SPI core.

void WarpRadio_RxLNAGainControl(unsigned int* baseaddr, char value, unsigned char radios)
This function combined with RxVGAGainControl adjusts the total receive gain. The bits (value) of the function map to B7:B6. 00 is the lowest possible gain. Affects only the radios specified. baseaddr refers to the base address of the SPI core.

void WarpRadio_RxVGAGainControl(unsigned int* baseaddr, char value, unsigned char radios)
This function combined with RxLNAGainControl adjusts the total receive gain. The 5 bits (value) of the function map to B5:B1. 00000 is the lowest possible gain. Affects only the radios specified. baseaddr refers to the base address of the SPI core.

void WarpRadio_TxVGAGainControl(unsigned int* baseaddr, char value, unsigned char radios)
This function adjusts the total transmit gain. The 6 bits (value) of the function map to B6:B1. 000000 is the lowest possible gain. Affects only the radios specified. baseaddr refers to the base address of the SPI core.

Last modified 18 years ago Last modified on Feb 7, 2006, 3:14:59 PM