[ previous ] [ next ] [ threads ]
 
 From:  "Gianfranco Risaliti" <gianfranco dot risaliti at yogitech dot com>
 To:  <m0n0wall at lists dot m0n0 dot ch>
 Subject:  RE: [m0n0wall] LCD Support
 Date:  Mon, 11 Aug 2003 09:50:02 +0200
>IIRC net45xx's don't have a parallel port.

 

Hi to all,

Net45xx is built with elan sc520 and it has a gpio interface inside,


You can configure gpio to switch on of their bit as a lpt port...

I'm just working to connect a LCD display to this gpio, the problem
which I'm fighting is signal voltage, it's to low 3.3v, but I think I
have found a lcd display which work at that voltage.

So we can connect a display to net45xx....

Just a little effort... I'm almost at the end...

If you like to switch on of the red led of the board net45xx try this
simple program  

------------------------------------------------------------------------
----

#include <stdio.h>

#include <stdlib.h>

#include <fcntl.h>

#include <sys/types.h>

#include <sys/mman.h>

 

 

#define MMCRBASE 0xFFFEF000

#define MAPBASE MMCRBASE

#define MAPLEN 0x1000

#define MMCR_PIOFS15_0 0xC20

#define MMCR_PIODIR15_0 0xC2A

#define MMCR_PIODATA15_0 0xC30

#define MMCR_PIOSET15_0 0xC34

#define MMCR_PIOCLR15_0 0xC38

 

 

#define ON 1

#define OFF 0

#define PIO_9 9  // LED test

 

typedef unsigned char ubyte;

typedef unsigned short uword;

ubyte *baseptr;

unsigned int i;

unsigned int j;

 

void ioSetup() {

 unsigned int *function, *direction;

 int handler; 

 handler = open("/dev/mem", O_RDWR);

 if (handler < 0) {

  printf("could not open /dev/mem: %d", 1);

  exit(-1); 

 }

 baseptr = (unsigned char *)mmap(0, MAPLEN, PROT_READ |
PROT_WRITE,MAP_SHARED, handler, MAPBASE);  if(baseptr == MAP_FAILED) { 

  printf("could not mmap MMCR: %d", 2);

  exit(-1); 

 }

 // select pio function

 function = (unsigned int *)(baseptr + MMCR_PIOFS15_0);

 // 0 for PIO port function, 1 for other function

 *function &= ~(1 << PIO_9);

 direction = (unsigned int *)(baseptr + MMCR_PIODIR15_0); 

 *direction |= (1 << PIO_9);  

}

 

void setValueDATA(int offset, int mode) {

 unsigned int *ptr = (unsigned int *)(baseptr + MMCR_PIODATA15_0);  if
(mode== ON)

  *ptr |= (1 << offset);

 else

  *ptr &= ~(1 << offset);

}

void delay() {

 for(i=0;i<10;i++){

   for(j=0;j<1000;j++){

  }

 } 

}

 

int main(){

 ioSetup();

 for (;;) {

  setValueDATA(9,ON); 

  delay();

  setValueDATA(9,OFF); 

  delay();

 }

 return 0; 

}

 

------------------------------------------------------------------------
-

Gianfranco Risaliti.....