Paparazzi UAS
v5.10_stable-5-g83a0da5-dirty
Paparazzi is a free software Unmanned Aircraft System.
|
arch independent USB API More...
Go to the source code of this file.
Data Structures | |
struct | usb_serial_periph |
Functions | |
void | VCOM_init (void) |
int | VCOM_putchar (int c) |
Writes one character to VCOM port. More... | |
int | VCOM_getchar (void) |
Reads one character from VCOM port. More... | |
bool | VCOM_check_free_space (uint16_t len) |
Checks if buffer free in VCOM buffer. More... | |
int | VCOM_check_available (void) |
Checks if data available in VCOM buffer. More... | |
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. More... | |
void | VCOM_event (void) |
Poll usb (required by libopencm3). More... | |
Variables | |
struct usb_serial_periph | usb_serial |
arch independent USB API
Definition in file usb_serial.h.
struct usb_serial_periph |
Definition at line 35 of file usb_serial.h.
Data Fields | ||
---|---|---|
struct link_device | device | Generic device interface. |
void VCOM_allow_linecoding | ( | uint8_t | mode | ) |
int VCOM_check_available | ( | void | ) |
Checks if data available in VCOM buffer.
Definition at line 420 of file usb_ser_hw.c.
References fifo_avail().
Referenced by event_usb_serial(), ReadUsbBuffer(), tunnel_event(), and usb_serial_char_available().
bool VCOM_check_free_space | ( | uint16_t | len | ) |
Checks if buffer free in VCOM buffer.
Definition at line 409 of file usb_ser_hw.c.
References FALSE, fifo_free(), and TRUE.
Referenced by tunnel_event(), usb_serial_check_free_space(), and VCOM_putchar().
void VCOM_event | ( | void | ) |
Poll usb (required by libopencm3).
VCOM_event() should be called from main/module event function
Definition at line 571 of file usb_ser_hw.c.
References fifo_avail(), my_usbd_dev, tx_timeout, and VCOM_send_message().
Referenced by event_usb_serial(), main(), and mcu_event().
int VCOM_getchar | ( | void | ) |
Reads one character from VCOM port.
Definition at line 386 of file usb_ser_hw.c.
References BULK_OUT_EP, BulkOut(), BulkOut_is_blocked, disableIRQ(), enableIRQ(), EOF, fifo_free(), fifo_get(), and MAX_PACKET_SIZE.
Referenced by event_usb_serial(), ReadUsbBuffer(), tunnel_event(), and usb_serial_getch().
void VCOM_init | ( | void | ) |
Definition at line 586 of file usb_ser_hw.c.
References _VIC_ADDR, _VIC_CNTL, abClassReqData, BULK_IN_EP, BULK_OUT_EP, BulkIn(), BulkOut(), cdcacm_set_config(), dev, usb_serial_periph::device, fifo_init(), GPIO11, GPIO12, GPIO_AF10, GPIOA, HandleClassRequest(), INT_IN_EP, my_usbd_dev, rxdata, TRUE, tx_timeout, txdata, 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_VIC_SLOT, USBFrameHandler(), USBIntHandler(), VIC_BIT, VIC_ENABLE, VIC_USB, VICIntEnable, and VICIntSelect.
Referenced by init_usb_serial(), main(), and mcu_init().
int VCOM_putchar | ( | int | c | ) |
Writes one character to VCOM port.
[in] | c | character to write |
Writes one character to VCOM port.
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 376 of file usb_ser_hw.c.
References EOF, fifo_put(), sys_time_usleep(), tx_timeout, TX_TIMEOUT_CNT, VCOM_check_free_space(), and VCOM_send_message().
Referenced by cmd_execute(), periodic_usb_serial(), tunnel_event(), usb_serial_parse_packet(), usb_serial_transmit(), and usb_serial_transmit_buffer().
void VCOM_send_message | ( | void | ) |
Send data from fifo right now.
Only if usb is connected.
Definition at line 574 of file usb_ser_hw.c.
References fifo_get(), MAX_PACKET_SIZE, and my_usbd_dev.
Referenced by cmd_execute(), usb_serial_parse_packet(), usb_serial_send(), VCOM_event(), and VCOM_putchar().
void VCOM_set_linecoding | ( | uint8_t | mode | ) |
struct usb_serial_periph usb_serial |
Definition at line 547 of file usb_ser_hw.c.
Referenced by VCOM_init().