Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
Pic32mxUsbCdcDevice.cxx File Reference
#include <fcntl.h>
#include "freertos_drivers/common/Serial.hxx"
#include "system_config.h"
#include "utils/Atomic.hxx"
#include "freertos_drivers/pic32mx/int_pic32mx795/int_defines.h"
#include "driver/usb/usbfs/drv_usbfs.h"
#include "usb/usb_device.h"
#include "usb/usb_device_cdc.h"
#include "os/os.h"

Go to the source code of this file.

Classes

class  Pic32mxCdc
 Device driver for PIC32MX USB virtual serial port. More...
 

Functions

void * usb_device_task (void *)
 
void usb_interrupt ()
 
static void usb_device_event_handler (USB_DEVICE_EVENT event, void *pData, uintptr_t context)
 
static USB_DEVICE_CDC_EVENT_RESPONSE cdc_device_event_handler (USB_DEVICE_CDC_INDEX index, USB_DEVICE_CDC_EVENT event, void *pData, uintptr_t userData)
 

Variables

const DRV_USBFS_INIT drvUSBFSInit
 Initialization structure in flash.
 
const USB_DEVICE_INIT usbDevInitData
 Initialization structure in flash.
 
Pic32mxCdc usbCdc0 ("/dev/serUSB0")
 

Detailed Description

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

This file implements a USB CDC device driver layer using PIC32 Harmony USB middleware driver.

Author
Balazs Racz
Date
9 Sep 2018

Definition in file Pic32mxUsbCdcDevice.cxx.

Function Documentation

◆ cdc_device_event_handler()

static USB_DEVICE_CDC_EVENT_RESPONSE cdc_device_event_handler ( USB_DEVICE_CDC_INDEX  index,
USB_DEVICE_CDC_EVENT  event,
void *  pData,
uintptr_t  userData 
)
static

Definition at line 587 of file Pic32mxUsbCdcDevice.cxx.

◆ usb_device_event_handler()

static void usb_device_event_handler ( USB_DEVICE_EVENT  event,
void *  pData,
uintptr_t  context 
)
static

Definition at line 553 of file Pic32mxUsbCdcDevice.cxx.

◆ usb_device_task()

void * usb_device_task ( void *  )

Definition at line 250 of file Pic32mxUsbCdcDevice.cxx.

◆ usb_interrupt()

void usb_interrupt ( )

Definition at line 261 of file Pic32mxUsbCdcDevice.cxx.

Variable Documentation

◆ drvUSBFSInit

const DRV_USBFS_INIT drvUSBFSInit
extern

Initialization structure in flash.

Definition at line 42 of file usb_cdc_device_descriptors.c.

◆ usbDevInitData

const USB_DEVICE_INIT usbDevInitData
extern

Initialization structure in flash.

Definition at line 308 of file usb_cdc_device_descriptors.c.