C++/VS2005 Display plugin skeleton

Discussing issues that occur during plugin development.

Moderators: caesar, IFR, mattcro, limbo, _X7JAY7X_

C++/VS2005 Display plugin skeleton

Postby Enrico74 » Fri Jul 06, 2007 1:29 pm

Hello,

I wanted to start the development of a display driver for the VFD of my case (Zalman HD135) but could not find any skeleton to start with.
So I first tried to build a proper C++ skeleton with VS2005 and got to the point where I think I could share it with the forum.
It can certainly be improved / correted / documented... but for now it just seems to do the job for my purposes (and maybe yours).

It comes with project files to be compiled with VS2005 (express edition should work) and a sample plugin.dll that can be loaded with LCDSmartie 5.4 (I did not try with any other versions).

Please post comments and suggestions.
You do not have the required permissions to view the files attached to this post.
Enrico74
 
Posts: 5
Joined: Mon Jul 02, 2007 5:17 pm
Location: Belfort, France

Postby TiTaN_pi8 » Tue Aug 07, 2007 8:29 pm

Very nice initiative!

I tried to load the solution file (plugin.sln) but I got an error about a file not found. I looked through the project file and found an absolute path from your machine. If you remove the line 'InheritedPropertySheets="..\..\..\..\Tronc\Ressources\Options communes BestOptim.vsprops"' twice (line 23 and 104) it works without errors.

I have attached the entire skeleton with edited project file.
You do not have the required permissions to view the files attached to this post.
TiTaN_pi8
 
Posts: 1
Joined: Tue Aug 07, 2007 8:22 pm

Postby Nick_Shl » Wed Nov 07, 2007 12:28 am

Hi!
I am want to write my own LCD driver. I am compiled this code with Visual C++ 6.0, but it isn't work. In display settings "Warning: DLL may not compatible!".
If I change string
Code: Select all
#define DLL_EXPORT(type) extern "C" __declspec(dllexport) type __stdcall
to
Code: Select all
#define DLL_EXPORT(type) extern "C" __declspec(dllexport) type
It work(show correct plugin name, usage and param), but if click button "OK" or "Apply", Smartie closing without any error...
Please help me.
Nick_Shl
 
Posts: 5
Joined: Wed Nov 07, 2007 12:16 am
Location: Minsk, Belarus

Postby mattcro » Wed Nov 07, 2007 12:31 pm

You may need to manually add/create a DEF resource file that lists the functions to be exported from the DLL. This looks something like this:
Code: Select all
LIBRARY   "JW002_LCD"

EXPORTS
  DISPLAYDLL_Init
  DISPLAYDLL_Done
  DISPLAYDLL_DriverName
  DISPLAYDLL_Usage
  DISPLAYDLL_DefaultParameters
  DISPLAYDLL_SetPosition
  DISPLAYDLL_Write
  DISPLAYDLL_SetBrightness
  DISPLAYDLL_CustomChar
  DISPLAYDLL_CustomCharIndex
  DISPLAYDLL_ReadKey
  DISPLAYDLL_SetBacklight
  DISPLAYDLL_SetContrast
  DISPLAYDLL_PowerResume
  DISPLAYDLL_SetGPO
  DISPLAYDLL_SetFan

The LIBRARY line must refer to the project name ("JW002_LCD" in my case). This file should be added as a project resource.

I hope I've got that all right, since I'm not in front of a project at the moment to check...
User avatar
mattcro
Forum Supporter
 
Posts: 517
Joined: Wed Mar 08, 2006 2:58 pm
Location: Scotland

Postby Nick_Shl » Wed Nov 07, 2007 2:48 pm

mattcro wrote:You may need to manually add/create a DEF resource file that lists the functions to be exported from the DLL. This looks something like this:
...
The LIBRARY line must refer to the project name ("JW002_LCD" in my case). This file should be added as a project resource.
I hope I've got that all right, since I'm not in front of a project at the moment to check...
Yes! All Right! Big thanks!
Image
Image
Nick_Shl
 
Posts: 5
Joined: Wed Nov 07, 2007 12:16 am
Location: Minsk, Belarus

Postby mattcro » Wed Nov 07, 2007 9:55 pm

Hey, look! I'm famous :lol:

Glad to hear you have the driver working now. The FTDI-based module looks interesting. I've used the FT232 but not the parallel FIFO ones. Do you have a microcontroller under the board there somewhere, or is it just the USB converter and LCD?
User avatar
mattcro
Forum Supporter
 
Posts: 517
Joined: Wed Mar 08, 2006 2:58 pm
Location: Scotland

Postby Nick_Shl » Thu Nov 08, 2007 12:36 pm

mattcro wrote:Glad to hear you have the driver working now. The FTDI-based module looks interesting. I've used the FT232 but not the parallel FIFO ones. Do you have a microcontroller under the board there somewhere, or is it just the USB converter and LCD?
I am use this chip without microcontroller. FT232 also can be used without microcontroller, because I am using "Bit-Bang Mode"(FT232BM/FT245BM Bit-Bang Mode) for control LCD in 4bit mode(D0-D4, E, R/W, A0, R/W now not using - always write. 1 line free, maybe use it in future for control backlight).
Nick_Shl
 
Posts: 5
Joined: Wed Nov 07, 2007 12:16 am
Location: Minsk, Belarus

Postby mattcro » Thu Nov 08, 2007 6:02 pm

Ah, didn't realise there was a bit-bang mode. That makes it very easy to hook up an LCD with USB if you use the DLP module.

For 4-bit LCD mode, you have D0-D3, RS and EN (plus EN2 on 40x4). That's two spare pins (or 1 spare on 40x4), so you can have backlight control on all LCDs, and maybe a GPO (or single button).

When you are happy with the driver, please share it by starting a new thread in the plugin announcements section with some info and the driver (plus source code if possible).
User avatar
mattcro
Forum Supporter
 
Posts: 517
Joined: Wed Mar 08, 2006 2:58 pm
Location: Scotland


Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 0 guests