| LPCOpen Platform v1.03 LPCOpen Platform for NXP LPC Microcontrollers

- Main Page
- Modules
- Data Structures
- Files
- Related Pages

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
VirtualSerial.c File Reference
`#include "VirtualSerial.h"`

Go to the source code of this file.

## Macros
#define | ECHO_CHARACTER_TASK (0)
#define | CDC_BRIDGE_TASK (ECHO_CHARACTER_TASK + 1)
#define | CDC_TASK_SELECT ECHO_CHARACTER_TASK

## Functions
static void | SetupHardware (void)
static void | EchoCharacter (void)
int | main (void)
| Main program body.
void | EVENT_USB_Device_Connect (void)
| USB Device connect event callback.
void | EVENT_USB_Device_Disconnect (void)
| USB Device disconnect event callback.
void | EVENT_USB_Device_ConfigurationChanged (void)
| USB Device configuration change event callback.
void | EVENT_USB_Device_ControlRequest (void)
| USB Device control request receive event callback.
void | EVENT_CDC_Device_LineEncodingChanged (USB_ClassInfo_CDC_Device_t *const CDCInterfaceInfo)
| CDC class driver event for a line encoding change on a CDC interface. This event fires each time the host requests a line encoding change (containing the serial parity, baud and other configuration information) and may be hooked in the user program by declaring a handler function with the same name and parameters listed here. The new line encoding settings are available in the LineEncoding structure inside the CDC interface structure passed as a parameter.

## Variables
USB_ClassInfo_CDC_Device_t | VirtualSerial_CDC_Interface

## Macro Definition Documentation

#define CDC_BRIDGE_TASK (ECHO_CHARACTER_TASK + 1)

Definition at line 44 of file VirtualSerial.c.

#define CDC_TASK_SELECT ECHO_CHARACTER_TASK

Standard file stream for the CDC interface when set up, so that the virtual CDC COM port can be used like any regular character stream in the C APIs Select example task, currently lpc11Uxx and lpc17xx don't support for bridging task Only LPC18xx has this feature

Definition at line 76 of file VirtualSerial.c.

#define ECHO_CHARACTER_TASK (0)

Definition at line 43 of file VirtualSerial.c.

## Function Documentation

static void EchoCharacter | ( | void |  | ) |
| static

Checks for data input, reply back to the host.

Definition at line 95 of file VirtualSerial.c.

static void SetupHardware | ( | void |  | ) |
| static

Configures the board hardware and chip peripherals for the demo's functionality.

Definition at line 83 of file VirtualSerial.c.

## Variable Documentation

USB_ClassInfo_CDC_Device_t VirtualSerial_CDC_Interface

Initial value:
= {
.Config = {
.ControlInterfaceNumber = 0,
.DataINEndpointNumber = CDC_TX_EPNUM,
.DataINEndpointSize = CDC_TXRX_EPSIZE,
.DataINEndpointDoubleBank = false,
.DataOUTEndpointNumber = CDC_RX_EPNUM,
.DataOUTEndpointSize = CDC_TXRX_EPSIZE,
.DataOUTEndpointDoubleBank = false,
.NotificationEndpointNumber = CDC_NOTIFICATION_EPNUM,
.NotificationEndpointSize = CDC_NOTIFICATION_EPSIZE,
.NotificationEndpointDoubleBank = false,
.PortNumber = 0,
},
}

LPCUSBlib CDC Class driver interface configuration and state information. This structure is passed to all CDC Class driver functions, so that multiple instances of the same class within a device can be differentiated from one another.

Definition at line 50 of file VirtualSerial.c.