forked from forks/qmk_firmware
owlet60 working oled and led firmware
This commit is contained in:
parent
4cf92670bb
commit
27f9465aab
254
keyboards/handwired/owlet60/config.h
Normal file
254
keyboards/handwired/owlet60/config.h
Normal file
|
@ -0,0 +1,254 @@
|
|||
/*
|
||||
Copyright 2019 worthlessowl
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "config_common.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0xFEED
|
||||
#define PRODUCT_ID 0xDA19
|
||||
#define DEVICE_VER 0x0001
|
||||
#define MANUFACTURER worthlessowl
|
||||
#define PRODUCT Owlet60
|
||||
#define DESCRIPTION TGR Alice inspired 65 or 60 percent keyboard
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 9
|
||||
#define MATRIX_COLS 8
|
||||
|
||||
/*
|
||||
* Keyboard Matrix Assignments
|
||||
*
|
||||
* Change this to how you wired your keyboard
|
||||
* COLS: AVR pins used for columns, left to right
|
||||
* ROWS: AVR pins used for rows, top to bottom
|
||||
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
|
||||
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
|
||||
*
|
||||
*/
|
||||
#define MATRIX_ROW_PINS {B5, F4, F5, F6, F7, B1, B3, B2, B6}
|
||||
#define MATRIX_COL_SELECT_PINS {D7, B4, E6}
|
||||
#define MATRIX_COL_DATA_PIN {C6}
|
||||
#define MATRIX_COL_PINS {}
|
||||
|
||||
/* COL2ROW, ROW2COL*/
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
|
||||
/*
|
||||
* Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN.
|
||||
*/
|
||||
//#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6
|
||||
|
||||
//#define BACKLIGHT_PIN D3
|
||||
//#define BACKLIGHT_BREATHING
|
||||
//#define BACKLIGHT_LEVELS 3
|
||||
|
||||
#ifdef OLED_ENABLE
|
||||
#define SSD1306OLED
|
||||
#endif
|
||||
|
||||
#define RGB_DI_PIN D0
|
||||
#ifdef RGB_DI_PIN
|
||||
#define RGBLED_NUM 8
|
||||
#define RGBLIGHT_HUE_STEP 8
|
||||
#define RGBLIGHT_SAT_STEP 8
|
||||
#define RGBLIGHT_VAL_STEP 8
|
||||
#define RGBLIGHT_LIMIT_VAL 128 /* The maximum brightness level */
|
||||
#define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */
|
||||
/*== all animations enable ==*/
|
||||
#define RGBLIGHT_ANIMATIONS
|
||||
// /*== or choose animations ==*/
|
||||
// #define RGBLIGHT_EFFECT_BREATHING
|
||||
// #define RGBLIGHT_EFFECT_RAINBOW_MOOD
|
||||
// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL
|
||||
// #define RGBLIGHT_EFFECT_SNAKE
|
||||
// #define RGBLIGHT_EFFECT_KNIGHT
|
||||
// #define RGBLIGHT_EFFECT_CHRISTMAS
|
||||
// #define RGBLIGHT_EFFECT_STATIC_GRADIENT
|
||||
// #define RGBLIGHT_EFFECT_RGB_TEST
|
||||
// #define RGBLIGHT_EFFECT_ALTERNATING
|
||||
// /*== customize breathing effect ==*/
|
||||
// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/
|
||||
// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64
|
||||
// /*==== use exp() and sin() ====*/
|
||||
// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7
|
||||
// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255
|
||||
#endif
|
||||
|
||||
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
||||
#define DEBOUNCE 9
|
||||
|
||||
/* define if matrix has ghost (lacks anti-ghosting diodes) */
|
||||
//#define MATRIX_HAS_GHOST
|
||||
|
||||
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||
//#define LOCKING_SUPPORT_ENABLE
|
||||
/* Locking resynchronize hack */
|
||||
//#define LOCKING_RESYNC_ENABLE
|
||||
|
||||
/* If defined, GRAVE_ESC will always act as ESC when CTRL is held.
|
||||
* This is userful for the Windows task manager shortcut (ctrl+shift+esc).
|
||||
*/
|
||||
// #define GRAVE_ESC_CTRL_OVERRIDE
|
||||
|
||||
/*
|
||||
* Force NKRO
|
||||
*
|
||||
* Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
|
||||
* state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
|
||||
* makefile for this to work.)
|
||||
*
|
||||
* If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
|
||||
* until the next keyboard reset.
|
||||
*
|
||||
* NKRO may prevent your keystrokes from being detected in the BIOS, but it is
|
||||
* fully operational during normal computer usage.
|
||||
*
|
||||
* For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
|
||||
* or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
|
||||
* bootmagic, NKRO mode will always be enabled until it is toggled again during a
|
||||
* power-up.
|
||||
*
|
||||
*/
|
||||
//#define FORCE_NKRO
|
||||
|
||||
/*
|
||||
* Magic Key Options
|
||||
*
|
||||
* Magic keys are hotkey commands that allow control over firmware functions of
|
||||
* the keyboard. They are best used in combination with the HID Listen program,
|
||||
* found here: https://www.pjrc.com/teensy/hid_listen.html
|
||||
*
|
||||
* The options below allow the magic key functionality to be changed. This is
|
||||
* useful if your keyboard/keypad is missing keys and you want magic key support.
|
||||
*
|
||||
*/
|
||||
|
||||
/* key combination for magic key command */
|
||||
/* defined by default; to change, uncomment and set to the combination you want */
|
||||
// #define IS_COMMAND() (get_mods() == MOD_MASK_SHIFT)
|
||||
|
||||
/* control how magic key switches layers */
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
|
||||
|
||||
/* override magic key keymap */
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
|
||||
//#define MAGIC_KEY_HELP H
|
||||
//#define MAGIC_KEY_HELP_ALT SLASH
|
||||
//#define MAGIC_KEY_DEBUG D
|
||||
//#define MAGIC_KEY_DEBUG_MATRIX X
|
||||
//#define MAGIC_KEY_DEBUG_KBD K
|
||||
//#define MAGIC_KEY_DEBUG_MOUSE M
|
||||
//#define MAGIC_KEY_VERSION V
|
||||
//#define MAGIC_KEY_STATUS S
|
||||
//#define MAGIC_KEY_CONSOLE C
|
||||
//#define MAGIC_KEY_LAYER0 0
|
||||
//#define MAGIC_KEY_LAYER0_ALT GRAVE
|
||||
//#define MAGIC_KEY_LAYER1 1
|
||||
//#define MAGIC_KEY_LAYER2 2
|
||||
//#define MAGIC_KEY_LAYER3 3
|
||||
//#define MAGIC_KEY_LAYER4 4
|
||||
//#define MAGIC_KEY_LAYER5 5
|
||||
//#define MAGIC_KEY_LAYER6 6
|
||||
//#define MAGIC_KEY_LAYER7 7
|
||||
//#define MAGIC_KEY_LAYER8 8
|
||||
//#define MAGIC_KEY_LAYER9 9
|
||||
//#define MAGIC_KEY_BOOTLOADER B
|
||||
//#define MAGIC_KEY_BOOTLOADER_ALT ESC
|
||||
//#define MAGIC_KEY_LOCK CAPS
|
||||
//#define MAGIC_KEY_EEPROM E
|
||||
//#define MAGIC_KEY_EEPROM_CLEAR BSPACE
|
||||
//#define MAGIC_KEY_NKRO N
|
||||
//#define MAGIC_KEY_SLEEP_LED Z
|
||||
|
||||
/*
|
||||
* Feature disable options
|
||||
* These options are also useful to firmware size reduction.
|
||||
*/
|
||||
|
||||
/* disable debug print */
|
||||
//#define NO_DEBUG
|
||||
|
||||
/* disable print */
|
||||
//#define NO_PRINT
|
||||
|
||||
/* disable action features */
|
||||
//#define NO_ACTION_LAYER
|
||||
//#define NO_ACTION_TAPPING
|
||||
//#define NO_ACTION_ONESHOT
|
||||
//#define NO_ACTION_MACRO
|
||||
//#define NO_ACTION_FUNCTION
|
||||
|
||||
/*
|
||||
* MIDI options
|
||||
*/
|
||||
|
||||
/* Prevent use of disabled MIDI features in the keymap */
|
||||
//#define MIDI_ENABLE_STRICT 1
|
||||
|
||||
/* enable basic MIDI features:
|
||||
- MIDI notes can be sent when in Music mode is on
|
||||
*/
|
||||
//#define MIDI_BASIC
|
||||
|
||||
/* enable advanced MIDI features:
|
||||
- MIDI notes can be added to the keymap
|
||||
- Octave shift and transpose
|
||||
- Virtual sustain, portamento, and modulation wheel
|
||||
- etc.
|
||||
*/
|
||||
//#define MIDI_ADVANCED
|
||||
|
||||
/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
|
||||
//#define MIDI_TONE_KEYCODE_OCTAVES 1
|
||||
|
||||
/*
|
||||
* HD44780 LCD Display Configuration
|
||||
*/
|
||||
/*
|
||||
#define LCD_LINES 2 //< number of visible lines of the display
|
||||
#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display
|
||||
|
||||
#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode
|
||||
|
||||
#if LCD_IO_MODE
|
||||
#define LCD_PORT PORTB //< port for the LCD lines
|
||||
#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0
|
||||
#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1
|
||||
#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2
|
||||
#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3
|
||||
#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0
|
||||
#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1
|
||||
#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2
|
||||
#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3
|
||||
#define LCD_RS_PORT LCD_PORT //< port for RS line
|
||||
#define LCD_RS_PIN 3 //< pin for RS line
|
||||
#define LCD_RW_PORT LCD_PORT //< port for RW line
|
||||
#define LCD_RW_PIN 2 //< pin for RW line
|
||||
#define LCD_E_PORT LCD_PORT //< port for Enable line
|
||||
#define LCD_E_PIN 1 //< pin for Enable line
|
||||
#endif
|
||||
*/
|
||||
|
||||
/* Bootmagic Lite key configuration */
|
||||
// #define BOOTMAGIC_LITE_ROW 0
|
||||
// #define BOOTMAGIC_LITE_COLUMN 0
|
13
keyboards/handwired/owlet60/info.json
Normal file
13
keyboards/handwired/owlet60/info.json
Normal file
|
@ -0,0 +1,13 @@
|
|||
{"keyboard_name": "Owlet60",
|
||||
"url": "https://https://qmk.fm/keyboards/",
|
||||
"maintainer": "qmk",
|
||||
"width": 19.5,
|
||||
"height": 5,
|
||||
"layouts": {
|
||||
"LAYOUT_owlet60_full_bsp": {
|
||||
"key_count": 72,
|
||||
"layout": [{"label":"1", "x":0.5, "y":0}, {"label":"~", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9.75, "y":0}, {"label":"*", "x":10.75, "y":0}, {"label":"(", "x":11.75, "y":0}, {"label":")", "x":12.75, "y":0}, {"label":"_", "x":13.75, "y":0}, {"label":"+", "x":14.75, "y":0}, {"label":"Backspace", "x":15.75, "y":0, "w":2}, {"label":"PgUp", "x":17.75, "y":0}, {"label":"2", "x":0.25, "y":1}, {"label":"Tab", "x":1.75, "y":1, "w":1.5}, {"label":"Q", "x":3.25, "y":1}, {"label":"W", "x":4.25, "y":1}, {"label":"E", "x":5.25, "y":1}, {"label":"R", "x":6.25, "y":1}, {"label":"T", "x":7.25, "y":1}, {"label":"Y", "x":9.5, "y":1}, {"label":"U", "x":10.5, "y":1}, {"label":"I", "x":11.5, "y":1}, {"label":"O", "x":12.5, "y":1}, {"label":"P", "x":13.5, "y":1}, {"label":"{", "x":14.5, "y":1}, {"label":"}", "x":15.5, "y":1}, {"label":"|", "x":16.5, "y":1, "w":1.5}, {"label":"PgDn", "x":18, "y":1}, {"label":"3", "x":0, "y":2}, {"label":"Caps Lock", "x":1.5, "y":2, "w":1.75}, {"label":"A", "x":3.25, "y":2}, {"label":"S", "x":4.25, "y":2}, {"label":"D", "x":5.25, "y":2}, {"label":"F", "x":6.25, "y":2}, {"label":"G", "x":7.25, "y":2}, {"label":"H", "x":10, "y":2}, {"label":"J", "x":11, "y":2}, {"label":"K", "x":12, "y":2}, {"label":"L", "x":13, "y":2}, {"label":":", "x":14, "y":2}, {"label":"\"", "x":15, "y":2}, {"label":"Enter", "x":16, "y":2, "w":2.25}, {"label":"Home", "x":18.25, "y":2}, {"label":"Shift", "x":1.25, "y":3, "w":2.25}, {"label":"Z", "x":3.5, "y":3}, {"label":"X", "x":4.5, "y":3}, {"label":"C", "x":5.5, "y":3}, {"label":"V", "x":6.5, "y":3}, {"label":"B", "x":7.5, "y":3}, {"label":"B", "x":9.75, "y":3}, {"label":"N", "x":10.75, "y":3}, {"label":"M", "x":11.75, "y":3}, {"label":"<", "x":12.75, "y":3}, {"label":">", "x":13.75, "y":3}, {"label":"?", "x":14.75, "y":3}, {"label":"Shift", "x":15.75, "y":3, "w":1.75}, {"label":"Up", "x":17.5, "y":3}, {"label":"End", "x":18.5, "y":3}, {"label":"Ctrl", "x":1.25, "y":4, "w":1.5}, {"label":"Alt", "x":4.5, "y":4, "w":1.5}, {"x":6, "y":4, "w":2}, {"label":"Fn", "x":8, "y":4, "w":1.25}, {"x":9.75, "y":4, "w":2.75}, {"label":"Alt", "x":12.5, "y":4, "w":1.5}, {"label":"Left", "x":16.5, "y":4}, {"label":"Down", "x":17.5, "y":4}, {"label":"Right", "x":18.5, "y":4}]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
93
keyboards/handwired/owlet60/keymaps/default/keymap.c
Normal file
93
keyboards/handwired/owlet60/keymaps/default/keymap.c
Normal file
|
@ -0,0 +1,93 @@
|
|||
/* Copyright 2019 worthlessowl
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
// Defines the keycodes used by our macros in process_record_user
|
||||
enum custom_keycodes {
|
||||
QMKBEST = SAFE_RANGE,
|
||||
QMKURL
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[0] = LAYOUT_owlet60_full_bsp(
|
||||
KC_1, KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_PGUP, \
|
||||
KC_2, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGDOWN, \
|
||||
KC_3, KC_CAPS,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, KC_HOME, \
|
||||
KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, \
|
||||
KC_LCTRL, KC_LALT, KC_SPC, MO(1),KC_SPC, KC_RALT, KC_LEFT, KC_DOWN, KC_RIGHT \
|
||||
),
|
||||
|
||||
[1] = LAYOUT_owlet60_full_bsp(
|
||||
KC_NO, KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, RGB_TOG, \
|
||||
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RGB_MOD, \
|
||||
KC_NO, KC_NO,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,KC_NO, KC_NO, RGB_VAI, \
|
||||
KC_TRNS,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_N, KC_NO, KC_NO,KC_NO, KC_NO, KC_NO, KC_TRNS, RGB_VAD, \
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \
|
||||
)
|
||||
};
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
case QMKBEST:
|
||||
if (record->event.pressed) {
|
||||
// when keycode QMKBEST is pressed
|
||||
SEND_STRING("QMK is the best thing ever!");
|
||||
} else {
|
||||
// when keycode QMKBEST is released
|
||||
}
|
||||
break;
|
||||
case QMKURL:
|
||||
if (record->event.pressed) {
|
||||
// when keycode QMKURL is pressed
|
||||
SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER));
|
||||
} else {
|
||||
// when keycode QMKURL is released
|
||||
}
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void matrix_init_user(void) {
|
||||
|
||||
}
|
||||
|
||||
void matrix_scan_user(void) {
|
||||
|
||||
}
|
||||
|
||||
void led_set_user(uint8_t usb_led) {
|
||||
|
||||
}
|
||||
|
||||
#ifdef OLED_DRIVER_ENABLE
|
||||
void oled_task_user(void) {
|
||||
// Host Keyboard Layer Status
|
||||
oled_write_P(PSTR("Lyr: "), false);
|
||||
switch (get_highest_layer(layer_state)) {
|
||||
case 0:
|
||||
oled_write_P(PSTR("Alpha\n"), false);
|
||||
break;
|
||||
case 1:
|
||||
oled_write_P(PSTR("FN\n"), false);
|
||||
break;
|
||||
default:
|
||||
// Or use the write_ln shortcut over adding '\n' to the end of your string
|
||||
oled_write_ln_P(PSTR("Undefined"), false);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
19
keyboards/handwired/owlet60/keymaps/hc4051/config.h
Normal file
19
keyboards/handwired/owlet60/keymaps/hc4051/config.h
Normal file
|
@ -0,0 +1,19 @@
|
|||
/* Copyright 2019 worthlessowl
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
// place overrides here
|
1
keyboards/handwired/owlet60/keymaps/hc4051/readme.md
Normal file
1
keyboards/handwired/owlet60/keymaps/hc4051/readme.md
Normal file
|
@ -0,0 +1 @@
|
|||
# The default keymap for owlet60
|
320
keyboards/handwired/owlet60/matrix.c
Normal file
320
keyboards/handwired/owlet60/matrix.c
Normal file
|
@ -0,0 +1,320 @@
|
|||
/*
|
||||
Copyright 2012 Jun Wako <wakojun@gmail.com>
|
||||
Copyright 2017 Cole Markham <cole@ccmcomputing.net>
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*
|
||||
* scan matrix
|
||||
*/
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include "owlet60.h"
|
||||
#include "wait.h"
|
||||
#include "print.h"
|
||||
#include "debug.h"
|
||||
#include "util.h"
|
||||
#include "matrix.h"
|
||||
#include "config.h"
|
||||
#include "timer.h"
|
||||
|
||||
#if (MATRIX_COLS <= 8)
|
||||
# define print_matrix_header() print("\nr/c 01234567\n")
|
||||
# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row))
|
||||
# define matrix_bitpop(i) bitpop(matrix[i])
|
||||
# define ROW_SHIFTER ((uint8_t)1)
|
||||
#elif (MATRIX_COLS <= 16)
|
||||
# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n")
|
||||
# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row))
|
||||
# define matrix_bitpop(i) bitpop16(matrix[i])
|
||||
# define ROW_SHIFTER ((uint16_t)1)
|
||||
#elif (MATRIX_COLS <= 32)
|
||||
# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n")
|
||||
# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row))
|
||||
# define matrix_bitpop(i) bitpop32(matrix[i])
|
||||
# define ROW_SHIFTER ((uint32_t)1)
|
||||
#endif
|
||||
|
||||
static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
|
||||
static const uint8_t col_select_pins[3] = MATRIX_COL_SELECT_PINS;
|
||||
static const uint8_t dat_pin = MATRIX_COL_DATA_PIN;
|
||||
|
||||
/* matrix state(1:on, 0:off) */
|
||||
static matrix_row_t raw_matrix[MATRIX_ROWS]; //raw values
|
||||
static matrix_row_t matrix[MATRIX_ROWS]; //raw values
|
||||
|
||||
static void select_col_manual(uint8_t col);
|
||||
void debounce_init(uint8_t num_rows);
|
||||
void debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed);
|
||||
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_init_user(void) {}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_scan_user(void) {}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_init_kb(void) {
|
||||
matrix_init_user();
|
||||
}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_scan_kb(void) {
|
||||
matrix_scan_user();
|
||||
}
|
||||
|
||||
inline
|
||||
uint8_t matrix_rows(void)
|
||||
{
|
||||
return MATRIX_ROWS;
|
||||
}
|
||||
|
||||
inline
|
||||
uint8_t matrix_cols(void)
|
||||
{
|
||||
return MATRIX_COLS;
|
||||
}
|
||||
|
||||
inline
|
||||
bool matrix_is_on(uint8_t row, uint8_t col)
|
||||
{
|
||||
return (matrix[row] & ((matrix_row_t)1<<col));
|
||||
}
|
||||
|
||||
inline
|
||||
matrix_row_t matrix_get_row(uint8_t row)
|
||||
{
|
||||
// Matrix mask lets you disable switches in the returned matrix data. For example, if you have a
|
||||
// switch blocker installed and the switch is always pressed.
|
||||
#ifdef MATRIX_MASKED
|
||||
return matrix[row] & matrix_mask[row];
|
||||
#else
|
||||
return matrix[row];
|
||||
#endif
|
||||
}
|
||||
|
||||
void matrix_print(void)
|
||||
{
|
||||
print_matrix_header();
|
||||
|
||||
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
|
||||
phex(row); print(": ");
|
||||
print_matrix_row(row);
|
||||
print("\n");
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t matrix_key_count(void)
|
||||
{
|
||||
uint8_t count = 0;
|
||||
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
||||
count += matrix_bitpop(i);
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
// uses standard row code
|
||||
static void select_row(uint8_t row)
|
||||
{
|
||||
setPinOutput(row_pins[row]);
|
||||
writePinLow(row_pins[row]);
|
||||
}
|
||||
|
||||
static void unselect_row(uint8_t row)
|
||||
{
|
||||
setPinInputHigh(row_pins[row]);
|
||||
}
|
||||
|
||||
static void unselect_rows(void)
|
||||
{
|
||||
for(uint8_t x = 0; x < MATRIX_ROWS; x++) {
|
||||
setPinInputHigh(row_pins[x]);
|
||||
}
|
||||
}
|
||||
|
||||
static void init_pins(void) { // still need some fixing, this might not work
|
||||
unselect_rows(); // with the loop
|
||||
/*
|
||||
for (uint8_t x = 0; x < MATRIX_COLS; x++) {
|
||||
setPinInputHigh(col_pins[x]);
|
||||
}
|
||||
*/
|
||||
setPinInputHigh(dat_pin);
|
||||
}
|
||||
|
||||
static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
|
||||
{
|
||||
// Store last value of row prior to reading
|
||||
matrix_row_t last_row_value = current_matrix[current_row];
|
||||
|
||||
// Clear data in matrix row
|
||||
current_matrix[current_row] = 0;
|
||||
|
||||
// Select row and wait for row selecton to stabilize
|
||||
select_row(current_row);
|
||||
wait_us(30);
|
||||
|
||||
// For each col...
|
||||
for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
|
||||
|
||||
// Select the col pin to read (active low)
|
||||
select_col_manual(col_index);
|
||||
wait_us(30);
|
||||
uint8_t pin_state = readPin(dat_pin);
|
||||
|
||||
// Populate the matrix row with the state of the col pin
|
||||
current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index);
|
||||
}
|
||||
|
||||
// Unselect row
|
||||
unselect_row(current_row);
|
||||
|
||||
return (last_row_value != current_matrix[current_row]);
|
||||
}
|
||||
|
||||
|
||||
void matrix_init(void) {
|
||||
|
||||
// initialize key pins
|
||||
init_pins();
|
||||
|
||||
// initialize matrix state: all keys off
|
||||
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
||||
raw_matrix[i] = 0;
|
||||
matrix[i] = 0;
|
||||
}
|
||||
|
||||
debounce_init(MATRIX_ROWS);
|
||||
|
||||
matrix_init_quantum();
|
||||
|
||||
DDRD &= ~(1<<5);
|
||||
PORTD &= ~(1<<5);
|
||||
|
||||
DDRB &= ~(1<<0);
|
||||
PORTB &= ~(1<<0);
|
||||
}
|
||||
|
||||
// modified for per col read matrix scan
|
||||
uint8_t matrix_scan(void)
|
||||
{
|
||||
bool changed = false;
|
||||
|
||||
for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) {
|
||||
changed |= read_cols_on_row(raw_matrix, current_row);
|
||||
}
|
||||
|
||||
debounce(raw_matrix, matrix, MATRIX_ROWS, changed);
|
||||
|
||||
matrix_scan_quantum();
|
||||
return (uint8_t)changed;
|
||||
}
|
||||
|
||||
/*
|
||||
uint8_t matrix_scan(void)
|
||||
{
|
||||
bool changed = false;
|
||||
|
||||
#if (DIODE_DIRECTION == COL2ROW)
|
||||
// Set row, read cols
|
||||
for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) {
|
||||
changed |= read_cols_on_row(raw_matrix, current_row);
|
||||
}
|
||||
#endif
|
||||
|
||||
debounce(raw_matrix, matrix, MATRIX_ROWS, changed);
|
||||
|
||||
matrix_scan_quantum();
|
||||
return (uint8_t)changed;
|
||||
}
|
||||
*/
|
||||
|
||||
static void select_col_manual(uint8_t col) {
|
||||
// emergency code, just a simple switch statement
|
||||
|
||||
if(col == 0)
|
||||
{
|
||||
setPinOutput(col_select_pins[0]);
|
||||
writePinLow(col_select_pins[0]);
|
||||
setPinOutput(col_select_pins[1]);
|
||||
writePinLow(col_select_pins[1]);
|
||||
setPinOutput(col_select_pins[2]);
|
||||
writePinLow(col_select_pins[2]);
|
||||
}
|
||||
|
||||
else if(col == 1)
|
||||
{
|
||||
setPinOutput(col_select_pins[0]);
|
||||
writePinHigh(col_select_pins[0]);
|
||||
setPinOutput(col_select_pins[1]);
|
||||
writePinLow(col_select_pins[1]);
|
||||
setPinOutput(col_select_pins[2]);
|
||||
writePinLow(col_select_pins[2]);
|
||||
}
|
||||
else if(col == 2)
|
||||
{
|
||||
setPinOutput(col_select_pins[0]);
|
||||
writePinLow(col_select_pins[0]);
|
||||
setPinOutput(col_select_pins[1]);
|
||||
writePinHigh(col_select_pins[1]);
|
||||
setPinOutput(col_select_pins[2]);
|
||||
writePinLow(col_select_pins[2]);
|
||||
}
|
||||
else if(col == 3)
|
||||
{
|
||||
setPinOutput(col_select_pins[0]);
|
||||
writePinHigh(col_select_pins[0]);
|
||||
setPinOutput(col_select_pins[1]);
|
||||
writePinHigh(col_select_pins[1]);
|
||||
setPinOutput(col_select_pins[2]);
|
||||
writePinLow(col_select_pins[2]);
|
||||
}
|
||||
else if(col == 4)
|
||||
{
|
||||
setPinOutput(col_select_pins[0]);
|
||||
writePinLow(col_select_pins[0]);
|
||||
setPinOutput(col_select_pins[1]);
|
||||
writePinLow(col_select_pins[1]);
|
||||
setPinOutput(col_select_pins[2]);
|
||||
writePinHigh(col_select_pins[2]);
|
||||
}
|
||||
else if(col == 5)
|
||||
{
|
||||
setPinOutput(col_select_pins[0]);
|
||||
writePinHigh(col_select_pins[0]);
|
||||
setPinOutput(col_select_pins[1]);
|
||||
writePinLow(col_select_pins[1]);
|
||||
setPinOutput(col_select_pins[2]);
|
||||
writePinHigh(col_select_pins[2]);
|
||||
}
|
||||
else if(col == 6)
|
||||
{
|
||||
setPinOutput(col_select_pins[0]);
|
||||
writePinLow(col_select_pins[0]);
|
||||
setPinOutput(col_select_pins[1]);
|
||||
writePinHigh(col_select_pins[1]);
|
||||
setPinOutput(col_select_pins[2]);
|
||||
writePinHigh(col_select_pins[2]);
|
||||
}
|
||||
|
||||
else if(col == 7)
|
||||
{
|
||||
setPinOutput(col_select_pins[0]);
|
||||
writePinHigh(col_select_pins[0]);
|
||||
setPinOutput(col_select_pins[1]);
|
||||
writePinHigh(col_select_pins[1]);
|
||||
setPinOutput(col_select_pins[2]);
|
||||
writePinHigh(col_select_pins[2]);
|
||||
}
|
||||
|
||||
}
|
51
keyboards/handwired/owlet60/owlet60.c
Normal file
51
keyboards/handwired/owlet60/owlet60.c
Normal file
|
@ -0,0 +1,51 @@
|
|||
/* Copyright 2019 worthlessowl
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "owlet60.h"
|
||||
|
||||
// Optional override functions below.
|
||||
// You can leave any or all of these undefined.
|
||||
// These are only required if you want to perform custom actions.
|
||||
|
||||
/*
|
||||
|
||||
void matrix_init_kb(void) {
|
||||
// put your keyboard start-up code here
|
||||
// runs once when the firmware starts up
|
||||
|
||||
matrix_init_user();
|
||||
}
|
||||
|
||||
void matrix_scan_kb(void) {
|
||||
// put your looping keyboard code here
|
||||
// runs every cycle (a lot)
|
||||
|
||||
matrix_scan_user();
|
||||
}
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
// put your per-action keyboard code here
|
||||
// runs for every action, just before processing by the firmware
|
||||
|
||||
return process_record_user(keycode, record);
|
||||
}
|
||||
|
||||
void led_set_kb(uint8_t usb_led) {
|
||||
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
|
||||
|
||||
led_set_user(usb_led);
|
||||
}
|
||||
|
||||
*/
|
63
keyboards/handwired/owlet60/owlet60.h
Normal file
63
keyboards/handwired/owlet60/owlet60.h
Normal file
|
@ -0,0 +1,63 @@
|
|||
/* Copyright 2019 worthlessowl
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
/* This a shortcut to help you visually see your layout.
|
||||
*
|
||||
* The first section contains all of the arguments representing the physical
|
||||
* layout of the board and position of the keys.
|
||||
*
|
||||
* The second converts the arguments into a two-dimensional array which
|
||||
* represents the switch matrix.
|
||||
*/
|
||||
#define LAYOUT_owlet60_all( \
|
||||
k50, k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, k0f, \
|
||||
k51, k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, \
|
||||
k52, k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, \
|
||||
k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e, \
|
||||
k40, k41, k42, k43, k44, k45, k46, k47, k48 \
|
||||
) { \
|
||||
{ k07, k11, k13, k15, k50, k19, k1b, k1d}, \
|
||||
{ k17, k21, k23, k25, k51, k29, k2b, k3d}, \
|
||||
{ k27, k31, k33, k35, k52, k39, k3b, k47}, \
|
||||
{ k37, k41, k42, k43, k40, k45, k46, k48}, \
|
||||
{ k38, k32, k34, k44, k30, k3a, k3c, k3e}, \
|
||||
{ k28, k22, k24, k36, k20, k2a, k2c, k2d}, \
|
||||
{ k18, k12, k14, k26, k10, k1a, k1c, k1e}, \
|
||||
{ k08, k02, k04, k16, k00, k0a, k0c, k0f}, \
|
||||
{ k09, k03, k05, k06, k01, k0b, k0d, k0e} \
|
||||
}
|
||||
|
||||
// swap col 1 with col 5, rearrange col 8
|
||||
#define LAYOUT_owlet60_full_bsp( \
|
||||
k50, k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0f, \
|
||||
k51, k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, \
|
||||
k52, k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, \
|
||||
k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e, \
|
||||
k40, k41, k42, k43, k44, k45, k46, k47, k48 \
|
||||
) { \
|
||||
{ k50, k11, k13, k15, k07, k19, k1b, k1d}, \
|
||||
{ k51, k21, k23, k25, k17, k29, k2b, k3d}, \
|
||||
{ k52, k31, k33, k35, k27, k39, k3b, k47}, \
|
||||
{ k40, k41, k42, k43, k37, k45, k46, k48}, \
|
||||
{ k30, k32, k34, k44, k38, k3a, k3c, k3e}, \
|
||||
{ k20, k22, k24, k36, k28, k2a, k2c, k2d}, \
|
||||
{ k10, k12, k14, k26, k18, k1a, k1c, k1e}, \
|
||||
{ k00, k02, k04, k16, k08, k0a, k0c, k0f}, \
|
||||
{ k01, k03, k05, k06, k09, k0b, k0d, KC_NO} \
|
||||
}
|
15
keyboards/handwired/owlet60/readme.md
Normal file
15
keyboards/handwired/owlet60/readme.md
Normal file
|
@ -0,0 +1,15 @@
|
|||
# owlet60
|
||||
|
||||
![owlet60](imgur.com image replace me!)
|
||||
|
||||
A short description of the keyboard/project
|
||||
|
||||
Keyboard Maintainer: [worthlessowl](https://github.com/yourusername)
|
||||
Hardware Supported: The PCBs, controllers supported
|
||||
Hardware Availability: links to where you can find this hardware
|
||||
|
||||
Make example for this keyboard (after setting up your build environment):
|
||||
|
||||
make owlet60:default
|
||||
|
||||
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
|
49
keyboards/handwired/owlet60/rules.mk
Normal file
49
keyboards/handwired/owlet60/rules.mk
Normal file
|
@ -0,0 +1,49 @@
|
|||
SRC += matrix.c
|
||||
SRC += ssd1306.c
|
||||
|
||||
# MCU name
|
||||
MCU = atmega32u4
|
||||
|
||||
|
||||
# Bootloader selection
|
||||
# Teensy halfkay
|
||||
# Pro Micro caterina
|
||||
# Atmel DFU atmel-dfu
|
||||
# LUFA DFU lufa-dfu
|
||||
# QMK DFU qmk-dfu
|
||||
# atmega32a bootloadHID
|
||||
BOOTLOADER = caterina
|
||||
|
||||
|
||||
# If you don't know the bootloader type, then you can specify the
|
||||
# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
# OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
|
||||
# Build Options
|
||||
# change yes to no to disable
|
||||
#
|
||||
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE = no # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE = no # Console for debug(+400)
|
||||
COMMAND_ENABLE = no # Commands for debug and configuration
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
NKRO_ENABLE = yes # USB Nkey Rollover
|
||||
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
||||
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
|
||||
MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config)
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
AUDIO_ENABLE = no # Audio output on port C6
|
||||
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
|
||||
HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400)
|
||||
CUSTOM_MATRIX = yes
|
||||
OLED_DRIVER_ENABLE = yes
|
342
keyboards/handwired/owlet60/ssd1306.c
Normal file
342
keyboards/handwired/owlet60/ssd1306.c
Normal file
|
@ -0,0 +1,342 @@
|
|||
|
||||
#ifdef SSD1306OLED
|
||||
|
||||
#include "ssd1306.h"
|
||||
#include "i2c.h"
|
||||
#include <string.h>
|
||||
#include "print.h"
|
||||
#ifndef LOCAL_GLCDFONT
|
||||
#include "common/glcdfont.c"
|
||||
#else
|
||||
#include <helixfont.h>
|
||||
#endif
|
||||
#ifdef ADAFRUIT_BLE_ENABLE
|
||||
#include "adafruit_ble.h"
|
||||
#endif
|
||||
#ifdef PROTOCOL_LUFA
|
||||
#include "lufa.h"
|
||||
#endif
|
||||
#include "sendchar.h"
|
||||
#include "timer.h"
|
||||
|
||||
// Set this to 1 to help diagnose early startup problems
|
||||
// when testing power-on with ble. Turn it off otherwise,
|
||||
// as the latency of printing most of the debug info messes
|
||||
// with the matrix scan, causing keys to drop.
|
||||
#define DEBUG_TO_SCREEN 0
|
||||
|
||||
//static uint16_t last_battery_update;
|
||||
//static uint32_t vbat;
|
||||
//#define BatteryUpdateInterval 10000 /* milliseconds */
|
||||
|
||||
// 'last_flush' is declared as uint16_t,
|
||||
// so this must be less than 65535
|
||||
#define ScreenOffInterval 60000 /* milliseconds */
|
||||
#if DEBUG_TO_SCREEN
|
||||
static uint8_t displaying;
|
||||
#endif
|
||||
static uint16_t last_flush;
|
||||
|
||||
static bool force_dirty = true;
|
||||
|
||||
// Write command sequence.
|
||||
// Returns true on success.
|
||||
static inline bool _send_cmd1(uint8_t cmd) {
|
||||
bool res = false;
|
||||
|
||||
if (i2c_start_write(SSD1306_ADDRESS)) {
|
||||
xprintf("failed to start write to %d\n", SSD1306_ADDRESS);
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (i2c_master_write(0x0 /* command byte follows */)) {
|
||||
print("failed to write control byte\n");
|
||||
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (i2c_master_write(cmd)) {
|
||||
xprintf("failed to write command %d\n", cmd);
|
||||
goto done;
|
||||
}
|
||||
res = true;
|
||||
done:
|
||||
i2c_master_stop();
|
||||
return res;
|
||||
}
|
||||
|
||||
// Write 2-byte command sequence.
|
||||
// Returns true on success
|
||||
static inline bool _send_cmd2(uint8_t cmd, uint8_t opr) {
|
||||
if (!_send_cmd1(cmd)) {
|
||||
return false;
|
||||
}
|
||||
return _send_cmd1(opr);
|
||||
}
|
||||
|
||||
// Write 3-byte command sequence.
|
||||
// Returns true on success
|
||||
static inline bool _send_cmd3(uint8_t cmd, uint8_t opr1, uint8_t opr2) {
|
||||
if (!_send_cmd1(cmd)) {
|
||||
return false;
|
||||
}
|
||||
if (!_send_cmd1(opr1)) {
|
||||
return false;
|
||||
}
|
||||
return _send_cmd1(opr2);
|
||||
}
|
||||
|
||||
#define send_cmd1(c) if (!_send_cmd1(c)) {goto done;}
|
||||
#define send_cmd2(c,o) if (!_send_cmd2(c,o)) {goto done;}
|
||||
#define send_cmd3(c,o1,o2) if (!_send_cmd3(c,o1,o2)) {goto done;}
|
||||
|
||||
static void clear_display(void) {
|
||||
matrix_clear(&display);
|
||||
|
||||
// Clear all of the display bits (there can be random noise
|
||||
// in the RAM on startup)
|
||||
send_cmd3(PageAddr, 0, (DisplayHeight / 8) - 1);
|
||||
send_cmd3(ColumnAddr, 0, DisplayWidth - 1);
|
||||
|
||||
if (i2c_start_write(SSD1306_ADDRESS)) {
|
||||
goto done;
|
||||
}
|
||||
if (i2c_master_write(0x40)) {
|
||||
// Data mode
|
||||
goto done;
|
||||
}
|
||||
for (uint8_t row = 0; row < MatrixRows; ++row) {
|
||||
for (uint8_t col = 0; col < DisplayWidth; ++col) {
|
||||
i2c_master_write(0);
|
||||
}
|
||||
}
|
||||
|
||||
display.dirty = false;
|
||||
|
||||
done:
|
||||
i2c_master_stop();
|
||||
}
|
||||
|
||||
#if DEBUG_TO_SCREEN
|
||||
#undef sendchar
|
||||
static int8_t capture_sendchar(uint8_t c) {
|
||||
sendchar(c);
|
||||
iota_gfx_write_char(c);
|
||||
|
||||
if (!displaying) {
|
||||
iota_gfx_flush();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool iota_gfx_init(bool rotate) {
|
||||
bool success = false;
|
||||
|
||||
i2c_master_init();
|
||||
send_cmd1(DisplayOff);
|
||||
send_cmd2(SetDisplayClockDiv, 0x80);
|
||||
send_cmd2(SetMultiPlex, DisplayHeight - 1);
|
||||
|
||||
send_cmd2(SetDisplayOffset, 0);
|
||||
|
||||
|
||||
send_cmd1(SetStartLine | 0x0);
|
||||
send_cmd2(SetChargePump, 0x14 /* Enable */);
|
||||
send_cmd2(SetMemoryMode, 0 /* horizontal addressing */);
|
||||
|
||||
if(rotate){
|
||||
// the following Flip the display orientation 180 degrees
|
||||
send_cmd1(SegRemap);
|
||||
send_cmd1(ComScanInc);
|
||||
}else{
|
||||
// Flips the display orientation 0 degrees
|
||||
send_cmd1(SegRemap | 0x1);
|
||||
send_cmd1(ComScanDec);
|
||||
}
|
||||
|
||||
send_cmd2(SetComPins, 0x2);
|
||||
send_cmd2(SetContrast, 0x8f);
|
||||
send_cmd2(SetPreCharge, 0xf1);
|
||||
send_cmd2(SetVComDetect, 0x40);
|
||||
send_cmd1(DisplayAllOnResume);
|
||||
send_cmd1(NormalDisplay);
|
||||
send_cmd1(DeActivateScroll);
|
||||
send_cmd1(DisplayOn);
|
||||
|
||||
send_cmd2(SetContrast, 0); // Dim
|
||||
|
||||
clear_display();
|
||||
|
||||
success = true;
|
||||
|
||||
iota_gfx_flush();
|
||||
|
||||
#if DEBUG_TO_SCREEN
|
||||
print_set_sendchar(capture_sendchar);
|
||||
#endif
|
||||
|
||||
done:
|
||||
return success;
|
||||
}
|
||||
|
||||
bool iota_gfx_off(void) {
|
||||
bool success = false;
|
||||
|
||||
send_cmd1(DisplayOff);
|
||||
success = true;
|
||||
|
||||
done:
|
||||
return success;
|
||||
}
|
||||
|
||||
bool iota_gfx_on(void) {
|
||||
bool success = false;
|
||||
|
||||
send_cmd1(DisplayOn);
|
||||
success = true;
|
||||
|
||||
done:
|
||||
return success;
|
||||
}
|
||||
|
||||
void matrix_write_char_inner(struct CharacterMatrix *matrix, uint8_t c) {
|
||||
*matrix->cursor = c;
|
||||
++matrix->cursor;
|
||||
|
||||
if (matrix->cursor - &matrix->display[0][0] == sizeof(matrix->display)) {
|
||||
// We went off the end; scroll the display upwards by one line
|
||||
memmove(&matrix->display[0], &matrix->display[1],
|
||||
MatrixCols * (MatrixRows - 1));
|
||||
matrix->cursor = &matrix->display[MatrixRows - 1][0];
|
||||
memset(matrix->cursor, ' ', MatrixCols);
|
||||
}
|
||||
}
|
||||
|
||||
void matrix_write_char(struct CharacterMatrix *matrix, uint8_t c) {
|
||||
matrix->dirty = true;
|
||||
|
||||
if (c == '\n') {
|
||||
// Clear to end of line from the cursor and then move to the
|
||||
// start of the next line
|
||||
uint8_t cursor_col = (matrix->cursor - &matrix->display[0][0]) % MatrixCols;
|
||||
|
||||
while (cursor_col++ < MatrixCols) {
|
||||
matrix_write_char_inner(matrix, ' ');
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
matrix_write_char_inner(matrix, c);
|
||||
}
|
||||
|
||||
void iota_gfx_write_char(uint8_t c) {
|
||||
matrix_write_char(&display, c);
|
||||
}
|
||||
|
||||
void matrix_write(struct CharacterMatrix *matrix, const char *data) {
|
||||
const char *end = data + strlen(data);
|
||||
while (data < end) {
|
||||
matrix_write_char(matrix, *data);
|
||||
++data;
|
||||
}
|
||||
}
|
||||
|
||||
void iota_gfx_write(const char *data) {
|
||||
matrix_write(&display, data);
|
||||
}
|
||||
|
||||
void matrix_write_P(struct CharacterMatrix *matrix, const char *data) {
|
||||
while (true) {
|
||||
uint8_t c = pgm_read_byte(data);
|
||||
if (c == 0) {
|
||||
return;
|
||||
}
|
||||
matrix_write_char(matrix, c);
|
||||
++data;
|
||||
}
|
||||
}
|
||||
|
||||
void iota_gfx_write_P(const char *data) {
|
||||
matrix_write_P(&display, data);
|
||||
}
|
||||
|
||||
void matrix_clear(struct CharacterMatrix *matrix) {
|
||||
memset(matrix->display, ' ', sizeof(matrix->display));
|
||||
matrix->cursor = &matrix->display[0][0];
|
||||
matrix->dirty = true;
|
||||
}
|
||||
|
||||
void iota_gfx_clear_screen(void) {
|
||||
matrix_clear(&display);
|
||||
}
|
||||
|
||||
void matrix_render(struct CharacterMatrix *matrix) {
|
||||
last_flush = timer_read();
|
||||
iota_gfx_on();
|
||||
#if DEBUG_TO_SCREEN
|
||||
++displaying;
|
||||
#endif
|
||||
|
||||
// Move to the home position
|
||||
send_cmd3(PageAddr, 0, MatrixRows - 1);
|
||||
send_cmd3(ColumnAddr, 0, (MatrixCols * FontWidth) - 1);
|
||||
|
||||
if (i2c_start_write(SSD1306_ADDRESS)) {
|
||||
goto done;
|
||||
}
|
||||
if (i2c_master_write(0x40)) {
|
||||
// Data mode
|
||||
goto done;
|
||||
}
|
||||
|
||||
for (uint8_t row = 0; row < MatrixRows; ++row) {
|
||||
for (uint8_t col = 0; col < MatrixCols; ++col) {
|
||||
const uint8_t *glyph = font + (matrix->display[row][col] * FontWidth);
|
||||
|
||||
for (uint8_t glyphCol = 0; glyphCol < FontWidth; ++glyphCol) {
|
||||
uint8_t colBits = pgm_read_byte(glyph + glyphCol);
|
||||
i2c_master_write(colBits);
|
||||
}
|
||||
|
||||
// 1 column of space between chars (it's not included in the glyph)
|
||||
//i2c_master_write(0);
|
||||
}
|
||||
}
|
||||
|
||||
matrix->dirty = false;
|
||||
|
||||
done:
|
||||
i2c_master_stop();
|
||||
#if DEBUG_TO_SCREEN
|
||||
--displaying;
|
||||
#endif
|
||||
}
|
||||
|
||||
void iota_gfx_flush(void) {
|
||||
matrix_render(&display);
|
||||
}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void iota_gfx_task_user(void) {
|
||||
}
|
||||
|
||||
void iota_gfx_task(void) {
|
||||
iota_gfx_task_user();
|
||||
|
||||
if (display.dirty|| force_dirty) {
|
||||
iota_gfx_flush();
|
||||
force_dirty = false;
|
||||
}
|
||||
|
||||
if (timer_elapsed(last_flush) > ScreenOffInterval) {
|
||||
iota_gfx_off();
|
||||
}
|
||||
}
|
||||
|
||||
bool process_record_gfx(uint16_t keycode, keyrecord_t *record) {
|
||||
force_dirty = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif
|
93
keyboards/handwired/owlet60/ssd1306.h
Normal file
93
keyboards/handwired/owlet60/ssd1306.h
Normal file
|
@ -0,0 +1,93 @@
|
|||
#ifndef SSD1306_H
|
||||
#define SSD1306_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include "pincontrol.h"
|
||||
#include "action.h"
|
||||
|
||||
enum ssd1306_cmds {
|
||||
DisplayOff = 0xAE,
|
||||
DisplayOn = 0xAF,
|
||||
|
||||
SetContrast = 0x81,
|
||||
DisplayAllOnResume = 0xA4,
|
||||
|
||||
DisplayAllOn = 0xA5,
|
||||
NormalDisplay = 0xA6,
|
||||
InvertDisplay = 0xA7,
|
||||
SetDisplayOffset = 0xD3,
|
||||
SetComPins = 0xda,
|
||||
SetVComDetect = 0xdb,
|
||||
SetDisplayClockDiv = 0xD5,
|
||||
SetPreCharge = 0xd9,
|
||||
SetMultiPlex = 0xa8,
|
||||
SetLowColumn = 0x00,
|
||||
SetHighColumn = 0x10,
|
||||
SetStartLine = 0x40,
|
||||
|
||||
SetMemoryMode = 0x20,
|
||||
ColumnAddr = 0x21,
|
||||
PageAddr = 0x22,
|
||||
|
||||
ComScanInc = 0xc0,
|
||||
ComScanDec = 0xc8,
|
||||
SegRemap = 0xa0,
|
||||
SetChargePump = 0x8d,
|
||||
ExternalVcc = 0x01,
|
||||
SwitchCapVcc = 0x02,
|
||||
|
||||
ActivateScroll = 0x2f,
|
||||
DeActivateScroll = 0x2e,
|
||||
SetVerticalScrollArea = 0xa3,
|
||||
RightHorizontalScroll = 0x26,
|
||||
LeftHorizontalScroll = 0x27,
|
||||
VerticalAndRightHorizontalScroll = 0x29,
|
||||
VerticalAndLeftHorizontalScroll = 0x2a,
|
||||
};
|
||||
|
||||
// Controls the SSD1306 128x32 OLED display via i2c
|
||||
|
||||
#ifndef SSD1306_ADDRESS
|
||||
#define SSD1306_ADDRESS 0x3C
|
||||
#endif
|
||||
|
||||
#define DisplayHeight 32
|
||||
#define DisplayWidth 128
|
||||
|
||||
#define FontHeight 8
|
||||
#define FontWidth 6
|
||||
|
||||
#define MatrixRows (DisplayHeight / FontHeight)
|
||||
#define MatrixCols (DisplayWidth / FontWidth)
|
||||
|
||||
struct CharacterMatrix {
|
||||
uint8_t display[MatrixRows][MatrixCols];
|
||||
uint8_t *cursor;
|
||||
bool dirty;
|
||||
};
|
||||
|
||||
struct CharacterMatrix display;
|
||||
|
||||
bool iota_gfx_init(bool rotate);
|
||||
void iota_gfx_task(void);
|
||||
bool iota_gfx_off(void);
|
||||
bool iota_gfx_on(void);
|
||||
void iota_gfx_flush(void);
|
||||
void iota_gfx_write_char(uint8_t c);
|
||||
void iota_gfx_write(const char *data);
|
||||
void iota_gfx_write_P(const char *data);
|
||||
void iota_gfx_clear_screen(void);
|
||||
|
||||
void iota_gfx_task_user(void);
|
||||
|
||||
void matrix_clear(struct CharacterMatrix *matrix);
|
||||
void matrix_write_char_inner(struct CharacterMatrix *matrix, uint8_t c);
|
||||
void matrix_write_char(struct CharacterMatrix *matrix, uint8_t c);
|
||||
void matrix_write(struct CharacterMatrix *matrix, const char *data);
|
||||
void matrix_write_P(struct CharacterMatrix *matrix, const char *data);
|
||||
void matrix_render(struct CharacterMatrix *matrix);
|
||||
|
||||
bool process_record_gfx(uint16_t keycode, keyrecord_t *record);
|
||||
|
||||
#endif
|
|
@ -18,7 +18,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#pragma once
|
||||
|
||||
#include "config_common.h"
|
||||
#include "pro_micro.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0xFEED
|
||||
|
@ -65,7 +64,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#define RGBLIGHT_HUE_STEP 8
|
||||
#define RGBLIGHT_SAT_STEP 8
|
||||
#define RGBLIGHT_VAL_STEP 8
|
||||
#define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */
|
||||
#define RGBLIGHT_LIMIT_VAL 128 /* The maximum brightness level */
|
||||
#define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */
|
||||
/*== all animations enable ==*/
|
||||
#define RGBLIGHT_ANIMATIONS
|
||||
|
@ -91,7 +90,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#define DEBOUNCE 9
|
||||
|
||||
/* define if matrix has ghost (lacks anti-ghosting diodes) */
|
||||
#define MATRIX_HAS_GHOST
|
||||
//#define MATRIX_HAS_GHOST
|
||||
|
||||
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||
//#define LOCKING_SUPPORT_ENABLE
|
||||
|
|
22
keyboards/owlet60/keymaps/oled_testing/config.h
Normal file
22
keyboards/owlet60/keymaps/oled_testing/config.h
Normal file
|
@ -0,0 +1,22 @@
|
|||
/* Copyright 2019 worthlessowl
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
// place overrides here
|
||||
|
||||
|
||||
#define OLED_FONT_H "customfont.c"
|
20
keyboards/owlet60/keymaps/oled_testing/customfont.c
Normal file
20
keyboards/owlet60/keymaps/oled_testing/customfont.c
Normal file
|
@ -0,0 +1,20 @@
|
|||
#pragma once
|
||||
|
||||
#ifdef __AVR__
|
||||
# include <avr/io.h>
|
||||
# include <avr/pgmspace.h>
|
||||
#elif defined(ESP8266)
|
||||
# include <pgmspace.h>
|
||||
#else
|
||||
# define PROGMEM
|
||||
#endif
|
||||
|
||||
// Helidox 8x6 font with QMK Firmware Logo
|
||||
// Online editor: http://teripom.x0.com/
|
||||
|
||||
static const unsigned char font[] PROGMEM = {
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x3e,0x5b,0x4f,0x5b,0x3e,0x00,0x3e,0x6b,0x4f,0x6b,0x3e,0x00,0x1c,0x3e,0x7c,0x3e,0x1c,0x00,0x18,0x3c,0x7e,0x3c,0x18,0x00,0x1c,0x57,0x7d,0x57,0x1c,0x00,0x1c,0x5e,0x7f,0x5e,0x1c,0x00,0x00,0x18,0x3c,0x18,0x00,0x00,0xff,0xe7,0xc3,0xe7,0xff,0x00,0x00,0x18,0x24,0x18,0x00,0x00,0xff,0xe7,0xdb,0xe7,0xff,0x00,0x30,0x48,0x3a,0x06,0x0e,0x00,0x26,0x29,0x79,0x29,0x26,0x00,0x40,0x7f,0x05,0x05,0x07,0x00,0x40,0x7f,0x05,0x25,0x3f,0x00,0x5a,0x3c,0xe7,0x3c,0x5a,0x00,0x7f,0x3e,0x1c,0x1c,0x08,0x00,0x08,0x1c,0x1c,0x3e,0x7f,0x00,0x14,0x22,0x7f,0x22,0x14,0x00,0x5f,0x5f,0x00,0x5f,0x5f,0x00,0x06,0x09,0x7f,0x01,0x7f,0x00,0x00,0x66,0x89,0x95,0x6a,0x00,0x60,0x60,0x60,0x60,0x60,0x00,0x94,0xa2,0xff,0xa2,0x94,0x00,0x08,0x04,0x7e,0x04,0x08,0x00,0x10,0x20,0x7e,0x20,0x10,0x00,0x08,0x08,0x2a,0x1c,0x08,0x00,0x08,0x1c,0x2a,0x08,0x08,0x00,0x1e,0x10,0x10,0x10,0x10,0x00,0x0c,0x1e,0x0c,0x1e,0x0c,0x00,0x30,0x38,0x3e,0x38,0x30,0x00,0x06,0x0e,0x3e,0x0e,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5f,0x00,0x00,0x00,0x00,0x07,0x00,0x07,0x00,0x00,0x14,0x7f,0x14,0x7f,0x14,0x00,0x24,0x2a,0x7f,0x2a,0x12,0x00,0x23,0x13,0x08,0x64,0x62,0x00,0x36,0x49,0x56,0x20,0x50,0x00,0x00,0x08,0x07,0x03,0x00,0x00,0x00,0x1c,0x22,0x41,0x00,0x00,0x00,0x41,0x22,0x1c,0x00,0x00,0x2a,0x1c,0x7f,0x1c,0x2a,0x00,0x08,0x08,0x3e,0x08,0x08,0x00,0x00,0x80,0x70,0x30,0x00,0x00,0x08,0x08,0x08,0x08,0x08,0x00,0x00,0x00,0x60,0x60,0x00,0x00,0x20,0x10,0x08,0x04,0x02,0x00,0x3e,0x51,0x49,0x45,0x3e,0x00,0x00,0x42,0x7f,0x40,0x00,0x00,0x72,0x49,0x49,0x49,0x46,0x00,0x21,0x41,0x49,0x4d,0x33,0x00,0x18,0x14,0x12,0x7f,0x10,0x00,0x27,0x45,0x45,0x45,0x39,0x00,0x3c,0x4a,0x49,0x49,0x31,0x00,0x41,0x21,0x11,0x09,0x07,0x00,0x36,0x49,0x49,0x49,0x36,0x00,0x46,0x49,0x49,0x29,0x1e,0x00,0x00,0x00,0x14,0x00,0x00,0x00,0x00,0x40,0x34,0x00,0x00,0x00,0x00,0x08,0x14,0x22,0x41,0x00,0x14,0x14,0x14,0x14,0x14,0x00,0x00,0x41,0x22,0x14,0x08,0x00,0x02,0x01,0x59,0x09,0x06,0x00,0x3e,0x41,0x5d,0x59,0x4e,0x00,0x7c,0x12,0x11,0x12,0x7c,0x00,0x7f,0x49,0x49,0x49,
|
||||
0x36,0x00,0x3e,0x41,0x41,0x41,0x22,0x00,0x7f,0x41,0x41,0x41,0x3e,0x00,0x7f,0x49,0x49,0x49,0x41,0x00,0x7f,0x09,0x09,0x09,0x01,0x00,0x3e,0x41,0x41,0x51,0x73,0x00,0x7f,0x08,0x08,0x08,0x7f,0x00,0x00,0x41,0x7f,0x41,0x00,0x00,0x20,0x40,0x41,0x3f,0x01,0x00,0x7f,0x08,0x14,0x22,0x41,0x00,0x7f,0x40,0x40,0x40,0x40,0x00,0x7f,0x02,0x1c,0x02,0x7f,0x00,0x7f,0x04,0x08,0x10,0x7f,0x00,0x3e,0x41,0x41,0x41,0x3e,0x00,0x7f,0x09,0x09,0x09,0x06,0x00,0x3e,0x41,0x51,0x21,0x5e,0x00,0x7f,0x09,0x19,0x29,0x46,0x00,0x26,0x49,0x49,0x49,0x32,0x00,0x03,0x01,0x7f,0x01,0x03,0x00,0x3f,0x40,0x40,0x40,0x3f,0x00,0x1f,0x20,0x40,0x20,0x1f,0x00,0x3f,0x40,0x38,0x40,0x3f,0x00,0x63,0x14,0x08,0x14,0x63,0x00,0x03,0x04,0x78,0x04,0x03,0x00,0x61,0x59,0x49,0x4d,0x43,0x00,0x00,0x7f,0x41,0x41,0x41,0x00,0x02,0x04,0x08,0x10,0x20,0x00,0x00,0x41,0x41,0x41,0x7f,0x00,0x04,0x02,0x01,0x02,0x04,0x00,0x40,0x40,0x40,0x40,0x40,0x00,0x00,0x03,0x07,0x08,0x00,0x00,0x20,0x54,0x54,0x78,0x40,0x00,0x7f,0x28,0x44,0x44,0x38,0x00,0x38,0x44,0x44,0x44,0x28,0x00,0x38,0x44,0x44,0x28,0x7f,0x00,0x38,0x54,0x54,0x54,0x18,0x00,0x00,0x08,0x7e,0x09,0x02,0x00,0x18,0xa4,0xa4,0x9c,0x78,0x00,0x7f,0x08,0x04,0x04,0x78,0x00,0x00,0x44,0x7d,0x40,0x00,0x00,0x20,0x40,0x40,0x3d,0x00,0x00,0x7f,0x10,0x28,0x44,0x00,0x00,0x00,0x41,0x7f,0x40,0x00,0x00,0x7c,0x04,0x78,0x04,0x78,0x00,0x7c,0x08,0x04,0x04,0x78,0x00,0x38,0x44,0x44,0x44,0x38,0x00,0xfc,0x18,0x24,0x24,0x18,0x00,0x18,0x24,0x24,0x18,0xfc,0x00,0x7c,0x08,0x04,0x04,0x08,0x00,0x48,0x54,0x54,0x54,0x24,0x00,0x04,0x04,0x3f,0x44,0x24,0x00,0x3c,0x40,0x40,0x20,0x7c,0x00,0x1c,0x20,0x40,0x20,0x1c,0x00,0x3c,0x40,0x30,0x40,0x3c,0x00,0x44,0x28,0x10,0x28,0x44,0x00,0x4c,0x90,0x90,0x90,0x7c,0x00,0x44,0x64,0x54,0x4c,0x44,0x00,0x00,0x08,0x36,0x41,0x00,0x00,0x00,0x00,0x77,0x00,0x00,0x00,0x00,0x41,0x36,0x08,0x00,0x00,0x02,0x01,0x02,0x04,0x02,0x00,0x3c,0x26,0x23,0x26,0x3c,0x00,0x00,0x00,0x00,0x80,0xe0,0xe0,0xe0,0xe0,0x60,0x60,0xe0,0xe0,0xc0,0x80,0x00,0x00,0x00,0x04,0x0c,0x1c,0x1c,0x1c,0x18,0x38,0x38,0x78,0x70,0x70,0xf0,0xa0,0xa0,0x08,
|
||||
0x18,0x18,0x18,0x1c,0x1c,0x1c,0x1c,0x1c,0x18,0x18,0x18,0xf8,0xf8,0xfc,0xf0,0x10,0x10,0x00,0x00,0x80,0xe0,0xf8,0xf0,0x70,0x70,0x70,0x70,0x60,0x60,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xc0,0xc0,0xc0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xf8,0xfc,0xfe,0xde,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xf0,0xf8,0xfc,0x3e,0x1e,0x06,0x01,0x00,0x00,0x00,0x7f,0x41,0x41,0x41,0x7f,0x00,0x7f,0x41,0x41,0x41,0x7f,0x00,0x00,0x80,0xc0,0xe0,0x7e,0x5b,0x4f,0x5b,0xfe,0xc0,0x00,0x00,0xc0,0x00,0xdc,0xd7,0xde,0xde,0xde,0xd7,0xdc,0x00,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0x7f,0xff,0xf3,0xe0,0xc0,0xc0,0xc0,0xf3,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x20,0x70,0x78,0x78,0xf8,0xf8,0xdc,0xcc,0x8c,0x84,0x07,0x03,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0x00,0x00,0x00,0xc0,0xfc,0xff,0x1f,0x03,0x01,0x00,0x00,0xc0,0xe0,0xfc,0x7f,0x1f,0x0f,0x03,0x80,0xe0,0xfc,0xff,0x1f,0x03,0x00,0x00,0x00,0x00,0x00,0xe0,0xfc,0xff,0x3f,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x0f,0x0f,0x0f,0x0e,0x1e,0x1e,0x0e,0x0c,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x69,0x69,0x6f,0x26,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x0f,0x1f,0x3f,0x3c,0x78,0x70,0x60,0x00,0x00,0x00,0x7f,0x41,0x41,0x41,0x7f,0x00,0x7f,0x41,0x41,0x41,0x7f,0x00,0x30,0x7b,0x7f,0x78,0x30,0x20,0x20,0x30,0x78,0x7f,0x3b,0x00,0x03,0x00,0x0f,0x7f,0x0f,0x0f,0x0f,0x7f,0x0f,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x03,0x03,0x03,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x38,0x38,0x1c,0x1c,0x0e,0x0e,0x07,0x03,0x03,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x07,0x03,0x01,0x00,
|
||||
0x00,0x00,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x00,0x00,0x00,0x0e,0x0f,0x07,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x07,0x03,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
};
|
107
keyboards/owlet60/keymaps/oled_testing/keymap.c
Normal file
107
keyboards/owlet60/keymaps/oled_testing/keymap.c
Normal file
|
@ -0,0 +1,107 @@
|
|||
/* Copyright 2019 worthlessowl
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
// Defines the keycodes used by our macros in process_record_user
|
||||
enum custom_keycodes {
|
||||
QMKBEST = SAFE_RANGE,
|
||||
QMKURL
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[0] = LAYOUT_owlet60_full_bsp(
|
||||
KC_1, KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_PGUP, \
|
||||
KC_2, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGDOWN, \
|
||||
KC_3, KC_CAPS,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, KC_HOME, \
|
||||
KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, \
|
||||
KC_LCTRL, KC_LALT, KC_SPC, MO(1),KC_SPC, KC_RALT, KC_LEFT, KC_DOWN, KC_RIGHT \
|
||||
),
|
||||
|
||||
[1] = LAYOUT_owlet60_full_bsp(
|
||||
KC_NO, KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, RGB_TOG, \
|
||||
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RGB_MOD, \
|
||||
KC_NO, KC_NO,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,KC_NO, KC_NO, RGB_VAI, \
|
||||
KC_TRNS,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_N, KC_NO, KC_NO,KC_NO, KC_NO, KC_NO, KC_TRNS, RGB_VAD, \
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \
|
||||
)
|
||||
};
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
case QMKBEST:
|
||||
if (record->event.pressed) {
|
||||
// when keycode QMKBEST is pressed
|
||||
SEND_STRING("QMK is the best thing ever!");
|
||||
} else {
|
||||
// when keycode QMKBEST is released
|
||||
}
|
||||
break;
|
||||
case QMKURL:
|
||||
if (record->event.pressed) {
|
||||
// when keycode QMKURL is pressed
|
||||
SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER));
|
||||
} else {
|
||||
// when keycode QMKURL is released
|
||||
}
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void matrix_init_user(void) {
|
||||
|
||||
}
|
||||
|
||||
void matrix_scan_user(void) {
|
||||
|
||||
}
|
||||
|
||||
void led_set_user(uint8_t usb_led) {
|
||||
|
||||
}
|
||||
|
||||
#ifdef OLED_DRIVER_ENABLE
|
||||
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
//return OLED_ROTATION_180;
|
||||
return OLED_ROTATION_180;
|
||||
}
|
||||
void oled_task_user(void) {
|
||||
// Host Keyboard Layer Status
|
||||
/*oled_write_P(PSTR("Lyr: "), false);
|
||||
switch (get_highest_layer(layer_state)) {
|
||||
case 0:
|
||||
oled_write_P(PSTR("Alpha\n"), false);
|
||||
break;
|
||||
case 1:
|
||||
oled_write_P(PSTR("FN\n"), false);
|
||||
break;
|
||||
default:
|
||||
// Or use the write_ln shortcut over adding '\n' to the end of your string
|
||||
oled_write_ln_P(PSTR("Undefined"), false);
|
||||
}
|
||||
|
||||
uint8_t led_usb_state = host_keyboard_leds();
|
||||
oled_write_P(led_usb_state & (1<<USB_LED_CAPS_LOCK) ? PSTR("CAPLCK ") : PSTR(" "), false);
|
||||
*/
|
||||
|
||||
static const char PROGMEM qmk_logo[] = {
|
||||
0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94,
|
||||
0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4,
|
||||
0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0};
|
||||
|
||||
oled_write_P(qmk_logo, false);
|
||||
}
|
||||
#endif
|
1
keyboards/owlet60/keymaps/oled_testing/readme.md
Normal file
1
keyboards/owlet60/keymaps/oled_testing/readme.md
Normal file
|
@ -0,0 +1 @@
|
|||
# The default keymap for owlet60
|
48
keyboards/owlet60/keymaps/oled_testing/rules.mk
Normal file
48
keyboards/owlet60/keymaps/oled_testing/rules.mk
Normal file
|
@ -0,0 +1,48 @@
|
|||
SRC += matrix.c
|
||||
|
||||
# MCU name
|
||||
MCU = atmega32u4
|
||||
|
||||
|
||||
# Bootloader selection
|
||||
# Teensy halfkay
|
||||
# Pro Micro caterina
|
||||
# Atmel DFU atmel-dfu
|
||||
# LUFA DFU lufa-dfu
|
||||
# QMK DFU qmk-dfu
|
||||
# atmega32a bootloadHID
|
||||
BOOTLOADER = caterina
|
||||
|
||||
|
||||
# If you don't know the bootloader type, then you can specify the
|
||||
# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
# OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
|
||||
# Build Options
|
||||
# change yes to no to disable
|
||||
#
|
||||
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE = no # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE = no # Console for debug(+400)
|
||||
COMMAND_ENABLE = no # Commands for debug and configuration
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
NKRO_ENABLE = yes # USB Nkey Rollover
|
||||
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
||||
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
|
||||
MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config)
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
AUDIO_ENABLE = no # Audio output on port C6
|
||||
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
|
||||
HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400)
|
||||
CUSTOM_MATRIX = yes
|
||||
OLED_DRIVER_ENABLE = yes
|
|
@ -19,13 +19,14 @@
|
|||
// You can leave any or all of these undefined.
|
||||
// These are only required if you want to perform custom actions.
|
||||
|
||||
/*
|
||||
|
||||
/*
|
||||
void matrix_init_kb(void) {
|
||||
// put your keyboard start-up code here
|
||||
// runs once when the firmware starts up
|
||||
|
||||
matrix_init_user();
|
||||
|
||||
}
|
||||
|
||||
void matrix_scan_kb(void) {
|
||||
|
@ -33,6 +34,7 @@ void matrix_scan_kb(void) {
|
|||
// runs every cycle (a lot)
|
||||
|
||||
matrix_scan_user();
|
||||
oled_task_user();
|
||||
}
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
SRC = matrix.c
|
||||
SRC += matrix.c
|
||||
|
||||
# MCU name
|
||||
MCU = atmega32u4
|
||||
|
@ -35,7 +35,7 @@ COMMAND_ENABLE = no # Commands for debug and configuration
|
|||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
NKRO_ENABLE = no # USB Nkey Rollover
|
||||
NKRO_ENABLE = yes # USB Nkey Rollover
|
||||
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
||||
RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
|
||||
MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config)
|
||||
|
@ -44,4 +44,5 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
|||
AUDIO_ENABLE = no # Audio output on port C6
|
||||
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
|
||||
HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400)
|
||||
CUSTOM_MATRIX = yes
|
||||
CUSTOM_MATRIX = yes
|
||||
OLED_DRIVER_ENABLE = no
|
Loading…
Reference in a new issue