in

andy vt's tools & blog

automating lazy

Roll my own driver?

Last post Mon, Jan 24 2011 11:21 AM by babgvant. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • Mon, Jan 17 2011 9:46 PM

    Roll my own driver?

    Because I am a masochist, or an idiot, I have decided to try making my own HTPC case electronics using a netduino to control my LCD, buttons, LED's etc and since I haven't figured out a good way to pull information from Windows 7 Media Center I'd like to use LCDWriter to talk to my board for all things LCD. The information about writing your my own driver was pretty vague (probably to keep people like me away) but I think I understand conceptually what needs to happen. I need to write what happens when LCDWriter calls the functions from my dll. So the easy functions to write are Clear and Init but I am not quite sure what to do for the rest. using System;

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using LcdWriter.SDK;
    using System.IO.Ports;

    namespace netduinolcd
    {
    public interface ILcdWriter : IDisposable
    {
    void Clear();
    void Init();
    void Render();
    void RenderString(byte row, string buffer);
    void ReviseString(int index, string buffer);
    void SetString(int index, string buffer, bool scroll, string sep, long rate, int repeat);
    void SetIcons(LcdIconCollection icons);
    int GetColumns();
    int GetRows();
    void Standby();
    }

    public abstract class netduinowriter : ILcdWriter
    {
    private string[ rowText = new string[2];
    private SerialPort serialport;
    public void Clear()
    {
    //Clear the display
    rowText[0] = "";
    rowText[1] = "";
    Render();
    }

    public void Init()
    {
    //Initialize the serial port

    //Initialize display
    }

    public void Render()
    {
    //Send strings to the display
    }

    public void RenderString(byte row, string buffer)
    {
    /* For row 0 = top, 1 = bottom
    * buffer is what we want to write to that row.
    */

    rowText[row] = buffer;
    Render();
    }

    public void ReviseString(int index, string buffer)
    {
    //What does this do?
    }

    public void SetString(int index, string buffer, bool scrooll, string sep, long rate, int repeat)
    {
    //And what are those variables?
    }

    public void SetIcons(LcdIconCollection icons)
    {
    //And this?
    }

    public int GetColumns()
    {
    //Return the number of columns on the display?
    return 16;
    }

    public int GetRows()
    {
    //Return the number of rows on the display?
    return 2;
    }

    public void Standby()
    {
    //Clear the screen, turn off the backlight
    }

    public void Dispose()
    {
    Standby();
    //close the serial port

    this.Dispose();
    }
    }
    }
    Any help would be great!

    Filed under: , , ,
  • Mon, Jan 24 2011 11:21 AM In reply to

    • babgvant
    • Top 10 Contributor
    • Joined on Tue, Oct 3 2006
    • United Kingdom

    Re: Roll my own driver?

    It's not vague to discourage you, I don't like writing docs :)

    The implementation for the 320B display/remote is attached LMK if you have questions.

Page 1 of 1 (2 items)
@2008 andy vt
Powered by Community Server (Non-Commercial Edition), by Telligent Systems