English
Language : 

SDK135 Datasheet, PDF (45/52 Pages) Freescale Semiconductor, Inc – Embedded SDK (Software Development Kit)
Freescale SemiconductEoxra,mIpnlecA.pplication Using cid1.lib
ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005
The gec[] samples can be obtained by using the gec.lib module, or by using a separate custom echo
canceller. The audio[] samples will be modified by the fdspk.lib module (or custom full duplex
speakerphone software) in this case. See the description of these modules and FeaturePhone application for
more detailed information.
In this example, there are two GPIO pins; one output pin, which places the telephone interface on-hook or
off-hook, and one input pin, which indicates the ring detect from the the telephone interface. The ring
detect pin is polled in the application and its polarity is placed in the variable
Line1Control.cidRingPolarity. This information is necessary for the Type 1 Telephony Features Library,
even when disableRinger is set (disabling the ring tone generator) and should be polled at a rate of
1600/sec as shown in the application. However, slower polling rates may be tolerated.
It is assumed that the functions go_onhook() and go_offhook(), which are not shown in Code
Example 6-1, would simply set or clear the output pin connected to the telephone interface. However, note
that these are not the same as when the application actually puts the module into an on-hook or off-hook
state. In this situation, the application must also set or clear the Line1Control.hookSwitch variable and then
call Type1CIDinit().
The Codec Interrupt Service Routine is also not shown in this example. This routine is assumed to transmit
and receive 8KHz samples from a codec and read/write to the buffers codecBufferLeftin[] and
codecBufferLeftout[]. This codec is connected to the telephone line interface. This routine is also assumed
to transmit and receive 8KHz samples from a codec and read/write to the buffers codecBufferRightin[] and
codecBufferRightout[]. This codec is connected to an audio interface. When the ISR has
received/transmitted five samples, the buffers are full/empty and the SamplesReady flag is set, indicating
to the application that it should call CalleridAppMain(). The calling rate of this routine should be 1600
calls/second.
In the beginning of the CalleridAppMain() routine, the codec samples are copied into the module’s sample
structure. Note that for the output samples, the line[] samples are copied into the right (audio) codec
channel, and the audio[] samples are copied into the left (line) codec channel. This sample "criss-cross" is
indicative of the natural signal flow for a telephone.
MOTOROLA
Type 1 Telephony Features Library Applications
6-5
For More Information On This Product,
Go to: www.freescale.com