![]() |
Zephyr API 4.4.99
A Scalable Open Source RTOS
|
Go to the source code of this file.
Typedefs | |
| typedef void(* | serial_vnd_write_cb_t) (const struct device *dev, void *user_data) |
| Callback called after bytes written to the virtual serial port. | |
Functions | |
| int | serial_vnd_queue_in_data (const struct device *dev, const unsigned char *data, uint32_t size) |
| Queues data to be read by the virtual serial port. | |
| uint32_t | serial_vnd_out_data_size_get (const struct device *dev) |
| Returns size of unread written data. | |
| uint32_t | serial_vnd_read_out_data (const struct device *dev, unsigned char *data, uint32_t size) |
| Read data written to virtual serial port. | |
| uint32_t | serial_vnd_peek_out_data (const struct device *dev, unsigned char *data, uint32_t size) |
| Peek at data written to virtual serial port. | |
| void | serial_vnd_set_callback (const struct device *dev, serial_vnd_write_cb_t callback, void *user_data) |
| Sets the write callback on a virtual serial port. | |
| typedef void(* serial_vnd_write_cb_t) (const struct device *dev, void *user_data) |
Callback called after bytes written to the virtual serial port.
| dev | Address of virtual serial port. |
| user_data | User data. |
Returns size of unread written data.
| dev | Address of virtual serial port. |
| uint32_t serial_vnd_peek_out_data | ( | const struct device * | dev, |
| unsigned char * | data, | ||
| uint32_t | size ) |
Peek at data written to virtual serial port.
Reads the data without consuming it. Future calls to serial_vnd_peek_out_data() or serial_vnd_read_out_data() will return this data again. Requires CONFIG_RING_BUFFER.
| dev | Address of virtual serial port. |
| data | Address of the output buffer. Cannot be NULL. |
| size | Data size (in bytes). |
| Number | of bytes written to the output buffer. |
| int serial_vnd_queue_in_data | ( | const struct device * | dev, |
| const unsigned char * | data, | ||
| uint32_t | size ) |
Queues data to be read by the virtual serial port.
| dev | Address of virtual serial port. |
| data | Address of data. |
| size | Data size (in bytes). |
| Number | of bytes written. |
| uint32_t serial_vnd_read_out_data | ( | const struct device * | dev, |
| unsigned char * | data, | ||
| uint32_t | size ) |
Read data written to virtual serial port.
Consumes the data, such that future calls to serial_vnd_read_out_data() will not include this data. Requires CONFIG_RING_BUFFER.
| dev | Address of virtual serial port. |
| data | Address of the output buffer. Can be NULL to discard data. |
| size | Data size (in bytes). |
| Number | of bytes written to the output buffer. |
| void serial_vnd_set_callback | ( | const struct device * | dev, |
| serial_vnd_write_cb_t | callback, | ||
| void * | user_data ) |
Sets the write callback on a virtual serial port.
| dev | Address of virtual serial port. |
| callback | Function to call after each write to the port. |
| user_data | Opaque data to pass to the callback. |