Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
TivaUsbKeyboardDev.cxx File Reference

Go to the source code of this file.

Macros

#define NUM_STRING_DESCRIPTORS    (sizeof(g_ppui8StringDescriptors) / sizeof(uint8_t *))
 

Functions

static uint32_t static_keyboard_handler (void *pvCBData, uint32_t ui32Event, uint32_t ui32MsgData, void *pvMsgData)
 
void usb0_interrupt_handler (void)
 Handle interrupts for USB0.
 

Variables

static const uint8_t g_pui8LangDescriptor []
 
static const uint8_t g_pui8ManufacturerString []
 
static const uint8_t g_pui8ProductString []
 
static const uint8_t g_pui8SeriailNumberString []
 
static const uint8_t g_pui8HIDInterfaceString []
 
static const uint8_t g_pui8ConfigString []
 
static const uint8_t *const g_ppui8StringDescriptors []
 
static const int8_t g_ppi8KeyUsageCodes [][2]
 

Detailed Description

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Device driver for a Tiva USB HID Keyboard device.

Author
Balazs Racz
Date
23 May 2017

Definition in file TivaUsbKeyboardDev.cxx.

Macro Definition Documentation

◆ NUM_STRING_DESCRIPTORS

#define NUM_STRING_DESCRIPTORS    (sizeof(g_ppui8StringDescriptors) / sizeof(uint8_t *))

Definition at line 102 of file TivaUsbKeyboardDev.cxx.

Function Documentation

◆ static_keyboard_handler()

static uint32_t static_keyboard_handler ( void *  pvCBData,
uint32_t  ui32Event,
uint32_t  ui32MsgData,
void *  pvMsgData 
)
static

Definition at line 241 of file TivaUsbKeyboardDev.cxx.

◆ usb0_interrupt_handler()

void usb0_interrupt_handler ( void  )

Handle interrupts for USB0.

Definition at line 410 of file TivaUsbKeyboardDev.cxx.

Variable Documentation

◆ g_ppi8KeyUsageCodes

const int8_t g_ppi8KeyUsageCodes[][2]
static

Definition at line 111 of file TivaUsbKeyboardDev.cxx.

◆ g_ppui8StringDescriptors

const uint8_t* const g_ppui8StringDescriptors[]
static
Initial value:
= {g_pui8LangDescriptor,
g_pui8ManufacturerString, g_pui8ProductString, g_pui8SeriailNumberString,
g_pui8HIDInterfaceString, g_pui8ConfigString}

Definition at line 98 of file TivaUsbKeyboardDev.cxx.

◆ g_pui8ConfigString

const uint8_t g_pui8ConfigString[]
static
Initial value:
= {(26 + 1) * 2, USB_DTYPE_STRING,
'H', 0, 'I', 0, 'D', 0, ' ', 0, 'K', 0, 'e', 0, 'y', 0, 'b', 0, 'o', 0, 'a',
0, 'r', 0, 'd', 0, ' ', 0, 'C', 0, 'o', 0, 'n', 0, 'f', 0, 'i', 0, 'g', 0,
'u', 0, 'r', 0, 'a', 0, 't', 0, 'i', 0, 'o', 0, 'n', 0}

Definition at line 88 of file TivaUsbKeyboardDev.cxx.

◆ g_pui8HIDInterfaceString

const uint8_t g_pui8HIDInterfaceString[]
static
Initial value:
= {(22 + 1) * 2,
USB_DTYPE_STRING, 'H', 0, 'I', 0, 'D', 0, ' ', 0, 'K', 0, 'e', 0, 'y', 0,
'b', 0, 'o', 0, 'a', 0, 'r', 0, 'd', 0, ' ', 0, 'I', 0, 'n', 0, 't', 0, 'e',
0, 'r', 0, 'f', 0, 'a', 0, 'c', 0, 'e', 0}

Definition at line 78 of file TivaUsbKeyboardDev.cxx.

◆ g_pui8LangDescriptor

const uint8_t g_pui8LangDescriptor[]
static
Initial value:
= {
4, USB_DTYPE_STRING, USBShort(USB_LANG_EN_US)}

Definition at line 41 of file TivaUsbKeyboardDev.cxx.

◆ g_pui8ManufacturerString

const uint8_t g_pui8ManufacturerString[]
static
Initial value:
= {
(17 + 1) * 2, USB_DTYPE_STRING, 'T', 0, 'e', 0, 'x', 0, 'a', 0, 's', 0, ' ',
0, 'I', 0, 'n', 0, 's', 0, 't', 0, 'r', 0, 'u', 0, 'm', 0, 'e', 0, 'n', 0,
't', 0, 's', 0,
}

Definition at line 49 of file TivaUsbKeyboardDev.cxx.

◆ g_pui8ProductString

const uint8_t g_pui8ProductString[]
static
Initial value:
= {(16 + 1) * 2, USB_DTYPE_STRING,
'K', 0, 'e', 0, 'y', 0, 'b', 0, 'o', 0, 'a', 0, 'r', 0, 'd', 0, ' ', 0, 'E',
0, 'x', 0, 'a', 0, 'm', 0, 'p', 0, 'l', 0, 'e', 0}

Definition at line 60 of file TivaUsbKeyboardDev.cxx.

◆ g_pui8SeriailNumberString

const uint8_t g_pui8SeriailNumberString[]
static
Initial value:
= {(8 + 1) * 2,
USB_DTYPE_STRING, '1', 0, '2', 0, '3', 0, '4', 0, '5', 0, '6', 0, '7', 0,
'8', 0}

Definition at line 69 of file TivaUsbKeyboardDev.cxx.