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

Atreus: add STM32F103C8T6 based variant #16846

Merged
merged 7 commits into from
Jun 16, 2022
Merged
Show file tree
Hide file tree
Changes from 6 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
2 changes: 2 additions & 0 deletions keyboards/atreus/atreus.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#include "teensy2.h"
#elif KEYBOARD_atreus_promicro
#include "promicro.h"
#elif KEYBOARD_atreus_f103
#include "f103.h"
#endif

// This a shortcut to help you visually see your layout.
Expand Down
28 changes: 28 additions & 0 deletions keyboards/atreus/f103/chconf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/* Copyright 2020 QMK
*
* 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/>.
*/

/*
* This file was auto-generated by:
* `qmk chibios-confmigrate -i keyboards/handwired/onekey/bluepill/chconf.h -r platforms/chibios/common/configs/chconf.h`
*/

#pragma once

#define CH_CFG_ST_TIMEDELTA 0

#define CH_CFG_USE_CONDVARS_TIMEOUT FALSE

#include_next <chconf.h>
38 changes: 38 additions & 0 deletions keyboards/atreus/f103/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/* Copyright 2022 DmNosachev
*
* 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"

/*
* 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)
*
*/

/* key matrix pins */
#define MATRIX_COL_PINS { B10, B1, B0, A7, A6, B5, B4, B3, A15, A10, A9 }
#define MATRIX_ROW_PINS { A5, A4, A3, A2 }
#define UNUSED_PINS {B12, B13, B14, B15, A8, B6, B7, B8, B9, A1, A0, C15, C14, C13}

/* COL2ROW, ROW2COL*/
#define DIODE_DIRECTION COL2ROW
16 changes: 16 additions & 0 deletions keyboards/atreus/f103/f103.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/* Copyright 2022 DmNosachev
*
* 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 "f103.h"
17 changes: 17 additions & 0 deletions keyboards/atreus/f103/f103.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* Copyright 2022 DmNosachev
*
* 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
26 changes: 26 additions & 0 deletions keyboards/atreus/f103/halconf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/* Copyright 2020 QMK
*
* 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/>.
*/

/*
* This file was auto-generated by:
* `qmk chibios-confmigrate -i keyboards/handwired/onekey/bluepill/halconf.h -r platforms/chibios/common/configs/halconf.h`
*/

#pragma once

#define HAL_USE_PWM TRUE

#include_next <halconf.h>
30 changes: 30 additions & 0 deletions keyboards/atreus/f103/mcuconf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/* Copyright 2020 QMK
*
* 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/>.
*/

/*
* This file was auto-generated by:
* `qmk chibios-confmigrate -i keyboards/handwired/onekey/bluepill/mcuconf.h -r platforms/chibios/STM32_F103_STM32DUINO/configs/mcuconf.h`
*/

#pragma once

#include_next <mcuconf.h>

#undef STM32_PWM_USE_TIM2
#define STM32_PWM_USE_TIM2 TRUE

#undef STM32_SPI_USE_SPI2
#define STM32_SPI_USE_SPI2 FALSE
10 changes: 10 additions & 0 deletions keyboards/atreus/f103/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# MCU name
MCU = STM32F103

# Bootloader selection
BOOTLOADER = stm32duino

# Enter lower-power sleep mode when on the ChibiOS idle thread
OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE

BOOTMAGIC_ENABLE = yes
147 changes: 147 additions & 0 deletions keyboards/atreus/keymaps/quartz64/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
/*
Copyright 2022 DmNosachev

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 names for use in layer keycodes and the keymap
enum layer_names {
_QW,
_RS,
_LW
};

#define MC1 COMP_FR_QUOTES
#define MC2 COMP_NBSP_EM_DASH
#define MC3 COMP_NBSP

enum custom_keycodes {
PLACEHOLDER = SAFE_RANGE, // can always be here
COMP_FR_QUOTES, // Compose: french quotes
COMP_NBSP_EM_DASH, // Compose: nbsp followed by em dash
COMP_NBSP, // Compose: nbsp
PWD1,
PWD2,
PWD3, // KP password
};

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/*
,----------------------------------. ,----------------------------------.
|Q/Alt | W | E | R | T | | Y | U | I | O | P |
|------+------+------+------+------| |------+------+------+------+------|
|A/Ctrl| S | D | F | G | | H | J | K | L |;/Ctrl|
|------+------+------+------+------|------.,------|------+------+------+------+------|
|Z/Shft| X | C | V | B |Bkspc ||Delete| N | M | , | . |?/Shft|
|------+------+------+------+------| || |------+------+------+------+------|
| ~ | Tab | - | GUI |Spc/LW|------'`------|Ent/RS| |\ | [ | ] | "' |
`----------------------------------' `----------------------------------'
*/
[_QW] = LAYOUT( /* Qwerty */
LALT_T(KC_Q), KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,
LCTL_T(KC_A), KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, RCTL_T(KC_SCLN),
LSFT_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, RSFT_T(KC_SLSH),
KC_GRV, KC_TAB, KC_MINS, KC_LGUI, LT(_LW, KC_SPC), KC_BSPC, KC_DEL, LT(_RS, KC_ENT), KC_BSLS, KC_LBRC, KC_RBRC, KC_QUOT
),

/*
,----------------------------------. ,----------------------------------.
| PrnSc| pwd1 | up | pwd2 | PgUp | | Home | F7 | F8 | F9 | |
|------+------+------+------+------| |------+------+------+------+------|
| trns | left | down | right| PgDn | | End | F4 | F5 | F6 | trns |
|------+------+------+------+------|------.,------|------+------+------+------+------|
| trns | MC2 | MC3 | ( | ) | || | AltGr| F1 | F2 | F3 | trns |
|------+------+------+------+------| || |------+------+------+------+------|
| trns | C+S | Ins | MC1 | trns |------'`------| trns | F10 | F11 | F12 | trns |
`----------------------------------' `----------------------------------'
*/

[_RS] = LAYOUT( /* RAISE */
KC_PSCR, PWD1, KC_UP, PWD2, KC_PGUP, KC_HOME, KC_F7, KC_F8, KC_F9, _______,
_______, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_END, KC_F4, KC_F5, KC_F6, _______,
_______, MC2, MC3, KC_LPRN, KC_RPRN, KC_RALT, KC_F1, KC_F2, KC_F3, _______,
_______, LCTL(KC_LSFT), _______, MC1, _______, _______, _______, _______, KC_F10, KC_F11, KC_F12, _______
),

/*
,----------------------------------. ,----------------------------------.
| ! | @ | # | $ | % | | / | 7 | 8 | 9 | . |
|------+------+------+------+------| |------+------+------+------+------|
| trns | ^ | & | * | PWD3 | | * | 4 | 5 | 6 | trns |
|------+------+------+------+------|------.,------|------+------+------+------+------|
| trns |r_tog | r_hue| r_sat| r_val| || | + | 1 | 2 | 3 | trns |
|------+------+------+------+------| || |------+------+------+------+------|
| trns | Esc |RESET |capslk| trns |------'`------| trns | 0 | - | += | trns |
`----------------------------------' `----------------------------------'
*/

[_LW] = LAYOUT( /* LOWER */
KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_PSLS, KC_7, KC_8, KC_9, KC_PDOT,
_______, KC_CIRC, KC_AMPR, KC_ASTR, PWD3, KC_PAST, KC_4, KC_5, KC_6, _______,
_______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, KC_PPLS, KC_1, KC_2, KC_3, _______,
_______, KC_ESC , RESET, KC_CAPS, _______, _______, _______, _______, KC_0, KC_PMNS, KC_EQL, _______
)
};

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case MC1:
// French quotes
if (record->event.pressed) {
SEND_STRING(SS_TAP(X_RALT)"<<"SS_TAP(X_RALT)">>"SS_TAP(X_LEFT));
}
return false;
break;

case MC2:
// NB-space + mdash + space
if (record->event.pressed) {
SEND_STRING(SS_TAP(X_RALT)" "SS_TAP(X_RALT)"--- ");
}
return false;
break;

case MC3:
// NB-space
if (record->event.pressed) {
SEND_STRING(SS_TAP(X_RALT)" ");
}
return false;
break;

case PWD1:
if (record->event.pressed) {
SEND_STRING("NakedLunch1991"SS_TAP(X_ENTER));
}
return false;
break;

case PWD2:
if (record->event.pressed) {
SEND_STRING("O94nx4sUWHc4akud"SS_TAP(X_ENTER));
DmNosachev marked this conversation as resolved.
Show resolved Hide resolved
}
return false;
break;

case PWD3:
if (record->event.pressed) {
SEND_STRING("Q123qQ123q\n");
}
return false;
break;
}
return true;
}
3 changes: 2 additions & 1 deletion keyboards/atreus/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Keyboard Maintainer: [Phil Hagelberg](https://github.com/technomancy)
Hardware Supported: Atreus, PCB-based or hand-wired
Hardware Availability: https://atreus.technomancy.us

These configuration files are specifically for the Atreus keyboards created by Phil Hagelberg (@technomancy). This keyboard is available in two variants: one powered by a Teensy 2 (usually hand-wired), one powered by an A-Star (usually using a PCB). You will need to use different `make` commands depending on the variant you have; see examples below.
These configuration files are specifically for the Atreus keyboards created by Phil Hagelberg (@technomancy). This keyboard is available in several variants: powered by a Teensy 2 or STM32F103C8T6 based MCU board (usually hand-wired), powered by an A-Star or ProMicro (usually using a PCB). You will need to use different `make` commands depending on the variant you have; see examples below.

Make example for this keyboard (after setting up your build environment):

Expand All @@ -19,6 +19,7 @@ If you would like to use one of the alternative controllers:
make atreus/astar:default:flash
make atreus/teensy2:default:flash
make atreus/promicro:default:flash
make atreus/f103:default:flash

If your keyboard layout is a mirror image of what you expected (i.e. you do not get QWERTY on the left but YTREWQ on the right), then you have an A-Star powered Atreus (older than March 2016) with PCB labels facing *down* instead of up. Specify that by adding `PCBDOWN=yes` to your `make` commands, e.g.

Expand Down