![]() |
|
If you can't view the Datasheet, Please click here to try to view without PDF Reader . |
|
Datasheet File OCR Text: |
Features * Software Module Dedicated to Voice Processing * Optimized for the AT75 Series Smart Internet Appliance Processor (SIAPTM) * Includes Several Run-time Configurable Stand-alone Algorithms - G.723.1 Dual-rate Vocoder (5.3 Kbps/6.4 Kbps) - VAD/CNG Silence Compression (Annex A of G.723.1) - G.711 -law and A-law Compression (64 Kbps) - Arbitrary Tone Generator * ITU-T G.723.1 and G.711 Standard-compliant * Available with a uClinux(R) Device Driver Overview The AT75C1210 G.723.1 Voice Processing Software Module is designed to run on the OakDSPCore(R) subsystem of the AT75 series Smart Internet Appliance Processor. It implements commonly-used voice processing algorithms: * * * * a low bit-rate G.723.1 vocoder for multimedia communication a silence compression algorithm to efficiently handle periods of silence during communication a high bit-rate voice compression algorithm an arbitrary tone generator that can be used to generate any frequency during a programmable duration Smart Internet Appliance Processor (SIAPTM) AT75C1210 G.723.1 - Voice Processing Software Module All these algorithms have a number of parameters which can be programmed at run time. These parameters modify the behavior of the DSP algorithms in such a manner that they comply with the applicable standards under most situations. They also allow the AT75C to cope with many non-standard situations often encountered on private telephone networks. The AT75C1210 takes advantage of the AT75 mailbox to exchange data with the onchip ARM7TDMI(R) core. The organization of the data communication channel makes it easy to integrate the AT75C1210 interface into most operating systems. For developers using uClinux, a specific device driver is supplied. It allows the extension of uClinux capabilities to the complete functionality of the AT75C1210 module in a seamless manner. This document is made up of three sections: 1. a functional description of the supported algorithms 2. a description of the low level software interface 3. a description of the uClinux device driver Mixing low-level and driver-level programming should be avoided. Rev. 1777A-11/01 1 Functional Description A functional block diagram of the AT75C1210 G.723.1 module is given in Figure 1. The different algorithms are independent. They can be enabled, disabled or programmed individually. Figure 1. Block Diagram G.723.1 Encoder + VAD/CNG Micro G.711 -law/a-law Decompression G.711 -law/a-law Compression Speaker G.723.1 Decoder + CNG Tone Generation G.723.1 Dual Rate Vocoder This algorithm can be used for compressing the speech or other audio signal components of a multimedia service at a very low bit rate. This coder has two bit rates associated with it: 5.3 and 6.4 Kbps. The higher bit rate has better quality; it is based on Multi Pulse Maximum Likelihood Quantization (MP-MLQ) technique. The lower bit rate gives good quality and provides system designers with additional flexibility; this rate is based on an Algebraic Code Linear Prediction (ACELP) technique. This coder operates on 30 ms speech frames of 16-bit linear PCM samples (sampling frequency is 8 kHz). An algorithmic delay of 7.5 ms is to be taken into account before getting an encoded voice data frame. That leads to a total delay of 37.5 ms. Resulting encoded frames are 20 bytes long for 5.3 Kbps rate and 24 bytes long for 6.4 Kbps rate. The encoding rate can be chosen by means of a configuration command sent to the DSP (see "Request Notification Messages" on page 7). VAD/CNG Voice Activity Detection (VAD) and Comfort Noise Generator (CNG) algorithms are designed to work hand-in-hand with G.723.1 vocoder. Silence compression techniques are used to reduce the transmitted bit rate during silent intervals of speech. The VAD side detects those silent intervals. CNG is used to produce a noise that matches the actual background noise. CNG uses information provided by VAD to encode silent intervals into Silence Insertion Descriptor (SID) frames that are 4 bytes long. It also re-synthesizes 16-bit linear PCM samples of background noise with a SID frame input. The VAD/CNG feature can be enabled or not by means of a configuration command sent to the DSP (see "Request Notification Messages" on page 7). -law and a-law are logarithmic compression techniques applied to speech signals. They are done by simple operations that give no delay and excellent quality of speech. However, the bit rate is very high (each 16-bit linear PCM speech sample gives an 8-bit compressed sample leading to 64 Kbps) making this feature useful only for broadband data networks. The compression/decompression algorithm can be chosen by means of a configuration command send to the DSP (see "Request Notification Messages" on page 7). The tone generation task generates a pure sine wave with programmable frequency, amplitude and duration. G.711 -law and Alaw Voice Compression Tone Generator 2 AT75C1210 G.723.1 1777A-11/01 AT75C1210 G.723.1 Low-level Interface This section describes how the AT75C1210 software is uploaded into the DSP subsystem program memory. It also describes how the application software running on the ARM(R) and the AT75C1210 running on the DSP Subsystem exchange information through the mailboxes. This section assumes an in-depth knowledge of the ARM/DSP Subsystem interface mailbox system. Voice Module Upload While the DSP subsystem is held in reset, its program memory is made visible in the ARM memory space. This allows the ARM application to write a binary image of the DSP software very easily. When the DSP subsystem is taken out of reset, its program memory is switched from the ARM memory space back to the DSP program space just before the first instruction is fetched. This process is illustrated in Figure 2. Figure 2. Voice Module Upload ARM Core SIAP_MDRB ASB OakB Program Memory P-Bus Reset Oak Subsystem X-RAM Y-RAM Upload Process A typical DSP program uses a number of initialized variables. Typically, the initial values are stored in the program space, and copied into their RAM location by the DSP start-up routine. This leads to the following statements: * * * * Just after the boot routine has initialized the variables, the DSP subsystem exhibits high redundancy since the same values exist in both program and data memories. The initial values stored in the program memory waste space and are not used during operation. To improve the program memory usage, the software is loaded in two consecutive steps. A small data initialization program is first loaded and executed. This program just initializes the X- and Y-RAM to the values expected by the audio decoder software. When the initialization is done, the program sends a DATA_INIT_DONE status message to the ARM application through the status mailbox. Then, the DSP subsystem is put in reset and the program itself is loaded. This code has no data init start-up routine. It assumes the RAMs are already initialized, which saves program space. When the software is ready to work, it sends a SW_INIT_DONE status message through the status mailbox. * 3 1777A-11/01 The mailbox operation and status messages are described in the section "Mailbox Usage" on page 5. Binary Image Format When the system is idle, the AT75C1210 module is stored in the ARM memory space, possibly in non volatile memory. The module contains the data initialization code, the application code, and additional formatting data. The various fields of the AT75C1210 binary image are described in Table 1. Table 1. Binary Image Fields Field Name INIT_OFFSET INIT_LENGTH SW_OFFSET SW_LENGHTH INIT_CODE SW_CODE Offset from Start of Field (Bytes) 0 4 8 12 16 16 + 2*INIT_LENGTH Length (Bytes) 4 4 4 4 2*INIT_LENGTH 2*SW_LENGTH Description Defines the position of the data initialization code from the beginning of the module image. Defines the length of the data initialization code (16-bit words). Valid between 0 and 24576. Defines the position of the audio decoder program from the beginning of the module image. Defines the length of the audio decoder code (16-bit words). Valid between 0 and 24576. Binary code of the data initialization program. Binary code of the application program. DPMB Configuration The DPMB is programmed in configuration 2 (as defined in the AT75 Series Datasheet) and gives the configuration shown in Table 2. All the mailboxes allow read/write access from both sides. Arbitration is done using the semaphores. Table 2. DPMB Configuration Mailbox # 0 1 2 3 4 5 6 7 Note: Offset from Base(1) 0x000 0x080 0x100 0x140 0x180 0x1A0 0x1C0 0x1E0 Length 0x80 0x80 0x40 0x40 0x20 0x20 0x20 0x20 Direction ARM -> Oak ARM <- Oak ARM -> Oak ARM -> Oak ARM -> Oak ARM <- Oak ARM -> Oak ARM <- Oak Semaphore Address(1) 0x200 0x204 0x208 0x20C 0x210 0x214 0x218 0x21C Usage Unused Unused DSP memory access Unused Unused Unused Request notification Status notification 1. Base address is 0xfa000000 for OakA, 0xfb000000 for OakB. 4 AT75C1210 G.723.1 1777A-11/01 AT75C1210 G.723.1 Mailbox Access ARM-to-Oak Mailboxes Before accessing the ARM-to-Oak mailboxes, the ARM must check that the corresponding semaphore is cleared to 0. Then it can read or write the mailbox data. When the data access is done, it must set the semaphore to 1 to notify the Oak that new data has arrived. The ARM is notified that new data is available in a mailbox when the corresponding semaphore is raised to 1, possibly triggering an interrupt. Then the ARM can access the mailbox. When the access is finished, the ARM must clear the semaphore to release the mailbox. This section describes the specific purpose of each mailbox. The exchanged information is formatted in structured messages. The message format and semantics are described in sections "Request Notification Messages" on page 7 and "Status Notification Messages" on page 11. Used by the ARM to provide to the OAK encoded speech frames (either G.711 data or G.723.1 data). Used by the ARM to get from the OAK encoded speech frames (either G.711 data or G.723.1 data). The ARM has the ability to send requests to read or write any location of the DSP memories, either in program or data space. This is useful for two purposes: * * Mailbox 6: Request Notification DSP software debug Programming of the DSP peripherals under the ARM application control Oak-to-ARM Mailboxes Mailbox Usage Mailbox 0: TX Encoded Voice Data Mailbox 1: RX Encoded Voice Data Mailbox 2: Oak Memory Access This mailbox is used by the ARM to pass requests to the DSP. These requests trigger specific tasks in the DSP software. For example, request notification messages are used to start or to stop the telephony algorithms. This mailbox is used by the DSP software to send status information. For example, a status notification message is sent by the DSP software at the end of the data initialization to notify the ARM application that the data has been initialized. The first two mailboxes deal with speech compressed frames. Each byte sent through the mailbox is put in a 16-bit word where the low byte is the original byte value and in the high byte are flags. Assuming the data to be transmitted is in "char buf[0..N-1]", it is formatted in the mailbox as shown in Table 3 (otherwise the frame is ignored). Table 3. Speech Frame Format(1) Word 0 FRAME_START|buf[0] Note: ... ... Word i (i = 1... N - 2) 0x0000|buf[i] ... ... Word N - 1 FRAME_END|buf[N - 1] Mailbox 7: Status Notification TX/RX Encoded Voice Data 1. With FRAME_START = 0x8000 and FRAME_END = 0x4000 Delivered frames are of variable length: * The length is encoded within the first two bits of buf[0] for G.723.1: - - - buf[0] & 0x3 = 0 -> 24 bytes at a rate of 6.3 Kbits per second buf[0] & 0x3 = 1 -> 20 bytes for a rate of 5.3 Kbits per second buf[0] & 0x3 = 2 -> 4 bytes for silence compression frames 5 1777A-11/01 - * buf[0] & 0x3 = 3 -> 1 byte: it follows a 4-byte frame while the silence scheme is unchanged If the system is in G.711, mode frames are 64 bits long, independent of the contents of buf[0]. Oak Memory Access The ARM has the ability to send requests to read or write any location of the Oak memories, either in program or data space. To achieve this, the mailbox 2 is divided into four fields: * Command field (mailbox base + 0): This is a request ID that tells what kind of operation is to be performed. Valid codes are: - - - - * * * 0x0001: Program memory read 0x0002: Program memory write 0x0003: Data memory read 0x0004: Data memory write Address field (base + 1 16-bit word): Should be written with the address location to be accessed. This is the value of the address as it is seen by the Oak. Length field (base + 2 16-bit words): Should be written with the number of consecutive locations to access. Data field (base + 3 16-bit words and following): For write access, should be filled with the values to write. For read access, contains the read values requested by the previous command. Example of use: Write 0x1234 into data location 0xabcd of the 0akB: 1. Wait for *(0xfb000208) == 0, i.e., the semaphore is cleared 2. *(0xfb000100) = 0x0004 // data write command 3. *(0xfb000102) = 0xabcd // this is the address 4. *(0xfb000104) = 0x0001 // only one word to write 5. *(0cfb000106) = 0x1234 // this is the value 6. *(0xfb000208) = 1 // notify the OakB Example of use: Read data locations 0xabcd and 0xabce from OakB: 1. Wait for *(0xfb000208) == 0, i.e. the semaphore is cleared 2. *(0xfb000100) = 0x0004 // data write command 3. *(0xfb000100) = 0x0003 // data read command 4. *(0xfb000102) = 0xabcd // this is the first address to read 5. *(0xfb000104) = 0x0002 // two words to read 6. *(0xfb000208) = 1 // notify the OakB 7. Wait for the semaphore to go back to 0. 8. Read 0xfb000106 and 0xfb000108 to get the requested values. 6 AT75C1210 G.723.1 1777A-11/01 AT75C1210 G.723.1 Request Notification Messages Request messages are used by the ARM to trigger specific tasks running on the DSP. These messages are always formatted in the same way. Figure 3 describes this format. Figure 3. Request Notification Message Format Mailbox Base Address LENGTH REQUEST_ID PARAMETER[0] LENGTH Words ... PARAMETER[LENGTH - 2] unused... 16 Bits A message always begins with a LENGTH field. This field contains the number of words of the message, excluding the LENGTH field itself. The REQUEST_ID field is uniquely defined to designate the type of request. Each request can be followed by a variable but well-defined number of PARAMETER fields. These fields contain additional data needed to handle the request. The description of the supported request messages is listed inTable 4. It is forbidden for the ARM application to issue unsupported messages. However, should the ARM application issue an unsupported or malformed request, the Oak software must recover gracefully. G.723.1 Configuration Request This message is sent to the Oak before enabling any G.723 operation. Table 4. G.723.1 Configuration Request Word 0 Word 1 Word 2 0x0006 0x0400 WORKRATE Message Length = 0x0006 Request ID = 0x0400 Work rate for encoding, valid values: 0: 6.3 Kbits/s rate 1: 5.3 Kbits/s rate Work rate for decoding, valid values: 0: 6.3 Kbits/s rate 1: 5.3 Kbits/s rate default 1 Note: This parameter is automatically set to the G.723 algorithm. In all cases this parameter needs to be initialized. 0: disable VAD 1: enable VAD Gain for the microphone input Valid: 0x0040 (- 36 dB) to 0x8000 (+18 dB) Gain for the speaker output Valid: 0x0040 (-36 dB) to 0x8000 (+18 dB) Word 3 WORKRATED Word 4 Word 5 Word 6 USEVX MICR_GAIN = 0x1000 * 10E(dB/20) SPKR_GAIN = 0x1000 * 10E(dB/20) 7 1777A-11/01 G.723.1 Decoding Start Request Table 5. G.723.1 Decoding Start Request Word 0 Word 1 0x0001 0x0401 Message length = 0x0001 Request ID = 0x0401 The G.723.1 decode task starts as soon as the DSP unit receives this request. G.723.1 Decoding Stop Request Table 6. G.723.1 Decoding Stop Request Word 0 Word 1 0x0001 0x0402 Message length = 0x0001 Request ID = 0x0402 The G.723.1 decode task is stopped as soon as this request is received by the DSP unit. G.723.1 Encoding Start Request Table 7. G.723.1 Encoding Start Request Word 0 Word 1 0x0001 0x0403 Message length = 0x0001 Request ID = 0x0403 The G.723.1 encode task starts as soon as the DSP unit receives this request. G.723.1 Encoding Stop Request Table 8. G.723.1 Encoding Stop Request Word 0 Word 1 0x0001 0x0404 Message length = 0x0001 Request ID = 0x0404 The G.723.1 encode task is stopped as soon as this request is received by the DSP unit. G.711 Configuration Request Table 9. G.711 Configuration Request Word 0 Word 1 Word 2 0x0005 0x0401 LAW Number of words of the message Request ID Selected Law for compression. Valid values: 0: -law 1: a-law default 0 8 AT75C1210 G.723.1 1777A-11/01 AT75C1210 G.723.1 Table 9. G.711 Configuration Request (Continued) Word 3 LAWD Selected Law for decompression. Valid values: 0: -law 1: a-law default 0 Gain for microphone input Valid: 0x0040 (-36 dB) to 0x8000 (+18 dB) Gain for the speaker output Valid: 0x0040 (-36 dB) to 0x8000 (+18 dB) Word 4 Word 5 MICR_GAIN = 0x1000 * 10E(dB/20) SPKR_GAIN = 0x1000 * 10E(dB/20) This message is sent to the Oak before enabling any G.711 operation G.711 Decompression Start Request Table 10. G.711 Decompression Start Request Word 0 Word 1 0x0001 0x0411 Number of words of the message Request ID The G.711 decompression task starts as soon as the DSP unit receives this request. G.711 Decompression Stop Request Table 11. G.711 Decompression Stop Request Word 0 Word 1 0x0001 0x0412 Number of words of the message Request ID The G.711 decompression task is stopped as soon as the DSP unit receives this request. G.711 Compression Start Request Table 12. G.711 Compression Start Request Word 0 Word 1 0x0001 0x0413 Number of words of the message Request ID The G.711 compression task starts as soon as the DSP unit receives this request. G.711 Compression Stop Request Table 13. G.711 Compression Stop Request Word 0 Word 1 0x0001 0x0414 Number of words of the message Request ID The G.711 compression task is stopped as soon as the DSP unit receives this request. 9 1777A-11/01 Tone Generation Configuration Request Table 14. Tone Generation Configuration Request Word 0 Word 1 Word 2 Word 3 Word 4 Word 5 0x0007 0x0800 32768 * cos (pi * TONE_FREQ/4000) 32768 * cos (pi * TONE_FREQ/4000) TONE_LEVEL = 32768 * 10E(dB/20) TONE_DURATION Message Length = 0x0007 Request ID = 0x0800 Words 2 and 3 define the frequency of the generated tone Level of the generated tone Duration of the generated tone in milliseconds 0x0000 means unlimited duration Duration of the silence following the tone in milliseconds 0x0000 means unlimited duration Bit 0: 0 causes the generator to wait for a tone generation start request (request ID 0x0801) before the tone is generated 1: the generation starts immediately Bit 1: 0: the tone is added to all other signals emitted on the speaker 1: all other signals are blocked while the tone is generated Word 6 SILENCE_DURATION Word 7 TONE_START Example: 0x0007 0x0801 0x5A82 0x5A83 0x4000 0x0080 0x0080 0x0003 This message configures the generator to emit a 1024 Hz tone 6 dB below the reference level. The tone is emitted as soon as the DSP unit receives the request. After 128 ms of signal and 128 ms of silence, a tone generation done status message is emitted. Tone Generation Start Request Table 15. Tone Generation Start Request Word 0 Word 1 0x0001 0x0801 Message length = 0x0001 Request ID = 0x0801 The tone starts as soon as the DSP unit receives this request. A tone generation configuration request (request ID 0x0800) should be issued before the tone generation start request is sent. If not, the behavior of the tone generator is unpredictable. Tone Generation Stop Request Table 16. Tone Generation Stop Request Word 0 Word 1 0x0001 0x0802 Message length = 0x0001 Request ID = 0802 The tone stops as soon as the DSP unit receives this request. This request can be used to stop an unlimited tone generation, or to halt the generator before the predefined duration has elapsed (early termination). 10 AT75C1210 G.723.1 1777A-11/01 AT75C1210 G.723.1 Status Notification Messages Status messages are used by the Oak to inform the ARM application that a specific event has occurred, or to respond to an earlier request. These messages are always formatted in the same way. Figure 4 describes this format. Figure 4. Status Notification Message Format Mailbox Base Address LENGTH STATUS_ID PARAMETER[0] LENGTH Words ... PARAMETER[LENGTH - 2] unused... 16 Bits A status message always begins with a LENGTH field. This field contains the number of words of the message, excluding the LENGTH field itself. The STATUS_ID field is uniquely defined to designate the type of status. Each status can be followed by a variable but well-defined number of PARAMETER fields. These fields contain additional status information. The description of the supported status messages is listed below. It is forbidden for the Oak program to issue unsupported status messages. However, should the Oak program issue an unsupported or malformed status message, the ARM application must recover gracefully. Data Initialization Status This status message is issued when the data initialization program has completed the data initialization process. The Oak can be safely reset and reloaded with the voice module precisely named. Table 17. Data Initialization Status Word 0 Word 1 Word 2 Word 3 Word 4 Word 5 Word 6 0x0006 DATA_INIT_DONE_ID VERSION_MONTH VERSION_DAY VERSION_YEAR VERSION_HOUR VERSION_MIN Message length = 0x0006 Status ID = 0x8001 Version information: Contains the date of the generation of the binary file of the DSP. Voice Module Initialization Status This status message is issued when the audio decoder has finished initializing itself and is ready to accept request messages. The ARM should not issue any request messages before this status message has been received. Table 18. Voice Module Initialization Status Word 0 Word 1 LENGTH SW_INIT_DONE_ID Message length = 0x0001 Status ID = 0x8002 11 1777A-11/01 Bad Format Status The Oak issues this message when it has received a request message in which the LENGTH field is not compatible with the request type. The OakB ignores the corresponding malformed request. Table 19. Bad Format Status Word 0 Word 1 Word 2 LENGTH BAD_FORMAT_ID BAD_FORMAT_VALUE Message length = 0x0002 Status ID = 0x80FF Contains the request ID of the malformed request message. Unknown Request Status The Oak issues this message when it has received a request message with an unsupported request ID field. Table 20. Unknown Request Status Word 0 Word 1 Word 2 LENGTH UNKNOWN_REQ_ID UNKNOWN_REQ_VALUE Message length = 0x0002 Status ID = 0x80FE Contains the request ID of the malformed request message. Bad Parameter Status The Oak issues this message when it has received a request message with a parameter having an invalid value. Table 21. Bad Parameter Status Word 0 Word 1 Word 2 LENGTH UNKNOWN_REQ_ID UNKNOWN_REQ_VALUE Message length = 0x0002 Status ID = 0x80FD Contains the request ID of the malformed request message. Bad Speech Frame Status This status is issued when a speech frame message does not have the correct header or footer Table 22. Bad Speech Frame Status Word 0 Word 1 LENGTH BAD_FRAME_ID Message length = 0x0001 Request ID = 0x84FF Underrun Status This status is issued when a speech frame takes too long to arrive, thus causing a discontinuity in the speech stream. Table 23. Underrun Status Word 0 Word 1 LENGTH UNDERRUN_ID Message length = 0x0001 Status ID = 0x84FD To avoid flooding the ARM with underrun status bursts, this kind of message should be issued at most once per compressed frame period, as long as the underrun state is encountered. 12 AT75C1210 G.723.1 1777A-11/01 AT75C1210 G.723.1 G.723.1 Decoding Stopped Status Message This status is issued if the decode task was stopped by a G.723.1 decode stop request (request ID 0x0402). Table 24. G.723.1 Decoding Stopped Status Message Word 0 Word 1 0x0001 0x8402 Message length = 0x0001 Status ID = 0x8402 G.723.1 Encoding Stopped Status Message This status is issued if the decode task was stopped by a G.723.1 encode stop request (request ID 0x0404). Table 25. G.723.1 Encoding Stopped Status Message Word 0 Word 1 0x0001 0x8404 Message length = 0x0001 Status ID = 0x8404 G.711 Decompression Stopped Status Message This status is issued if the decompression task was stopped by a G.711 decompression stop request (request ID 0x0412). Table 26. G.711 Decompression Stopped Status Message Word 0 Word 1 0x0001 0x8412 Message length = 0x0001 Status ID = 0x8412 G.711 Compression Stopped Status Message This status is issued if the compression task was stopped by a G.711 compression stop request (request ID 0x0414). Table 27. G.711 Compression Stopped Status Message Word 0 Word 1 0x0001 0x8414 Message length = 0x0001 Status ID = 0x8414 Tone Generation Status This message is issued when the tone duration has elapsed. It is not issued if the tone was stopped by a tone generation stop request (request ID 0x0802). Table 28. Tone Generation Status Message Word 0 Word 1 0x0001 0x8802 Message length = 0x0001 Status ID = 0x8802 13 1777A-11/01 AT75C1210 Device Driver The AT75C1210 software module is supplied with device driver for uClinux. This device driver enables the application developer to integrate all the AT75C1210 functionality into the uClinux kernel. All the features of the AT75C1210 modules can be accessed through the standard uClinux API. This section documents this API. Under uClinux, the device drivers are accessed through filesystem entries. The AT75C1210 device driver is a character type driver. The associated virtual file can be opened, read from, written to and closed like any regular file. The major role of the device driver is to redefine the file access methods, so that the application can interact with the underlying device as if it were a file through the standard file manipulation functions. It provides the application with an abstraction layer which hides the low level interface on top of which it sits. The AT75C1210 device driver is operated through the /dev/g723 filesystem. It is used for G.723.1 operations. G.723.1 Driver Operations The G.723.1 driver redefines the following file manipulation functions: * * * * * int open(const char *path, int flags, mode_t mode); int read(int fd, void *buf, int count); int write(int fd, void *buf, int count); int select(int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout); int close(int fd); Additionally, the ioctl function allows control of additional features of the AT75C1210 that are not accessible with the read or write methods. Those special commands are described below. The prototype of the ioctl function is: * int ioctl(int fd, int request, char *argp); Open Method Synopsis #include 14 AT75C1210 G.723.1 1777A-11/01 AT75C1210 G.723.1 Return Values Open return the new file descriptor, or -1 if an error occurred. In the latter case, the global variable errno is set appropriately to reflect the cause of error. Possible values of errno are: * ENODEV: this indicates that the underlying hardware does not exist or is not supported. One reason can be a corruption of the binary DSP software which could not be loaded into the DSP subsystem. EBUSY: the underlying hardware is busy. Most probably there is another process using the same resource. ENOMEM: a memory allocation requested by the driver failed. This happens when the system memory is full. int fd = open("/dev/g723", O_RDWR | O_NONBLOCK); This opens the G.723 device driver in read/write mode. It selects non blocking I/O for read and write operations. The file descriptor is returned in fd. If fd is positive, the G.723 device is readily available for read and write operations. * * Example Close Method Synopsis #include Return Values Example Read Method Synopsis #include 15 1777A-11/01 Return Values On success, the number of bytes read is returned. It is not an error if this number is smaller than the number of bytes requested. This may happen for example because fewer bytes are actually available at the time, or because read was interrupted by a signal. On error, -1 is returned and errno is set appropriately. Possible values for errno are as follows: * * * * EAGAIN: non-blocking I/O has been selected using O_NONBLOCK and no data was immediately available. EBADF: fd is not a valid descriptor. EINVAL: the /dev/g723 file was not open for reading. EFAULT: buf is outside the accessible address space. ret = read(fd,buf,256); This reads at most 256 bytes from file descriptor fd (assumed here to be related to /dev/g723), and stores them into the memory location pointed to by buf. Example Write Method Synopsis #include 16 AT75C1210 G.723.1 1777A-11/01 AT75C1210 G.723.1 Ioctl Method Synopsis #include 17 1777A-11/01 Installation For versions of the siap_uClinux previous to 2.0, the installation of the AT75C1210 software is as follows: Change directory to siap-uClinux-1.x.y/ and launch patch_AT75C1210. It carries out the following actions: * * * * Add g723.bin DSP binary in the prods/dk020/romdisk/romdisk/lib/ directory. Add voice/ demo sources subdirectory in apps/ directory Add g723/ driver subdirectory in linux/arch/armnommu/driver/ directory Modify various configuration files After it ends, change directory to linux/ and type: > make xconfig This updates the configuration according to the file modification. Verify that the "G.723.1 support" item is correctly set to "y". Afterwards clean and rebuild your uClinux distribution. For versions 2.0 and higher, the driver is already installed. Application Example Synopsis #include 18 AT75C1210 G.723.1 1777A-11/01 Atmel Headquarters Corporate Headquarters 2325 Orchard Parkway San Jose, CA 95131 TEL (408) 441-0311 FAX (408) 487-2600 Atmel Product Operations Atmel Colorado Springs 1150 E. Cheyenne Mtn. Blvd. Colorado Springs, CO 80906 TEL (719) 576-3300 FAX (719) 540-1759 Europe Atmel SarL Route des Arsenaux 41 Casa Postale 80 CH-1705 Fribourg Switzerland TEL (41) 26-426-5555 FAX (41) 26-426-5500 Atmel Grenoble Avenue de Rochepleine BP 123 38521 Saint-Egreve Cedex, France TEL (33) 4-7658-3000 FAX (33) 4-7658-3480 Atmel Heilbronn Theresienstrasse 2 POB 3535 D-74025 Heilbronn, Germany TEL (49) 71 31 67 25 94 FAX (49) 71 31 67 24 23 Asia Atmel Asia, Ltd. Room 1219 Chinachem Golden Plaza 77 Mody Road Tsimhatsui East Kowloon Hong Kong TEL (852) 2721-9778 FAX (852) 2722-1369 Atmel Nantes La Chantrerie BP 70602 44306 Nantes Cedex 3, France TEL (33) 0 2 40 18 18 18 FAX (33) 0 2 40 18 19 60 Japan Atmel Japan K.K. 9F, Tonetsu Shinkawa Bldg. 1-24-8 Shinkawa Chuo-ku, Tokyo 104-0033 Japan TEL (81) 3-3523-3551 FAX (81) 3-3523-7581 Atmel Rousset Zone Industrielle 13106 Rousset Cedex, France TEL (33) 4-4253-6000 FAX (33) 4-4253-6001 Atmel Smart Card ICs Scottish Enterprise Technology Park East Kilbride, Scotland G75 0QR TEL (44) 1355-357-000 FAX (44) 1355-242-743 literature@atmel.com Web Site http://www.atmel.com (c) Atmel Corporation 2001. Atmel Corporation makes no warranty for the use of its products, other than those expressly contained in the Company's standard warranty which is detailed in Atmel's Terms and Conditions located on the Company's web site. The Company assumes no responsibility for any errors which may appear in this document, reserves the right to change devices or specifications detailed herein at any time without notice, and does not make any commitment to update the information contained herein. No licenses to patents or other intellectual property of Atmel are granted by the Company in connection with the sale of Atmel products, expressly or by implication. Atmel's products are not authorized for use as critical components in life support devices or systems. Atmel (R) is the registered trademark of Atmel; SIAP TM is the trademark of Atmel. ARM (R) and ARM7TDMI(R) are registered trademarks of ARM Ltd.; OakDSPCore (R) is a registered trademark of DSP Group Inc.; uClinux (R) is the registered trademark of Lineo Inc. Other terms and product names may be the trademarks of others. Printed on recycled paper. 1777A-11/01/0M |
Price & Availability of AT75C1210
![]() |
|
|
All Rights Reserved © IC-ON-LINE 2003 - 2022 |
[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy] |
Mirror Sites : [www.datasheet.hk]
[www.maxim4u.com] [www.ic-on-line.cn]
[www.ic-on-line.com] [www.ic-on-line.net]
[www.alldatasheet.com.cn]
[www.gdcy.com]
[www.gdcy.net] |