From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31688 invoked by alias); 12 Mar 2013 22:17:26 -0000 Received: (qmail 31680 invoked by uid 22791); 12 Mar 2013 22:17:25 -0000 X-SWARE-Spam-Status: No, hits=0.7 required=5.0 tests=AWL,BAYES_00,DKIM_ADSP_CUSTOM_MED,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,KHOP_THREADED,NML_ADSP_CUSTOM_MED,SPF_NEUTRAL X-Spam-Check-By: sourceware.org Received: from sam.nabble.com (HELO sam.nabble.com) (216.139.236.26) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 12 Mar 2013 22:17:17 +0000 Received: from tom.nabble.com ([192.168.236.105]) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1UFXVU-0003M5-E0 for ecos-discuss@ecos.sourceware.org; Tue, 12 Mar 2013 15:17:16 -0700 Date: Tue, 12 Mar 2013 22:17:00 -0000 From: EnneGi To: ecos-discuss@ecos.sourceware.org Message-ID: <1363126636423-225218.post@n7.nabble.com> In-Reply-To: References: <1362939557386-224910.post@n7.nabble.com> <513CDD92.6060003@siva.com.mk> <1362956256201-224925.post@n7.nabble.com> <1363020733839-225026.post@n7.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: [ECOS] Re: How to create a GPIO driver X-SW-Source: 2013-03/txt/msg00024.txt.bz2 Great answer! Thanks! A question: can you tell me how the function hal_LPC1XXX_gpio_set() (and other) appear in your source? In my source this function is described in this way: __externC void hal_LPC17XX_gpio_set( cyg_uint32 pin ) { cyg_uint32 port = CYGHWR_HAL_LPC17XX_GPIO_PORT(pin); int bit = CYGHWR_HAL_LPC17XX_GPIO_BIT(pin); cyg_uint32 cm = CYGHWR_HAL_LPC17XX_GPIO_CFG(pin); cyg_uint32 cr; if( pin == CYGHWR_HAL_LPC17XX_GPIO_NONE ) return; if( bit > 7 ) port += 4, bit -= 8; HAL_READ_UINT32( port, cr ); cr &= ~(0xF<<(bit*4)); cr |= cm<<(bit*4); HAL_WRITE_UINT32( port, cr ); // If this is a pullup/down input, set the ODR bit to switch on // the appropriate pullup/down resistor. if( cm == (CYGHWR_HAL_LPC17XX_GPIO_MODE_IN|CYGHWR_HAL_LPC17XX_GPIO_CNF_PULL) ) { cyg_uint32 odr; port = CYGHWR_HAL_LPC17XX_GPIO_PORT( pin ); bit = CYGHWR_HAL_LPC17XX_GPIO_BIT(pin); HAL_READ_UINT32( port+CYGHWR_HAL_LPC17XX_GPIO_ODR, odr ); if( pin & CYGHWR_HAL_LPC17XX_GPIO_PULLUP ) odr |= (1<>bit)&1; } -- View this message in context: http://sourceware-org.1504.n7.nabble.com/How-to-create-a-GPIO-driver-tp224910p225218.html Sent from the Sourceware - ecos-discuss mailing list archive at Nabble.com. -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss