APM:Libraries
|
#include <usb.h>
#include <hal.h>
#include <systick.h>
#include <exti.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <boards.h>
Go to the source code of this file.
Macros | |
#define | USB_CDCACM_CONTROL_LINE_DTR (0x01) |
#define | USB_CDCACM_CONTROL_LINE_RTS (0x02) |
Typedefs | |
typedef uint8_t | U8 |
typedef uint32_t | U32 |
typedef uint16_t | U16 |
Enumerations | |
enum | reset_state_t { DTR_UNSET, DTR_HIGH, DTR_NEGEDGE, DTR_LOW } |
Functions | |
uint32_t | USBD_OTG_ISR_Handler (const USB_OTG_CORE_HANDLE *pdev) |
static U16 | VCP_Init (void) |
static U16 | VCP_DeInit (void) |
static U16 | VCP_Ctrl (uint32_t Cmd, uint8_t *Buf, uint32_t Len) |
static U16 | VCP_DataTx (const uint8_t *Buf, uint32_t Len) |
static U16 | VCP_DataRx (uint8_t *Buf, uint32_t Len) |
void | OTG_FS_IRQHandler (void) |
U8 * | USBD_USR_DeviceDescriptor (U8 speed, U16 *length) |
U8 * | USBD_USR_LangIDStrDescriptor (U8 speed, U16 *length) |
U8 * | USBD_USR_ProductStrDescriptor (U8 speed, U16 *length) |
U8 * | USBD_USR_ManufacturerStrDescriptor (U8 speed, U16 *length) |
U8 * | USBD_USR_SerialStrDescriptor (U8 speed, U16 *length) |
U8 * | USBD_USR_ConfigStrDescriptor (U8 speed, U16 *length) |
U8 * | USBD_USR_InterfaceStrDescriptor (U8 speed, U16 *length) |
void | USBD_USR_Init (void) |
void | USBD_USR_DeviceReset (uint8_t speed) |
void | USBD_USR_DeviceConfigured (void) |
void | USBD_USR_DeviceSuspended (void) |
void | USBD_USR_DeviceResumed (void) |
void | USBD_USR_DeviceConnected (void) |
void | USBD_USR_DeviceDisconnected (void) |
void | usb_default_attr (usb_attr_t *attr) |
void | USB_OTG_BSP_Init (USB_OTG_CORE_HANDLE *pdev) |
int | usb_periphcfg (FunctionalState state) |
int | usb_configure (usb_attr_t *attr) |
void | usb_setParams (usb_attr_t *attr) |
void | USB_OTG_BSP_EnableInterrupt (USB_OTG_CORE_HANDLE *pdev) |
void | USB_OTG_BSP_DisableInterrupt () |
void | USB_OTG_BSP_mDelay (const uint32_t msec) |
void | VCP_MarkWritten (unsigned sz) |
unsigned | VCP_SpaceAvailContig (void) |
unsigned | VCP_PutContig (void const *buff, unsigned len) |
unsigned | VCP_SpaceAvail (void) |
unsigned | VCP_DataAvail (void) |
void | VCP_MarkRead (unsigned sz) |
unsigned | VCP_GetContig (void *buff, unsigned max_len) |
unsigned | VCP_DataAvailContig (void) |
int | usb_open (void) |
int | usb_close (void) |
uint8_t | is_usb_connected (usb_attr_t *attr) |
int | usb_ioctl (int request, void *ctl) |
void | USB_OTG_BSP_uDelay (const uint32_t usec) |
int | usb_write (const uint8_t *buf, unsigned int nbytes) |
int | usb_read (void *buf, unsigned int nbytes) |
uint32_t | usb_data_available (void) |
bool | usb_get_dtr () |
void | usb_reset_rx () |
void | usb_reset_tx () |
uint16_t | usb_tx_pending (void) |
uint16_t | usb_tx_space (void) |
void | VCP_SetUSBTxBlocking (uint8_t Mode) |
uint8_t | is_usb_opened () |
void | reset_usb_opened () |
Variables | |
USB_OTG_CORE_HANDLE | USB_OTG_dev |
__ALIGN_BEGIN USB_OTG_CORE_HANDLE USB_OTG_dev | __ALIGN_END |
static usb_attr_t * | usb_attr |
static volatile U8 | VCP_DTRHIGH = 0 |
static volatile U8 | VCP_RTSHIGH = 0 |
static enum reset_state_t | reset_state = DTR_UNSET |
static const U16 | rxfifo_size = USB_RXFIFO_SIZE |
static ring_buffer _rxfifo | IN_CCM |
static ring_buffer * | rxfifo = &_rxfifo |
static uint8_t | rx_buf [USB_RXFIFO_SIZE] |
static U8 | preempt_prio |
static U8 | sub_prio |
static U8 | usb_ready |
static U8 | UsbTXBlock = 1 |
LINE_CODING | linecoding |
U8 | APP_Rx_Buffer [] |
U32 | APP_Rx_ptr_in |
const CDC_IF_Prop_TypeDef | VCP_fops |
const USBD_Usr_cb_TypeDef | USR_cb |
static const USBD_DEVICE | USR_CDC_desc |
static U8 | usb_connected =0 |
static U8 | usb_opened =0 |
#define USB_CDCACM_CONTROL_LINE_DTR (0x01) |
Referenced by VCP_Ctrl().
#define USB_CDCACM_CONTROL_LINE_RTS (0x02) |
Referenced by VCP_Ctrl().
enum reset_state_t |
uint8_t is_usb_connected | ( | usb_attr_t * | attr | ) |
Definition at line 705 of file usb.c.
Referenced by usb_ioctl().
uint8_t is_usb_opened | ( | ) |
Definition at line 794 of file usb.c.
Referenced by F4Light::USBDriver::read(), and F4Light::USBDriver::write().
void OTG_FS_IRQHandler | ( | void | ) |
Definition at line 168 of file usb.c.
Referenced by VCP_SpacePtr().
void reset_usb_opened | ( | ) |
Definition at line 795 of file usb.c.
Referenced by F4Light::USBDriver::write().
int usb_close | ( | void | ) |
Definition at line 688 of file usb.c.
Referenced by F4Light::USBDriver::end().
int usb_configure | ( | usb_attr_t * | attr | ) |
Definition at line 350 of file usb.c.
Referenced by usb_init(), and usb_ioctl().
uint32_t usb_data_available | ( | void | ) |
Definition at line 764 of file usb.c.
Referenced by F4Light::USBDriver::available().
void usb_default_attr | ( | usb_attr_t * | attr | ) |
Definition at line 296 of file usb.c.
Referenced by usb_init().
int usb_ioctl | ( | int | request, |
void * | ctl | ||
) |
int usb_open | ( | void | ) |
Definition at line 674 of file usb.c.
Referenced by usb_init().
void USB_OTG_BSP_DisableInterrupt | ( | ) |
Definition at line 388 of file usb.c.
Referenced by usb_periphcfg().
int usb_periphcfg | ( | FunctionalState | state | ) |
Definition at line 314 of file usb.c.
Referenced by usb_close(), usb_open(), and VCP_SpacePtr().
int usb_read | ( | void * | buf, |
unsigned int | nbytes | ||
) |
Definition at line 760 of file usb.c.
Referenced by usb_getc().
void usb_reset_rx | ( | ) |
void usb_setParams | ( | usb_attr_t * | attr | ) |
Definition at line 365 of file usb.c.
Referenced by usb_configure().
uint16_t usb_tx_pending | ( | void | ) |
Definition at line 780 of file usb.c.
Referenced by usb_getc().
uint16_t usb_tx_space | ( | void | ) |
Definition at line 784 of file usb.c.
Referenced by F4Light::USBDriver::txspace().
int usb_write | ( | const uint8_t * | buf, |
unsigned int | nbytes | ||
) |
Definition at line 756 of file usb.c.
Referenced by usb_putc(), and F4Light::USBDriver::write().
uint32_t USBD_OTG_ISR_Handler | ( | const USB_OTG_CORE_HANDLE * | pdev | ) |
|
static |
unsigned VCP_DataAvail | ( | void | ) |
Definition at line 609 of file usb.c.
Referenced by usb_data_available().
unsigned VCP_DataAvailContig | ( | void | ) |
Definition at line 636 of file usb.c.
Referenced by VCP_GetContig().
|
static |
Definition at line 644 of file usb.c.
Referenced by usb_read().
|
static |
Definition at line 583 of file usb.c.
Referenced by usb_write().
unsigned VCP_GetContig | ( | void * | buff, |
unsigned | max_len | ||
) |
Definition at line 625 of file usb.c.
Referenced by VCP_DataRx().
|
static |
void VCP_MarkRead | ( | unsigned | sz | ) |
Definition at line 618 of file usb.c.
Referenced by VCP_GetContig(), and VCP_SpacePtr().
void VCP_MarkWritten | ( | unsigned | sz | ) |
Definition at line 549 of file usb.c.
Referenced by VCP_PutContig(), and VCP_SpacePtr().
unsigned VCP_PutContig | ( | void const * | buff, |
unsigned | len | ||
) |
Definition at line 564 of file usb.c.
Referenced by VCP_DataTx().
void VCP_SetUSBTxBlocking | ( | uint8_t | Mode | ) |
Definition at line 789 of file usb.c.
Referenced by VCP_SpacePtr().
unsigned VCP_SpaceAvail | ( | void | ) |
Definition at line 575 of file usb.c.
Referenced by usb_tx_pending(), and usb_tx_space().
unsigned VCP_SpaceAvailContig | ( | void | ) |
Definition at line 556 of file usb.c.
Referenced by VCP_PutContig().
const __ALIGN_BEGIN U8 USBD_LangIDDesc [USB_SIZ_STRING_LANGID] __ALIGN_END |
U8 APP_Rx_Buffer[] |
U32 APP_Rx_ptr_in |
Referenced by usb_reset_tx().
|
static |
LINE_CODING linecoding |
|
static |
Definition at line 63 of file usb.c.
Referenced by usb_open(), USB_OTG_BSP_EnableInterrupt(), and usb_setParams().
|
static |
Definition at line 49 of file usb.c.
Referenced by VCP_Ctrl().
|
static |
Definition at line 60 of file usb.c.
Referenced by F4Light::UART_PPM::UART_PPM(), and VCP_Init().
|
static |
|
static |
Definition at line 51 of file usb.c.
Referenced by VCP_Init().
|
static |
Definition at line 63 of file usb.c.
Referenced by usb_open(), and usb_setParams().
|
static |
Definition at line 38 of file usb.c.
Referenced by usb_init(), and usb_ioctl().
|
static |
Definition at line 184 of file usb.c.
Referenced by Linux::GPIO_Sysfs::from(), is_usb_connected(), AP_HAL::GPIO::pinMode(), usb_open(), USBD_USR_DeviceConfigured(), USBD_USR_DeviceConnected(), USBD_USR_DeviceDisconnected(), USBD_USR_DeviceResumed(), USBD_USR_DeviceSuspended(), USBD_USR_Init(), and VCP_Ctrl().
|
static |
Definition at line 185 of file usb.c.
Referenced by is_usb_opened(), reset_usb_opened(), USBD_USR_DeviceConfigured(), USBD_USR_DeviceConnected(), USBD_USR_DeviceDisconnected(), USBD_USR_DeviceResumed(), USBD_USR_DeviceSuspended(), USBD_USR_Init(), VCP_Ctrl(), and VCP_DataRx().
USB_OTG_CORE_HANDLE USB_OTG_dev |
|
static |
Definition at line 64 of file usb.c.
Referenced by usb_close(), usb_configure(), and usb_open().
|
static |
Definition at line 66 of file usb.c.
Referenced by VCP_SetUSBTxBlocking().
|
static |
|
static |
Definition at line 39 of file usb.c.
Referenced by usb_get_dtr(), VCP_Ctrl(), and VCP_DataRx().
const CDC_IF_Prop_TypeDef VCP_fops |
|
static |
Definition at line 40 of file usb.c.
Referenced by VCP_Ctrl().