Skip to content
hasu@tmk edited this page Nov 18, 2021 · 28 revisions

Integer Overflow/Rollover

https://arduino.stackexchange.com/a/12588

Arduino Timer:

  • unsigned long millis()
  • unsigned long micros()

unsigned long is 32-bit size on AVR. millis() rollovers in 49.7 days and micros() in 71.58 secs.

AVR Integer Size

https://gcc.gnu.org/wiki/avr-gcc#Type_Layout

https://www.nongnu.org/avr-libc/user-manual/group__avr__stdint.html

IDEA

Minmal firmware Build

for non-keyboard project

  • NO_KEYBOARD build option for minimal build
  • 6KRO_ENABLE(boot keyboard compatible when report protocol)
  • NKRO_ENABLE

currently keyboard function is built automatically without any options.

Mouse Scroll Wheel Emulation

two implementatons exists on PS/2 and ADB. One common impl to be shared by projects would be nice.

IBMPC buffer handling on send

Data on recv buffer can be removed by calling host_send(). TODO: Fix

MOUSE_ENABLE/MOUSEKEY_ENABLE Build Option

need to be organized

MOUSE_ENABLE is needed for mouse project without mouse key feature. It enables mouse output interface.

Control Endpoint 0

Send command to the endpoint for hidden functions.

UHS3

class

UHS_host/UHS_HID/UHS_HID.h

UHS_HID : UHS_USBInterface

  • UHS_HID(UHS_USB_HOST_BASE *p, UHS_HID_PROCESSOR *hp)
  • Start()
  • OKtoEnumerate(ENUMERATION_INFO *ei)
  • SetInterface(ENUMERATION_INFO *ei)
  • Poll()
  • DriverDefaults()
  • driverPoll()
  • GetAddress()
  • Polling()
  • OnRelease()
  • SetIdle(iface, reportID, duration)
  • SetProtocol(iface, protocol)
  • SetReport(iface, report_type, report_id, nbytes, dataptr)
  • ReportDescr(wIndex, nbytes, *buffer)

UHS_HID_PROCESSOR

  • onStart(UHS_HID_base)
  • onPoll(UHS_HID_base, data, length)
  • onRelease(UHS_HID_base)

UHS_HID_base

HID drivers: RAW, KEYBOARD, MOUSE

  • UHS_HID *parent
  • UHS_HID_driver_t driver
  • driverPoll()
  • driverStart()
  • driverRelease()
  • writeReport(nbytes, *dataptr)

UHS_HID_RAW : UHS_HID_base

UHS_host/UHS_HID/HIDBOOT/UHS_HIDRAWBOOT_KEYBOARD.h

UHS_HIDBOOT_keyboard : UHS_HID_base

UHS_host/UHS_HID/HIDBOOT/UHS_HIDRAWBOOT_MOUSE.h

UHS_HIDBOOT_mouse : UHS_HID_base

Clone this wiki locally