From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15965 invoked by alias); 2 Mar 2013 18:25:05 -0000 Received: (qmail 15940 invoked by uid 22791); 2 Mar 2013 18:25:03 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from hagrid.ecoscentric.com (HELO mail.ecoscentric.com) (212.13.207.197) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 02 Mar 2013 18:25:00 +0000 Received: by mail.ecoscentric.com (Postfix, from userid 48) id 63673151A07D; Sat, 2 Mar 2013 18:24:59 +0000 (GMT) From: bugzilla-daemon@bugs.ecos.sourceware.org To: unassigned@bugs.ecos.sourceware.org Subject: [Bug 1001787] New: GPIO Interrupt Support for Kinetis Date: Sat, 02 Mar 2013 18:25:00 -0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: eCos X-Bugzilla-Component: Patches and contributions X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: mjones@linear.com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: low X-Bugzilla-Assigned-To: unassigned@bugs.ecos.sourceware.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter cc Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://bugs.ecos.sourceware.org/ Auto-Submitted: auto-generated MIME-Version: 1.0 Mailing-List: contact ecos-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: ecos-bugs-owner@sourceware.org X-SW-Source: 2013/txt/msg00110.txt.bz2 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 the assignee for the bug.