login
Forgot?
Login with Facebook

Don't have an account? Register one now!

LCD Control driver in Debian 2.26 written in C

Bids 
14
Avg Bid
$180 USD
CLOSED
  • Project ID:

    749391
  • Project Type:

    Fixed
  • Budget:

    $30-$250 USD

Project Description:

We are looking for a talented programmer to help develop an LCD screen and keypad driver in Debian Linux 2.6 kernel. The script or driver must work in 32 and 64 bit environments. The basic function of the LCD and keypad will be to display simple usage statistics for cpu, memory, and hard disk. The LCD will also be used to display network configuration info. This driver will be the initial version for production. As time moves forward, we would like to continue to utilize the same programmer to make improvements to the driver and add new functionality. We intend to have the following functionality after the initial version: control LAN bypass function, reboot/shutdown, launch restore mechanism, launch backup mechanism, and output various database statistics.

The LCM manufacturer has included a sample driver and source that works. This can be used as a reference for programming.

Additional Project Description:

08/05/2010 at 11:06 EDT:
Picture of the unit.



Skills required:

C Programming, Linux

Additional Files:

UT-ENTERPRISE-GREEN.JPEG

Project posted by:

Proactivens United States
(0 Reviews)

Last seen:

Public Clarification Board

1 messages

  • Proactivens

    Sample C file text


    #define BASE 0x378
    #define I_REGISTER 2
    #define D_REGISTER 0
    #define WRITE_DATA 8

    #define Superio_index 0x2e
    #define Superio_data 0x2f
    #define BANK_REG 0x07

    #define timeout_value 5 //Set time out value, the default value is 5 seconds

    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    #include <time.h>
    #include <signal.h>
    #include <unistd.h>
    #include <sys/io.h>
    #include <sys/types.h>
    #include <sys/utsname.h>
    #include <sys/perm.h>
    #include <sys/time.h>

    int status;
    pid_t pid;


    // LCD display control functions
    void display_on(void);
    void display_off(void);
    void clear_display(void);
    void return_home(void);
    void entry_mode(void);
    void function_set(void);
    void initialize_display(void);
    void print_character(int character);
    int detect_all_press();

    void open_LCD(void);
    void close_LCD(void);
    void timeout(void);
    int btn_pressed=0, count_end=1;

    // Functions for making screens to send to the LCD
    void main_loop(void);

    // Main function
    int main(void)
    {
    int width; // LCD screen width
    int height; // LCD screen height
    int i; // Just a counter
    width = 16;
    height = 2;
    ioperm(BASE, 3, 1); // Get permission to the prallel port
    outb(0, BASE + 2); // Make sure there is power on C0
    initialize_display(); // Initialize the display
    main_loop();
    display_off();
    ioperm(BASE, 3, 0);
    return 0;
    }

    void open_LCD(void)
    {
    int data_temp;
    ioperm(Superio_index, 2, 1); //Get permission to the GPIO port
    outb(0x87, Superio_index);
    outb(0x87, Superio_index);
    outb(BANK_REG, Superio_index);
    outb(BANK_REG, Superio_data);
    outb(0xf1, Superio_index);
    data_temp=inb(Superio_data);
    data_temp&=~(0x10);
    outb(data_temp, Superio_data);
    ioperm(Superio_index, 2, 0); //Cloase permission to the GPIO port
    }

    void close_LCD(void)
    {
    int data_temp;
    ioperm(Superio_index, 2, 1); //Get permission to the GPIO port
    outb(0x87, Superio_index);
    outb(0x87, Superio_index);
    outb(BANK_REG, Superio_index);
    outb(BANK_REG, Superio_data);
    outb(0xf1, Superio_index);
    data_temp=inb(Superio_data);
    data_temp|=0x10;
    outb(data_temp, Superio_data);
    ioperm(Superio_index, 2, 0); //Cloase permission to the GPIO port
    }

    void timeout(void)
    {
    btn_pressed=1;
    count_end=0;
    }

    void display_on(void)
    {
    outb(12, BASE); //Turn on D3 and D4
    outb(I_REGISTER + WRITE_DATA, BASE + 2); //Turn off C1 and C3
    outb(4 + I_REGISTER + WRITE_DATA, BASE + 2); //Turn on C2 while C1 and C3 remains off
    outb(I_REGISTER + WRITE_DATA, BASE + 2); //Reset Control pins
    usleep(0);
    }



    void display_off(void)
    {
    outb(8, BASE); //Turn on D3 and D4
    outb(I_REGISTER + WRITE_DATA, BASE + 2); //Turn off C1 and C3
    outb(4 + I_REGISTER + WRITE_DATA, BASE + 2); //Turn on C2 while C1 and C3 remains off
    outb(I_REGISTER + WRITE_DATA, BASE + 2); //Reset Control pins
    usleep(0);
    }


    void clear_display(void)
    {
    outb(1, BASE); //Turn on D0
    outb(I_REGISTER + WRITE_DATA, BASE + 2); //Turn off C1 and C3
    outb(4 + I_REGISTER + WRITE_DATA, BASE + 2); //Turn on C2 while C1 and C3 remains off
    outb(I_REGISTER + WRITE_DATA, BASE + 2); //Reset Control pins
    usleep(0);
    }


    void return_home(void)
    {
    outb(2, BASE); //Turn on D1
    outb(I_REGISTER + WRITE_DATA, BASE + 2); //Turn off C1 and C3
    outb(4 + I_REGISTER + WRITE_DATA, BASE + 2); //Turn on C2 while C1 and C3 remains off
    // usleep(1); //Wait while Enable (C2) is high so LCD will have time to load the info
    outb(I_REGISTER + WRITE_DATA, BASE + 2); //Reset Control pins
    usleep(0);
    }


    void entry_mode(void)
    {
    outb(6, BASE); //Turn on D1 and D2
    outb(I_REGISTER + WRITE_DATA, BASE + 2); //Turn off C1 and C3
    outb(4 + I_REGISTER + WRITE_DATA, BASE + 2); //Turn on C2 while C1 and C3 remains off
    outb(I_REGISTER + WRITE_DATA, BASE + 2); //Reset Control pins
    usleep(0);
    }


    void function_set(void)
    {
    outb(56, BASE); //Turn on D3, D4 and D5
    outb(I_REGISTER + WRITE_DATA, BASE + 2); //Turn off C1 and C3
    outb(4 + I_REGISTER + WRITE_DATA, BASE + 2); //Turn on C2 while C1 and C3 remains off
    outb(I_REGISTER + WRITE_DATA, BASE + 2); //Reset Control pins
    usleep(0);
    }


    void initialize_display(void)
    {
    function_set();
    function_set();
    entry_mode();
    display_on();
    clear_display();
    }


    void print_character(int character)
    {
    outb(D_REGISTER + WRITE_DATA, BASE + 2); //Set register to Write Data
    outb(character, BASE); // Set the character code
    outb(4 + D_REGISTER + WRITE_DATA, BASE + 2); //Enable High
    outb(D_REGISTER + WRITE_DATA, BASE + 2); //Disable High
    usleep(0); //Wait while Enable (C2) is high so LCD will have time to load the info
    }


    int detect_all_press()
    {
    unsigned char b123;
    b123 = 0xF0 & inb(0x379);
    switch(b123){
    case 0x70: //don't press any button
    return 0;
    break;
    case 0x30: //button left
    return 1;
    break;
    case 0x60: //button up
    return 2;
    break;
    case 0xF0: //button right
    return 3;
    break;
    case 0x50: //button down
    return 4;
    break;
    case 0xB0: //button left & right to exit
    return 5;
    break;
    default:
    return 0;
    break;
    }
    }

    void main_loop(void)
    {
    int x, retval, timer_counter=0;
    char clearbr[]=" up"; //show word
    char bypassoff[]=" right";
    char aewinos[]=" down";
    char bypasson[]=" left";
    unsigned char d123=0, c123;
    pid=fork();
    // printf("PID= %d\n", pid);
    if(pid==0)
    {
    // printf("Signal Alarm timeout!\n");
    signal(SIGALRM,timeout); //excute timeout func as soon as receive the SIGALRM
    // printf("Process Signal timeout\n");
    while(1)
    {
    if(btn_pressed)
    {
    btn_pressed=0;
    timer_counter=timeout_value;
    }
    else if(!count_end)
    {
    timer_counter--;
    sleep(1);
    if(!timer_counter) //If timer count out, Excute close_LCD,
    {
    close_LCD();
    timer_counter=timeout_value;
    count_end=1;
    }
    }
    // printf("it is in child process\n");
    }
    exit(0);
    }
    else if(pid==-1)
    {
    printf("The Timer subprocess was not created! \n");
    }
    else
    {
    // printf("PID= %d\n",pid);
    while(1){
    c123=detect_all_press(); //?sbuttonA
    if ((d123 != 1) && (c123 == 1)){
    clear_display();
    for(x = 0; x < strlen(clearbr); x++)
    print_character(clearbr[x]); //display "left" in lcm
    open_LCD();
    kill(pid,SIGALRM);
    printf("up\n"); //print in computer
    }
    if ((d123 != 2) && (c123 == 2)){
    clear_display();
    for(x = 0; x < strlen(bypassoff); x++)
    print_character(bypassoff[x]); //display "up"
    open_LCD();
    kill(pid,SIGALRM);
    printf("right\n");
    }
    if ((d123 != 3) && (c123 == 3)){
    clear_display();
    for(x = 0; x < strlen(aewinos); x++)
    print_character(aewinos[x]); //display "right"
    open_LCD();
    kill(pid,SIGALRM);
    printf("down\n");
    }
    if ((d123 != 4) && (c123 == 4)){
    clear_display();
    for(x = 0; x < strlen(bypasson); x++)
    print_character(bypasson[x]); //display "down"
    open_LCD();
    kill(pid,SIGALRM);
    printf("left\n");
    }
    if ((d123 != 5) && (c123 == 5)){
    clear_display();
    close_LCD();
    retval = kill( pid,SIGKILL );
    if ( retval )
    {
    puts( "kill failed." );
    perror( "kill" );
    waitpid( pid, &status, 0 );
    }
    else
    {
    printf("LCD test is exited!\n");
    }
    break; //?kP?loopAM?`{
    }
    return_home();
    d123=c123; //OUbuttonA d?Uj
    }
    }
    }

    over 1 year ago


If you are the project creator or one of the bidders, please Log In for more options.


All Bids ()

muthusuba India
muthusuba
India From India     Offline
  C Programming Level 1 (93%, 99th percentile)
  General Freelancer Orientation (75%, 81st percentile)
$150 in 2 days 
$30 Milestone Requested
over 1 year ago
4.6

3.8

2 Reviews
62% Completion Rate
Initial bid. Please check PMB. Thaank you.
TheArseneLupin Tunisia
small.jpg
TheArseneLupin
Tunisia From Tunisia     Offline
  US English Level 1 (93%, 57th percentile)
  C Programming Level 1 (75%, 77th percentile)
  C++ Level 1 (83%, 88th percentile)
  Unix Level 1 (83%, 30th percentile)
  General Freelancer Orientation (80%, 90th percentile)
$100 in 2 days 
$20 Milestone Requested
over 1 year ago
4.9

2.7

10 Reviews
43% Completion Rate
Hi, I ve seen the requirements and I believe am the right person for this job. Please check PMB for more details.
dmmartins Brazil
dmmartins
Brazil From Brazil     Offline
  Foundation EUFreelance.com Member
$220 in 10 days 
0
over 1 year ago
4.7

2.5

4 Reviews
66% Completion Rate
Please see PM.
mpinfotech1 India
mpinfotech1
India From India     Offline
$95 in 2 days 
$10 Milestone Requested
over 1 year ago
0.0

0.0

0 Reviews
0% Completion Rate
Hi, We are the group of people working from both India and US with knowledge in PHP, C#, ASP.NET,C,C++ ,HTML,CSS,Data processing,XML, Sql Server, MSSql, DB2,Lotus Joomla, Drupal,Java.Jsp,oracle did several projects as ... more
Hi, We are the group of people working from both India and US with knowledge in PHP, C#, ASP.NET,C,C++ ,HTML,CSS,Data processing,XML, Sql Server, MSSql, DB2,Lotus Joomla, Drupal,Java.Jsp,oracle did several projects as the same and we are really interested in taking up this task and do our best and complete support in doing this project. More over before we produce to you our team will test our best as much as we can and We can give you free technical support. We will send you our previous works which we done in web designing and technologies which will be more satisfactory for you We promise for that. Already we have done a project for this kind for more information I will send a in PM. We can work in around the clock basis. less
ngoctam1307 Viet Nam
20092006183.jpg
ngoctam1307
Viet Nam From Viet Nam     Offline
$150 in 30 days 
0
over 1 year ago
May i help you?
lsdumbrella United States
lsdumbrella
United States From United States     Offline
$250 in 14 days 
0
over 1 year ago
0.0

2.0

1 Review
16% Completion Rate
may I help?
ra9ftm Russian Federation
ra9ftm
Russian Federation From Russian Federation     Offline
$30 in 10 days 
0
over 1 year ago
I am developing drivers in linux for embedded systems. I think I can do this work.
rmj2010 India
rmj2010
India From India     Offline
  Foundation EUFreelance.com Member
$50 in 10 days 
$5 Milestone Requested
over 1 year ago
I am new here, I had work on such project
sansoftaus India
Facebook_1711176.jpg
sansoftaus
India From India     Offline
$70 in 1 day 
$18 Milestone Requested
over 1 year ago
Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
ibotstechnologie India
ibotstechnologie
India From India     Offline
  Foundation EUFreelance.com Member
$250 in 10 days 
$50 Milestone Requested
over 1 year ago
Hi I have done the 16x2 LCD Device driver ,let me know when do u wan't it...
togenius Sweden
ali new.jpg
togenius
Sweden From Sweden     Offline
  Foundation EUFreelance.com Member
$250 in 30 days 
$125 Milestone Requested
over 1 year ago
0.0

0.0

0 Reviews
33% Completion Rate
I have good experience in programming in Linux/Unix environment and can do your work. I hope to listen from you soon.
shearwater123 India
shearwaterlogo.JPG
shearwater123
India From India     Offline
  General Freelancer Orientation (75%, 81st percentile)
$250 in 15 days 
$50 Milestone Requested
over 1 year ago
We are from Shearwater Software and we specialize in Linux migrations. We have extensive programming experience in C/C++/Java and working experience on various flavors of UNIX and Linux. As part of migration effort we ... more
We are from Shearwater Software and we specialize in Linux migrations. We have extensive programming experience in C/C++/Java and working experience on various flavors of UNIX and Linux. As part of migration effort we rewrite applications too. Please visit us at www.shearwater-software.com for more details. We can take up this project as we are expertise and we can deliver it as quickly as possible. So Please accept our bid for your project. We will assign a team of senior programmers and the entire team will be communicating to you throughout the development period using msn/skype messenger. This team will email you daily reports and the same will be uploaded to our web server so that you can check the updates on a daily/weekly basis. Please let me know if you need any further info. Thanks Priyanka Business Executive Shearwater Software Pvt. Ltd., Bangalore less
crazyblu Russian Federation
crazyblu
Russian Federation From Russian Federation     Offline
$250 in 15 days 
0
over 1 year ago
0.0

0.0

0 Reviews
0% Completion Rate
Hi I am ready to start of the your project/ Regards, Sergey
gencosoftware01 United States
gencosoftware01
United States From United States     Offline
  Foundation LimeExchange Member
$400 in 7 days 
$80 Milestone Requested
over 1 year ago
0.0

0.0

0 Reviews
0% Completion Rate
I can do the job. Please send me more information. I am an expert in linux and programming and have work on suff like this for more than 10 years. Please do not hesitate to ask any questions. I know my bid i... more
I can do the job. Please send me more information. I am an expert in linux and programming and have work on suff like this for more than 10 years. Please do not hesitate to ask any questions. I know my bid is a bit over your budget, but I assure you that i can get this job done in the set time.  less