Interface: tos.interfaces.HPLUART

interface HPLUART

The byte-level interface to the UART, which can send and receive simultaneously.

This interface, as it directly abstracts hardware, follows the hardware interface convention of not maintaining state. Therefore, some conditions that could be understood by a higher layer to be errors execute properly; for example, one can call txBit when in receive mode. A higher level interface must provide the checks for conditions such as this.

Author:
Jason Hill
David Gay
Philip Levis

Commands
command result_t init() Initialize the UART.
command result_t put(uint8_t data) Send one byte of data.
command result_t stop() TUrn off the UART

Events
event result_t get(uint8_t data) A byte of data has been received.
event result_t putDone() The previous call to put has completed; another byte may now be sent.

Commands - Details

init

command result_t init()

Initialize the UART.

Returns:
SUCCESS always.

put

command result_t put(uint8_t data)

Send one byte of data. There should only one outstanding send at any time; one must wait for the putDone event before calling put again.

Returns:
SUCCESS always.

stop

command result_t stop()

TUrn off the UART

Returns:
SUCCESS always

Events - Details

get

event result_t get(uint8_t data)

A byte of data has been received.

Returns:
SUCCESS always.

putDone

event result_t putDone()

The previous call to put has completed; another byte may now be sent.

Returns:
SUCCESS always.