This is the mail archive of the
ecos-patches@sourceware.org
mailing list for the eCos project.
[Bug 1001787] New: GPIO Interrupt Support for Kinetis
- From: bugzilla-daemon at bugs dot ecos dot sourceware dot org
- To: ecos-patches at ecos dot sourceware dot org
- Date: Sat, 02 Mar 2013 18:24:56 +0000
- Subject: [Bug 1001787] New: GPIO Interrupt Support for Kinetis
- Auto-submitted: auto-generated
Please do not reply to this email, use the link below.
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001787
Bug ID: 1001787
Summary: GPIO Interrupt Support for Kinetis
Product: eCos
Version: CVS
Target: All
Architecture/Host Cortex-M
OS:
Status: UNCONFIRMED
Severity: enhancement
Priority: low
Component: Patches and contributions
Assignee: unassigned@bugs.ecos.sourceware.org
Reporter: mjones@linear.com
CC: ecos-patches@ecos.sourceware.org
Created attachment 2113
--> http://bugs.ecos.sourceware.org/attachment.cgi?id=2113&action=edit
Support Kinetis GPIO interrupts and add set/get API
This patch adds to the Kinetis GPIO macros and API. It allows code to accept an
interrupt on a port by applying a configuration call, getting the interrupt,
and clearing the interrupt. I also added API for set/get of pins. The interrupt
is well tested on one port and pin. The set/get underlying macro was tested on
a pin before writing the API. The API is coded in a simple manner such that by
inspection if the original macros work, the API will work.
I don't have a mechanism to test interrupts on multiple pins/ports. So strictly
speaking, I can only say it is very robust using the example below. The code is
simple enough I feel save putting this code in CVS. However, if anyone has
hardware that would allow more testing, please do so if you have time.
If anyone is unhappy with the API, I am happy to make changes, retest, and send
a new patch.
An example:
#define ALERT_PORT 0
#define ALERT_PIN 19
cyg_uint32 alert_isr( cyg_vector_t vector,
cyg_addrword_t data
)
{
cyg_interrupt_mask(CYGNUM_HAL_INTERRUPT_PORTA);
hal_kinetis_gpio_interrupt_acknowledge(ALERT_PORT, ALERT_PIN);
// Do a little critical work.
return CYG_ISR_HANDLED | CYG_ISR_CALL_DSR;
}
void alert_dsr( cyg_vector_t vector,
cyg_ucount32 count,
cyg_addrword_t data
)
{
cyg_flag_setbits(&alert_flag, 0x01);
cyg_interrupt_unmask(CYGNUM_HAL_INTERRUPT_PORTA);
}
cyg_interrupt_create(
CYGNUM_HAL_INTERRUPT_PORTA, // Vector
0xA0, // Priority
(cyg_addrword_t)0, // Data
alert_isr, // ISR
alert_dsr, // DSR
&alert_handle, // Handle
&alert_interrupt); // INTR
cyg_interrupt_attach(alert_handle);
hal_kinetis_gpio_setup_port(ALERT_PORT, ALERT_PIN, 0xA, 0x1, 0x00);
hal_kinetis_gpio_interrupt_acknowledge(ALERT_PORT, ALERT_PIN);
cyg_interrupt_unmask(CYGNUM_HAL_INTERRUPT_PORTA);
--
You are receiving this mail because:
You are on the CC list for the bug.