diff --git a/keyboards/handwired/stm32/Unavailable pins.txt b/keyboards/handwired/bluepill/Unavailable pins.txt similarity index 100% rename from keyboards/handwired/stm32/Unavailable pins.txt rename to keyboards/handwired/bluepill/Unavailable pins.txt diff --git a/keyboards/handwired/bluepill/bluepill.c b/keyboards/handwired/bluepill/bluepill.c new file mode 100644 index 00000000000..30effbc31dd --- /dev/null +++ b/keyboards/handwired/bluepill/bluepill.c @@ -0,0 +1 @@ +#include "bluepill.h" diff --git a/keyboards/handwired/stm32/stm32.h b/keyboards/handwired/bluepill/bluepill.h similarity index 92% rename from keyboards/handwired/stm32/stm32.h rename to keyboards/handwired/bluepill/bluepill.h index 99c2d9017ab..3d156533c36 100644 --- a/keyboards/handwired/stm32/stm32.h +++ b/keyboards/handwired/bluepill/bluepill.h @@ -4,16 +4,12 @@ #include "quantum.h" #include "led.h" -// Modified by Xydane -// Original: -// #define LAYOUT(k00) {{ k00 }} - -/* +/* 70% LAYOUT ESC| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10| F11| F12| PSC| PGU| PGD GRA| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | ' | ¡ | BCKS | DEL TAB| Q | W | E | R | T | Y | U | I | O | P | ` | + | | HOM CAP| A | S | D | F | G | H | J | K | L | Ñ | ´ | Ç | ENTER | END - LSI| < | Z | X | C | V | B | N | M | , | . | - | RSHIF | UP | FNL + LSI | Z | X | C | V | B | N | M | , | . | - | RSHIF | UP | FNL LCT| WIN| ALT| ESPACE | ALG| FN | RCT| LEF| DOW| RIG */ diff --git a/keyboards/handwired/bluepill/bluepill70/bluepill70.c b/keyboards/handwired/bluepill/bluepill70/bluepill70.c new file mode 100644 index 00000000000..c8b0bebdb1e --- /dev/null +++ b/keyboards/handwired/bluepill/bluepill70/bluepill70.c @@ -0,0 +1 @@ +#include "bluepill70.h" diff --git a/keyboards/handwired/bluepill/bluepill70/bluepill70.h b/keyboards/handwired/bluepill/bluepill70/bluepill70.h new file mode 100644 index 00000000000..37b4d9bb0b3 --- /dev/null +++ b/keyboards/handwired/bluepill/bluepill70/bluepill70.h @@ -0,0 +1,6 @@ +#ifndef BLUEPILL70_H +#define BLUEPILL70_H +#include "bluepill.h" +// Modified by Xydane +// #define LAYOUT(k00) {{ k00 }} +#endif diff --git a/keyboards/handwired/stm32/stm70/bootloader_defs.h b/keyboards/handwired/bluepill/bluepill70/bootloader_defs.h similarity index 100% rename from keyboards/handwired/stm32/stm70/bootloader_defs.h rename to keyboards/handwired/bluepill/bluepill70/bootloader_defs.h diff --git a/keyboards/handwired/stm32/stm70/chconf.h b/keyboards/handwired/bluepill/bluepill70/chconf.h similarity index 100% rename from keyboards/handwired/stm32/stm70/chconf.h rename to keyboards/handwired/bluepill/bluepill70/chconf.h diff --git a/keyboards/handwired/stm32/stm70/config.h b/keyboards/handwired/bluepill/bluepill70/config.h similarity index 94% rename from keyboards/handwired/stm32/stm70/config.h rename to keyboards/handwired/bluepill/bluepill70/config.h index 0f1d7c51088..2aed7d5f74e 100644 --- a/keyboards/handwired/stm32/stm70/config.h +++ b/keyboards/handwired/bluepill/bluepill70/config.h @@ -13,7 +13,7 @@ // Modified by Xydane #define MANUFACTURER "QMK" #define USBSTR_MANUFACTURER 'T', '\x00', 'M', '\x00', 'K', '\x00', ' ', '\x00', '\xc6', '\x00' -#define PRODUCT "Stm32 70" +#define PRODUCT "BluePill70" #define USBSTR_PRODUCT 'C', '\x00', 'h', '\x00', 'i', '\x00', 'b', '\x00', 'i', '\x00', 'O', '\x00', 'S', '\x00', ' ', '\x00', 'Q', '\x00', 'M', '\x00', 'K', '\x00', ' ', '\x00', 't', '\x00', 'e', '\x00', 's', '\x00', 't', '\x00' #define DESCRIPTION "QMK keyboard firmware test for ChibiOS" diff --git a/keyboards/handwired/stm32/stm70/flash.sh b/keyboards/handwired/bluepill/bluepill70/flash.sh similarity index 100% rename from keyboards/handwired/stm32/stm70/flash.sh rename to keyboards/handwired/bluepill/bluepill70/flash.sh diff --git a/keyboards/handwired/stm32/stm70/halconf.h b/keyboards/handwired/bluepill/bluepill70/halconf.h similarity index 100% rename from keyboards/handwired/stm32/stm70/halconf.h rename to keyboards/handwired/bluepill/bluepill70/halconf.h diff --git a/keyboards/handwired/stm32/stm70/led.c b/keyboards/handwired/bluepill/bluepill70/led.c similarity index 100% rename from keyboards/handwired/stm32/stm70/led.c rename to keyboards/handwired/bluepill/bluepill70/led.c diff --git a/keyboards/handwired/stm32/stm70/matrix.c b/keyboards/handwired/bluepill/bluepill70/matrix.c similarity index 99% rename from keyboards/handwired/stm32/stm70/matrix.c rename to keyboards/handwired/bluepill/bluepill70/matrix.c index cc6018552ad..9ab56551115 100644 --- a/keyboards/handwired/stm32/stm70/matrix.c +++ b/keyboards/handwired/bluepill/bluepill70/matrix.c @@ -81,9 +81,6 @@ void matrix_init(void) LED_ON(); wait_ms(500); LED_OFF(); - - // Start of PWM dual color leds - //iniciarluces(); } uint8_t matrix_scan(void) diff --git a/keyboards/handwired/stm32/stm70/mcuconf.h b/keyboards/handwired/bluepill/bluepill70/mcuconf.h similarity index 100% rename from keyboards/handwired/stm32/stm70/mcuconf.h rename to keyboards/handwired/bluepill/bluepill70/mcuconf.h diff --git a/keyboards/handwired/stm32/stm70/rules.mk b/keyboards/handwired/bluepill/bluepill70/rules.mk similarity index 100% rename from keyboards/handwired/stm32/stm70/rules.mk rename to keyboards/handwired/bluepill/bluepill70/rules.mk diff --git a/keyboards/handwired/stm32/boards/GENERIC_STM32_F103/board.c b/keyboards/handwired/bluepill/boards/GENERIC_STM32_F103/board.c similarity index 100% rename from keyboards/handwired/stm32/boards/GENERIC_STM32_F103/board.c rename to keyboards/handwired/bluepill/boards/GENERIC_STM32_F103/board.c diff --git a/keyboards/handwired/stm32/boards/GENERIC_STM32_F103/board.h b/keyboards/handwired/bluepill/boards/GENERIC_STM32_F103/board.h similarity index 100% rename from keyboards/handwired/stm32/boards/GENERIC_STM32_F103/board.h rename to keyboards/handwired/bluepill/boards/GENERIC_STM32_F103/board.h diff --git a/keyboards/handwired/stm32/boards/GENERIC_STM32_F103/board.mk b/keyboards/handwired/bluepill/boards/GENERIC_STM32_F103/board.mk similarity index 100% rename from keyboards/handwired/stm32/boards/GENERIC_STM32_F103/board.mk rename to keyboards/handwired/bluepill/boards/GENERIC_STM32_F103/board.mk diff --git a/keyboards/handwired/stm32/config.h b/keyboards/handwired/bluepill/config.h similarity index 100% rename from keyboards/handwired/stm32/config.h rename to keyboards/handwired/bluepill/config.h diff --git a/keyboards/handwired/bluepill/ejemplo de layer light b/keyboards/handwired/bluepill/ejemplo de layer light new file mode 100644 index 00000000000..2f1498490b8 --- /dev/null +++ b/keyboards/handwired/bluepill/ejemplo de layer light @@ -0,0 +1,149 @@ +// keymap.c +// https://github.com/AGausmann/qmk_firmware/tree/agausmann-v3.x/keyboards/nyquist/keymaps/agausmann + +#include "action_layer.h" +#include "eeconfig.h" +#include "util.h" +#ifdef RGBLIGHT_ENABLE +#include "rgblight.h" +#endif + +extern keymap_config_t keymap_config; + +#define DEFAULT_LAYER 0 +#define LOWER_LAYER 1 +#define RAISE_LAYER 2 +#define MIDI_LAYER 4 +#define GAMING_LAYER 8 +#define GAMING_NUMPAD_LAYER 9 +#define SETUP_LAYER 12 +#define NUMPAD_LAYER 13 + +enum custom_keycodes { + CK_BACK = TO(DEFAULT_LAYER), + CK_LOW = MO(LOWER_LAYER), + CK_RAS = MO(RAISE_LAYER), + CK_MIDI = TG(MIDI_LAYER), + CK_GAME = TG(GAMING_LAYER), + CK_GNUM = OSL(GAMING_NUMPAD_LAYER), + CK_SET = OSL(SETUP_LAYER), + CK_NUM = TG(NUMPAD_LAYER), +}; + +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[DEFAULT_LAYER] = KEYMAP( \ + CK_BACK, _______, CK_MIDI, CK_GAME, CK_SET, _______, _______, CK_NUM, _______, _______, _______, _______, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_CLCK, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL, KC_LGUI, KC_LALT, _______, CK_LOW, KC_ENT, KC_SPC, CK_RAS, _______, KC_RALT, KC_RGUI, KC_RCTL \ +), + +[LOWER_LAYER] = KEYMAP( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, _______, KC_INS, KC_HOME, KC_UP, KC_END, KC_PGUP, _______, \ + _______, KC_F5, KC_F6, KC_F7, KC_F8, _______, KC_DEL, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______, \ + _______, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, KC_PAUS, KC_PSCR, KC_SLCK, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +), + +[RAISE_LAYER] = KEYMAP( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, \ + _______, _______, _______, KC_VOLD, KC_VOLU, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, _______, _______, _______, KC_MUTE, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +), + +[MIDI_LAYER] = KEYMAP( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + MI_ALLOFF,MI_Gs, MI_A, MI_As, MI_B, MI_OCTU, _______, _______, _______, _______, _______, _______, \ + _______, MI_E, MI_F, MI_Fs, MI_G, MI_TRNSU,_______, _______, _______, _______, _______, _______, \ + _______, MI_C, MI_Cs, MI_D, MI_Ds, MI_TRNSD,_______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, MI_SUS, MI_OCTD, _______, _______, _______, _______, _______, _______ \ +), + +[GAMING_LAYER] = KEYMAP( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_UP, \ + KC_LCTL, XXXXXXX, KC_LALT, CK_GNUM, KC_BSLS, KC_SPC, KC_SPC, XXXXXXX, XXXXXXX, KC_LEFT, KC_RGHT, KC_DOWN \ +), + +[GAMING_NUMPAD_LAYER] = KEYMAP( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, KC_0, KC_1, KC_2, KC_3, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, KC_4, KC_5, KC_6, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, KC_7, KC_8, KC_9, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +), + +[SETUP_LAYER] = KEYMAP( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, RGB_TOG, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +), + +[NUMPAD_LAYER] = KEYMAP( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, KC_PAST, _______, \ + _______, _______, _______, _______, _______, _______, KC_NLCK, KC_P4, KC_P5, KC_P6, KC_PPLS, KC_PEQL, \ + _______, _______, _______, _______, _______, _______, _______, KC_P1, KC_P2, KC_P3, KC_PMNS, KC_PENT, \ + _______, _______, _______, _______, _______, _______, _______, KC_P0, KC_PCMM, KC_PDOT, KC_PSLS, _______ \ +), + +}; + + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +void matrix_init_user(void) { + + + rgblight_enable(); +} + +void matrix_scan_user(void) { + #ifdef RGBLIGHT_ENABLE + + static uint8_t old_layer = 255; + uint8_t new_layer = biton32(layer_state); + + if (old_layer != new_layer) { + switch (new_layer) { + case DEFAULT_LAYER: + rgblight_setrgb(0x00, 0x00, 0xFF); + break; + case NUMPAD_LAYER: + rgblight_setrgb(0x00, 0xA0, 0xFF); + break; + case MIDI_LAYER: + rgblight_setrgb(0xFF, 0x00, 0x00); + break; + case GAMING_LAYER: + rgblight_setrgb(0xFF, 0x20, 0x00); + break; + case SETUP_LAYER: + rgblight_setrgb(0xFF, 0x00, 0xFF); + break; + } + + old_layer = new_layer; + } + + #endif //RGBLIGHT_ENABLE +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} \ No newline at end of file diff --git a/keyboards/handwired/bluepill/keymaps/default/keymap.c b/keyboards/handwired/bluepill/keymaps/default/keymap.c new file mode 100644 index 00000000000..42a294df8a4 --- /dev/null +++ b/keyboards/handwired/bluepill/keymaps/default/keymap.c @@ -0,0 +1,97 @@ +/* +Copyright 2012,2013 Jun Wako + +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 . +*/ + +#include "bluepill.h" + +#define XXXXXXX KC_NO + +// Define layer names +#define _NORMAL 0 +#define _FNONE 1 +#define _FNTWO 2 + + +// Highly Modified by Xydane +const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_NORMAL] = KEYMAP_SEVENTY( + KC_ESC, 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_PSCREEN,KC_HOME, KC_END, \ +KC_GRAVE, 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_DELETE, \ + 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_PGUP, \ + 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_NUHS, KC_ENT,KC_PGDOWN, \ + KC_LSPO, XXXXXXX,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSPC,KC_UP, F(1), \ + KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,F(0), KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT ), + + [_FNONE] = KEYMAP_SEVENTY( + KC_TRNS, KC_MPRV, KC_MSTP, KC_MPLY, KC_MNXT, KC_TRNS,KC_MUTE,KC_VOLD,KC_VOLU, KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_P7, KC_P8, KC_P9, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_P4, KC_P5, KC_P6, KC_PPLS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_P1, KC_P2, KC_P3, KC_PAST, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, \ + KC_TRNS, XXXXXXX, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_P0, KC_PDOT,KC_PENT, KC_PSLS, KC_TRNS,KC_TRNS,KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, F(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS ), + + [_FNTWO] = KEYMAP_SEVENTY( + KC_TRNS, KC_MPRV, KC_MSTP, KC_MPLY, KC_MNXT, KC_TRNS, KC_MUTE,KC_VOLD,KC_VOLU,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_P7, KC_P8, KC_P9, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_P4, KC_P5, KC_P6, KC_PPLS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_P1, KC_P2, KC_P3, KC_PAST, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, \ + KC_TRNS, XXXXXXX, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_P0, KC_PDOT,KC_PENT, KC_PSLS, KC_TRNS,KC_TRNS,KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, F(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS ), +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_MOMENTARY(1), // to Fn overlay + [1] = ACTION_LAYER_TOGGLE(2), // to Fn overlay + [2] = ACTION_FUNCTION(2), + [3] = ACTION_FUNCTION(3), +}; + +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { + switch (id) { + case 2: + if (record->event.pressed) { + palTogglePad(GPIOA, 1); + } + break; + + // Continuar para incluir funciones propias + /*case 3: + if (record->event.pressed) { + function_led(algo); + } + break;*/ + + } +} + +/* Layer based ilumination, set min value to 0xFFF */ +/*uint32_t layer_state_set_user(uint32_t state) { + switch (biton32(state)) { + case _FNONE: + custom_function1(min1, min2;) + rgblight_setrgb (0xFF, 0x00, 0x00); + break; + case _FNTWO: + custom_function2(min1, min2;) + rgblight_setrgb (0x00, 0xFF, 0x00); + break; + default: // for any other layers, or the default layer + custom_function3(min1, min2;) + rgblight_setrgb (0x00, 0xFF, 0xFF); + break; + } + return state; +}*/ \ No newline at end of file diff --git a/keyboards/handwired/bluepill/keymaps/iso/keymap.c b/keyboards/handwired/bluepill/keymaps/iso/keymap.c new file mode 100644 index 00000000000..28a5247d6d2 --- /dev/null +++ b/keyboards/handwired/bluepill/keymaps/iso/keymap.c @@ -0,0 +1,86 @@ +/* +Copyright 2012,2013 Jun Wako + +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 . +*/ + +#include "bluepill.h" + +// Define layer names +#define _NORMAL 0 +#define _FNONE 1 +#define _FNTWO 2 + + +// Highly Modified by Xydane +const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_NORMAL] = KEYMAP_SEVENTY( + KC_ESC, 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_PSCREEN,KC_HOME, KC_END, \ +KC_GRAVE, 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_DELETE, \ + 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_PGUP, \ + 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_NUHS, KC_ENT,KC_PGDOWN, \ + KC_LSPO, KC_NUBS,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSPC,KC_UP, F(1), \ + KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,F(0), KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT ), + + [_FNONE] = KEYMAP_SEVENTY( + KC_TRNS, KC_MPRV, KC_MSTP, KC_MPLY, KC_MNXT, KC_TRNS,KC_MUTE,KC_VOLD,KC_VOLU, KC_TRNS,KC_TRNS,KC_NLCK, KC_CALC, KC_TRNS,KC_TRNS,KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_P7, KC_P8, KC_P9, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_P4, KC_P5, KC_P6, KC_PPLS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_P1, KC_P2, KC_P3, KC_PAST, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_P0, KC_PDOT,KC_PENT, KC_PSLS, KC_TRNS,KC_TRNS,KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, F(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS ), + + [_FNTWO] = KEYMAP_SEVENTY( + KC_TRNS, KC_MPRV, KC_MSTP, KC_MPLY, KC_MNXT, KC_TRNS,KC_MUTE,KC_VOLD,KC_VOLU, KC_TRNS,KC_TRNS,KC_NLCK, KC_CALC, KC_TRNS,KC_TRNS,KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_P7, KC_P8, KC_P9, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_P4, KC_P5, KC_P6, KC_PPLS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_P1, KC_P2, KC_P3, KC_PAST, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_P0, KC_PDOT,KC_PENT, KC_PSLS, KC_TRNS,KC_TRNS,KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, F(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS ), +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_MOMENTARY(1), // to Fn overlay + [1] = ACTION_LAYER_TOGGLE(2), // to Fn overlay + [2] = ACTION_FUNCTION(2), +}; + +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { + switch (id) { + case 2: + if (record->event.pressed) { + palTogglePad(GPIOA, 1); + //palTogglePad(GPIOA, 0); + } + break; +}; + +/* Layer based ilumination, comment to off */ +uint32_t layer_state_set_user(uint32_t state) { + switch (biton32(state)) { + case _FNONE: + palClearPad(GPIOA, 0); //ON + palSetPad(GPIOA, 1); //OFF + break; + case _FNTWO: + palClearPad(GPIOA, 1); //ON + palSetPad(GPIOA, 1); //OFF + break; + default: // for any other layers, or the default layer + palClearPad(GPIOA, 1); //ON + palSetPad(GPIOA, 0); //OFF + break; + } + return state; +}; \ No newline at end of file diff --git a/keyboards/handwired/stm32/ld/MKL26Z64.ld b/keyboards/handwired/bluepill/ld/MKL26Z64.ld similarity index 100% rename from keyboards/handwired/stm32/ld/MKL26Z64.ld rename to keyboards/handwired/bluepill/ld/MKL26Z64.ld diff --git a/keyboards/handwired/stm32/ld/STM32F103x8_stm32duino_bootloader.ld b/keyboards/handwired/bluepill/ld/STM32F103x8_stm32duino_bootloader.ld similarity index 100% rename from keyboards/handwired/stm32/ld/STM32F103x8_stm32duino_bootloader.ld rename to keyboards/handwired/bluepill/ld/STM32F103x8_stm32duino_bootloader.ld diff --git a/keyboards/handwired/bluepill/readme.md b/keyboards/handwired/bluepill/readme.md new file mode 100644 index 00000000000..f81d3368525 --- /dev/null +++ b/keyboards/handwired/bluepill/readme.md @@ -0,0 +1,53 @@ + +# BluePill handwired + +Keyboards using a BluePill controller (generic Chinese STM32F103C8T6) and based on the [KC64 of Xydane](https://github.com/Xydane/qmk_firmware). + +Keyboard Maintainer: [FPazos](https://github.com/fpazos), but I hope to leave the project in better hands. +Hardware Supported: Bluepill STM32F103C8T6 +Hardware Availability: Everywhere + +Make example for BluePill70 (after setting up your build environment): + +make handwired/bluepill/bluepill70:default + +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. + + +{% hint style='info' %} Read everything before using it for something {% endhint %} + +## Introduction + +First of all thanks to [Xydane](https://github.com/Xydane) at [GeekHack](https://geekhack.org/) for his advice and his repository, without it you couldn't be reading this. + +That's was an attempt to create a firmware using an STM32F103C8T6, and in a "future", also developing a revision for split keyboards. But... +As I'm mainly a web developer I didn't even get to debug the controller, not to speak about ChibiOS. So I just structured everything, created a working 70% layout and leave the project to someone with more knowledge and patience. + +## Resistor fix + +If you want to use the Bluepill USB port, it's very likely that you need to solder a 1.8 kΩ between PA12 and 3.3V. That depends on the PC's motherboard but I needed it, more info [here](https://wiki.stm32duino.com/index.php?title=Blue_Pill). + +## No bootloader + +Neither Xydane or I used the bootloader. Just use a serial programmer (FTDI, ST-LINK). + +## Adding layouts and revisions + +If you want to create new layouts just add it to the keymaps folder. If you prefer to develop a more complex revision just copy the bluepill70 folder, rename it and create a new keymap in /keymap.c (I tried to divide the project even more but it didn't worked). + +## Pinout + +That's the pinout; + + A5 A15 A10 A9 A8 B15 B14 B13 B12 B11 B10 B1 B0 A7 A6 + B9 ESC| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10| F11| F12| PSC| PGU| PGD + B8 GRA| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | ' | ¡ | BCKS | DEL + B7 TAB| Q | W | E | R | T | Y | U | I | O | P | ` | + | | HOM + B6 CAP| A | S | D | F | G | H | J | K | L | Ñ | ´ | Ç | ENTER | END + B5 LSI| < | Z | X | C | V | B | N | M | , | . | - | RSHIF | UP | FNT + B4 LCT| WIN| ALT| ESPACE | ALG| FN | RCT| LEF| DOW| RIG + +It also uses: +PC13: Caps Lock led. +PA0: Backlight. +PA1: Backlight. \ No newline at end of file diff --git a/keyboards/handwired/stm32/rules.mk b/keyboards/handwired/bluepill/rules.mk similarity index 100% rename from keyboards/handwired/stm32/rules.mk rename to keyboards/handwired/bluepill/rules.mk diff --git a/keyboards/handwired/stm32/README.TXT b/keyboards/handwired/stm32/README.TXT deleted file mode 100644 index 886c2017be9..00000000000 --- a/keyboards/handwired/stm32/README.TXT +++ /dev/null @@ -1,9 +0,0 @@ -/* B3 A15 A10 A9 A8 B15 B14 B13 B12 B11 B10 B1 B0 A7 A6 - B9 ESC| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10| F11| F12| PSC| PGU| PGD - B8 GRA| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | ' | ¡ | BCKS | DEL - B7 TAB| Q | W | E | R | T | Y | U | I | O | P | ` | + | | HOM - B6 º (CAP| A | S | D | F | G | H | J | K | L | Ñ | ´ | Ç | ENTER | END - B5 LSI| < | Z | X | C | V | B | N | M | , | . | - | RSHIF | UP | FNL - B4 LCT| WIN| ALT| ESPACE | ALG| FN | RCT| LEF| DOW| RIG -*/ - diff --git a/keyboards/handwired/stm32/boards/GENERIC_STM32_F103/mini_stm32_mapping.png b/keyboards/handwired/stm32/boards/GENERIC_STM32_F103/mini_stm32_mapping.png deleted file mode 100644 index c44a7d9ebcb..00000000000 Binary files a/keyboards/handwired/stm32/boards/GENERIC_STM32_F103/mini_stm32_mapping.png and /dev/null differ diff --git a/keyboards/handwired/stm32/boards/maple_mini_mapping.png b/keyboards/handwired/stm32/boards/maple_mini_mapping.png deleted file mode 100644 index 12cfa81db26..00000000000 Binary files a/keyboards/handwired/stm32/boards/maple_mini_mapping.png and /dev/null differ diff --git a/keyboards/handwired/stm32/keymaps/default/keymap.c b/keyboards/handwired/stm32/keymaps/default/keymap.c deleted file mode 100644 index 3c9c7d15784..00000000000 --- a/keyboards/handwired/stm32/keymaps/default/keymap.c +++ /dev/null @@ -1,37 +0,0 @@ -/* -Copyright 2012,2013 Jun Wako - -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 . -*/ - -#include "stm32.h" - -// Highly Modified by Xydane -const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - KEYMAP_SEVENTY( - KC_ESC, 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_PSCREEN, KC_PGUP, KC_PGDOWN, \ - KC_GRAVE, 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_DELETE, \ - 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_PGUP, \ - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, K3C, K3D, KC_PGDOWN, \ - KC_LSFT, KC_NUBS,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_INS, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, RALT(kc), K55, KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT ), - - KEYMAP_SEVENTY( - KC_ESC, 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_PSCREEN, KC_PGUP, KC_PGDOWN, \ - KC_GRAVE, 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_DELETE, \ - 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_PGUP, \ - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, K3C, K3D, KC_PGDOWN, \ - KC_LSFT, KC_NUBS,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_INS, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, RALT(kc), K55, KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT ), -}; diff --git a/keyboards/handwired/stm32/keymaps/iso/keymap.c b/keyboards/handwired/stm32/keymaps/iso/keymap.c deleted file mode 100644 index 6447164ce56..00000000000 --- a/keyboards/handwired/stm32/keymaps/iso/keymap.c +++ /dev/null @@ -1,95 +0,0 @@ -/* -Copyright 2012,2013 Jun Wako - -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 . -*/ -//#include "keymap_extras/keymap_spanish.h" // For future unicode spanish keys -#include "stm32.h" - -// Define layer names -#define _NORMAL 0 -#define _FNONE 1 -#define _FNTWO 2 - - -// Highly Modified by Xydane -const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_NORMAL] = KEYMAP_SEVENTY( - KC_ESC, 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_PSCREEN,KC_HOME, KC_END, \ - KC_GRAVE, 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_DELETE, \ - 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_PGUP, \ - 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_NUHS, KC_ENT,KC_PGDOWN, \ - KC_LSPO, KC_NUBS,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSPC,KC_UP, F(1), \ - KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,F(0), KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT ), - - [_FNONE] = KEYMAP_SEVENTY( - KC_TRNS, KC_MPRV, KC_MSTP, KC_MPLY, KC_MNXT, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_MUTE,KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_P7, KC_P8, KC_P9, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_P4, KC_P5, KC_P6, KC_PPLS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_P1, KC_P2, KC_P3, KC_PAST, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_P0, KC_PDOT,KC_PENT, KC_PSLS, KC_TRNS,KC_TRNS,KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, F(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS ), - - [_FNTWO] = KEYMAP_SEVENTY( - KC_TRNS, KC_MPRV, KC_MSTP, KC_MPLY, KC_MNXT, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_MUTE,KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_P7, KC_P8, KC_P9, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_P4, KC_P5, KC_P6, KC_PPLS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_P1, KC_P2, KC_P3, KC_PAST, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_P0, KC_PDOT,KC_PENT, KC_PSLS, KC_TRNS,KC_TRNS,KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, F(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS ), -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(1), // to Fn overlay - [1] = ACTION_LAYER_TOGGLE(2), // to Fn overlay - [2] = ACTION_FUNCTION(2), - [3] = ACTION_FUNCTION(3), -}; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - switch (id) { - case 2: - if (record->event.pressed) { - palTogglePad(GPIOA, 1); - } - break; - - // Continuar para incluir funciones propias - /*case 3: - if (record->event.pressed) { - function_led(algo); - } - break;*/ - - } -} - -/* Layer based ilumination, set min value to 0xFFF */ -/*uint32_t layer_state_set_user(uint32_t state) { - switch (biton32(state)) { - case _FNONE: - custom_function1(min1, min2;) - rgblight_setrgb (0xFF, 0x00, 0x00); - break; - case _FNTWO: - custom_function2(min1, min2;) - rgblight_setrgb (0x00, 0xFF, 0x00); - break; - default: // for any other layers, or the default layer - custom_function3(min1, min2;) - rgblight_setrgb (0x00, 0xFF, 0xFF); - break; - } - return state; -}*/ \ No newline at end of file diff --git a/keyboards/handwired/stm32/stm32.c b/keyboards/handwired/stm32/stm32.c deleted file mode 100644 index e3d7dd4e909..00000000000 --- a/keyboards/handwired/stm32/stm32.c +++ /dev/null @@ -1 +0,0 @@ -#include "stm32.h" diff --git a/keyboards/handwired/stm32/stm70/pwm.c b/keyboards/handwired/stm32/stm70/pwm.c deleted file mode 100644 index d5d2177df9f..00000000000 --- a/keyboards/handwired/stm32/stm70/pwm.c +++ /dev/null @@ -1,79 +0,0 @@ -/* -Copyright 2012 Jun Wako - -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 . -*/ - -#include "hal.h" -//#include "led.h" - - - -/* New awesome dual color leds functions, animations and more */ -/* Based on pwm_callback by fcayci: https://github.com/fcayci/STM32F4-ChibiOS/blob/master/pwm_callback/main.c */ - -static void pwmcb(PWMDriver *pwmp); - -static PWMConfig pwmcfg = { - 1000, // Clock frecuency (seconds) = 1/value - 100, // PWM period (ticks = clockfrecuency * pwmperiod) - pwmcb, // Callback, disable with NULL - { - {PWM_OUTPUT_ACTIVE_HIGH, NULL}, /* Enable Channel 0 */ - {PWM_OUTPUT_ACTIVE_HIGH, NULL}, /* Enable Channel 1 */ - //{PWM_OUTPUT_ACTIVE_HIGH, NULL}, /* Enable Channel 2 */ - //{PWM_OUTPUT_ACTIVE_HIGH, NULL} /* Enable Channel 3 */ - }, - 0, /* HW dependent part */ - 0 -}; - - -/* - * PWM callback. - * Each time calculate the next duty cycle. - */ -static void pwmcb(PWMDriver *pwmp) { - (void)pwmp; - - static uint16_t dir = 0, width = 0; - - if (dir == 0) {width = (width + 100);} - else {width = (width - 100);} - - if (width >= 100) {dir = 1;} - else if (width == 0) {dir = 0;} - - pwmEnableChannel(&PWMD4, 0, width); - pwmEnableChannel(&PWMD4, 1, 100-width); - //pwmEnableChannel(&PWMD4, 2, width); - //pwmEnableChannel(&PWMD4, 3, 100-width); -} - -static void iniciarluces(void) { - - palSetPadMode(GPIOC, 15, PAL_MODE_ALTERNATE(2)); /* Green */ - palSetPadMode(GPIOC, 14, PAL_MODE_ALTERNATE(2)); /* Red */ - - pwmStart(&PWMD4, &pwmCFG); - -} - - - - - -// inline void gh60_caps_led_off(void) { DDRB &= ~(1<<2); PORTB &= ~(1<<2); } - -// inline void gh60_caps_led_on(void) { DDRB |= (1<<2); PORTB &= ~(1<<2); } \ No newline at end of file diff --git a/keyboards/handwired/stm32/stm70/pwmexample.c b/keyboards/handwired/stm32/stm70/pwmexample.c deleted file mode 100644 index 664be1b763a..00000000000 --- a/keyboards/handwired/stm32/stm70/pwmexample.c +++ /dev/null @@ -1,35 +0,0 @@ -#include "ch.h" -#include "hal.h" - -static PWMConfig pwmcfg = { - 200000, - 1000, - NULL, - { - {PWM_OUTPUT_ACTIVE_HIGH, NULL}, - {PWM_OUTPUT_ACTIVE_HIGH, NULL}, - {PWM_OUTPUT_ACTIVE_HIGH, NULL}, - {PWM_OUTPUT_ACTIVE_HIGH, NULL} - }, - 0, - 0 -}; - -int main(void) { - halInit(); - chSysInit(); - - palSetPadMode(GPIOE, 8, PAL_MODE_ALTERNATE(2)); - palSetPadMode(GPIOE, 9, PAL_MODE_ALTERNATE(2)); - - pwmStart(&PWMD1, &pwmcfg); - - while (1) { - pwmEnableChannel(&PWMD1, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD1, 1000)); // 10% duty cycle - chThdSleepMilliseconds(2000); - pwmEnableChannel(&PWMD1, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD1, 9000)); // 90% duty cycle - chThdSleepMilliseconds(2000); - } - - return 0; -} \ No newline at end of file diff --git a/keyboards/handwired/stm32/stm70/stm70.c b/keyboards/handwired/stm32/stm70/stm70.c deleted file mode 100644 index 955233d6102..00000000000 --- a/keyboards/handwired/stm32/stm70/stm70.c +++ /dev/null @@ -1 +0,0 @@ -#include "stm70.h" diff --git a/keyboards/handwired/stm32/stm70/stm70.h b/keyboards/handwired/stm32/stm70/stm70.h deleted file mode 100644 index 7a7ae9c4a3a..00000000000 --- a/keyboards/handwired/stm32/stm70/stm70.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef STM70_H -#define STM70_H -#include "stm32.h" -// Modified by Xydane -// #define LAYOUT(k00) {{ k00 }} -#endif