MAV'RIC
Public Member Functions
Serial Class Reference
Inheritance diagram for Serial:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual bool init (void)=0
 Hardware initialization.
virtual uint32_t readable (void)=0
 Test if there are bytes available to read.
virtual uint32_t writeable (void)=0
 Test if there is space available to write bytes.
virtual void flush (void)=0
 Sends instantaneously all outgoing bytes.
virtual bool attach (serial_interrupt_callback_t func)=0
 Attach a function to call after a receive interrupt is generated.
virtual bool write (const uint8_t *bytes, const uint32_t size=1)=0
 Write bytes on the serial line.
virtual bool read (uint8_t *bytes, const uint32_t size=1)=0
 Read bytes from the serial line.
virtual bool newline ()
 write newline character to stream ('
')

Member Function Documentation

virtual bool Serial::attach ( serial_interrupt_callback_t  func) [pure virtual]

Attach a function to call after a receive interrupt is generated.

A default handler should be provided by the implementation to add the incoming data in a buffer, so is not mandatory to call this method. The function callback will be called after the interrupt handler

Parameters:
funcPointer to the callback function
Returns:
true Success
false Failed

Implemented in Serial_stm32, Serial_avr32, Serial_chibios, Serial_usb_stm32, Serial_udp, Serial_usb_avr32, and Serial_linux_io.

Here is the caller graph for this function:

virtual void Serial::flush ( void  ) [pure virtual]

Sends instantaneously all outgoing bytes.

Returns:
Number of bytes available for writing

Implemented in Serial_stm32, Serial_avr32, Serial_chibios, Serial_usb_stm32, Serial_udp, Serial_usb_avr32, Serial_linux_io, and Serial_dummy.

Here is the caller graph for this function:

virtual bool Serial::init ( void  ) [pure virtual]

Hardware initialization.

Returns:
true Success
false Error

Implemented in Serial_stm32, Serial_avr32, Serial_chibios, Serial_usb_stm32, Serial_udp, Serial_usb_avr32, Serial_linux_io, and Serial_dummy.

bool Serial::newline ( ) [virtual]

write newline character to stream ('
')

Returns:
success

Reimplemented in Serial_linux_io.

Here is the call graph for this function:

virtual bool Serial::read ( uint8_t *  bytes,
const uint32_t  size = 1 
) [pure virtual]

Read bytes from the serial line.

Parameters:
bytesIncoming bytes
sizeNumber of bytes to read
Returns:
true Data successfully read
false Data not read

Implemented in Serial_stm32, Serial_avr32, Serial_chibios, Serial_usb_stm32, Serial_udp, Serial_usb_avr32, and Serial_linux_io.

Here is the caller graph for this function:

virtual uint32_t Serial::readable ( void  ) [pure virtual]

Test if there are bytes available to read.

Returns:
Number of incoming bytes available

Implemented in Serial_stm32, Serial_avr32, Serial_chibios, Serial_usb_stm32, Serial_udp, Serial_usb_avr32, Serial_linux_io, and Serial_dummy.

Here is the caller graph for this function:

virtual bool Serial::write ( const uint8_t *  bytes,
const uint32_t  size = 1 
) [pure virtual]

Write bytes on the serial line.

Parameters:
byteOutgoing bytes
sizeNumber of bytes to write
Returns:
true Data successfully written
false Data not written

Implemented in Serial_stm32, Serial_avr32, Serial_chibios, Serial_usb_stm32, Serial_udp, Serial_usb_avr32, and Serial_linux_io.

Here is the caller graph for this function:

virtual uint32_t Serial::writeable ( void  ) [pure virtual]

Test if there is space available to write bytes.

Returns:
Number of bytes available for writing

Implemented in Serial_stm32, Serial_avr32, Serial_chibios, Serial_usb_stm32, Serial_udp, Serial_usb_avr32, Serial_linux_io, and Serial_dummy.

Here is the caller graph for this function:


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines