Commit Graph

156 Commits (43ee200b2b6e2e234ee8d13d8824e1d5068ba7d0)

Author SHA1 Message Date
Ben Blazak 50998376c5 (still reading hid stuff; taking a break to update matrix)
dox posted the PCB render the other day.  also, i have the current
flowing the wrong way for the keyswitch diodes to work right now
2012-05-26 20:48:20 -07:00
Ben Blazak 22752fead8 finished section 9 of the usb spec! 2012-05-13 18:06:17 -07:00
Ben Blazak 1acaaaf5ff (intermediate checkin: working on new usb code)
(plus a few small aesthetic things in /src/keyboard.  i changed some
function like macros to lower-case, because someday they might be
implemented as real functions... and there's no real reason to
distinguish between functions and function like macros in the main() and
other higher level code.  at least that's what it seems like to me right
now.)
2012-05-06 18:36:51 -07:00
Ben Blazak 5c2f6e64f4 (made things a bit easier to read) 2012-04-30 14:05:25 -07:00
Ben Blazak 2e4eeb430b made kb-layers use flash memory by default 2012-04-29 18:47:27 -07:00
Ben Blazak 3c968c41f2 (changed some little things in layers) 2012-04-29 00:47:08 -07:00
Ben Blazak 0b423bef70 moved keyboard layout to program space 2012-04-29 00:17:17 -07:00
Ben Blazak 229a2446a7 moved libs around; split some code in layouts 2012-04-28 23:40:00 -07:00
Ben Blazak 4e913361ac abstracted layout access a little 2012-04-28 22:39:23 -07:00
Ben Blazak c90908becd (fixed 'references' a little) 2012-04-28 13:23:51 -07:00
Ben Blazak 69367d25ec added descriptions to most of the 'references' entries 2012-04-28 13:05:40 -07:00
Ben Blazak 1c6d31f012 changing how computed includes are handled 2012-04-28 01:23:51 -07:00
Ben Blazak 5b83e1f630 (small macro fix) 2012-04-28 00:58:31 -07:00
Ben Blazak 2009c160e4 moved the twi library 2012-04-28 00:46:35 -07:00
Ben Blazak 66a5932fa8 moved the key-functions files 2012-04-27 15:39:26 -07:00
Ben Blazak 07d3bbc4f4 (minor doc update) 2012-04-26 13:06:22 -07:00
Ben Blazak 690efc28cb updating docs (a little) 2012-04-26 13:03:51 -07:00
Ben Blazak 15efb43b76 fixed *.md indenting
apparently, sublists need to be indented 4 spaces (1 tab) or more to be
recognized as such (because subsequent lines of a list may be indented
up to 3 spaces).  it's right there on the markdown syntax page, but i
didn't catch it the first time.
2012-04-26 03:44:20 -07:00
Ben Blazak a0f69c9200 minor doc and keymap update 2012-04-26 02:51:14 -07:00
Ben Blazak b6cc6108ae (aesthetic; modified makefile) 2012-04-25 00:14:12 -07:00
Ben Blazak 241e90104a (minor, and a little reorganization) 2012-04-24 23:49:17 -07:00
Ben Blazak b7e5e7b735 refactoring layout stuff
- made short keycode macros for the USB keycodes (under "lib/...")
- refactored "keyboard/.../layout.c", to make way for multiple layouts,
  and to make it easier to read (by using short keycode macros)
  - layout.h has a computed include line now, and the code (and layout
    specific header stuff) is in a subdirectory.  the makefile should
    take care of which layout gets included and compiled
- changed kbfun_press() and kbfun_release() to be able to handle the
  modifier keys (instead of requiring a separate function for the
  modifiers)
- added a makefile variable for which keyboard gets compiled.  even
  though there's only one right now
2012-04-24 23:22:20 -07:00
Ben Blazak acba260663 increased error checks for mcp23018_updat_matrix()
and some aesthetic stuff
2012-04-24 12:17:06 -07:00
Ben Blazak bec0c7244f reorganized src/lib 2012-04-22 12:08:32 -07:00
Ben Blazak 502fa3a79f rewrote makefile (standalone now); removed some unnecessary stuff 2012-04-18 01:29:38 -07:00
Ben Blazak 1cdfae2e14 (mostly aesthetic stuff; removed one dependency from makefile)
- Merge branch 'dev'
2012-04-13 19:06:57 -07:00
Ben Blazak cae0560e04 removed makefile dependency on the unix shell (hopefully) 2012-04-13 19:05:06 -07:00
Ben Blazak 53e620a173 (updated references) 2012-04-12 21:54:46 -07:00
Ben Blazak 6384589e5c (update references) 2012-04-12 19:05:51 -07:00
Ben Blazak 264d5c55bb fixed mcp23018 row placement in _circuit-diagram.svg 2012-04-12 15:56:58 -07:00
Ben Blazak d70b9da592 (mostly aesthetic things that i forgot) 2012-04-11 23:10:37 -07:00
Ben Blazak 201e38c576 first working firmware! :)
- merge from branch 'dev'

implementation / version notes:
- needs testing still (a lot), but with the little i could do on my
  breadboard it looked stable.  6-KRO looks like it works, and the key
  press/release and modifier press/release functions, and LED indicators
  look like they work.  yay!
- looks like it's scanning at about 167 Hz (as accurately as i could
  measure with a prescaling loop, an LED, and a stopwatch).  most of
  this (almost all of it, actually) is due to i2c.  it has the potential
  to get a little faster (maybe slightly past 200 Hz, if i try), but i'm
  not sure if i will since most keyboards i found speeds for online
  scanned at a little less than 100 Hz - so that should be fast enough.
- also, my method of assigning a keycode, press function, and release
  function to each key on each layer seems like it should be time and
  space consuming; but we have plenty of space (we're only using ~11%
  currently), and plenty of time apparently, since the teensy is running
  at 16MHz, and the time used by the extra function calls pales in
  comparison to the time used by the i2c functions.

other notes:
- see the *.md files for documentation about everything.  i did my best
  to make and keep them accurate with the source, so hopefully nothing
  (too important..) got past me.
- also, there's a nice circuit diagram under
  "src/keyboard/ergodox/_circuit-diagram.svg" :) .  i like it a lot, and
  it's accurate for now, but i'm not sure how maintainable it'll be if
  the pins change.

yay!! :D  i'm so happy i got it working.
2012-04-11 22:35:40 -07:00
Ben Blazak 8e68c2ea07 . 2012-04-11 22:05:59 -07:00
Ben Blazak 8b168bc88e cleaned up :) and ready to merge 2012-04-11 21:05:45 -07:00
Ben Blazak 98033358f4 added ergodox circuit diagram; and a few misc things; time to clean up 2012-04-11 18:52:31 -07:00
Ben Blazak cd6826eeb5 checkin before deleting the debug code; almost ready for first beta!
- simple bug fix in kbfun_press() and kbfun_release()
- no longer check for previous init() in the mcp23018 functions;
  something would happen when i tried to read from it, sometimes, when
  it'd been unplugged or stoped some other way, and it would hang - and
  the only thing that would make it better was running the test_twi_2
  function (a series of writes, with stops after each).  so now
  mcp23018_init() is a series of writes, with stops after each.  it
  doesn't take appreciably longer to run...  maybe it should be looked
  into later though.
- changed the main() loop a little
2012-04-10 18:58:26 -07:00
Ben Blazak 57e82aebcf lots and lots; now writing/debugging keyboard logic
also, mcp23018_init() needs fixing: `twi_stop()` needs to be at the end
of transmission blocks.  i wouldn't think that would be necessary, but
it seems to be the only thing that'll make it work, and it also seems
consistent with the protocol diagram in the datasheet (lol, imagine
that), so i think that's what i'll have to do.  not as though it matters
much i guess, since it's a single master / single slave system anyway, i
was just hoping not to release the bus till i was finished..
2012-04-10 01:44:27 -07:00
Ben Blazak 92c3d541f1 (forgot to add these to git the other day) 2012-04-06 00:21:07 -07:00
Ben Blazak a24a45fce7 wrote teensy update() (need to test); minor mcp23018 update() fix 2012-04-06 00:19:57 -07:00
Ben Blazak 2dce6e4066 lots
- fixed some includes (`uint8_t` comes from a header, not the language)
- put code from some of the .h files into .c files
- now using open drain logic (hi-Z or GND) on both chips instead of
  driving the row pins high on the teensy, or using a pull-up resistor
  on the row pins with the mcp23018
- put `return 0;` at the end of some functions that weren't void
- fixed/updated some documentation; esp. the row assignments for the
  mcp23018
- generalized the unused/row/column pin assignment and init code using
  macros, so they'll be much easier to move around if necessary
- fixed a redefinition error in "lib/usb/keyboard-usage-page.h"
2012-04-05 03:08:20 -07:00
Ben Blazak f41502ba3c mostly working on mcp23018.c; init() and update() might be ready :)
also, moved the twi code to lib/teensy-2-0/twi*
2012-04-02 01:59:00 -07:00
Ben Blazak b0b9335651 few things; mostly, I2C works now!; it was a hardware error
i had been leaving the RESET pin floating... this does not work.  it
must be externally biased - high, if you want the chip to work.. :) lol
2012-03-31 17:02:55 -07:00
Ben Blazak f49d503698 little work on the teensy init function and header; not much else 2012-03-28 01:03:11 -07:00
Ben Blazak a288b8a045 intermitent checkin; lots of stuff; i2c on hold; kb logic in progress 2012-03-27 03:06:52 -07:00
Ben Blazak b77e74cacd doing something clever with macro prefixes, which didn't work
i'd like to keep it around in the history though, just for fun - :)
2012-03-21 16:51:42 -07:00
Ben Blazak 19725eed4a *lots* of stuff .. :) - got PWM working!
also, i didn't make a note of it in the *.md file, but Waveform
Generation Mode 15 for fast PWM wasn't working right (well.. wasn't
working how i expected it to).  i misinterpreted what the modes were
doing, partially (haha, or all-ly?) because i didn't read the
description of fast pwm thoroughly enough...  in any case, all the
information's in the datasheet, and it's actually not terribly long.
i'm not sure how to correctly use Mode 15 yet, but i think i'll leave it
alone for now, since Mode 5 works as expected, and i think what the
datasheet says about *that* makes enough sense to me for me to be
content for the moment.
2012-03-19 00:01:41 -07:00
Ben Blazak 4dd05f515b working more on controller_init(), and file factoring 2012-03-16 18:31:36 -07:00
Ben Blazak 37b504adfe mostly: figured out how to initialize the LEDs with PWM 2012-03-16 03:15:47 -07:00
Ben Blazak 6fb3bf7a57 still working...
- removed the comment about the RESET pin on the MCP23018: i think these
  chips reset on powerup
- the partitioning of code into files is all wrong at the moment... i
  need to write some more and then fix that
2012-03-15 01:01:36 -07:00
Ben Blazak 4bcc0e5dc3 split the firmware into general/controller/keyboard files 2012-03-14 14:46:52 -07:00