(about to remove some things)

partial-rewrite
Ben Blazak 2013-03-18 21:31:39 -07:00
parent 38e3ff49f8
commit b63e4ef0f0
9 changed files with 139 additions and 155 deletions

View File

@ -1,8 +1,3 @@
<!-- TODO: rewrite / rework -->
# References
## Electronics Stuff
* [Resistor Color Codes]
@ -512,17 +507,30 @@
about how I would write a keymap making thing in javascript. Not sure how
good it'd be for that specifically, but the concept is just so **awesome**!
### Other Random Stuff
### Hardware Stuff (for the keyboard case)
#### Software
* [Working with Acrylic]
(http://www.bcae1.com/plexi.htm)
* mentioned in [this post]
(http://geekhack.org/index.php?topic=22780.msg782192#msg782192)
by [sordna] (http://geekhack.org/index.php?action=profile;u=9426)
(on <http://geekhack.org/>)
* also see [this post]
(http://geekhack.org/index.php?topic=22780.msg782080#msg782080)
by [kurplop] (http://geekhack.org/index.php?action=profile;u=17045)
(on <http://geekhack.org/>)
### Some Random Software Stuff
* [Tutorial: Metacompilers Part 1]
(http://www.bayfronttechnologies.com/mc_tutorial.html)
Probably doesn't have anything to do with microprocessors *or* web
development (at least at the moment)... but once again, the concept is really
awesome :) . I included it here because, as I was writing in C, the thought
"I could write a script to generate this code in Python *so* easily..." went
through my head quite often.
development (at least at the moment)... but the concept is really awesome :)
. I included it here because, as I was writing in C, the thought "I could
write a script to generate this code in Python *so* easily..." went through
my head quite often.
* [Towards Moore's Law Software: Part 1 of 3]
(http://www.moserware.com/2008/04/towards-moores-law-software-part-1-of-3.html)
@ -544,22 +552,7 @@
so... not that it looks dead (and, acutally, I didn't check the IRC channel
or forums or anything, so I could be completely wrong), just not very active.
And the documentation's fairly incomplete (which is sad, it looks like a
really cool language :) ).
#### Hardware
* [Working with Acrylic]
(http://www.bcae1.com/plexi.htm)
* mentioned in [this post]
(http://geekhack.org/index.php?topic=22780.msg782192#msg782192)
by [sordna] (http://geekhack.org/index.php?action=profile;u=9426)
(on <http://geekhack.org/>)
* also see [this post]
(http://geekhack.org/index.php?topic=22780.msg782080#msg782080)
by [kurplop] (http://geekhack.org/index.php?action=profile;u=17045)
(on <http://geekhack.org/>)
really cool language...).

View File

@ -26,7 +26,7 @@
|| !( OPT__MCP23018__DRIVE_ROWS || OPT__MCP23018__DRIVE_COLUMNS )
#error "MCP23018 pin drive direction incorrectly set"
#endif
/** macros/(group) pin drive direction
/** macros/(group) pin drive direction/description
* Select which set of pins (rows or columns) will drive (alternate between
* hi-Z and drive low), and which will be inputs (hi-Z)
*

View File

@ -31,7 +31,7 @@
|| !( OPT__TEENSY__DRIVE_ROWS || OPT__TEENSY__DRIVE_COLUMNS )
#error "Teensy pin drive direction incorrectly set"
#endif
/** macros/(group) pin drive direction
/** macros/(group) pin drive direction/description
* Select which set of pins (rows or columns) will drive (alternate between
* hi-Z and drive low), and which will be inputs (hi-Z)
*
@ -190,7 +190,7 @@
// ----------------------------------------------------------------------------
/** functions/teensy__init/description
* Returns
* Returns:
* - success: `0`
*/
uint8_t teensy__init(void) {

View File

@ -69,8 +69,6 @@
#define OPT__TWI__FREQENCY 400000
#include "../../../firmware/lib/twi/options.h"
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
@ -80,11 +78,8 @@
#define OPT__USB__VENDOR_ID 0x1d50 // Openmoko, Inc.
#define OPT__USB__PRODUCT_ID 0x6028 // ErgoDox ergonomic keyboard
#include "../../../firmware/lib/usb/keyboard/options.h"
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
#endif // ERGODOX_FIRMWARE__FIRMWARE__KEYBOARD__ERGODOX__OPTIONS__H

View File

@ -0,0 +1,80 @@
/* ----------------------------------------------------------------------------
* Copyright (c) 2013 Ben Blazak <benblazak.dev@gmail.com>
* Released under The MIT License (see "doc/licenses/MIT.md")
* Project located at <https://github.com/benblazak/ergodox-firmware>
* ------------------------------------------------------------------------- */
/** description
* Layer-stack interface
*
* Prefix: `layer_stack__`
*
* This file is meant to be included and used by the keyboard layout
* implemenmtation.
*/
#ifndef ERGODOX_FIRMWARE__LIB__LAYOUT__LAYER_STACK__H
#define ERGODOX_FIRMWARE__LIB__LAYOUT__LAYER_STACK__H
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
uint8_t layer_stack__peek (uint8_t offset);
uint8_t layer_stack__push (uint8_t layer_id, uint8_t layer_number);
uint8_t layer_stack__pop_id (uint8_t layer_id);
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
#endif // ERGODOX_FIRMWARE__LIB__LAYOUT__LAYER_STACK__H
// ============================================================================
// === documentation ==========================================================
// ============================================================================
// === layer_stack__peek() ===
/** functions/layer_stack__peek/description
* Return the `offset`th element of the layer stack
*
* Arguments:
* - `offset`: the offset of the element to return (with the top being
* `offset = 0`)
*
* Returns:
* - success: the layer-number of the `offset`th element, or `0` if `offset`
* was out of bounds
*/
// === layer_stack__push() ===
/** functions/layer_stack__push/description
* Push the given element onto the top of the layer stack (or update the
* element if it already exists)
*
* Arguments:
* - `layer_id`: the ID of the layer to push
* - `layer_number`: the layer-number of the layer to push
*
* Returns:
* - success: the offset of the element that was pushed (or pudated)
*
* Notes:
* - If the given layer-id is not present in the stack, a new element is
* created and placed on the top of the stack (as expected)
* - If the given layer-id is present in the stack, the element with that ID is
* updated
*/
// === layer_stack__pop_id() ===
/** functions/layer_stack__pop_id/description
* Pop the given element (by ID) out from the layer stack
*
* Arguments:
* - `layer_id`: the ID of the layer to push
*
* Returns:
* - success: the offset of the element that was pushed (or pudated)
*/

35
firmware/main.c Normal file
View File

@ -0,0 +1,35 @@
/* ----------------------------------------------------------------------------
* Copyright (c) 2013 Ben Blazak <benblazak.dev@gmail.com>
* Released under The MIT License (see "doc/licenses/MIT.md")
* Project located at <https://github.com/benblazak/ergodox-firmware>
* ------------------------------------------------------------------------- */
/** description
* `main()`: tying it all together
*/
// TODO: includes
// ----------------------------------------------------------------------------
#ifndef OPT__DEBOUNCE_TIME
#error "OPT__DEBOUNCE_TIME not defined"
#endif
/** macros/OPT__DEBOUNCE_TIME/description
* The minimum amount of time to wait between two scans of a key, in
* milliseconds
*
* Notes:
* - Cherry MX bounce time <= 5ms (at 16 in/sec actuation speed) (spec)
*/
// ----------------------------------------------------------------------------
// TODO: macros, if any
// ----------------------------------------------------------------------------
void main(void) {
}

View File

@ -1,37 +0,0 @@
/* ----------------------------------------------------------------------------
* Copyright (c) 2013 Ben Blazak <benblazak.dev@gmail.com>
* Released under The MIT License (see "doc/licenses/MIT.md")
* Project located at <https://github.com/benblazak/ergodox-firmware>
* ------------------------------------------------------------------------- */
/** description
* Things kept track of by `main()` that need to be accessible to other parts
* of the program.
*
* Prefix: `main__`
*/
#ifndef ERGODOX_FIRMWARE__FIRMWARE__MAIN__H
#define ERGODOX_FIRMWARE__FIRMWARE__MAIN__H
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
uint8_t main__layer_stack__peek (uint8_t offset);
uint8_t main__layer_stack__push (uint8_t layer_id, uint8_t layer_number);
uint8_t main__layer_stack__pop_id (uint8_t layer_id);
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
#endif // ERGODOX_FIRMWARE__FIRMWARE__MAIN__H
// ============================================================================
// === documentation ==========================================================
// ============================================================================
// TODO

View File

@ -20,17 +20,7 @@
// ----------------------------------------------------------------------------
// TODO: move to main.c
#ifndef OPT__DEBOUNCE_TIME
#error "OPT__DEBOUNCE_TIME not defined"
#endif
/** macros/OPT__DEBOUNCE_TIME/description
* The minimum amount of time to wait between two scans of a key, in
* milliseconds
*
* Notes:
* - Cherry MX bounce time <= 5ms (at 16 in/sec actuation speed) (spec)
*/
// (nothing here for now)
// ----------------------------------------------------------------------------

View File

@ -2,81 +2,9 @@
- the gnu avr toolchain
- python 3
- pyyaml `sudo pip install pyyaml`
- markdown `sudo pip install markdown`
## Coding Conventions
### Comments
`/** ... */` comments are to be written in YAML, so they can be processed by
external tools to generate documentation, and for other purposes.
* When read the following will be stripped:
* The first line (typically `/**`)
* The last line (typically ` */`)
* The first two characters of each line (typically ` *`)
* All elements are optional.
* All list elements are repeatable.
* All of these elements may all be specified from within any scanned file.
* Some of these elements have defaults (commented below); giving them a value
explicitly will override that.
* The element `.ignore` may appear in any list, and should be ignored.
- &atom '<boolean>|<number>|<string.markdown>'
- &value-map
type: *atom
name: *atom
description: *atom
values: [ *value-map ]
notes: [ *atom ]
- &description-map
# the file description
description: *atom
- &function-map
function:
<< : *value-map
arguments: *value-map
return value: *value-map
- &macro-map
macro: { << : *value-map }
- &typedef-map
typedef: { << : *value-map }
- &file-map
file:
# name: taken from the filesystem
# description: taken from the '[filename].md' if it exists
<< : [ *description-map, *value-map ]
functions: [ *function-map ]
macros: [ *macro-map ]
typedefs: [ *typedef-map ]
- &directory-map
directory:
# name: taken from filesystem
# description: taken from the 'readme.md' if it exists
<< : *value-map
files: [ *file-map ]
directories: [ *directory-map ]
- &project-map
project:
<< : *value-map
directories: [ *directory-map ]
- projects: [ *project-map ]
-------------------------------------------------------------------------------
Copyright &copy; 2012, 2013 Ben Blazak <benblazak.dev@gmail.com>