Here are my suggestions for a Common Data Aquisition API, please send your suggestions/criticism to this list. OK First we should start with the 'Atoms', we need support for the most popular chipsets. There should be a global info struct that contains informations about 'global' parameters for the chipset (for example a oscillator frequency used for timing} The 'Modes' can be controlled thru the API. Selecting one mode blocks the Atom for other use. An atom can be configured (initialized), a mode can be selected for an atom and operation8 can be triggered. Each mode has its own configuration, each time a mode is selected the atom cannot be used by another virtual instrument. Depending on what chipset type is configured the operational modes have different meanings (the PIO for example). An Atom can be a chipsets feature (on 8255 for example there could be one atom for each port) bigger blocks of data should be transferred with read()/write() preceeded by one A_CONFIGURE that switches the buffer pointer to the desired atom. Currently I have no idea how events can be used to trigger user actions. I think only one Major number should be used for all atoms atom-addressing could be done by open one minor device per atom or by giving the atom address as intrinsic information with the call-structs (I think this method will be more flexible). The chipset setup should be done from a special config program that reads a hardware config-spec file. -------------------------------------------------------------------------- Calling conventions: open( "/dev/atoms/xxx", O_RDWR); opens the desired atom. ioctl(fd,A_CONFIGURE, config_s s) config_s contains global information about an atom chipset_type, xtal frequencies etc. ioctl(fd,A_SELECT, mode_s s) selects a operational mode for an atom ioctl(fd,A_TRIGGER, trigger_s s) triggers a hardware operation start/stop etc ioctl(fd,A_STATUS, status_s *s) ask for status information read()/write() read or write to atoms data-buffer (if any) for results. ------------------------------------------------------------------------ Operational Modes: o Counter and Timing Controllers: -------------------------------- - 8253, Am9513, ... Global configuration: chipset type, xtal freq, Modes: 1.) Event Counter One or more counter(s) can be used as event counter one click per pulse parameter: {preset value} result: {The count} 2.) Frequency Counter One Counter is used as timebase counter triggering the gate of the event counter. parameter: { timebase count , xtal freq } result: { the count } 3.) Pulse Generator ( pulse freq & with ) One counter is the trigger counter that starts the other counter this counter counts until terminal count is reached. parameter: { pulse freq, pulse witdh, xtal freq } 4.) Interrupt Generator { single shot } Clicks one interrupt every time the terminal count has been reached parameter: { click time, xtal freq } result: - 5.) Frequency divider Timer is pulsed with external or internal oscillator parameter: { timebase, xtal freq } result: - o) D/A Converter ---------------- Global Configuration: chipset type, Reference Voltage, resolution (12/16 bit) Modes: 1.) Single Shot Voltage output Programmable output ( simple ) parameter: { voltage } 2.) Programmable Waveform generator uses Interrupt Generator Atom o) A/D Converter ------------------------- Global Configuration: chipset type, Reference Voltage, resolution (12/16bit) Modes: 1.) Single Shot Voltage Input Software controlled A/D conversion parameter: - result: {voltage} 2.) Multichannel Analog-input parameter: channel data result: one voltage per channel o) Programmable Instrumentation Amplifier --------------------------------------- Global Configuration: chipset type Modes: 1.) Programmable Gain: parameter: gain value result: o) Programmable Multiplexer Circuit ------------------------------------- Global Configuration: chipset type Modes: 1.) Single Channel Operation Enable channel parameter: {channel no} o) PIO circuit --------------------------------------- Global Configuration: chipset type Modes: 1:) Digital Input 2.) Digital Output 3:) Single Line in/out