PER Firmware
Loading...
Searching...
No Matches
usb_device.c File Reference

Periodic CAN<->USB forwarding. More...

#include "usb_device.h"
#include <string.h>
#include "activity_leds.h"
#include "can_library/generated/SCAN.h"
#include "can_library/generated/VCAN.h"
#include "phal_G4/fdcan/fdcan.h"
#include "rtos/rtos.h"
#include "main.h"
#include "usb/usb_control.h"
Include dependency graph for usb_device.c:

Functions

void usb_rx_enqueue (const cannector_tx_frame_t *frames, size_t count)
 
static bool usb_rx_peek (cannector_tx_frame_t *frame, size_t *head_out)
 
static void usb_rx_pop (size_t expected_head)
 
static void process_usb_rx_frames (void)
 
static void process_usb_tx_frames (void)
 
void usb_periodic (void)
 

Variables

static usb_rx_queue_t g_usb_rx_queue
 

Detailed Description

Periodic CAN<->USB forwarding.

Author
Irving Wang (irvin.nosp@m.gw@p.nosp@m.urdue.nosp@m..edu)
Millan Kumar (kumar.nosp@m.798@.nosp@m.purdu.nosp@m.e.ed.nosp@m.u)

Function Documentation

◆ process_usb_rx_frames()

static void process_usb_rx_frames ( void )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ process_usb_tx_frames()

static void process_usb_tx_frames ( void )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ usb_periodic()

void usb_periodic ( void )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ usb_rx_enqueue()

void usb_rx_enqueue ( const cannector_tx_frame_t * frames,
size_t count )
Here is the caller graph for this function:

◆ usb_rx_peek()

static bool usb_rx_peek ( cannector_tx_frame_t * frame,
size_t * head_out )
static
Here is the caller graph for this function:

◆ usb_rx_pop()

static void usb_rx_pop ( size_t expected_head)
static
Here is the caller graph for this function:

Variable Documentation

◆ g_usb_rx_queue

usb_rx_queue_t g_usb_rx_queue
static
Initial value:
= {
.frames = {{0}},
.head = 0U,
.tail = 0U,
.count = 0U,
.bus_stalled = {false, false, false},
}