Browse Source

[keyboard] Add [n]2 support (#9862)

* Create Alter folder

* Revert "Create Alter folder"

This reverts commit 361103b821.

* Add n2 keyboard

* Apply suggestions from code review

Edited config.h, keymap.c, readme.md, and rules.mk

Co-authored-by: Ryan <fauxpark@gmail.com>

* Update readme.md

Co-authored-by: Ryan <fauxpark@gmail.com>
pull/9883/head
NightlyBoards 3 years ago
committed by GitHub
parent
commit
83c12a516b
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 213 additions and 0 deletions
  1. +93
    -0
      keyboards/nightly_boards/n2/config.h
  2. +12
    -0
      keyboards/nightly_boards/n2/info.json
  3. +23
    -0
      keyboards/nightly_boards/n2/keymaps/default/keymap.c
  4. +18
    -0
      keyboards/nightly_boards/n2/n2.c
  5. +27
    -0
      keyboards/nightly_boards/n2/n2.h
  6. +18
    -0
      keyboards/nightly_boards/n2/readme.md
  7. +22
    -0
      keyboards/nightly_boards/n2/rules.mk

+ 93
- 0
keyboards/nightly_boards/n2/config.h View File

@ -0,0 +1,93 @@
/*
Copyright 2020 Neil Brian Ramirez
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 0x0717
#define PRODUCT_ID 0x0003
#define DEVICE_VER 0x0001
#define MANUFACTURER Neil Brian Ramirez
#define PRODUCT [n]2
/* key matrix size */
#define MATRIX_ROWS 2
#define MATRIX_COLS 2
/*
* 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 { F1, C7 }
#define MATRIX_COL_PINS { F0, C6 }
#define UNUSED_PINS
/* COL2ROW, ROW2COL*/
#define DIODE_DIRECTION COL2ROW
// #define BACKLIGHT_PIN F1
// #define BACKLIGHT_BREATHING
// #define BACKLIGHT_LEVELS 3
#define RGB_DI_PIN D4
#ifdef RGB_DI_PIN
#define RGBLED_NUM 2
#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_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 5
/* 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
/* disable these deprecated features by default */
#define NO_ACTION_MACRO
#define NO_ACTION_FUNCTION

+ 12
- 0
keyboards/nightly_boards/n2/info.json View File

@ -0,0 +1,12 @@
{
"keyboard_name": "[n]2",
"url": "",
"maintainer": "Neil Brian Ramirez",
"width": 1,
"height": 2,
"layouts": {
"LAYOUT": {
"layout": [{"x":0, "y":0}, {"x":0, "y":1}]
}
}
}

+ 23
- 0
keyboards/nightly_boards/n2/keymaps/default/keymap.c View File

@ -0,0 +1,23 @@
/* Copyright 2020 Neil Brian Ramirez
*
* 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
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT(
KC_L,
KC_O
)
};

+ 18
- 0
keyboards/nightly_boards/n2/n2.c View File

@ -0,0 +1,18 @@
/* Copyright 2020 Neil Brian Ramirez
*
* 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 "n2.h"

+ 27
- 0
keyboards/nightly_boards/n2/n2.h View File

@ -0,0 +1,27 @@
/* Copyright 2020 Neil Brian Ramirez
*
* 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"
#define LAYOUT( \
K00, \
K11 \
) { \
{ K00, KC_NO }, \
{ KC_NO, K11 }, \
}

+ 18
- 0
keyboards/nightly_boards/n2/readme.md View File

@ -0,0 +1,18 @@
# [n]2
![n2](https://i.imgur.com/iHOxmHil.png)
A 2 key pcb
* Keyboard Maintainer: [Neil Brian Ramirez](https://github.com/NightlyBoards)
* Hardware Supported: atmega32u4
Make example for this keyboard (after setting up your build environment):
make nightly_boards/n2:default
Flashing example for this keyboard:
make nightly_boards/n2:default:flash
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).

+ 22
- 0
keyboards/nightly_boards/n2/rules.mk View File

@ -0,0 +1,22 @@
# MCU name
MCU = atmega32u4
# Bootloader selection
BOOTLOADER = atmel-dfu
# Build Options
# change yes to no to disable
#
BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
MOUSEKEY_ENABLE = no # Mouse keys
EXTRAKEY_ENABLE = yes # Audio control and System control
CONSOLE_ENABLE = no # Console for debug
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
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
BLUETOOTH_ENABLE = no # Enable Bluetooth
AUDIO_ENABLE = no # Audio output

Loading…
Cancel
Save