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

Go to the source code of this file.

Macros

#define __USBDEVICEHIDCOM_C__
 

Functions

static void RxTxCallback (stc_usbn_t *pstcUsb, struct stc_usbn_endpoint_data *pstcEndpoint)
 Receive or transmitted data callback. More...
 
static void ConfCallback (stc_usbn_t *pstcUsb)
 Configuration change callback, used to see if configuration is set or cleared. More...
 
void UsbDeviceHidCom_Init (stc_usbn_t *pstcUsb)
 Initialisation callback. More...
 
boolean_t UsbDeviceHidCom_Send (uint8_t *pu8Buffer, en_usbsend_mode_t enMode)
 Send data. More...
 
boolean_t UsbDeviceHidCom_IsSending ()
 Check if data transfer is still in process. More...
 
boolean_t UsbDeviceHidCom_DataSent ()
 Check if data transfer was transmitted. More...
 
uint32_t UsbDeviceHidCom_GetReceivedData (uint8_t *pu8OutBuffer)
 Send data. More...
 

Variables

static const uint8_t u8MaxSupportedEndpoints = 2
 
static stc_usbn_endpoint_data_t * ppstcUsedEndpoints [2]
 
static stc_usbn_endpoint_buffer_t pstcEndpointBuffers [2]
 
static uint8_t ppu8Buffers [2][64]
 
static const uint32_t pu32BufferSizes [2] = {64,64}
 
static stc_usbn_endpoint_data_t * pstcEndpointIN
 
static stc_usbn_endpoint_data_t * pstcEndpointOUT
 
static boolean_t bDataReceived = FALSE
 
static boolean_t bDataSent = TRUE
 
static boolean_t bReady = FALSE
 
static stc_usbn_t * pstcUsbHandle = NULL
 

Detailed Description

CONST USB_ASSISTANT_OFF

A detailed description is available at USB Device HID Com Module description

  • See README.TXT for project description
  • USB Human Interface Device Communication

History:

  • 2012-07-20 1.0 MSc First version for FM3 USB library
  • 2013-10-14 1.1 MSc PDL support added

Definition in file UsbDeviceHidCom.c.

Macro Definition Documentation

#define __USBDEVICEHIDCOM_C__

Definition at line 56 of file UsbDeviceHidCom.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 110 of file UsbDeviceHidCom.c.

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

Referenced by UsbDeviceHidCom_Init().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Receive or transmitted data callback.

Parameters
pstcUsbPointer to USB instance
pstcEndpointPointer to endpoint instance
Returns
none

Definition at line 132 of file UsbDeviceHidCom.c.

References bDataReceived, bDataSent, TRUE, and stc_usbn_endpoint_data::u8EndpointAddress.

Referenced by UsbDeviceHidCom_Init().

Here is the caller graph for this function:

Variable Documentation

boolean_t bDataReceived = FALSE
static

Definition at line 87 of file UsbDeviceHidCom.c.

Referenced by RxTxCallback(), and UsbDeviceHidCom_GetReceivedData().

boolean_t bReady = FALSE
static

Definition at line 89 of file UsbDeviceHidCom.c.

Referenced by ConfCallback(), and UsbDeviceHidCom_Send().

stc_usbn_endpoint_data_t* ppstcUsedEndpoints[2]
static

Definition at line 81 of file UsbDeviceHidCom.c.

uint8_t ppu8Buffers[2][64]
static

Definition at line 83 of file UsbDeviceHidCom.c.

Referenced by UsbDeviceHidCom_Init().

stc_usbn_endpoint_buffer_t pstcEndpointBuffers[2]
static

Definition at line 82 of file UsbDeviceHidCom.c.

stc_usbn_endpoint_data_t* pstcEndpointIN
static

Definition at line 85 of file UsbDeviceHidCom.c.

stc_usbn_endpoint_data_t* pstcEndpointOUT
static

Definition at line 86 of file UsbDeviceHidCom.c.

stc_usbn_t* pstcUsbHandle = NULL
static
const uint32_t pu32BufferSizes[2] = {64,64}
static

Definition at line 84 of file UsbDeviceHidCom.c.

Referenced by UsbDeviceHidCom_Init().

const uint8_t u8MaxSupportedEndpoints = 2
static

Definition at line 80 of file UsbDeviceHidCom.c.

Referenced by UsbDeviceHidCom_Init().