Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qmk_firmware #318

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added keyboards/1.zip
Binary file not shown.
39 changes: 39 additions & 0 deletions keyboards/1/1.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#include "quantum.h"

#ifdef DIP_SWITCH_ENABLE
bool dip_switch_update_kb(uint8_t index, bool active) {
if (!dip_switch_update_user(index, active)) {
return false;
}
if (index == 0) {
default_layer_set(1UL << (active ? 0 : 2));
}
return true;
}
#endif

void keyboard_post_init_kb(void) {
setPinOutputPushPull(LED_MAC_OS_PIN);
setPinOutputPushPull(LED_WIN_OS_PIN);
writePin(LED_MAC_OS_PIN, !LED_OS_PIN_ON_STATE);
writePin(LED_WIN_OS_PIN, !LED_OS_PIN_ON_STATE);

keyboard_post_init_user();
}

void housekeeping_task_kb(void) {
if (default_layer_state == (1 << 0)) {
writePin(LED_MAC_OS_PIN, LED_OS_PIN_ON_STATE);
writePin(LED_WIN_OS_PIN, !LED_OS_PIN_ON_STATE);
}
if (default_layer_state == (1 << 2)) {
writePin(LED_MAC_OS_PIN, !LED_OS_PIN_ON_STATE);
writePin(LED_WIN_OS_PIN, LED_OS_PIN_ON_STATE);
}
}

void suspend_power_down_kb(void) {
writePin(LED_WIN_OS_PIN, !LED_OS_PIN_ON_STATE);
writePin(LED_MAC_OS_PIN, !LED_OS_PIN_ON_STATE);
suspend_power_down_user();
}
31 changes: 31 additions & 0 deletions keyboards/1/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#pragma once

#define ENABLE_COMPILE_KEYCODE
#define FORCE_NKRO
#define DEBOUNCE_TYPE DEBOUNCE_EAGER
#define DEBOUNCE 1
#define USB_POLLING_LATE_INTERVAL 0.125
#define KEYS_PER_SCAN 12

/* DIP switch */
#define DIP_SWITCH_PINS { D2 }

/* Indication led */
#define LED_MAC_OS_PIN C10
#define LED_WIN_OS_PIN C11
#define LED_OS_PIN_ON_STATE 1

/* The I2C Driver Configuration */
#define I2C1_CLOCK_SPEED 400000
#define I2C1_DUTY_CYCLE FAST_DUTY_CYCLE_2

/* The SPI Driver Configuration */
// #define SPI_DRIVER SPID1
// #define SPI_SCK_PIN A5
// #define SPI_MOSI_PIN A7
// #define SPI_MISO_PIN A6
// #define CKLED2001_SPI_DIVISOR 21

/* EEPROM Driver Configuration */
#define WEAR_LEVELING_LOGICAL_SIZE 2048
#define WEAR_LEVELING_BACKING_SIZE (WEAR_LEVELING_LOGICAL_SIZE * 2)
5 changes: 5 additions & 0 deletions keyboards/1/halconf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#pragma once

#define HAL_USE_I2C TRUE

#include_next <halconf.h>
146 changes: 146 additions & 0 deletions keyboards/1/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
{
"keyboard_name": "1",
"manufacturer": "1",
"url": "1",
"maintainer": "1",
"features": {
"bootmagic": true,
"command": false,
"console": false,
"dip_switch": true,
"extrakey": true,
"mousekey": true,
"nkro": true
},
"usb": {
"vid": "0x0000",
"pid": "0x0000",
"device_version": "0.0.0"
},
"processor": "STM32F401",
"bootloader": "stm32-dfu",
"matrix_pins": {
"cols": ["A0", "A1", "A2", "A3", "C0", "C1", "C2", "C3", "A8", "C12", "B9", "C6", "C7", "C4", "C5","A15", "B10", "B12", "B13", "B14", "B15"],
"rows": ["B0", "B1", "B8", "B3", "B4", "B5"]
},
"diode_direction": "COL2ROW",
"indicators": {
"caps_lock": "C9",
"num_lock": "C8"
},
"layouts": {
"LAYOUT": {
"layout": [
{"matrix":[0,0], "x":0, "y":0},
{"matrix":[0,1], "x":2, "y":0},
{"matrix":[0,2], "x":3, "y":0},
{"matrix":[0,3], "x":4, "y":0},
{"matrix":[0,4], "x":5, "y":0},
{"matrix":[0,5], "x":6.5, "y":0},
{"matrix":[0,6], "x":7.5, "y":0},
{"matrix":[0,7], "x":8.5, "y":0},
{"matrix":[0,8], "x":9.5, "y":0},
{"matrix":[0,9], "x":11, "y":0},
{"matrix":[0,10], "x":12, "y":0},
{"matrix":[0,11], "x":13, "y":0},
{"matrix":[0,12], "x":14, "y":0},
{"matrix":[0,14], "x":15.25, "y":0},
{"matrix":[0,15], "x":16.25, "y":0},
{"matrix":[0,16], "x":17.25, "y":0},

{"matrix":[1,0], "x":0, "y":1.25},
{"matrix":[1,1], "x":1, "y":1.25},
{"matrix":[1,2], "x":2, "y":1.25},
{"matrix":[1,3], "x":3, "y":1.25},
{"matrix":[1,4], "x":4, "y":1.25},
{"matrix":[1,5], "x":5, "y":1.25},
{"matrix":[1,6], "x":6, "y":1.25},
{"matrix":[1,7], "x":7, "y":1.25},
{"matrix":[1,8], "x":8, "y":1.25},
{"matrix":[1,9], "x":9, "y":1.25},
{"matrix":[1,10], "x":10, "y":1.25},
{"matrix":[1,11], "x":11, "y":1.25},
{"matrix":[1,12], "x":12, "y":1.25},
{"matrix":[1,13], "x":13, "y":1.25, "w":2},
{"matrix":[1,14], "x":15.25, "y":1.25},
{"matrix":[1,15], "x":16.25, "y":1.25},
{"matrix":[1,16], "x":17.25, "y":1.25},
{"matrix":[1,17], "x":18.5, "y":1.25},
{"matrix":[1,18], "x":19.5, "y":1.25},
{"matrix":[1,19], "x":20.5, "y":1.25},
{"matrix":[1,20], "x":21.5, "y":1.25},

{"matrix":[2,0], "x":0, "y":2.25, "w":1.5},
{"matrix":[2,1], "x":1.5, "y":2.25},
{"matrix":[2,2], "x":2.5, "y":2.25},
{"matrix":[2,3], "x":3.5, "y":2.25},
{"matrix":[2,4], "x":4.5, "y":2.25},
{"matrix":[2,5], "x":5.5, "y":2.25},
{"matrix":[2,6], "x":6.5, "y":2.25},
{"matrix":[2,7], "x":7.5, "y":2.25},
{"matrix":[2,8], "x":8.5, "y":2.25},
{"matrix":[2,9], "x":9.5, "y":2.25},
{"matrix":[2,10], "x":10.5, "y":2.25},
{"matrix":[2,11], "x":11.5, "y":2.25},
{"matrix":[2,12], "x":12.5, "y":2.25},
{"matrix":[2,13], "x":13.5, "y":2.25, "w":1.5},
{"matrix":[2,14], "x":15.25, "y":2.25},
{"matrix":[2,15], "x":16.25, "y":2.25},
{"matrix":[2,16], "x":17.25, "y":2.25},
{"matrix":[2,17], "x":18.5, "y":2.25},
{"matrix":[2,18], "x":19.5, "y":2.25},
{"matrix":[2,19], "x":20.5, "y":2.25},
{"matrix":[2,20], "x":21.5, "y":2.25, "h":2},

{"matrix":[3,0], "x":0, "y":3.25, "w":1.75},
{"matrix":[3,1], "x":1.75, "y":3.25},
{"matrix":[3,2], "x":2.75, "y":3.25},
{"matrix":[3,3], "x":3.75, "y":3.25},
{"matrix":[3,4], "x":4.75, "y":3.25},
{"matrix":[3,5], "x":5.75, "y":3.25},
{"matrix":[3,6], "x":6.75, "y":3.25},
{"matrix":[3,7], "x":7.75, "y":3.25},
{"matrix":[3,8], "x":8.75, "y":3.25},
{"matrix":[3,9], "x":9.75, "y":3.25},
{"matrix":[3,10], "x":10.75, "y":3.25},
{"matrix":[3,11], "x":11.75, "y":3.25},
{"matrix":[3,13], "x":12.75, "y":3.25, "w":2.25},
{"matrix":[3,17], "x":18.5, "y":3.25},
{"matrix":[3,18], "x":19.5, "y":3.25},
{"matrix":[3,19], "x":20.5, "y":3.25},

{"matrix":[4,0], "x":0, "y":4.25, "w":2.25},
{"matrix":[4,2], "x":2.25, "y":4.25},
{"matrix":[4,3], "x":3.25, "y":4.25},
{"matrix":[4,4], "x":4.25, "y":4.25},
{"matrix":[4,5], "x":5.25, "y":4.25},
{"matrix":[4,6], "x":6.25, "y":4.25},
{"matrix":[4,7], "x":7.25, "y":4.25},
{"matrix":[4,8], "x":8.25, "y":4.25},
{"matrix":[4,9], "x":9.25, "y":4.25},
{"matrix":[4,10], "x":10.25, "y":4.25},
{"matrix":[4,11], "x":11.25, "y":4.25},
{"matrix":[4,13], "x":12.25, "y":4.25, "w":2.75},
{"matrix":[4,15], "x":16.25, "y":4.25},
{"matrix":[4,17], "x":18.5, "y":4.25},
{"matrix":[4,18], "x":19.5, "y":4.25},
{"matrix":[4,19], "x":20.5, "y":4.25},
{"matrix":[4,20], "x":21.5, "y":4.25, "h":2},

{"matrix":[5,0], "x":0, "y":5.25, "w":1.25},
{"matrix":[5,1], "x":1.25, "y":5.25, "w":1.25},
{"matrix":[5,2], "x":2.5, "y":5.25, "w":1.25},
{"matrix":[5,6], "x":3.75, "y":5.25, "w":6.25},
{"matrix":[5,10], "x":10, "y":5.25, "w":1.25},
{"matrix":[5,11], "x":11.25, "y":5.25, "w":1.25},
{"matrix":[5,12], "x":12.5, "y":5.25, "w":1.25},
{"matrix":[5,13], "x":13.75, "y":5.25, "w":1.25},
{"matrix":[5,14], "x":15.25, "y":5.25},
{"matrix":[5,15], "x":16.25, "y":5.25},
{"matrix":[5,16], "x":17.25, "y":5.25},
{"matrix":[5,17], "x":18.5, "y":5.25, "w":2},
{"matrix":[5,18], "x":20.5, "y":5.25}
]
}
}
}
Loading
Loading