This is the mail archive of the
ecos-bugs@sourceware.org
mailing list for the eCos project.
[Bug 1001787] GPIO Interrupt Support for Kinetis
- From: bugzilla-daemon at bugs dot ecos dot sourceware dot org
- To: unassigned at bugs dot ecos dot sourceware dot org
- Date: Sun, 17 Mar 2013 14:00:18 +0000
- Subject: [Bug 1001787] GPIO Interrupt Support for Kinetis
- Auto-submitted: auto-generated
- References: <bug-1001787-777@http.bugs.ecos.sourceware.org/>
Please do not reply to this email, use the link below.
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001787
Ilija Kocho <ilijak@siva.com.mk> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ilijak@siva.com.mk
Assignee|unassigned@bugs.ecos.source |ilijak@siva.com.mk
|ware.org |
--- Comment #1 from Ilija Kocho <ilijak@siva.com.mk> ---
Hi Mike
Thank you for your contribution. Now I have a little time to see your macros
and functions, but my ability for testing is limited.
Interrupt support:
To begin with, I should have added __irqc parameter to CYGHWR_HAL_KINETIS_PIN()
from the beginning.
CYGHWR_HAL_KINETIS_SETUP_PIN() corrects my mistake but I would avoid the
assignment operation in this macro in order to allow it's usage in arrays. It
is usually necesary to set several pins at once. Than we can define an array
and call macro HAL_SET_PINS() (See Ethernet, Flexbus and DDRAM drivers for use
cases). Therefore I propose following modification of your macro (then my
original macro will be a special case with __irqc = 0):
// Pin configuration descriptor PinCD
// PinCD is a 32 bit unsigned integer which contains configuration information
// for one pin. This macro produces PinCD based on following parameters:
// __port - Port name, [A, F]
// __bit - Port bit [0, 31]
// __mux - Multiplexer index [0, 7]
// __irqc - Interrupt configuration [0, F]
// __cnf - Configuration options
#define CYGHWR_HAL_KINETIS_PINCD(__port, __bit, __mux, __irqc, __cnf) \
((CYGHWR_HAL_KINETIS_PORT##__port << 20) | ((__bit) << 27) \
| CYGHWR_HAL_KINETIS_PORT_PCR_IRQC(__irqc) \
| CYGHWR_HAL_KINETIS_PORT_PCR_MUX(__mux) | (__cnf))
// PinCD with disabled interrupts. (For backward compatibility)
#define CYGHWR_HAL_KINETIS_PIN(__port, __bit, __mux, __cnf) \
CYGHWR_HAL_KINETIS_PIN_CNF(__port, __bit, __mux, 0, __cnf)
The interrupt acknowledge function should be designed with efficiency in mind
so I would avoid switch even though it requires direct coding instead of using
macros.
Bit manipulation functions: Having such macros already, bit manipulation
functions seem redundant to me. Is there a use case where we must use function
(rather than macro)?
This is all for now.
Ilija
--
You are receiving this mail because:
You are the assignee for the bug.