Sample - Drivers Library
Changes
- V2.00 : Initial revision
- V3.00 : New M93CX6 SPI E2P driver
- V4.00 : Former drivers removed; New E2P chip drivers.
- V4.10 : New NAND flash driver on the parallel bus.
Library Description
This Driver sample ADL Library allows applications to use directly some
specefic devices, plugged on SPI or I2C or Parallel bus. The available drivers
are listed bellow :
- ST M95XX0 E2P Memory (SPI)
This driver allows to write/read bytes to/from a M95XX0 external memory on the SPI bus.
The drv_SPI_E2P_M95XX0_Load() function has to be called prior to any drv_Subscribe call in order to link the application with this specific driver.
- ST M24CXX E2P Memory (I2C)
This driver allows to write/read bytes to/from a M24C64 external memory on the I2C bus.
The drv_SPI_E2P_M24CXX_Load() function has to be called prior to any drv_Subscribe call in order to link the application with this specific driver.
- ST NANDXXX-M flash Memory (Parallel Bus)
This driver allows to write/read bytes to/from a NAND256R4M3 external memory on the Parallel bus.
The drv_PARALLEL_BUS_NANDXXXM_Load() function has to be called prior to any drv_Subscribe call in order to link the application with this specific driver.
In Remote Task Environement (RTE mode), read/write operations are not certified with the PARALLEL_BUS_NANDXXXM drivers. The embedded application executed from a PC can be too slow and does not respect times of reading/writing.
Library API
All constants and APIs are defined by the drv_global.h header file, which must
be included by any application to allows it to use the Drivers Library.
The library will need the global variable bellow on link operation, to define
the trace level on which will be displayed the Drivers traces :
extern u8 drv_TraceLevel;
The Drivers APIs are defined bellow :
drv_Subscribe
This API can be used to subscribe to a specific device driver.bool
drv_Subscribe
(
drv_ID_t
ID, drv_Settings_t *
pSettings
);
Parameter | Description |
ID | driver ID, defined in the drv_ID_t enum. |
pSettings | settings structure, defined as drv_Settings_t union
please refer to each driver header file for more
informations. |
drv_Unsubscribe
This API can be used to unsubscribe from the requested driver.bool
drv_Unsubscribe
(
drv_ID_t
ID
);
Parameter | Description |
ID | driver ID, defined in the drv_ID_t enum. |
drv_Write
This API can be used to write on the required device.bool
drv_Write
(
drv_ID_t
ID, drv_Write_t *
pWriteBuffer
);
Parameter | Description |
ID | driver ID, defined in the drv_ID_t enum. |
pWriteBuffer | write structure, defined as drv_Write_t union
please refer to each driver header file for more
informations. |
drv_Read
This API can be used to read from the required device.bool
drv_Read
(
drv_ID_t
ID, drv_Read_t *
pReadBuffer
);
Parameter | Description |
ID | driver ID, defined in the drv_ID_t enum. |
pReadBuffer | read structure, defined as drv_Read_t union
please refer to each driver header file for more
informations. |
Updated: Tue Sep 19 17:08:36 CEST 2006;