explaination for the mainboard stuff

This commit is contained in:
2025-06-26 14:07:24 -07:00
parent 19aa606bb8
commit 63dc0a01c8
6 changed files with 254 additions and 1 deletions

1
.obsidian/app.json vendored Normal file
View File

@@ -0,0 +1 @@
{}

1
.obsidian/appearance.json vendored Normal file
View File

@@ -0,0 +1 @@
{}

31
.obsidian/core-plugins.json vendored Normal file
View File

@@ -0,0 +1,31 @@
{
"file-explorer": true,
"global-search": true,
"switcher": true,
"graph": true,
"backlink": true,
"canvas": true,
"outgoing-link": true,
"tag-pane": true,
"properties": false,
"page-preview": true,
"daily-notes": true,
"templates": true,
"note-composer": true,
"command-palette": true,
"slash-command": false,
"editor-status": true,
"bookmarks": true,
"markdown-importer": false,
"zk-prefixer": false,
"random-note": false,
"outline": true,
"word-count": true,
"slides": false,
"audio-recorder": false,
"workspaces": false,
"file-recovery": true,
"publish": false,
"sync": true,
"webviewer": false
}

22
.obsidian/graph.json vendored Normal file
View File

@@ -0,0 +1,22 @@
{
"collapse-filter": true,
"search": "",
"showTags": false,
"showAttachments": false,
"hideUnresolved": false,
"showOrphans": true,
"collapse-color-groups": true,
"colorGroups": [],
"collapse-display": true,
"showArrow": false,
"textFadeMultiplier": 0,
"nodeSizeMultiplier": 1,
"lineSizeMultiplier": 1,
"collapse-forces": true,
"centerStrength": 0.518713248970312,
"repelStrength": 10,
"linkStrength": 1,
"linkDistance": 250,
"scale": 1,
"close": false
}

175
.obsidian/workspace.json vendored Normal file
View File

@@ -0,0 +1,175 @@
{
"main": {
"id": "469034f7e9b5fb3b",
"type": "split",
"children": [
{
"id": "8e99f7b5372abfbb",
"type": "tabs",
"children": [
{
"id": "ba28e77977832bda",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "firmware/components/mainboard/README.md",
"mode": "source",
"source": false
},
"icon": "lucide-file",
"title": "README"
}
}
]
}
],
"direction": "vertical"
},
"left": {
"id": "ee3e9cd73bfd4e67",
"type": "split",
"children": [
{
"id": "866588de05537010",
"type": "tabs",
"children": [
{
"id": "6e0b1f0e736aa473",
"type": "leaf",
"state": {
"type": "file-explorer",
"state": {
"sortOrder": "alphabetical",
"autoReveal": false
},
"icon": "lucide-folder-closed",
"title": "Files"
}
},
{
"id": "380606aba917ae27",
"type": "leaf",
"state": {
"type": "search",
"state": {
"query": "",
"matchingCase": false,
"explainSearch": false,
"collapseAll": false,
"extraContext": false,
"sortOrder": "alphabetical"
},
"icon": "lucide-search",
"title": "Search"
}
},
{
"id": "90e76482bb16cc8e",
"type": "leaf",
"state": {
"type": "bookmarks",
"state": {},
"icon": "lucide-bookmark",
"title": "Bookmarks"
}
}
]
}
],
"direction": "horizontal",
"width": 300
},
"right": {
"id": "53f5c09c52c4d751",
"type": "split",
"children": [
{
"id": "c3079a730d631ea3",
"type": "tabs",
"children": [
{
"id": "0e64e3236d7f1370",
"type": "leaf",
"state": {
"type": "backlink",
"state": {
"file": "firmware/components/mainboard/README.md",
"collapseAll": false,
"extraContext": false,
"sortOrder": "alphabetical",
"showSearch": false,
"searchQuery": "",
"backlinkCollapsed": false,
"unlinkedCollapsed": true
},
"icon": "links-coming-in",
"title": "Backlinks for README"
}
},
{
"id": "9e6f7140a09c1bc7",
"type": "leaf",
"state": {
"type": "outgoing-link",
"state": {
"file": "firmware/components/mainboard/README.md",
"linksCollapsed": false,
"unlinkedCollapsed": true
},
"icon": "links-going-out",
"title": "Outgoing links from README"
}
},
{
"id": "0167222091d8db4d",
"type": "leaf",
"state": {
"type": "tag",
"state": {
"sortOrder": "frequency",
"useHierarchy": true,
"showSearch": false,
"searchQuery": ""
},
"icon": "lucide-tags",
"title": "Tags"
}
},
{
"id": "37866ffcbb8ebcff",
"type": "leaf",
"state": {
"type": "outline",
"state": {
"file": "firmware/components/mainboard/README.md",
"followCursor": false,
"showSearch": false,
"searchQuery": ""
},
"icon": "lucide-list",
"title": "Outline of README"
}
}
]
}
],
"direction": "horizontal",
"width": 300,
"collapsed": true
},
"left-ribbon": {
"hiddenItems": {
"switcher:Open quick switcher": false,
"graph:Open graph view": false,
"canvas:Create new canvas": false,
"daily-notes:Open today's daily note": false,
"templates:Insert template": false,
"command-palette:Open command palette": false
}
},
"active": "ba28e77977832bda",
"lastOpenFiles": [
"docs/Software Documentation.md"
]
}

View File

@@ -1,4 +1,27 @@
# Mainboard
The goal of the mainboard is to take in CAN signals from the modules, and then convert these can signals to USB HID report. How the can signals would be structured is that it would be based off the Universal Serial Bus HID Usage Table. We can let the first byte be the Usage ID and the second byte be the status of that key.
The goal of the mainboard is to take in CAN signals from the modules, and then convert these can signals to USB HID report.
# How is CAN Data is Transmitted
When you press a button on a module, it sends two CAN messages—one when the key is pressed down, and another when its released. This is in order to avoid spamming the bus with constant message of every status for every key.
The CAN data follows a simple 2-byte pattern:
- The **first byte** is the Universal HID Keyboard Key Code
- The **second byte** reports the status of that key (pressed or released)
So, if we send something like `xx04`, it means the keycode for the letter “A” is pressed The mainboard picks that up and adds it to the report FIFO queue
## Keycode Byte
Keyboard codes can be found here https://www.toomanyatoms.com/computer/usb_keyboard_codes.html. They are pretty self explanatory.
## Second Byte
|Bit|Meaning|
|---|---|
|0xxx xxxx|Is the key pressed? 0 = released, 1 = pressed
Of course, we have 7 bits extra, but this can be used for future proofing. For example, we might want a module that does not follow the USB Keyboard Codes. Think of it as configuration bits that maybe useful in the future.
# N-Key Rollover
Well use a FIFO (First In, First Out) queue to keep track of all the keys pressed and update the USB HID report accordingly.
Read more about the HID report structure here: https://wiki.osdev.org/USB_Human_Interface_Devices