PDL for FM4  Version1.2
Peripheral Driverl Library for FM4
UsbDeviceHidJoystick.c File Reference
Include dependency graph for UsbDeviceHidJoystick.c:

Go to the source code of this file.

Functions

static boolean_t SendData (uint8_t *pu8Buffer, uint32_t u32DataSize, en_usbsend_mode_t enMode)
 
static void ConfCallback (stc_usbn_t *pstcUsb)
 Configuration change callback, used to see if configuration is set or cleared. More...
 
void UsbDeviceHidJoystick_Init (stc_usbn_t *pstcUsb)
 
void UsbDeviceHidJoystick_ChangeThrottle (int8_t iThrottle)
 
void UsbDeviceHidJoystick_ChangeX (int8_t iX)
 
void UsbDeviceHidJoystick_ChangeY (int8_t iY)
 
void UsbDeviceHidJoystick_ChangeXY (int8_t iX, int8_t iY)
 
void UsbDeviceHidJoystick_ChangeButton1 (boolean_t bButtonValue)
 
void UsbDeviceHidJoystick_ChangeButton2 (boolean_t bButtonValue)
 
void UsbDeviceHidJoystick_ChangeButton3 (boolean_t bButtonValue)
 
void UsbDeviceHidJoystick_ChangeButton4 (boolean_t bButtonValue)
 
void UsbDeviceHidJoystick_ChangeHatUp (void)
 
void UsbDeviceHidJoystick_ChangeHatRight (void)
 
void UsbDeviceHidJoystick_ChangeHatDown (void)
 
void UsbDeviceHidJoystick_ChangeHatLeft (void)
 
void UsbDeviceHidJoystick_ChangeHatNoDirection (void)
 
boolean_t UsbDeviceHidJoystick_IsConnected (void)
 

Variables

static uint8_t DataSentFlags = 0
 
static uint8_t pu8JoystickData [4] = {0,0,0,0}
 
static stc_usbn_endpoint_data_t * pstcEndpointIN
 
static stc_usbn_endpoint_buffer_t stcEndpointBufferIN
 
static stc_usbn_t * pstcUsbHandle = NULL
 
static boolean_t bReady = FALSE
 

Detailed Description

CONST USB_ASSISTANT_OFF

A detailed description is available at USB Device Joystick Module description

History:

  • 2013-10-14 1.1 MSc PDL support added

Definition in file UsbDeviceHidJoystick.c.

Function Documentation

static void ConfCallback ( stc_usbn_t *  pstcUsb)
static

Configuration change callback, used to see if configuration is set or cleared.

Parameters
pstcUsbPointer to USB instance
Returns
none

Definition at line 101 of file UsbDeviceHidJoystick.c.

References bReady, FALSE, TRUE, UsbConfigured, and UsbDevice_GetStatus().

Referenced by UsbDeviceHidJoystick_Init().

Here is the call graph for this function:

Here is the caller graph for this function:

static boolean_t SendData ( uint8_t *  pu8Buffer,
uint32_t  u32DataSize,
en_usbsend_mode_t  enMode 
)
static

Is called from main application to send data via endpoint

Parameters
pu8BufferBuffer to send
u32DataSizeBuffersize
enModepolled sending, interrupt sending or DMA
Returns
1: if succesful, 0: if usb was not ready

Definition at line 167 of file UsbDeviceHidJoystick.c.

References DataSentFlags, FALSE, pstcUsbHandle, TRUE, UsbConfigured, UsbDevice_GetStatus(), UsbDevice_SendData(), and UsbPOLL.

Referenced by UsbDeviceHidJoystick_ChangeButton1(), UsbDeviceHidJoystick_ChangeButton2(), UsbDeviceHidJoystick_ChangeButton3(), UsbDeviceHidJoystick_ChangeButton4(), UsbDeviceHidJoystick_ChangeHatDown(), UsbDeviceHidJoystick_ChangeHatLeft(), UsbDeviceHidJoystick_ChangeHatNoDirection(), UsbDeviceHidJoystick_ChangeHatRight(), UsbDeviceHidJoystick_ChangeHatUp(), UsbDeviceHidJoystick_ChangeThrottle(), UsbDeviceHidJoystick_ChangeX(), UsbDeviceHidJoystick_ChangeXY(), and UsbDeviceHidJoystick_ChangeY().

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

boolean_t bReady = FALSE
static

Definition at line 85 of file UsbDeviceHidJoystick.c.

Referenced by ConfCallback(), and UsbDeviceHidJoystick_IsConnected().

uint8_t DataSentFlags = 0
static

Definition at line 80 of file UsbDeviceHidJoystick.c.

Referenced by SendData().

stc_usbn_endpoint_data_t* pstcEndpointIN
static

Definition at line 82 of file UsbDeviceHidJoystick.c.

stc_usbn_t* pstcUsbHandle = NULL
static

Definition at line 84 of file UsbDeviceHidJoystick.c.

Referenced by SendData(), and UsbDeviceHidJoystick_Init().

stc_usbn_endpoint_buffer_t stcEndpointBufferIN
static

Definition at line 83 of file UsbDeviceHidJoystick.c.

Referenced by UsbDeviceHidJoystick_Init().