public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Interrupt driven serial communication on AT91SAM9260
@ 2009-10-02 15:37 Gurkan Sokat
  2009-10-06  7:21 ` Dave Milter
  0 siblings, 1 reply; 2+ messages in thread
From: Gurkan Sokat @ 2009-10-02 15:37 UTC (permalink / raw)
  To: ecos-discuss

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [ECOS] Interrupt driven serial communication on AT91SAM9260
  2009-10-02 15:37 [ECOS] Interrupt driven serial communication on AT91SAM9260 Gurkan Sokat
@ 2009-10-06  7:21 ` Dave Milter
  0 siblings, 0 replies; 2+ messages in thread
From: Dave Milter @ 2009-10-06  7:21 UTC (permalink / raw)
  To: Gurkan Sokat; +Cc: ecos-discuss

On 10/2/09, Gurkan Sokat <gurkansokat@yahoo.com> wrote:
> 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?
>

look at packages/devs/serial/arm/at91/current/src/at91_serial.c at
ecos repository,
it contains complete example how to do that, may be you can just use
it, without working with hardware.

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-10-06  7:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-02 15:37 [ECOS] Interrupt driven serial communication on AT91SAM9260 Gurkan Sokat
2009-10-06  7:21 ` Dave Milter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).