Advantech PCI-1736UP Spezifikationen Seite 154

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 159
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 153
Comedi
143 / 148
};
The function pointers insn_read . . . cancel . offer (pointers to) the standardized user-visible API that every subdevice should
offer; every device driver has to fill in these functions with their board-specific implementations. (Functionality for which Comedi
provides generic functions will, by definition, not show up in the device driver data structures.)
The buf_change and munge function pointers offer functionality that is not visible to the user and for which the device driver
writer must provide a board-specific implementation: buf_change() is called when a change in the data buffer requires han-
dling; munge() transforms different bit-representations of DAQ values, for example from unsigned to 2’s complement.
6.2.1.3 comedi_device
The last data structure stores the information at the device level:
struct comedi_device_struct{
int use_count;
comedi_driver
*
driver;
void
*
private;
kdev_t minor;
char
*
board_name;
const void
*
board_ptr;
int attached;
int rt;
spinlock_t spinlock;
int in_request_module;
int n_subdevices;
comedi_subdevice
*
subdevices;
int options[COMEDI_NDEVCONFOPTS];
/
*
dumb
*
/
int iobase;
int irq;
comedi_subdevice
*
read_subdev;
wait_queue_head_t read_wait;
comedi_subdevice
*
write_subdev;
wait_queue_head_t write_wait;
struct fasync_struct
*
async_queue;
void (
*
open)(comedi_device
*
dev);
void (
*
close)(comedi_device
*
dev);
};
6.2.1.4 comedi_async
The following data structure contains all relevant information: addresses and sizes of buffers, pointers to the actual data, and the
information needed for event handling:
struct comedi_async_struct{
void
*
prealloc_buf; /
*
pre-allocated buffer
*
/
unsigned int prealloc_bufsz; /
*
buffer size, in bytes
*
/
unsigned long
*
buf_page_list; /
*
physical address of each page
*
/
unsigned int max_bufsize; /
*
maximum buffer size, bytes
*
/
unsigned int mmap_count; /
*
current number of mmaps of prealloc_buf
*
/
volatile unsigned int buf_write_count; /
*
byte count for writer (write completed)
*
/
Seitenansicht 153

Kommentare zu diesen Handbüchern

Keine Kommentare