Crate calc_common
source ·Expand description
Contains shared types for the calc-rs
project.
Note: the Character and MetaButton types are laid out to match the following 5x5 matrix hardwired into the current keyboard prototype.
The Button ID for a given Button is row_num * 5 + col_num
.
Buttons
0 1 2 3 4
.----.------.------.-------.-------. External buttons
0 | 0 | 1 | 2 | 3 | 4 | 25 26
:----+------+------+-------+-------: .-----.------.
1 | 5 | 6 | 7 | 8 | 9 | | Alt | Menu |
:----+------+------+-------+-------: '-----'------'
2 | + | - | x | / | ^ |
:----+------+------+-------+-------:
3 | ( | ) | . | Left | Right |
:----+------+------+-------+-------:
4 | Up | Down | Back | Enter | Clear |
'----'------'------'-------'-------'
Modules
Structs
- A compact, one byte representation of a button. Can be either a Character or MetaButton
Enums
- Represents a character that can be put into an expression.
- Represents a charactor or symbol that cannot be put into an expression
- A button that isn’t a Character (eg
Enter
)
Constants
- The number of characters with their own dedicated buttons
Unions
- Represents either a Character or an ExtendedCharacter