at75c1222 ETC-unknow, at75c1222 Datasheet - Page 27

no-image

at75c1222

Manufacturer Part Number
at75c1222
Description
Manufacturer
ETC-unknow
Datasheet
Example
G.711 Encoder Driver
Operations
Open Method
Synopsis
Description
Return Values
Example
2664A–INTAP–07/02
Assume that “fd” is referring to /dev/g729decoder1. This ioctl configures the decode
channel 1 with the G.729 payload.
The G.711 encoder driver redefines the following file manipulation functions:
Additionally, the ioctl() function controls additional features of the AT75C1222 which are
not accessible with the other methods. These special commands are described below.
The prototype of the ioctl() function is:
The /dev/g711encoder0 virtual file must be opened prior to any encoding operation on
the G.711 encoder device driver. This is made with the open() method, the same as for
any regular file. The main operation performed by the open() method of the device driver
is to load and initialize the corresponding DSP software in the DSP subsystem.
When this initialization is successful, the open system call converts the file “path” name
("/dev/g711encoder0" in this case) into a file descriptor. This file descriptor is a non-neg-
ative integer which will be used in subsequent I/O operations such as read(), ioctl(), etc.
“flags” should be O_RDONLY which request opening the file in read-only mode.
“flags” may also be bitwise-or'd with O_NONBLOCK. In this case, neither the open nor
any subsequent operations on the file descriptor which is returned will cause the calling
process to wait.
Open return the new file descriptor, or -1 if an error occurred. In the latter case, the glo-
bal variable errno is set appropriately to reflect the cause of error. Possible values of
errno are:
This opens the G.711 encoder device driver in read mode. It selects non blocking I/O for
read operations. The file descriptor is returned in “fd”. If “fd” is positive, the g711
encoder device is readily available for read operations.
ioctl(fd, DEC_CONFIG, NULL);
int open(const char *path, int flags, mode_t mode);
int read(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);
int ioctl(int fd, int request, char *argp);
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
int open(const char *path, int flags);
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/g711encoder0", O_RDONLY | O_NONBLOCK);
AT75C1222
27

Related parts for at75c1222