From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5250 invoked by alias); 17 Mar 2013 14:00:40 -0000 Received: (qmail 5230 invoked by uid 22791); 17 Mar 2013 14:00:38 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,TW_RQ 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; Sun, 17 Mar 2013 14:00:32 +0000 Received: from localhost (hagrid.ecoscentric.com [127.0.0.1]) by mail.ecoscentric.com (Postfix) with ESMTP id DAEFE4680009 for ; Sun, 17 Mar 2013 14:00:30 +0000 (GMT) Received: from mail.ecoscentric.com ([127.0.0.1]) by localhost (hagrid.ecoscentric.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cYojNRabFTRZ; Sun, 17 Mar 2013 14:00:24 +0000 (GMT) From: bugzilla-daemon@bugs.ecos.sourceware.org To: ecos-patches@ecos.sourceware.org Subject: [Bug 1001787] GPIO Interrupt Support for Kinetis Date: Sun, 17 Mar 2013 14:00:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed 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: ilijak@siva.com.mk X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: low X-Bugzilla-Assigned-To: ilijak@siva.com.mk X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: cc assigned_to Message-ID: In-Reply-To: References: 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-patches-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: ecos-patches-owner@ecos.sourceware.org X-SW-Source: 2013-03/txt/msg00026.txt.bz2 Please do not reply to this email, use the link below. http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001787 Ilija Kocho 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 --- 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 on the CC list for the bug.