MAV'RIC
|
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 (' ') |
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
func | Pointer to the callback function |
Implemented in Serial_stm32, Serial_avr32, Serial_chibios, Serial_usb_stm32, Serial_udp, Serial_usb_avr32, and Serial_linux_io.
virtual void Serial::flush | ( | void | ) | [pure virtual] |
Sends instantaneously all outgoing bytes.
Implemented in Serial_stm32, Serial_avr32, Serial_chibios, Serial_usb_stm32, Serial_udp, Serial_usb_avr32, Serial_linux_io, and Serial_dummy.
virtual bool Serial::init | ( | void | ) | [pure virtual] |
Hardware initialization.
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 ('
')
Reimplemented in Serial_linux_io.
virtual bool Serial::read | ( | uint8_t * | bytes, |
const uint32_t | size = 1 |
||
) | [pure virtual] |
Read bytes from the serial line.
bytes | Incoming bytes |
size | Number of bytes to read |
Implemented in Serial_stm32, Serial_avr32, Serial_chibios, Serial_usb_stm32, Serial_udp, Serial_usb_avr32, and Serial_linux_io.
virtual uint32_t Serial::readable | ( | void | ) | [pure virtual] |
Test if there are bytes available to read.
Implemented in Serial_stm32, Serial_avr32, Serial_chibios, Serial_usb_stm32, Serial_udp, Serial_usb_avr32, Serial_linux_io, and Serial_dummy.
virtual bool Serial::write | ( | const uint8_t * | bytes, |
const uint32_t | size = 1 |
||
) | [pure virtual] |
Write bytes on the serial line.
byte | Outgoing bytes |
size | Number of bytes to write |
Implemented in Serial_stm32, Serial_avr32, Serial_chibios, Serial_usb_stm32, Serial_udp, Serial_usb_avr32, and Serial_linux_io.
virtual uint32_t Serial::writeable | ( | void | ) | [pure virtual] |
Test if there is space available to write bytes.
Implemented in Serial_stm32, Serial_avr32, Serial_chibios, Serial_usb_stm32, Serial_udp, Serial_usb_avr32, Serial_linux_io, and Serial_dummy.