LPCOpen Platform  v1.03
LPCOpen Platform for NXP LPC Microcontrollers
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
VirtualSerial.c File Reference
#include "VirtualSerial.h"
#include "KeyboardHost.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 char EchoCharacter (void)
 
int main (void)
 Main program body.
 
void VirtualSerial_putchar (int ch)
 Print the character ch to Virtual Serial.
 
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

static USB_ClassInfo_CDC_Device_t VirtualSerial_CDC_Interface
 

Macro Definition Documentation

#define CDC_BRIDGE_TASK   (ECHO_CHARACTER_TASK + 1)

Definition at line 41 of file VirtualSerial.c.

#define CDC_TASK_SELECT   ECHO_CHARACTER_TASK

Select example task, currently lpc11Uxx and lpc17xx don't support for bridging task Only LPC18xx has this feature

Definition at line 68 of file VirtualSerial.c.

#define ECHO_CHARACTER_TASK   (0)

Definition at line 40 of file VirtualSerial.c.

Function Documentation

static char EchoCharacter ( void  )
static

Checks for data input, reply back to the host.

Definition at line 89 of file VirtualSerial.c.

static void SetupHardware ( void  )
static

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

Definition at line 79 of file VirtualSerial.c.

Variable Documentation

USB_ClassInfo_CDC_Device_t VirtualSerial_CDC_Interface
static
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 = 1,
},
}

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 47 of file VirtualSerial.c.