|  | Paparazzi UAS v7.0_unstable
    Paparazzi is a free software Unmanned Aircraft System. | 
arch independent USB API More...
#include <inttypes.h>#include "std.h"#include "pprzlink/pprzlink_device.h"#include "mcu_periph/uart.h"#include "mcu_arch.h" Include dependency graph for usb_serial.h:
 Include dependency graph for usb_serial.h: This graph shows which files directly or indirectly include this file:
 This graph shows which files directly or indirectly include this file:Go to the source code of this file.
| Data Structures | |
| struct | usb_serial_periph | 
| Macros | |
| #define | USB_RX_BUFFER_SIZE UART_RX_BUFFER_SIZE | 
| #define | USBD_NUMBER 1 | 
| Functions | |
| void | VCOM_init (void) | 
| int | VCOM_putchar (int c) | 
| Writes one character to VCOM port fifo. | |
| int | VCOM_getchar (void) | 
| Reads one character from VCOM port. | |
| int | VCOM_peekchar (int ofs) | 
| Reads one character from VCOM port without removing it from the queue. | |
| bool | VCOM_check_free_space (uint16_t len) | 
| Checks if buffer free in VCOM buffer. | |
| int | VCOM_check_available (void) | 
| Checks if data available in VCOM buffer. | |
| void | VCOM_set_linecoding (uint8_t mode) | 
| void | VCOM_allow_linecoding (uint8_t mode) | 
| void | VCOM_send_message (void) | 
| Send data from fifo right now. | |
| void | VCOM_event (void) | 
| Poll usb (required by libopencm3). | |
| Variables | |
| struct usb_serial_periph | usb_serial | 
arch independent USB API
Definition in file usb_serial.h.
| struct usb_serial_periph | 
Definition at line 51 of file usb_serial.h.
 Collaboration diagram for usb_serial_periph:
 Collaboration diagram for usb_serial_periph:| Data Fields | ||
|---|---|---|
| struct link_device | device | Generic device interface. | 
| uint16_t | nb_bytes | |
| void * | reg_addr | |
| uint8_t | rx_buf[USB_RX_BUFFER_SIZE] | Receive buffer. | 
| uint16_t | rx_read_idx | |
| #define USB_RX_BUFFER_SIZE UART_RX_BUFFER_SIZE | 
Definition at line 38 of file usb_serial.h.
| #define USBD_NUMBER 1 | 
Definition at line 48 of file usb_serial.h.
Checks if data available in VCOM buffer.
Definition at line 459 of file usb_ser_hw.c.
References fifo_avail(), and rxfifo.
Referenced by dfu_command_event(), event_usb_serial(), ReadUsbBuffer(), tunnel_event(), and usb_serial_char_available().
 Here is the call graph for this function:
 Here is the call graph for this function: Here is the caller graph for this function:
 Here is the caller graph for this function:Checks if buffer free in VCOM buffer.
Definition at line 450 of file usb_ser_hw.c.
References FALSE, fifo_free(), TRUE, and txfifo.
Referenced by dfu_command_event(), tunnel_event(), usb_serial_check_free_space(), and VCOM_putchar().
 Here is the call graph for this function:
 Here is the call graph for this function: Here is the caller graph for this function:
 Here is the caller graph for this function:Poll usb (required by libopencm3).
VCOM_event() should be called from main/module event function
Definition at line 468 of file usb_ser_hw.c.
References fifo_avail(), foo, my_usbd_dev, tx_timeout, txfifo, and VCOM_send_message().
Referenced by event_usb_serial(), main(), and mcu_event().
 Here is the call graph for this function:
 Here is the call graph for this function: Here is the caller graph for this function:
 Here is the caller graph for this function:Reads one character from VCOM port.
Definition at line 425 of file usb_ser_hw.c.
References fifo_get(), and rxfifo.
Referenced by dfu_command_event(), event_usb_serial(), ReadUsbBuffer(), tunnel_event(), and usb_serial_getch().
 Here is the call graph for this function:
 Here is the call graph for this function: Here is the caller graph for this function:
 Here is the caller graph for this function:Definition at line 565 of file usb_ser_hw.c.
References cdcacm_set_config(), config, dev, usb_serial_periph::device, fifo_init(), foo, GPIO11, GPIO12, GPIO_AF10, GPIOA, my_usbd_dev, rxdata, rxfifo, serial_no, tx_timeout, txdata, txfifo, usb_connected, usb_serial, usb_serial_char_available(), usb_serial_check_free_space(), usb_serial_getch(), usb_serial_send(), usb_serial_transmit(), usb_serial_transmit_buffer(), usb_strings, and usbd_control_buffer.
Referenced by init_usb_serial(), main(), and mcu_init().
 Here is the call graph for this function:
 Here is the call graph for this function: Here is the caller graph for this function:
 Here is the caller graph for this function:Reads one character from VCOM port without removing it from the queue.
| ofs | position to read | 
Definition at line 438 of file usb_ser_hw.c.
References fifo_peek(), foo, and rxfifo.
Referenced by dfu_command_event().
 Here is the call graph for this function:
 Here is the call graph for this function: Here is the caller graph for this function:
 Here is the caller graph for this function:Writes one character to VCOM port fifo.
Since we don't really have an instant feeedback from USB driver if the character was written, we always return c if we are connected.
| [in] | c | character to write | 
Definition at line 397 of file usb_ser_hw.c.
References fifo_put(), sys_time_usleep(), tx_timeout, TX_TIMEOUT_CNT, txfifo, usb_connected, VCOM_check_free_space(), and VCOM_send_message().
Referenced by cmd_execute(), periodic_usb_serial(), tunnel_event(), usb_serial_parse_packet(), usb_serial_parse_packet(), usb_serial_transmit(), and usb_serial_transmit_buffer().
 Here is the call graph for this function:
 Here is the call graph for this function: Here is the caller graph for this function:
 Here is the caller graph for this function:Send data from fifo right now.
Only if usb is connected.
Definition at line 487 of file usb_ser_hw.c.
References fifo_get(), foo, MAX_PACKET_SIZE, my_usbd_dev, txfifo, and usb_connected.
Referenced by cmd_execute(), usb_serial_parse_packet(), usb_serial_parse_packet(), usb_serial_send(), VCOM_event(), and VCOM_putchar().
 Here is the call graph for this function:
 Here is the call graph for this function: Here is the caller graph for this function:
 Here is the caller graph for this function:| 
 | extern | 
Definition at line 523 of file usb_ser_hw.c.
Referenced by VCOM_init().