User manual

GHI Electronics,LLC Embedded Master User Manual
Custom Native Drivers
13. Custom Native Drivers
Managed code is safer for the system than native code. Programmers do not have to
worry about memory leaks or uninitialized pointers anymore. These nice features come
with a performance penalty. Depending on the application, speed may not be an issue.
GHI Electronics has proven experience with customizing Micro Framework with extended
functionality. FAT -previously- and USB libraries are completely written in native code but
still accessible from managed applications. The same way, any required functionality can
be added to the core of Embedded Master.
13.1. Requesting New Native Driver
Whenever possible, it is recommended that the design is started with managed code.
Once the driver is working then it would be easier to take the managed code and convert it
to native code. For example, an application may require Embedded Master to transfer
encrypted data over the network or CAN bus. We will also assume that required encryption
is not supported by .NET Micro Framework. The encryption algorithm can be written in C#
for testing the system. At this point, the developer can do some analysis to determine if the
“bottleneck” is the encryption or not. GHI can now take the managed encryption algorithm
and rewrite it in native code then add it to the core of Embedded Master for a fee. Please
contact GHI for further details.
13.2. Required Native Drivers
Some drivers can't be developed in managed applications. The display is one of the
devices that requires drivers to be written in native code and placed in the core. The driver
even runs at power up before the managed system is ready yet. In this case, GHI can
develop the complete driver or the user can supply some managed examples. LCDs on
Embedded Master run on a dedicated SPI bus (SPI2). This second SPI bus can be used
to connect the new unsupported LCD. A simple managed application can be used to reset
and setup the new LCD. This simple managed application can be used as a base to start
writing the native drivers.
Important: User can access SPI2 but must be aware that it is used in the SPI-based
Embedded Master LCD Driver when active.
13.3. Semi-Native Drivers
In some case, a native driver can be used with minor modification from the managed side.
Here is a scenario: A display need to be used. This display has the same controller as the
Rev. 2.06 TFT Page 93 of 102 www.ghielectronics.com