User manual
DSM tutorials
3.3 Creating a PSL
To create a PSL you compile the device drivers that match the peripherals on your target platform into a
Handel-C library and header file. Each of the drivers should be configured with interfaces that match the
pin allocations on your platform.
The organization of a PSL with respect to device drivers and application code is illustrated here:
ORGANIZATION OF PLATFORM SUPPORT LIBRARIES
3.4 Designing a device driver
A device driver can be divided into three parts:
• Device interface
• Application Programming Interface
• Interface translation code
The device interface is defined by the manufacturer and is specified in the device documentation. Your
device driver must conform to this interface. Device documentation can usually be obtained from a
manufacturers website.
Keep the API simple. Where the device has a great deal of functionality it is sometimes appropriate to
constrain the functionality presented by the API to just the functions required by common applications.
How you implement your interface translation code will affect the efficiency and the flexibility of your
device driver. Some issues to consider when designing this part are:
• How much hardware should your device driver consume
www.celoxica.com
Page 29