PDL for FM4  Version1.2
Peripheral Driverl Library for FM4
UsbDevicePrinter.c File Reference
#include "UsbDevicePrinter.h"
Include dependency graph for UsbDevicePrinter.c:

Go to the source code of this file.

Functions

static void ClassSetupRequest (stc_usbn_t *pstcUsb, stc_usb_request_t *pstcSetup)
 
static void UsbDevicePrinter_RxCallback (stc_usbn_t *pstcUsb, struct stc_usbn_endpoint_data *pstcEndpoint)
 
static void UsbDevicePrinter_TxCallback (stc_usbn_t *pstcUsb, struct stc_usbn_endpoint_data *pstcEndpoint)
 
void UsbDevicePrinter_Init (stc_usbn_t *pstcUsb)
 
void UsbDevicePrinter_SetReceivedCallback (usbdeviceprinter_datareceived_func_ptr_t pstnCallback)
 
void UsbDevicePrinter_SetSentCallback (usbdeviceprinter_datasent_func_ptr_t pstnCallback)
 
uint32_t UsbDevicePrinter_GetReceivedData (uint8_t **ppu8Buffer)
 
boolean_t UsbDevicePrinter_SendData (stc_usbn_t *pstcUsb, uint8_t *pu8Buffer, uint32_t u32DataSize, en_usbsend_mode_t enMode)
 
uint8_t UsbDevicePrinter_DataSent (void)
 

Variables

static uint8_t DataReceivedFlags = 0
 
static uint8_t DataSentFlags = 0
 
static uint32_t u32LastReceivedSize
 
static stc_usbn_endpoint_buffer_t stcEndpointBufferOUT
 
static uint8_t pu8IngoingBuffer [512]
 
static stc_usbn_endpoint_data_t * pstcEndpointOUT
 
static stc_usbn_endpoint_buffer_t stcEndpointBufferIN
 
stc_usbn_endpoint_buffer_t stcEpBufferIN
 
static stc_usbn_endpoint_data_t * pstcEndpointIN
 
static stc_usbn_t * pstcUsbHandle = NULL
 
static
usbdeviceprinter_datareceived_func_ptr_t 
pstnReceivedData
 
static
usbdeviceprinter_datasent_func_ptr_t 
pstnSentData
 

Detailed Description

CONST USB_ASSISTANT_OFF

A detailed description is available at USB Device Printer Module description

History:

  • 2013-08-12 1.0 MSc First version
  • 2013-10-14 1.1 MSc PDL support added

Definition in file UsbDevicePrinter.c.

Function Documentation

static void ClassSetupRequest ( stc_usbn_t *  pstcUsb,
stc_usb_request_t *  pstcSetup 
)
static

Class Setup Request handling

Parameters
pstcUsbUSB handle
pstcSetupReceived Setup

Definition at line 202 of file UsbDevicePrinter.c.

Referenced by UsbDevicePrinter_Init().

Here is the caller graph for this function:

static void UsbDevicePrinter_RxCallback ( stc_usbn_t *  pstcUsb,
struct stc_usbn_endpoint_data *  pstcEndpoint 
)
static

Is called from UsbDevice.c when a endpoint buffer was received

Parameters
pstcUsbUSB Handle
pstcEndpointEndpoint

Definition at line 215 of file UsbDevicePrinter.c.

References BUFFER_SIZE_ENDPOINTOUT, DataReceivedFlags, stc_usbn_endpoint_data::pstcEndpointBuffer, pstnReceivedData, stc_usbn_endpoint_buffer::pu8Buffer, pu8IngoingBuffer, stc_usbn_endpoint_buffer::u32DataSize, u32LastReceivedSize, UsbDevice_ReceiveData(), and UsbIRQ.

Referenced by UsbDevicePrinter_Init().

Here is the call graph for this function:

Here is the caller graph for this function:

static void UsbDevicePrinter_TxCallback ( stc_usbn_t *  pstcUsb,
struct stc_usbn_endpoint_data *  pstcEndpoint 
)
static

Is called from UsbDevice.c when a endpoint buffer was sent

Parameters
pstcUsbUSB Handle
pstcEndpointEndpoint

Definition at line 281 of file UsbDevicePrinter.c.

References DataSentFlags, and pstnSentData.

Referenced by UsbDevicePrinter_Init().

Here is the caller graph for this function:

Variable Documentation

uint8_t DataReceivedFlags = 0
static
uint8_t DataSentFlags = 0
static
stc_usbn_endpoint_data_t* pstcEndpointIN
static

Definition at line 95 of file UsbDevicePrinter.c.

stc_usbn_endpoint_data_t* pstcEndpointOUT
static

Definition at line 91 of file UsbDevicePrinter.c.

stc_usbn_t* pstcUsbHandle = NULL
static

Definition at line 96 of file UsbDevicePrinter.c.

Referenced by UsbDevicePrinter_Init().

uint8_t pu8IngoingBuffer[512]
static

Definition at line 90 of file UsbDevicePrinter.c.

Referenced by UsbDevicePrinter_Init(), and UsbDevicePrinter_RxCallback().

stc_usbn_endpoint_buffer_t stcEndpointBufferIN
static

Definition at line 93 of file UsbDevicePrinter.c.

Referenced by UsbDevicePrinter_Init().

stc_usbn_endpoint_buffer_t stcEndpointBufferOUT
static

Definition at line 89 of file UsbDevicePrinter.c.

Referenced by UsbDevicePrinter_Init().

Definition at line 94 of file UsbDevicePrinter.c.

uint32_t u32LastReceivedSize
static