Usart Receiver Pause?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Usart Receiver Pause?

Matthias Ringwald
Hi
  I need to block IRQs for longer than the HW buffer of the AVR  
USARTS can
  handle but cannot tolerate loosing bytes on the USARTS, too.

  To solve this, I'd like to programmatically set the RTS line.
  Should I do this in my app only or add it to the USART drivers?

  I guess, I could add an IOCTRLs UART_SETRTS and UART_GETRTS
  and add some code to usartavr.c and usart.c ?

Comments ?

  Matthias
_______________________________________________
En-Nut-Discussion mailing list
[hidden email]
http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion
Reply | Threaded
Open this post in threaded view
|

Re: Usart Receiver Pause?

Harald Kipp
Matthias,

This would be generally useful.

How about

   u_long flags = UART_MF_RTSOFF;
   ioctl(fd, UART_SETMODEMCONTROL, &flags);
   flags = UART_MF_RTSON;
   ioctl(fd, UART_SETMODEMCONTROL, &flags);

or alternatively

   u_long flags;
   ioctl(fd, UART_GETMODEMCONTROL, &flags);
   flags &= ~UART_MF_RTS;
   ioctl(fd, UART_SETMODEMCONTROL, &flags);
   flags |= UART_MF_RTS;
   ioctl(fd, UART_SETMODEMCONTROL, &flags);

In opposite to UART_SETRTS this would simplify the
hardware independent layer, because only one ioctl
code needs to be checked and passed to the hardware
dependent layer.

Harald

At 19:53 10.06.2005 +0200, you wrote:

>Hi
>  I need to block IRQs for longer than the HW buffer of the AVR
>USARTS can
>  handle but cannot tolerate loosing bytes on the USARTS, too.
>
>  To solve this, I'd like to programmatically set the RTS line.
>  Should I do this in my app only or add it to the USART drivers?
>
>  I guess, I could add an IOCTRLs UART_SETRTS and UART_GETRTS
>  and add some code to usartavr.c and usart.c ?
>
>Comments ?
>
>  Matthias

_______________________________________________
En-Nut-Discussion mailing list
[hidden email]
http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion
Reply | Threaded
Open this post in threaded view
|

Re: Usart Receiver Pause?

Harald Kipp
I forgot to add

...in case of later enhancements for additional control lines.

Harald

At 20:23 10.06.2005 +0200, you wrote:

>Matthias,
>
>This would be generally useful.
>
>How about
>
>   u_long flags = UART_MF_RTSOFF;
>   ioctl(fd, UART_SETMODEMCONTROL, &flags);
>   flags = UART_MF_RTSON;
>   ioctl(fd, UART_SETMODEMCONTROL, &flags);
>
>or alternatively
>
>   u_long flags;
>   ioctl(fd, UART_GETMODEMCONTROL, &flags);
>   flags &= ~UART_MF_RTS;
>   ioctl(fd, UART_SETMODEMCONTROL, &flags);
>   flags |= UART_MF_RTS;
>   ioctl(fd, UART_SETMODEMCONTROL, &flags);
>
>In opposite to UART_SETRTS this would simplify the
>hardware independent layer, because only one ioctl
>code needs to be checked and passed to the hardware
>dependent layer.
>
>Harald
>
>At 19:53 10.06.2005 +0200, you wrote:
>>Hi
>>  I need to block IRQs for longer than the HW buffer of the AVR
>>USARTS can
>>  handle but cannot tolerate loosing bytes on the USARTS, too.
>>
>>  To solve this, I'd like to programmatically set the RTS line.
>>  Should I do this in my app only or add it to the USART drivers?
>>
>>  I guess, I could add an IOCTRLs UART_SETRTS and UART_GETRTS
>>  and add some code to usartavr.c and usart.c ?
>>
>>Comments ?
>>
>>  Matthias
>
>_______________________________________________
>En-Nut-Discussion mailing list
>[hidden email]
>http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion

_______________________________________________
En-Nut-Discussion mailing list
[hidden email]
http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion
Reply | Threaded
Open this post in threaded view
|

Re: Usart Receiver Pause?

Matthias Ringwald
Hi Harald,

thanks for commenting and the better/cleaner/easier implementation  
hint.. I'll report back..
  Matthias

On 10.06.2005, at 20:25, Harald Kipp wrote:

> I forgot to add
>
> ...in case of later enhancements for additional control lines.
>
> Harald
>
> At 20:23 10.06.2005 +0200, you wrote:
>
>> Matthias,
>>
>> This would be generally useful.
>>
>> How about
>>
>>   u_long flags = UART_MF_RTSOFF;
>>   ioctl(fd, UART_SETMODEMCONTROL, &flags);
>>   flags = UART_MF_RTSON;
>>   ioctl(fd, UART_SETMODEMCONTROL, &flags);
>

_______________________________________________
En-Nut-Discussion mailing list
[hidden email]
http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion