#include "UsbFunction.h"#include "base_type.h"#include "UsbDescriptors.h"#include "dbg.h"Go to the source code of this file.
History:
Definition in file UsbFunction.c.
| boolean_t UsbFunction_AllEndpointsIdle | ( | void | ) |
If all endpoints are idle, returns true
Definition at line 471 of file UsbFunction.c.
| void UsbFunction_ClearStartOfFrameHandler | ( | void | ) |
Connect USB function (only used if auto connect is disabled)
| bAutoConnect | can be used to auto connect/disconnect (standard) |
Definition at line 949 of file UsbFunction.c.
| void UsbFunction_DisableSOF | ( | void | ) |
Disconnect USB function
| bForceDisconnect | can be used to force disconnect |
Definition at line 975 of file UsbFunction.c.
| void UsbFunction_EnableSOF | ( | void | ) |
| void UsbFunction_EnableWakeup | ( | boolean_t | bEnableDisable | ) |
send wakeup to computer
| bEnableDisable | TRUE to enable, FALSE to disable |
Definition at line 1213 of file UsbFunction.c.
| __interrupt void UsbFunction_EndpointIsr | ( | void | ) |
Interrupt Routine (USB-Function Endpoint1-5 Interrupt)
Example Vectors.c
Definition at line 1728 of file UsbFunction.c.
Get the current endpoint status
| u8Endpoint | Endpoint Number (0..5) |
Definition at line 460 of file UsbFunction.c.
| uint8_t UsbFunction_GetStatus | ( | void | ) |
Get the current USB status
Definition at line 448 of file UsbFunction.c.
| void UsbFunction_Initialize | ( | boolean_t | bAutoConnect | ) |
| void UsbFunction_SendData | ( | uint8_t | u8EndpointNumber, | |
| puint8_t | buffer, | |||
| uint32_t | buffersize, | |||
| uint8_t | u8PollingMode | |||
| ) |
Procedure to send buffer with Endpoint 0..5
| u8EndpointNumber | Endpoint number (0..5) | |
| buffer | pointer of buffer to send | |
| buffersize | size of buffer to send |
Definition at line 1004 of file UsbFunction.c.
| void UsbFunction_SetCustomEndpointBuffer | ( | uint8_t | u8Endpoint, | |
| usb_buffer_t * | pstcEndpointBuffer | |||
| ) |
Set a custom endpoint buffer
| u8Endpoint | Endpoint number | |
| pstcEndpointBuffer | pointer to buffer struct |
Example:
Definition at line 612 of file UsbFunction.c.
only for Endpoint 0, used in data stage to send replies for requests
| buffer | pointer of buffer to send | |
| buffersize | size of buffer to send |
Definition at line 1181 of file UsbFunction.c.
| void UsbFunction_SetEventHandler | ( | uint8_t | u8Target, | |
| uint8_t | u8Event, | |||
| uint8_t | u8Options, | |||
| uint8_t(*)(usb_event_t *stcEvent) | handler | |||
| ) |
Set event handler.
| u8Target | target, can be: USB_EVENT_TARGET_VENDOR, USB_EVENT_TARGET_MAINAPP, USB_EVENT_TARGET_GENERAL | |
| u8Event | event, can be: USB_EVENT_RECEIVE, USB_EVENT_SENT, USB_EVENT_CONNECT, USB_EVENT_DISCONNECT | |
| u8Options | options handler event handler |
Example:
Definition at line 515 of file UsbFunction.c.
| void UsbFunction_SetStartOfFrameHandler | ( | void(*)(uint16_t u16FrameNumber) | handler | ) |
Set a Start of Frame handler
| handler | Start Of Framehandler, type: handler(uint16_t u16FrameNumber); |
Definition at line 582 of file UsbFunction.c.
| void UsbFunction_Stall | ( | uint8_t | u8EndpointNumber | ) |
| void UsbFunction_StallRemove | ( | uint8_t | u8EndpointNumber | ) |
| __interrupt void UsbFunction_StatusControlIsr | ( | void | ) |
Interrupt Routine (USB-Function Status & Control Interrupt)
Example Vectors.c
Definition at line 1839 of file UsbFunction.c.
| __interrupt void UsbFunction_VbusIsr | ( | void | ) |
Interrupt Routine (USB-Function VBUS Interrupt)
Example Vectors.c
Definition at line 1920 of file UsbFunction.c.
Definition at line 115 of file UsbFunction.c.
| fnuint8_t au8ReceiveBuffer[USB_FUNC_EP0_SIZE] |
Definition at line 96 of file UsbFunction.c.
| uint8_t au8TransmittBuffer[MAX_RECV_BUFFER] |
Definition at line 104 of file UsbFunction.c.
| uint8_t flag_sendEP0 = 0 |
Definition at line 109 of file UsbFunction.c.
| uint8_t(* pu8HandlerBeforeStatusChange)(usb_event_t *stcEvent)=0 |
Event Handler Status Change: Connect, Disconnect.
| uint8_t(* pu8HandlerClassEvent)(usb_event_t *stcEvent)=0 |
| uint8_t(* pu8HandlerStatusEvent)(usb_event_t *stcEvent)=0 |
Class Event Handler (Class Requests, Status Change: Connect, Disconnect).
| void(* SOFHandler)(uint16_t u16FrameNumber)=0 |
| usb_buffer_t stcEndpointBuffer0 = {au8ReceiveBuffer,USB_FUNC_EP0_SIZE,0,0} |
Definition at line 97 of file UsbFunction.c.
| usb_buffer_t stcEndpointBuffer1 = {au8ReceiveBuffer,USB_FUNC_EP0_SIZE,0,0} |
Definition at line 98 of file UsbFunction.c.
| usb_buffer_t stcEndpointBuffer2 = {au8ReceiveBuffer,USB_FUNC_EP0_SIZE,0,0} |
Definition at line 99 of file UsbFunction.c.
| usb_buffer_t stcEndpointBuffer3 = {au8ReceiveBuffer,USB_FUNC_EP0_SIZE,0,0} |
Definition at line 100 of file UsbFunction.c.
| usb_buffer_t stcEndpointBuffer4 = {au8ReceiveBuffer,USB_FUNC_EP0_SIZE,0,0} |
Definition at line 101 of file UsbFunction.c.
| usb_buffer_t stcEndpointBuffer5 = {au8ReceiveBuffer,USB_FUNC_EP0_SIZE,0,0} |
Definition at line 102 of file UsbFunction.c.
Event Handler Before Status Change: Connect, Disconnect.
Definition at line 93 of file UsbFunction.c.
Definition at line 107 of file UsbFunction.c.
| uint8_t u8UsbStatus = 0 |
Definition at line 113 of file UsbFunction.c.
1.6.1