Project

General

Profile

Manually

Bad idea ....

ENX driver Generator

This tool creates a skeleton driver for ENX.
You can find it in the subversion repository in this sub directory : EnxTools/Driver_Generator

It is the easiest way to create an empty ENX driver.

Options of the configure script

The options available are:
  • --with-name : Defines name of the driver. You should use uppercase for first letter of the name.
  • --with-version : Used to create driver for oldest version of ENX. Available only for ENX version upper 2.0.
  • --enable-C : When thos option is used, the driver generator creates a skeleton calling C module.

How to fill ADA skeleton

First of all, never modify the plugin_*.ad? files without good reason.

Driver type

If you need to add specific parameter to the driver object, you must modify the type T_*driver name* in the driver name.ads.

   type T_Test is new T_Driver with null record;
   -----------------------------------------------------------
   -- Example if you want to add an integer in the record:  --
   --           type T_Test is new T_Driver with record --
   --              My_Integer : Integer := 0;               --
   --           end record;                                 --
   -----------------------------------------------------------

Initialization phase

If you need specific initialization actions, you can use init and close functions.
For example if you use a Linux device, you can open the device in the init function and close it in the close one.

The init function is called when you create the ENX device (calling create command).
The close function is called when you delete the ENX device (callong delete command).

ENX functions

All the other functions implements the standard ENX functionnality.
The Write_32 function implements MM functionnalitu, aso.

All the functions have two arguments:
  1. the driver object itself.
  2. the command with all the parameters

Example of C skeleton using external shared library

First step: Creating an empty driver with C module enabled.

./configure --with-name=Test_Shared_Librabry --enable-C
make
make install

Second step: Create your own shared library

Third step: Modifying ada project file to link ENX driver with your library.

for Library_Options use (".....", "-LPath_to_your_library", "-lYour_library_name");

Fourth step: Compiling your ENX driver

make
make install

Don't forget to modify your LD_LIBRARY_PATH to add the path to your library.