ts-7000
[Top] [All Lists]

Re: [ts-7000] GPIO cannot disable IRQ ?!?

To:
Subject: Re: [ts-7000] GPIO cannot disable IRQ ?!?
From: Clark Dunson <>
Date: Fri, 11 Feb 2011 06:31:43 -0800


Thank you Joel, I'll look into it.


On Feb 11, 2011, at 5:59 AM, Joel Morgan wrote:

 

On Fri, 2011-02-11 at 01:04 +0000, Clark wrote:
>
> I thought that GPIO would have to have GPIOFIntEn
> read as non-zero for the interrupt to be enabled.
> NO. Interrupts are unaffected by the values in GPIOFIntEn,
> GPIOFIntType1, and GPIOFIntType2 and frankly I am very
> confused.

I once suggested playing with these registers from userland and was
soundly corrected by Jim Jackson (thanks Jim).

> // __________________________________________________________
>
> #include<unistd.h>
> #include<sys/types.h>
> #include<sys/mman.h>
> #include<stdio.h>
> #include<fcntl.h>
> #include<string.h>
>
> int main(int argc, char **argv)
> {
> volatile unsigned int *PFDR, *PFDDR, *GPIOFDB, *GPIOFIntEn,
> *GPIOFIntType1, *GPIOFIntType2;
> int i;
> unsigned char state;
> unsigned char *gpio_ptr;
> int fd = open("/dev/mem", O_RDWR|O_SYNC);
>
> gpio_ptr = mmap(0, getpagesize(), PROT_READ|PROT_WRITE, MAP_SHARED,
> fd, 0x80840000);
>
> PFDR = (unsigned int *)(gpio_ptr + 0x30); // port f
> PFDDR = (unsigned int *)(gpio_ptr + 0x34); // port f direction
> register
> GPIOFDB = (unsigned int *)(gpio_ptr + 0x64); // debounce on port b
>
> GPIOFIntEn = (unsigned int *)(gpio_ptr + 0x58);
> GPIOFIntType1 = (unsigned int *)(gpio_ptr + 0x4C);
> GPIOFIntType2 = (unsigned int *)(gpio_ptr + 0x50);
>
> printf( "PFDR=0x%x PFDDR=0x%x GPIOFDB=0x%x GPIOFIntEn=0x%x
> GPIOFIntType1=0x%x GPIOFIntType2=0x%02x\n", *PFDR, *PFDDR, *GPIOFDB,
> *GPIOFIntEn, *GPIOFIntType1, *GPIOFIntType2 );
>
> if( argc >=2 ) {
> printf( "Configuring port\n" );
> *PFDDR = 0x0;

If this is on a ts7260 you need to do a read-modify-write when changing
the port f control registers

> *GPIOFIntType1 = 0xffffffff;
> *GPIOFIntEn=0x0; /* all ffff's out of desperation */
> *GPIOFIntType2 = 0x0;
> printf( "PFDR=0x%x PFDDR=0x%x GPIOFDB=0x%x GPIOFIntEn=0x%x
> GPIOFIntType1=0x%x GPIOFIntType2=0x%x\n", *PFDR, *PFDDR, *GPIOFDB,
> *GPIOFIntEn, *GPIOFIntType1, *GPIOFIntType2 );
> }
>
> close(fd);
> return 0;
> }

--
--
Joel R. Morgan
Morgan Millwright Services, Inc.
Linux User #504110 http://counter.li.org/




__._,_.___


Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: =Email Delivery: Digest | m("yahoogroups.com?subject","ts-7000-fullfeatured");=Change Delivery Format: Fully Featured">Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | =Unsubscribe

__,_._,___
<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU