![]() |
PDL for FM4
Version1.2
Peripheral Driverl Library for FM4
|
Macros | |
| #define | BUFFER_SIZE_ENDPOINTOUT 512 |
Typedefs | |
| typedef void(* | usbdeviceprinter_datareceived_func_ptr_t )(uint8_t *pu8DataBuffer, uint32_t u32DataLength) |
| typedef void(* | usbdeviceprinter_datasent_func_ptr_t )(void) |
Functions | |
| void | UsbDevicePrinter_Init (stc_usbn_t *pstcUsb) |
| 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) |
| void | UsbDevicePrinter_SetReceivedCallback (usbdeviceprinter_datareceived_func_ptr_t pstnCallback) |
| void | UsbDevicePrinter_SetSentCallback (usbdeviceprinter_datasent_func_ptr_t pstnCallback) |
Provided functions of USB Device Printer module:
Used to enumerate printe class
| #define BUFFER_SIZE_ENDPOINTOUT 512 |
Definition at line 101 of file UsbDevicePrinter.h.
Referenced by UsbDevicePrinter_Init(), and UsbDevicePrinter_RxCallback().
| typedef void(* usbdeviceprinter_datareceived_func_ptr_t)(uint8_t *pu8DataBuffer, uint32_t u32DataLength) |
Definition at line 110 of file UsbDevicePrinter.h.
| typedef void(* usbdeviceprinter_datasent_func_ptr_t)(void) |
Definition at line 111 of file UsbDevicePrinter.h.
| uint8_t UsbDevicePrinter_DataSent | ( | void | ) |
Is used to use get the sent status of endpoint
Definition at line 294 of file UsbDevicePrinter.c.
References DataSentFlags.
| uint32_t UsbDevicePrinter_GetReceivedData | ( | uint8_t ** | ppu8Buffer | ) |
Is used to use received data from endpoint
| ppu8Buffer | pointer to buffer |
Definition at line 236 of file UsbDevicePrinter.c.
References DataReceivedFlags, stc_usbn_endpoint_data::pstcEndpointBuffer, stc_usbn_endpoint_buffer::pu8Buffer, and u32LastReceivedSize.
| void UsbDevicePrinter_Init | ( | stc_usbn_t * | pstcUsb | ) |
Is called to initialize this class (usally in UsbConfig.c)
| pstcUsb | USB Handle |
Definition at line 124 of file UsbDevicePrinter.c.
References BUFFER_SIZE_ENDPOINTOUT, ClassSetupRequest(), stc_usbdevice_class_config::pfnConfCallback, stc_usbdevice_class_config::pfnConnectionCallback, stc_usbdevice_class_config::pfnDisconnectionCallback, stc_usbdevice_endpoint_config::pfnRxTxCallback, stc_usbdevice_class_config::pfnSetupRequestCallback, stc_usbdevice_endpoint_config::pstcEndpointBuffer, pstcUsbHandle, pu8IngoingBuffer, stcEndpointBufferIN, stcEndpointBufferOUT, stc_usbdevice_endpoint_config::u8EndpointAddress, stc_usbdevice_class_config::u8InterfaceClass, stc_usbdevice_class_config::u8InterfaceNumber, stc_usbdevice_class_config::u8InterfaceProtocoll, stc_usbdevice_class_config::u8InterfaceSubClass, USBDESCR_ENDPOINT, UsbDevice_ReceiveData(), UsbDevice_RegisterVendorClass(), UsbDevice_SetupEndpoint(), UsbDevicePrinter_RxCallback(), UsbDevicePrinter_TxCallback(), and UsbIRQ.

| boolean_t UsbDevicePrinter_SendData | ( | stc_usbn_t * | pstcUsb, |
| uint8_t * | pu8Buffer, | ||
| uint32_t | u32DataSize, | ||
| en_usbsend_mode_t | enMode | ||
| ) |
Is called from main application to send data via endpoint
| pstcUsb | USB Handle |
| pu8Buffer | Buffer to send |
| u32DataSize | Buffersize |
| enMode | polled sending, interrupt sending or DMA |
Definition at line 258 of file UsbDevicePrinter.c.
References DataSentFlags, FALSE, TRUE, UsbConfigured, UsbDevice_GetStatus(), UsbDevice_SendData(), and UsbPOLL.

| void UsbDevicePrinter_SetReceivedCallback | ( | usbdeviceprinter_datareceived_func_ptr_t | pstnCallback | ) |
Set received callback
| pstnCallback | callback handle |
Definition at line 176 of file UsbDevicePrinter.c.
References pstnReceivedData.
| void UsbDevicePrinter_SetSentCallback | ( | usbdeviceprinter_datasent_func_ptr_t | pstnCallback | ) |
Set sent callback
| pstnCallback | callback handle |
Definition at line 188 of file UsbDevicePrinter.c.
References pstnSentData.