Skip to content

Commit

Permalink
Merge remote-tracking branch 'qmk/develop' into develop
Browse files Browse the repository at this point in the history
* qmk/develop:
  Fix right half of Nyquist in 4x12 mode having row shifted up by one (qmk#14914)
  Pteron36 Refactor (qmk#14904)
  Initial USB2422 driver (qmk#14835)
  Split out arm_atsam shift register logic (qmk#14848)
  Fix ccache default (qmk#14906)
  Move USE_CCACHE logic to common location (qmk#14899)
  • Loading branch information
Carlos Cardoso committed Oct 22, 2021
2 parents 2193c67 + 203b87a commit 2c85296
Show file tree
Hide file tree
Showing 30 changed files with 734 additions and 417 deletions.
216 changes: 108 additions & 108 deletions tmk_core/protocol/arm_atsam/usb/usb2422.h → drivers/usb2422.c

Large diffs are not rendered by default.

59 changes: 59 additions & 0 deletions drivers/usb2422.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/* Copyright 2021 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 3 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 <stdbool.h>

#ifndef USB2422_ADDRESS
# define USB2422_ADDRESS 0x58
#endif

#ifndef USB2422_VENDOR_ID
# define USB2422_VENDOR_ID 0xFEED
#endif
#ifndef USB2422_PRODUCT_ID
# define USB2422_PRODUCT_ID 0x0001
#endif
#ifndef USB2422_DEVICE_VER
# define USB2422_DEVICE_VER 0x0001
#endif

#ifndef USB2422_MANUFACTURER
# define USB2422_MANUFACTURER "QMK"
#endif
#ifndef USB2422_PRODUCT
# define USB2422_PRODUCT "QMK Hub"
#endif

/** \brief Initialises the dependent subsystems */
void USB2422_init(void);

/** \brief Push configuration to the USB2422 device */
void USB2422_configure(void);

/** \brief Reset the chip (RESET_N)
*
* NOTE:
* Depends on a valid USB2422_RESET_PIN configuration
*/
void USB2422_reset(void);

/** \brief Indicates the USB state of the hub (SUSP_IND)
*
* NOTE:
* Depends on a valid USB2422_ACTIVE_PIN configuration
*/
bool USB2422_active(void);
4 changes: 3 additions & 1 deletion keyboards/keebio/nyquist/rev3/rev3.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,12 @@
{ L10, L11, L12, L13, L14, L15 }, \
{ L20, L21, L22, L23, L24, L25 }, \
{ L30, L31, L32, L33, L34, L35 }, \
{ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
{ R00, R01, R02, R03, R04, R05 }, \
{ R10, R11, R12, R13, R14, R15 }, \
{ R20, R21, R22, R23, R24, R25 }, \
{ R30, R31, R32, R33, R34, R35 } \
{ R30, R31, R32, R33, R34, R35 }, \
{ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \
}

#define LAYOUT_ortho_5x12 LAYOUT
2 changes: 1 addition & 1 deletion keyboards/massdrop/alt/alt.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "i2c_master.h"
#include "md_rgb_matrix.h" //For led keycodes
#include "usb/udi_cdc.h"
#include "usb/usb2422.h"
#include "usb/usb_hub.h"

#define LAYOUT_65_ansi_blocker( \
K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11, K12, K13, K14, K15, \
Expand Down
27 changes: 16 additions & 11 deletions keyboards/massdrop/alt/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* This Shift Register expands available hardware output lines to control additional peripherals */
/* It uses four lines from the MCU to provide 16 output lines */
/* Shift Register Clock configuration (MCU to ShiftRegister.RCLK) */
#define SR_EXP_RCLK_PORT PB
#define SR_EXP_RCLK_PIN 14
#define SR_EXP_RCLK_PIN B14
/* Shift Register Output Enable configuration (MCU to ShiftRegister.OE_N) */
#define SR_EXP_OE_N_PORT PB
#define SR_EXP_OE_N_PIN 15
#define SR_EXP_OE_PIN B15
/* SERCOM port to use for Shift Register SPI */
/* DATAOUT and SCLK must be configured to use hardware pins of this port */
#define SR_EXP_SERCOM SERCOM2
#define SPI_SERCOM SERCOM2
/* Shift Register SPI Data Out configuration (MCU.SERCOMx.PAD[0] to ShiftRegister.SER) */
#define SR_EXP_DATAOUT_PORT PA
#define SR_EXP_DATAOUT_PIN 12
#define SR_EXP_DATAOUT_MUX 2
#define SPI_DATAOUT_PIN A12
#define SPI_DATAOUT_MUX 2
/* Shift Register SPI Serial Clock configuration (MCU.SERCOMx.PAD[1] to ShiftRegister.SRCLK) */
#define SR_EXP_SCLK_PORT PA
#define SR_EXP_SCLK_PIN 13
#define SR_EXP_SCLK_MUX 2
#define SPI_SCLK_PIN A13
#define SPI_SCLK_MUX 2

/* Debug LED (Small LED Located near MCU) */
#define DEBUG_LED_ENABLE 1
Expand Down Expand Up @@ -94,6 +90,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define DEBUG_BOOT_TRACING_PORT PB
#define DEBUG_BOOT_TRACING_PIN 23

/* USB2422 config */
#define USB2422_ADDRESS 0x58
#define USB2422_VENDOR_ID 0x04D8
#define USB2422_PRODUCT_ID 0xEEC5
#define USB2422_DEVICE_VER 0x0101
#define USB2422_MANUFACTURER "Massdrop Inc."
#define USB2422_PRODUCT "Massdrop Hub"
#define USB2422_ACTIVE_PIN A18

/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCE 5

Expand Down
27 changes: 16 additions & 11 deletions keyboards/massdrop/ctrl/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* This Shift Register expands available hardware output lines to control additional peripherals */
/* It uses four lines from the MCU to provide 16 output lines */
/* Shift Register Clock configuration (MCU to ShiftRegister.RCLK) */
#define SR_EXP_RCLK_PORT PB
#define SR_EXP_RCLK_PIN 14
#define SR_EXP_RCLK_PIN B14
/* Shift Register Output Enable configuration (MCU to ShiftRegister.OE_N) */
#define SR_EXP_OE_N_PORT PB
#define SR_EXP_OE_N_PIN 15
#define SR_EXP_OE_PIN B15
/* SERCOM port to use for Shift Register SPI */
/* DATAOUT and SCLK must be configured to use hardware pins of this port */
#define SR_EXP_SERCOM SERCOM2
#define SPI_SERCOM SERCOM2
/* Shift Register SPI Data Out configuration (MCU.SERCOMx.PAD[0] to ShiftRegister.SER) */
#define SR_EXP_DATAOUT_PORT PA
#define SR_EXP_DATAOUT_PIN 12
#define SR_EXP_DATAOUT_MUX 2
#define SPI_DATAOUT_PIN A12
#define SPI_DATAOUT_MUX 2
/* Shift Register SPI Serial Clock configuration (MCU.SERCOMx.PAD[1] to ShiftRegister.SRCLK) */
#define SR_EXP_SCLK_PORT PA
#define SR_EXP_SCLK_PIN 13
#define SR_EXP_SCLK_MUX 2
#define SPI_SCLK_PIN A13
#define SPI_SCLK_MUX 2

/* Debug LED (Small LED Located near MCU) */
#define DEBUG_LED_ENABLE 1
Expand Down Expand Up @@ -93,6 +89,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define DEBUG_BOOT_TRACING_PORT PB
#define DEBUG_BOOT_TRACING_PIN 23

/* USB2422 config */
#define USB2422_ADDRESS 0x58
#define USB2422_VENDOR_ID 0x04D8
#define USB2422_PRODUCT_ID 0xEEC5
#define USB2422_DEVICE_VER 0x0101
#define USB2422_MANUFACTURER "Massdrop Inc."
#define USB2422_PRODUCT "Massdrop Hub"
#define USB2422_ACTIVE_PIN A18

/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCE 5

Expand Down
2 changes: 1 addition & 1 deletion keyboards/massdrop/ctrl/ctrl.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "i2c_master.h"
#include "md_rgb_matrix.h" //For led keycodes
#include "usb/udi_cdc.h"
#include "usb/usb2422.h"
#include "usb/usb_hub.h"

#define LAYOUT( \
K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11, K12, K13, K14, K15, \
Expand Down
88 changes: 85 additions & 3 deletions keyboards/pteron36/info.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,95 @@
{
"keyboard_name": "Pteron36",
"url": "",
"maintainer": "Harshit Goel",
"maintainer": "harshitgoel96",
"layouts": {
"LAYOUT_split_3x5_3": {
"layout": [{"x":2, "y":0}, {"x":12.5, "y":0}, {"x":1, "y":0.5}, {"x":3, "y":0.5}, {"x":11.5, "y":0.5}, {"x":13.5, "y":0.5}, {"x":4, "y":0.75}, {"x":10.5, "y":0.75}, {"x":0, "y":1}, {"x":2, "y":1}, {"x":12.5, "y":1}, {"x":14.5, "y":1}, {"x":1, "y":1.5}, {"x":3, "y":1.5}, {"x":11.5, "y":1.5}, {"x":13.5, "y":1.5}, {"x":4, "y":1.75}, {"x":10.5, "y":1.75}, {"x":0, "y":2}, {"x":2, "y":2}, {"x":12.5, "y":2}, {"x":14.5, "y":2}, {"x":1, "y":2.5}, {"x":3, "y":2.5}, {"x":11.5, "y":2.5}, {"x":13.5, "y":2.5}, {"x":4, "y":2.75}, {"x":10.5, "y":2.75}, {"x":0, "y":3}, {"x":14.5, "y":3}, {"x":4, "y":4}, {"x":5, "y":4}, {"x":6, "y":4}, {"x":8.5, "y":4}, {"x":9.5, "y":4}, {"x":10.5, "y":4}]
"layout": [
{"x":0, "y":1},
{"x":1, "y":0.5},
{"x":2, "y":0},
{"x":3, "y":0.5},
{"x":4, "y":0.75},
{"x":10, "y":0.75},
{"x":11, "y":0.5},
{"x":12, "y":0},
{"x":13, "y":0.5},
{"x":14, "y":1},

{"x":0, "y":2},
{"x":1, "y":1.5},
{"x":2, "y":1},
{"x":3, "y":1.5},
{"x":4, "y":1.75},
{"x":10, "y":1.75},
{"x":11, "y":1.5},
{"x":12, "y":1},
{"x":13, "y":1.5},
{"x":14, "y":2},

{"x":0, "y":3},
{"x":1, "y":2.5},
{"x":2, "y":2},
{"x":3, "y":2.5},
{"x":4, "y":2.75},
{"x":10, "y":2.75},
{"x":11, "y":2.5},
{"x":12, "y":2},
{"x":13, "y":2.5},
{"x":14, "y":3},

{"x":4, "y":4},
{"x":5, "y":4},
{"x":6, "y":4},
{"x":8, "y":4},
{"x":9, "y":4},
{"x":10, "y":4}
]
},
"LAYOUT_split_3x5_3_encoder": {
"layout": [{"x":2, "y":0}, {"x":12.5, "y":0}, {"x":1, "y":0.5}, {"x":3, "y":0.5}, {"x":11.5, "y":0.5}, {"x":13.5, "y":0.5}, {"x":4, "y":0.75}, {"x":10.5, "y":0.75}, {"x":0, "y":1}, {"x":2, "y":1}, {"x":12.5, "y":1}, {"x":14.5, "y":1}, {"x":1, "y":1.5}, {"x":3, "y":1.5}, {"x":11.5, "y":1.5}, {"x":13.5, "y":1.5}, {"x":4, "y":1.75}, {"x":10.5, "y":1.75}, {"x":0, "y":2}, {"x":2, "y":2}, {"x":12.5, "y":2}, {"x":14.5, "y":2}, {"x":1, "y":2.5}, {"x":3, "y":2.5}, {"x":11.5, "y":2.5}, {"x":13.5, "y":2.5}, {"x":4, "y":2.75}, {"label":"enc1", "x":5.5, "y":2.75}, {"label":"enc2", "x":9, "y":2.75}, {"x":10.5, "y":2.75}, {"x":0, "y":3}, {"x":14.5, "y":3}, {"x":4, "y":4}, {"x":5, "y":4}, {"x":6, "y":4}, {"x":8.5, "y":4}, {"x":9.5, "y":4}, {"x":10.5, "y":4}]
"layout": [
{"x":0, "y":1},
{"x":1, "y":0.5},
{"x":2, "y":0},
{"x":3, "y":0.5},
{"x":4, "y":0.75},
{"x":10, "y":0.75},
{"x":11, "y":0.5},
{"x":12, "y":0},
{"x":13, "y":0.5},
{"x":14, "y":1},

{"x":0, "y":2},
{"x":1, "y":1.5},
{"x":2, "y":1},
{"x":3, "y":1.5},
{"x":4, "y":1.75},
{"x":10, "y":1.75},
{"x":11, "y":1.5},
{"x":12, "y":1},
{"x":13, "y":1.5},
{"x":14, "y":2},

{"x":0, "y":3},
{"x":1, "y":2.5},
{"x":2, "y":2},
{"x":3, "y":2.5},
{"x":4, "y":2.75},
{"label":"enc1", "x":5.5, "y":2.75},
{"label":"enc2", "x":8.5, "y":2.75},
{"x":10, "y":2.75},
{"x":11, "y":2.5},
{"x":12, "y":2},
{"x":13, "y":2.5},
{"x":14, "y":3},

{"x":4, "y":4},
{"x":5, "y":4},
{"x":6, "y":4},
{"x":8, "y":4},
{"x":9, "y":4},
{"x":10, "y":4}
]
}
}
}
13 changes: 7 additions & 6 deletions keyboards/pteron36/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ enum custom_keycodes {

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

[_QWERTY] = LAYOUT_split_3x5_3_encoder(
KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,
KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,
KC_Z, KC_X, KC_C, KC_V, KC_B,KC_LBRACKET, KC_RBRACKET, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH,
KC_LGUI, KC_BSPC, KC_SPC, KC_SPC, KC_ENT, KC_RALT
)};
[_QWERTY] = LAYOUT_split_3x5_3_encoder(
KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,
KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,
KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LBRC, KC_RBRC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH,
KC_LGUI, KC_BSPC, KC_SPC, KC_SPC, KC_ENT, KC_RALT
)
};
Loading

0 comments on commit 2c85296

Please sign in to comment.