Paparazzi UAS  v5.0.5_stable-7-g4b8bbb7
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
usb_ser_hw.c File Reference
#include <string.h>
#include "std.h"
#include <stdbool.h>
#include "LPC21xx.h"
#include "armVIC.h"
#include "mcu_periph/usb_serial.h"
#include <BOARD_CONFIG>
#include "lpcusb/usbapi.h"
+ Include dependency graph for usb_ser_hw.c:

Go to the source code of this file.

Data Structures

struct  fifo_t
 
struct  TLineCoding
 

Macros

#define USB_VIC_SLOT   10
 
#define INT_IN_EP   0x81
 
#define BULK_OUT_EP   0x05
 
#define BULK_IN_EP   0x82
 
#define MAX_PACKET_SIZE   64
 
#define LE_WORD(x)   ((x)&0xFF),((x)>>8)
 
#define CS_INTERFACE   0x24
 
#define CS_ENDPOINT   0x25
 
#define SET_LINE_CODING   0x20
 
#define GET_LINE_CODING   0x21
 
#define SET_CONTROL_LINE_STATE   0x22
 
#define VCOM_FIFO_SIZE   128
 
#define EOF   (-1)
 
#define ASSERT(x)
 

Functions

static void USBIntHandler (void)
 
static void BulkOut (U8 bEP, U8 bEPStatus)
 
void fifo_init (fifo_t *fifo, U8 *buf)
 
BOOL fifo_put (fifo_t *fifo, U8 c)
 
BOOL fifo_get (fifo_t *fifo, U8 *pc)
 
int fifo_avail (fifo_t *fifo)
 
int fifo_free (fifo_t *fifo)
 

Variables

int allow_line_coding = 0
 
static TLineCoding LineCoding = {115200, 0, 0, 8}
 
static uint8_t abBulkBuf [64]
 
static uint8_t abClassReqData [8]
 
static uint8_t txdata [VCOM_FIFO_SIZE]
 
static uint8_t rxdata [VCOM_FIFO_SIZE]
 
static fifo_t txfifo
 
static fifo_t rxfifo
 
static bool BulkOut_is_blocked = false
 
static const uint8_t abDescriptors []
 

Macro Definition Documentation

#define ASSERT (   x)

Definition at line 88 of file usb_ser_hw.c.

#define BULK_IN_EP   0x82

Definition at line 71 of file usb_ser_hw.c.

#define BULK_OUT_EP   0x05

Definition at line 70 of file usb_ser_hw.c.

#define CS_ENDPOINT   0x25

Definition at line 79 of file usb_ser_hw.c.

#define CS_INTERFACE   0x24

Definition at line 78 of file usb_ser_hw.c.

#define EOF   (-1)

Definition at line 87 of file usb_ser_hw.c.

#define GET_LINE_CODING   0x21

Definition at line 82 of file usb_ser_hw.c.

#define INT_IN_EP   0x81

Definition at line 69 of file usb_ser_hw.c.

#define LE_WORD (   x)    ((x)&0xFF),((x)>>8)

Definition at line 75 of file usb_ser_hw.c.

#define MAX_PACKET_SIZE   64

Definition at line 73 of file usb_ser_hw.c.

#define SET_CONTROL_LINE_STATE   0x22

Definition at line 83 of file usb_ser_hw.c.

#define SET_LINE_CODING   0x20

Definition at line 81 of file usb_ser_hw.c.

#define USB_VIC_SLOT   10

Definition at line 66 of file usb_ser_hw.c.

#define VCOM_FIFO_SIZE   128

Definition at line 85 of file usb_ser_hw.c.

Function Documentation

static void BulkOut ( U8  bEP,
U8  bEPStatus 
)
static
int fifo_avail ( fifo_t fifo)
int fifo_free ( fifo_t fifo)
BOOL fifo_get ( fifo_t fifo,
U8 *  pc 
)
void fifo_init ( fifo_t fifo,
U8 *  buf 
)
BOOL fifo_put ( fifo_t fifo,
U8  c 
)
static void USBIntHandler ( void  )
static

Variable Documentation

uint8_t abBulkBuf[64]
static

Definition at line 107 of file usb_ser_hw.c.

uint8_t abClassReqData[8]
static

Definition at line 108 of file usb_ser_hw.c.

const uint8_t abDescriptors[]
static

Definition at line 133 of file usb_ser_hw.c.

int allow_line_coding = 0

Definition at line 104 of file usb_ser_hw.c.

bool BulkOut_is_blocked = false
static

Definition at line 116 of file usb_ser_hw.c.

TLineCoding LineCoding = {115200, 0, 0, 8}
static

Definition at line 106 of file usb_ser_hw.c.

uint8_t rxdata[VCOM_FIFO_SIZE]
static

Definition at line 111 of file usb_ser_hw.c.

fifo_t rxfifo
static

Definition at line 114 of file usb_ser_hw.c.

uint8_t txdata[VCOM_FIFO_SIZE]
static

Definition at line 110 of file usb_ser_hw.c.

fifo_t txfifo
static

Definition at line 113 of file usb_ser_hw.c.