User Tools

Site Tools


for_developers:wrapper_lib

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Last revisionBoth sides next revision
for_developers:wrapper_lib [2017/04/18 11:45] kalbererfor_developers:wrapper_lib [2017/04/18 12:32] kalberer
Line 8: Line 8:
   - Create classes for every type you intend to support (AnalogOut, DigitalIn, PWM, ...):   - Create classes for every type you intend to support (AnalogOut, DigitalIn, PWM, ...):
     - These classes have to derive from the EEROS HAL classes In- or Output respectively ScalableIn- or ScalableOutput. You can find these classes in the EEROS repository in folder ''/includes/eeros/hal''. This allows you to access the member functions of the derived classes when they are loaded dynamically over the configuration file.     - These classes have to derive from the EEROS HAL classes In- or Output respectively ScalableIn- or ScalableOutput. You can find these classes in the EEROS repository in folder ''/includes/eeros/hal''. This allows you to access the member functions of the derived classes when they are loaded dynamically over the configuration file.
 +    - Implement the derived functions for every class. The ''set()'' and ''get()'' functions have to access the hardware library and write or read from hardware according to their functionality.
     - For scalable channels ''scale'' and ''offset'' (member variables of ScalableIn- and ScalableOutput) have to be taken into account. Calculate the effective output value set to the hardware with these values. Check AnalogOut of [[https://github.com/eeros-project/comedi-eeros|comedi-eeros]] for an example. Scale and offset describe the scaling factors of the connected hardware. So you have to divide the output value by scale.     - For scalable channels ''scale'' and ''offset'' (member variables of ScalableIn- and ScalableOutput) have to be taken into account. Calculate the effective output value set to the hardware with these values. Check AnalogOut of [[https://github.com/eeros-project/comedi-eeros|comedi-eeros]] for an example. Scale and offset describe the scaling factors of the connected hardware. So you have to divide the output value by scale.
     - Create a C function ''createType'', which will be called dynamically from EEROS for every supported type. This function has to create an object of the corresponding type and returns a pointer to it.     - Create a C function ''createType'', which will be called dynamically from EEROS for every supported type. This function has to create an object of the corresponding type and returns a pointer to it.
     - Create all necessary Feature Functions as C functions. These are intended to use for all actions which cannot be called with the derived functions like setting a PWM frequency.     - Create all necessary Feature Functions as C functions. These are intended to use for all actions which cannot be called with the derived functions like setting a PWM frequency.
   - Create a class to handle the hardware device node (''open'', ''close'', ...). Create a factory for the device. On every creation of a channel there will be an access to ''getDevice()'' and you have to make sure that the device is opened only once.   - Create a class to handle the hardware device node (''open'', ''close'', ...). Create a factory for the device. On every creation of a channel there will be an access to ''getDevice()'' and you have to make sure that the device is opened only once.
for_developers/wrapper_lib.txt · Last modified: 2017/04/18 12:43 by kalberer