Darien Figueroa / Mbed 2 deprecated repo3

Dependencies:   mbed MAX14720 MAX30205 USBDevice

Embed: (wiki syntax)

« Back to documentation index

HID Class Reference

HID Class Reference

USB Human Interface Device functions to connect to EV kit without requiring a custom device driver. More...

Public Member Functions

bool HandleWMDeviceChangeMessage (Message m)
 Called when a WM_DEVICECHANGE message has arrived, indicating that a device has been attached or removed.
void findHIDs ()
 findHIDs() called upon startup or if a desired HID has been inserted or removed
Boolean RegisterForDeviceNotifications (IntPtr formHandle, Guid classGuid, ref IntPtr deviceNotificationHandle)
 Requests to receive a notification when a device is attached or removed.
void StopReceivingDeviceNotifications (IntPtr deviceNotificationHandle)
 Requests to stop receiving notification messages when a device in an interface class is attached or removed.
bool I2C_Initialize (byte index, byte clockSpeed)
 Firmware command code 4 OUT = I2C configuration (IO_BUFFER.Ptr[3+gOffset] & 1) ? (SMB0CF |= 0x10) : (SMB0CF &= 0xEF)
bool FirmwareVersion (out byte VerMajor, out byte VerMinor, out byte verYearHundreds, out byte verYear, out byte verMonth, out byte verDay)
 Firmware command code 0 IN = Firmware version
bool LEDSet (bool ON)
 Firmware command code 1
void GPIOP0Get (out byte xxxxxxP06P07)
 Firmware command code 1 IN = GPIOP0Get read I/O pins P0.6, P0.7
void GPIOP1P2ConfigSet (byte P1MDOUT, byte P2MDOUT, byte weakPullupDisable)
 Firmware command code 2 OUT = GPIO configuration (C51F321 P1 and P2)
void GPIOP1P2ConfigGet (out byte P1MDOUT, out byte P2MDOUT, out byte weakPullupDisable)
 Firmware command code 2 IN = GPIO configuration (C51F321 P1 and P2)
void GPIOP1P2Out (byte P1, byte P2)
 Firmware command code 3 OUT = GPIO value (C51F321 P1 and P2)
void GPIOP1P2In (out byte P1, out byte P2)
 Firmware command code 3 IN = GPIO value (C51F321 P1 and P2)
void SPIConfigSet (byte config)
 Firmware command code 7 OUT = SPI config ((SPI0CFG & 0x30) >> 4) + (SPI0CN & 4)
void SPIConfigGet (out byte config)
 Firmware command code 7 IN = SPI config ((SPI0CFG & 0x30) >> 4) + (SPI0CN & 4)
void SPIClockSet (byte SPI0CKR)
 Firmware command code 8 OUT = SPI clock rate
void SPIClockGet (out byte SPI0CKR)
 Firmware command code 8 IN = SPI clock rate
void SPITransfer (byte[] mosiData, out byte[] misoBuffer)
 Firmware command code 9 = SPI transaction
void INT0Enable (byte EX0)
 Firmware command code 23 OUT = enable INT0 (or Mock HID FIFO data diagnostic)
  • INT0Enable(0) disabled (EX0=0)
  • INT0Enable(1) real hardware (EX0=1)
  • INT0Enable(2) Mock HID x1 channel 101, 102, 103, ...


Detailed Description

USB Human Interface Device functions to connect to EV kit without requiring a custom device driver.

Definition at line 59 of file GuiDLLs/RPCSupport/HidSupport/HID.cs.


Member Function Documentation

void findHIDs (  )

findHIDs() called upon startup or if a desired HID has been inserted or removed

Definition at line 648 of file GuiDLLs/RPCSupport/HidSupport/HID.cs.

bool FirmwareVersion ( out byte  VerMajor,
out byte  VerMinor,
out byte  verYearHundreds,
out byte  verYear,
out byte  verMonth,
out byte  verDay 
)

Firmware command code 0 IN = Firmware version

Parameters:
VerMajor
VerMinor
verYearHundreds
verYear
verMonth
verDay

Definition at line 1667 of file GuiDLLs/RPCSupport/HidSupport/HID.cs.

void GPIOP0Get ( out byte  xxxxxxP06P07 )

Firmware command code 1 IN = GPIOP0Get read I/O pins P0.6, P0.7

Parameters:
xxxxxxP06P07

Definition at line 1758 of file GuiDLLs/RPCSupport/HidSupport/HID.cs.

void GPIOP1P2ConfigGet ( out byte  P1MDOUT,
out byte  P2MDOUT,
out byte  weakPullupDisable 
)

Firmware command code 2 IN = GPIO configuration (C51F321 P1 and P2)

Parameters:
P1MDOUT
P2MDOUT
weakPullupDisable

Definition at line 1808 of file GuiDLLs/RPCSupport/HidSupport/HID.cs.

void GPIOP1P2ConfigSet ( byte  P1MDOUT,
byte  P2MDOUT,
byte  weakPullupDisable 
)

Firmware command code 2 OUT = GPIO configuration (C51F321 P1 and P2)

Parameters:
P1MDOUT
P2MDOUT
weakPullupDisable

Definition at line 1784 of file GuiDLLs/RPCSupport/HidSupport/HID.cs.

void GPIOP1P2In ( out byte  P1,
out byte  P2 
)

Firmware command code 3 IN = GPIO value (C51F321 P1 and P2)

Parameters:
P1
P2

Definition at line 1858 of file GuiDLLs/RPCSupport/HidSupport/HID.cs.

void GPIOP1P2Out ( byte  P1,
byte  P2 
)

Firmware command code 3 OUT = GPIO value (C51F321 P1 and P2)

Parameters:
P1
P2

Definition at line 1836 of file GuiDLLs/RPCSupport/HidSupport/HID.cs.

bool HandleWMDeviceChangeMessage ( Message  m )

Called when a WM_DEVICECHANGE message has arrived, indicating that a device has been attached or removed.

Parameters:
ma message with information about the device
Returns:
true on HID device arrival or remove complete

Definition at line 596 of file GuiDLLs/RPCSupport/HidSupport/HID.cs.

bool I2C_Initialize ( byte  index,
byte  clockSpeed 
)

Firmware command code 4 OUT = I2C configuration (IO_BUFFER.Ptr[3+gOffset] & 1) ? (SMB0CF |= 0x10) : (SMB0CF &= 0xEF)

Parameters:
gI2Cflagsbit0 == 1: repeated start
EXTHOLDset EXTHOLD bit (SMBus setup / hold time extension)
ClearSDAbyTogglingSCLclear SDA by toggling SCL

Firmware command code 4 IN = I2C configuration

(IO_BUFFER.Ptr[3+gOffset] & 1) ? (SMB0CF |= 0x10) : (SMB0CF &= 0xEF)

Parameters:
gI2Cflagsbit0 == 1: repeated start
EXTHOLDSMB0CF & 0x10

Firmware command code 5 OUT = I2C clock rate (number of counts to overflow)

SCL_kHz = TimerClockMHz * 1000 / ReloadTH1

Parameters:
ReloadTH1SMBus timer's count value: ReloadTH1 = (byte)(0.5 + (TimerClockMHz * 1000 / SCL_kHz))

Firmware command code 5 IN = I2C clock rate (number of counts to overflow)

SCL_kHz = TimerClockMHz * 1000 / ReloadTH1

Parameters:
TimerClockMHzSMBus timer's clock frequency (in MHz); expect constant 8
ReloadTH1SMBus timer's count value: SCL_kHz = TimerClockMHz * 1000 / ReloadTH1

Firmware command code 6 OUT = I2C transaction

Parameters:
deviceAddressI2C device address, 8-bit left-justified (LSB=R/w bit)
numDataBytesI2C burst write register data count, in bytes
numRegBytesI2C device register address length, normally 1 byte. Can be 0 for SMBusQuick protocol.
databyte array containing the register data to transmit
regbyte array containing the device register address
ignoreNACK

Firmware command code 6 IN = I2C transaction

Parameters:
deviceAddressI2C device address, 8-bit left-justified (LSB=R/w bit)
numDataBytesI2C burst read register data count, in bytes
numRegBytesI2C device register address length, normally 1 byte. Can be 0 for SMBusQuick protocol.
readDatabyte array which receives the register data
regbyte array containing the device register address
ignoreNACK
Returns:
status value; may be HID.I2C_NACK_ERROR if ignoreNACK parameter is true

Definition at line 1509 of file GuiDLLs/RPCSupport/HidSupport/HID.cs.

void INT0Enable ( byte  EX0 )

Firmware command code 23 OUT = enable INT0 (or Mock HID FIFO data diagnostic)

  • INT0Enable(0) disabled (EX0=0)
  • INT0Enable(1) real hardware (EX0=1)
  • INT0Enable(2) Mock HID x1 channel 101, 102, 103, ...

  • INT0Enable(3) Mock HID x2 channels 101, 201, 102, 202, 103, 203, ...
  • INT0Enable(4) Mock HID x3 channels 101, 201, 301, 102, 202, 302, 103, 203, 303, ...
  • INT0Enable(5) Mock HID x4 channels 101, 201, 301, 401, 102, 202, 302, 402, 103, 203, 303, 403, ...
Parameters:
EX0

Definition at line 2120 of file GuiDLLs/RPCSupport/HidSupport/HID.cs.

bool LEDSet ( bool  ON )

Firmware command code 1

Parameters:
ONON = true: LED turns on

Definition at line 1726 of file GuiDLLs/RPCSupport/HidSupport/HID.cs.

Boolean RegisterForDeviceNotifications ( IntPtr  formHandle,
Guid  classGuid,
ref IntPtr  deviceNotificationHandle 
)

Requests to receive a notification when a device is attached or removed.

Parameters:
formHandlehandle to the window that will receive device events.
classGuiddevice interface GUID.
deviceNotificationHandlereturned device notification handle.
Returns:
True on success.

Definition at line 781 of file GuiDLLs/RPCSupport/HidSupport/HID.cs.

void SPIClockGet ( out byte  SPI0CKR )

Firmware command code 8 IN = SPI clock rate

Parameters:
SPI0CKR

Definition at line 2021 of file GuiDLLs/RPCSupport/HidSupport/HID.cs.

void SPIClockSet ( byte  SPI0CKR )

Firmware command code 8 OUT = SPI clock rate

Parameters:
SPI0CKR

Definition at line 2010 of file GuiDLLs/RPCSupport/HidSupport/HID.cs.

void SPIConfigGet ( out byte  config )

Firmware command code 7 IN = SPI config ((SPI0CFG & 0x30) >> 4) + (SPI0CN & 4)

Parameters:
config

Definition at line 1998 of file GuiDLLs/RPCSupport/HidSupport/HID.cs.

void SPIConfigSet ( byte  config )

Firmware command code 7 OUT = SPI config ((SPI0CFG & 0x30) >> 4) + (SPI0CN & 4)

Parameters:
config

Definition at line 1986 of file GuiDLLs/RPCSupport/HidSupport/HID.cs.

void SPITransfer ( byte[]  mosiData,
out byte[]  misoBuffer 
)

Firmware command code 9 = SPI transaction

Parameters:
mosiDataSPI MOSI (Master-Out, Slave-In) data to write into slave device
misoBufferSPI MISO (Master-In, Slave-Out) data buffer containing data bytes received from slave device (size will be allocated same size as mosiData)

Definition at line 2035 of file GuiDLLs/RPCSupport/HidSupport/HID.cs.

void StopReceivingDeviceNotifications ( IntPtr  deviceNotificationHandle )

Requests to stop receiving notification messages when a device in an interface class is attached or removed.

Parameters:
deviceNotificationHandlehandle returned previously by RegisterDeviceNotification.

Definition at line 1117 of file GuiDLLs/RPCSupport/HidSupport/HID.cs.