21
API REQUIREMENTS
This section gives examples of the API modules that
are required to be written in order to support the HAR-
RIS PRISM chipset. These modules must then be com-
piled and finally linked with the MAC protocol object
code. The complete list of API modules is found in a
separate document, the Am79C930 Device Driver
Interface Description.
API Procedures
Enable_TX()
This routine keys the transmitter on. It is called after a
frame has been completely formatted and TX_DMA is
programmed. Upon return from this routine, the
Am79C930 device will have started the data transmis-
sion. Any register and transceiver-dependent signalling
that is required to turn the transmitter on will be executed
in this routing, including assertion of the TXS bit of TIR8.
The transceiver will remain in the transmit state until the
transmission is terminated by either the Am79C930
hardware and/or the call tot he Disable_TX routine.
uint8 Enable_TX if Good(uint16 good length, uint8
dma length)
This API call is used by firmware when it is receiving a
frame to which it knows that a response will be sent if
the CRC32 on the frame is good. In order to minimize
the SIFS turnaround of the firmware, this API call is
made a few bytes before the end of the frame being
received. This routine will wait until DMA zero transfer
count has reached DMA length, at which time it will
check if the CRC is good by comparing the Am79C930
CRC good length register with the good length value
passed in the API call. If they match, then this API rout-
ing will start the transmitter and return.
Disable_TX()
Most transceiver transmitters would typically be keyed
off by the Am79C930 hardware which provides auto-
matic termination of the transmission through state ma-
chine generated signals at the Am79C930 pins. After
all bytes of the frame and the CRC have been sent, the
Am79C930 firmware will call this routine. The
Disable_TX routine will key off the transmitter if auto-
matic termination cannot be supported and enable any
RX functions that are required.
reset_CCA()
This routine is called by the firmware whenever it wishes
CCA to clear and start again. The actual steps taken by
this routine will depend on the PHY hardware used, but
as a minimum it must clear any CCA busy indication.
Enable_RX()
This routine is used to enable the receiver and is called
after each transmission. Enable_RX() must also per-
form the equivalent of the reset_CCA function.
Sleep (uint8 Sleep_Lvl)
This routine is used tot put the radio into its low power
consumption Sleep state. Once in the Sleep state, the
Wake routine must be called to resume operation. Dif-
ferent degrees of sleep are allowed by passing a pa-
rameter indicating which level of sleep is currently
desired.
Wake()
The Wake routine will cause the radio to exit the Sleep
state and power up its circuitry. When the routine returns
the radio will be in the Receive state.
Initialize (uint8 Domain)
This routine is called during the firmware’s initialization
procedure. The Am79C930 registers will be pro-
grammed by this routine bringing he Am79C930 to a
known default state. Following Am79C930 initialization,
the transceiver should be reset and then specific regis-
ters programmed, bringing the transceiver to the re-
quired initial default state. This includes a default
channel and power level for the transmitter. The trans-
ceiver may then be programmed for a specific channel
and power setting with the following commands.
The Domain of operation is passed as an argument in
the Initialize() routine in order to allow any special pro-
cessing or function that needs to be performed for a
particular domain to be correctly executed. As an ex-
ample, in the MKK domain, it is a requirement that all
radiators in the 2.4 GHz band send an identification
frame upon power up. In order to allow this function to
be carried out, additional information must be available
in order to form the frame properly, and this information
can be obtained at a fixed location in the code space,
immediately following the normal MIB structures. The
structure that follows contains one byte identifying the
domain, one byte giving a length, and subsequent bytes
that contain any necessary data (MKK Callsign ID, for
example).
Preset_Channel (uint8 Channel)
This routine is called to move the programming informa-
tion for the NEXTchannel from the table in the flash into
a next channel information variable in the SRAM, and
also, to copy this same value into the next channel reg-
ister inside of the radio synthesizer, if such a register
exists.
Note:
Some radio hardware does not contain a “next
channel” register. For such radios, the
Preset_channel() operation will only be able to copy the
next channel information programming information
from the flash tot he SRAM.
A typical application of Preset_channel() is that follow-
ing a Change_channel() call during an FH hop, a
Preset_channel() API call should be executed. This al-
lows the Change_channel() call to be executed at the