[Tinyos-devel] Proposed UART Changes

Eric Decker cire831 at gmail.com
Thu Jun 18 18:25:33 PDT 2009


On Thu, Jun 18, 2009 at 3:24 PM, Philip Levis <pal at cs.stanford.edu> wrote:

>
> On Jun 17, 2009, at 12:56 PM, Trevor Pace wrote:
>
> > Hey Eric,
> >
> > The problem I am seeing right now is that I am developing a module
> > which should in theory work on any mote that supports UART. However,
> > there exists no hardware abstraction interface provided by all
> > platforms that would allow me to disable/enable communication.  It
> > does exist at the lower HPL but that is implemented per chip.
> >
> > So for me to shut-off my reception temporary I must wire a chip-
> > specific HPL Uart module removing the possibility of compatibility
> > with other chip sets. The Msp430HplUart you mentioned does support
> > enabling/disabling for sure, unfortunately by the time it gets to
> > the PlatformSerialC abstraction (which is available to all chipsets
> > with UART) then I lose that ability.
>
> It seems we definitely want a UartControl or UartSettings interface.
>
> One constraint is that we want to catch bad settings at compile-time.
> For example, trying to set the UART to a speed the MCU does not
> support should be a compile-time error. The standard way to do this is
> with enums: if you use an undefined enum you don't compile.
>
> How about something like
>
> interface UartControl {
>   command error_t enableRx();
>   command error_t disableRx();
>   command bool rxEnabled();
>
>   command error_t enableTx();
>   command error_t disableTx();
>   command bool txEnabled();
>

Unfortunately this is ambiguos.   What does enabled mean?   The device can
be turned on
and capable of doing its function.  There is also the issue of interrupts
being turned on
or off.

More detail is needed.  Another question is what does the abstraction buy
us?

eric


>
>   // TOS_UART_2400, TOS_UART_57600, etc.
>   command error_t setSpeed(uart_speed_t spd);
>   command uart_speed_t speed();
>
>   // TOS_PARITY_NONE, TOS_PARITY_EVEN, TOS_PARITY_ODD, etc.
>   command error_t setParity(uart_parity_t par);
>   command uart_parity_t parity();
>
>   command error_t setStop();
>   command error_t setNoStop();
>   command bool stopBits();
> }
>
> Thoughts?
>
> Phil
>
> _______________________________________________
> Tinyos-devel mailing list
> Tinyos-devel at millennium.berkeley.edu
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-devel
>



-- 
Eric B. Decker
Senior (over 50 :-) Researcher
Autonomous Systems Lab
Jack Baskin School of Engineering
UCSC
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.millennium.berkeley.edu/pipermail/tinyos-devel/attachments/20090618/61947b2d/attachment-0001.htm 


More information about the Tinyos-devel mailing list