BSPACM
20150113
Board Support Package for ARM Cortex-M Microcontrollers
|
ioctl() support for BSPACM's newlib file descriptor operations More...
#include <bspacm/newlib/fdops.h>
Go to the source code of this file.
Macros | |
#define | BSPACM_IOCTL_FLUSH 0x100 |
Functions | |
int | ioctl (int fd, int request,...) |
ioctl() support for BSPACM's newlib file descriptor operations
This file defines ioctl request values common to multiple BSPACM devices. More specific ioctl requests may be defined in other headers.
Applications should make no attempt to interpret ioctl values; they are to be treated as opaque integers that are constant within a given application.
#define BSPACM_IOCTL_FLUSH 0x100 |
Flush read and write buffers at the device layer.
This blocks, with interrupts enabled, as long as the underlying device still has data pending for transmission or reception; e.g. see iBSPACMperiphUARTfifoState() for an example device-layer utility used by this ioctl.
A common use for this would be to flush pending information written through stdout
prior to entering a sleep mode that might disable the peripheral that supports the device. E.g.:
flags | One of the values O_RDONLY (0), O_WRONLY (1), or O_RDWR (2) as defined in <fcntl.h>. O_RDONLY and O_RDWR will block until all material received by the device has been consumed by the application. O_WRONLY and O_RDWR will block until all material submitted to the device has been written. |
int ioctl | ( | int | fd, |
int | request, | ||
... | |||
) |
Manipulate the underlying parameters of the device.
The semantics of this are specific to request
and to the device that fd
references.
fd | descriptor for an open device |
request | operation-specific request identifier |
... | any parameters associated with request |
errno
.