2008-09-10 13:57:42     gpio questions

Document created by Aaronwu Employee on Aug 7, 2013
Version 1Show Document
  • View in full screen mode

2008-09-10 13:57:42     gpio questions

Kyle Schlansker (UNITED STATES)

Message: 61901   


I'm using Ports A and D for some interrupts and GPIO outputs and have a few questions.


1) Do I need to do anything special to use a GPIO as an interrupt?  Right now I'm simply requesting a irqs by calling 'request_irq(IRQ_PA0, ...)' etc.  Should  the PORTA_FER bit for PA0 be set to 0 for interrupts, just like it is for a normal gpio input?


2) I'm using bfin_write_PORTA_FER to set stuff from my module.  Is there a higher level function I should be using instead?  I seem to recall mike saying not to use the bfin_write macros.


3) Whlie this isn't really a question, it seems that the documentation is inconsistent regarding default settings for the FER registers:


Page 30-4 of the BF54x Peripheral HRM rev 0.4 states:

    "However, all pins default to the SPORT2 and SPORT3 module settings after reset"

Yet Page 9-8 of the BF54x HRM rev 0.4 states:

    "By default, all port pins are configured for GPIO operation after reset"


As described in #2, I'm planning to set a known default value for the FER registers, but it would be nice to get clarification on the true default settings.






2008-09-10 14:17:02     Re: gpio questions

Mike Frysinger (UNITED STATES)

Message: 61902   


you should not be touching any PORT register.  the interrupt/GPIO/peripheral framework takes care of everything for you.


a pin has multiple information associated with it.  it can be in a peripheral or gpio (FER), and the peripheral state can have multiple functions (MUX).  i imagine that is what the HRM is talking about.