From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13289 invoked by alias); 2 Oct 2009 15:37:15 -0000 Received: (qmail 13281 invoked by uid 22791); 2 Oct 2009 15:37:14 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00 X-Spam-Check-By: sourceware.org Received: from web52802.mail.re2.yahoo.com (HELO web52802.mail.re2.yahoo.com) (206.190.48.245) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Fri, 02 Oct 2009 15:37:10 +0000 Received: (qmail 76032 invoked by uid 60001); 2 Oct 2009 15:37:08 -0000 Message-ID: <907868.75159.qm@web52802.mail.re2.yahoo.com> Received: from [76.17.118.117] by web52802.mail.re2.yahoo.com via HTTP; Fri, 02 Oct 2009 08:37:08 PDT Date: Fri, 02 Oct 2009 15:37:00 -0000 From: Gurkan Sokat To: ecos-discuss@ecos.sourceware.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes 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] Interrupt driven serial communication on AT91SAM9260 X-SW-Source: 2009-10/txt/msg00017.txt.bz2 Hi, I am new to this and I can not figure out how to set up interrupt driven serial communication on AT91SAM9260. I need to use USART3 and all I want is to have interrupt when data received. This is what I have so far. Not sure if any part of it is true or not, but here it is. Can anybody help me on this? Thanks. cyg_uint32 serialIsr(cyg_vector_t vector, cyg_addrword_t data) { hal_interrupt_mask(CYGNUM_HAL_VECTOR_US3); diag_printf("Interrupt worked..."); hal_interrupt_acknowledge(CYGNUM_HAL_VECTOR_US3); return CYG_ISR_HANDLED; } /* Declare the ISR variables. */ cyg_handle_t serialInterruptHdl; cyg_interrupt serialInterruptObj; cyg_vector_t serialInterruptVector = CYGNUM_HAL_VECTOR_US3; int main(void) { ... cyg_interrupt_create(serialInterruptVector, 0, 0, serialIsr, 0, &serialInterruptHdl, &serialInterruptObj); //hal_interrupt_configure(serialInterruptVector,0,1); HAL_INTERRUPT_ATTACH(serialInterruptVector, serialIsr, &serialInterruptHdl, &serialInterruptObj); hal_interrupt_acknowledge(CYGNUM_HAL_INTERRUPT_US3); hal_interrupt_unmask(CYGNUM_HAL_INTERRUPT_US3); HAL_WRITE_UINT32( SAM9_UART3+_UART_IER, 0x00000001 ); HAL_WRITE_UINT32( SAM9_UART3+_UART_IDR, 0x00000000 ); while(1) { ... } } -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss