/67key-firmware

Firmware for 67key-trackpoint

Primary LanguageC

67 Key keyboard with trackpoint

TODO

  • Finish keymap/layers
  • Make tp reset non blocking?
  • uf2: turn down brightness on rgbs
  • Set serial number in descriptor? check uf2 source. add to tud_descriptor_string_cb
  • Merge spi master and matrix?
  • Make force reset universal
  • Turn off unused clocks? APB ADC. Whatever was started by uf2
  • Figure out clean way to have keys do things outside of keymap
  • Set up Fn lock
  • Make menu/help, move to config.c?
  • Intermittent wake up from sleep after putting computer to sleep. Doesn't wake up computer.
  • sends 3 reports whenever any key changes. problem?
  • limit scrolling to 1 at a time.
  • Check speedup of inlining millis(). Doesn't reallly work with externs. Cleared the dmb/irq around returning msticks, increased 108k->112kHz.
  • Implement debounce? Does happen occasionally.
  • tp reading and writing from ram stalls sometimes. dataAvailable not being set? Done, set up timeout in tp_getDataBit().
  • Wakeup from TP and spacebar working, with idle(1). Standby not working, must set up low level interrupt and clocks. Linux not setting wakeup enabled by default, works when changed. Must be hid only? Added udev rule from archwiki. Changed HID portocol to keyboard in hid descriptor. Wakeup enabled without udev rule
  • set up modifier reporting
  • set up system for leds
  • Delay a bit after middle mouse to make sure it's not a scroll. Do like tp wired keyboard, only send middle button on release? Done, hardcoded dirtily.

Power and Sleep

The trackpoint uses an external interrupt on the falling edge to clock in data. There is also a line going straight to the space bar, set up to interrupt on a low level. Level interrupts are asynchronout and can wake up from deep sleep. These are both configured in trackpoint.c. So, to go to sleep, I set tp clk pin to trigger on a low level and enable the spacebar interrupt. Immediately on wake up (or first call) I turn off the spacebar interrupt and reset the tp clk pin to a falling edge interrupt.

Waking up from sleep has been a little tricky. Entering deep sleep works. Waking up from a low level external interrupt also works. But, waking up from a usb resume does not start up correctly. The current draw spikes, then drops back down. So, I'm using idle(2). Sleeps and wakes up fine.

  • Deep sleep with Trackpoint: 13.5mA
  • Deep sleep w/o Trackpoint: 1.1mA
  • Idle(2) with Trackpoint: 17.5mA
  • Normal with LEDs: 26mA