Skip to content

Commit

Permalink
Add Matrix 8XV1.2 OG rev1 PCB (qmk#11614)
Browse files Browse the repository at this point in the history
* add v1 12og pcb

* update

* matrix changes for testing

* Update matrix.c

* finalized files

* rename board versions

* update readmes

* typo in readme

* fix board filenames

* Update keyboards/matrix/m12og/rev1/rev1.c

Co-authored-by: Drashna Jaelre <drashna@live.com>

* change function

* update halconf and chconf

* merge master

* Update readme.md

* Update readme.md

* Update readme.md

Co-authored-by: Drashna Jaelre <drashna@live.com>
  • Loading branch information
kb-elmo and drashna authored Jun 11, 2021
1 parent 2e90ef0 commit 0ef145d
Show file tree
Hide file tree
Showing 26 changed files with 1,008 additions and 24 deletions.
18 changes: 7 additions & 11 deletions keyboards/matrix/m12og/readme.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
# Matrix 8XV1.2 OG keyboard

![Matrix 8XV1.2 OG](https://raw.githubusercontent.com/yulei/qmk_webusb_tool/master/public/m12og.jpg)
![Matrix 8XV1.2 OG](https://i.imgur.com/NELL6Sbl.jpg)

This was the Matrix 8XV1.2 OG keyboard made by the Matrix team. Note: this firmware only support ISO/ANSI version,
and DO NOT support the 8XV1.2 OG ANSI only version.
This was the Matrix 8XV1.2 OG keyboard made by the Matrix team.

* Keyboard Maintainer: [astro](https://github.com/yulei)
* Hardware Supported: Matrix 8XV1.2 OG (ISO/ANSI) keyboard
* Hardware Availability: Matrix Lab
There are two versions of the PCB available.

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

make matrix/m12og: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).
|Version|Features |
|-------|-----------------------------------------------------|
|rev1 |Green/Yellow PCB / ARM STM32 controller / ANSI only |
|rev2 |White PCB / Atmel AVR controller / ANSI/ISO |
50 changes: 50 additions & 0 deletions keyboards/matrix/m12og/rev1/boards/m12og_v1/board.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

#include <hal.h>

/**
* @brief PAL setup.
* @details Digital I/O ports static configuration as defined in @p board.h.
* This variable is used by the HAL when initializing the PAL driver.
*/
#if HAL_USE_PAL || defined(__DOXYGEN__)
const PALConfig pal_default_config =
{
{VAL_GPIOAODR, VAL_GPIOACRL, VAL_GPIOACRH},
{VAL_GPIOBODR, VAL_GPIOBCRL, VAL_GPIOBCRH},
{VAL_GPIOCODR, VAL_GPIOCCRL, VAL_GPIOCCRH},
{VAL_GPIODODR, VAL_GPIODCRL, VAL_GPIODCRH},
{VAL_GPIOEODR, VAL_GPIOECRL, VAL_GPIOECRH},
};
#endif

/*
* Early initialization code.
* This initialization must be performed just after stack setup and before
* any other initialization.
*/
void __early_init(void) {
stm32_clock_init();

}

/*
* Board-specific initialization code.
*/
void boardInit(void) {

}
142 changes: 142 additions & 0 deletions keyboards/matrix/m12og/rev1/boards/m12og_v1/board.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
/*
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

#ifndef _BOARD_H_
#define _BOARD_H_

/*
* Board identifier.
*/
#define BOARD_M12OG
#define BOARD_NAME "Matrix 12og keyboard"

/*
* Board frequencies.
*/
#define STM32_LSECLK 32768
#define STM32_HSECLK 8000000

/*
* MCU type, supported types are defined in ./os/hal/platforms/hal_lld.h.
*
* Only xB (128KB Flash) is defined, but it's identical to the
* x8 version (64KB Flash) except for the Flash region size in the
* linker script. For x8 parts use xB here and change to the x8 linker
* script in the project Makefile.
*/
#define STM32F103xB

/*
* IO pins assignments
*
* numbering is sorted by onboard/connectors, as from the schematics in
* http://www.vcc-gnd.com/read.php?tid=369
*/

/* on-board */
#define GPIOA_USBDM 11 // pin 8
#define GPIOA_USBDP 12 // pin 9

#define GPIOC_OSC32_IN 14
#define GPIOC_OSC32_OUT 15

/*
* I/O ports initial setup, this configuration is established soon after reset
* in the initialization code.
*
* The digits have the following meaning:
* 0 - Analog input.
* 1 - Push Pull output 10MHz.
* 2 - Push Pull output 2MHz.
* 3 - Push Pull output 50MHz.
* 4 - Digital input.
* 5 - Open Drain output 10MHz.
* 6 - Open Drain output 2MHz.
* 7 - Open Drain output 50MHz.
* 8 - Digital input with PullUp or PullDown resistor depending on ODR.
* 9 - Alternate Push Pull output 10MHz.
* A - Alternate Push Pull output 2MHz.
* B - Alternate Push Pull output 50MHz.
* C - Reserved.
* D - Alternate Open Drain output 10MHz.
* E - Alternate Open Drain output 2MHz.
* F - Alternate Open Drain output 50MHz.
* Please refer to the STM32 Reference Manual for details.
*/

/*
* Port A setup.
* Everything input with pull-up except:
*/
#define VAL_GPIOACRL 0x88888888 /* PA7...PA0 */
#define VAL_GPIOACRH 0x88888888 /* PA15...PA8 */
#define VAL_GPIOAODR 0xFFFFFFFF

/*
* Port B setup.
* Everything input with pull-up except:
*/
#define VAL_GPIOBCRL 0x88888888 /* PB7...PB0 */
#define VAL_GPIOBCRH 0x88888888 /* PB15...PB8 */
#define VAL_GPIOBODR 0xFFFFFFFF

/*
* Port C setup.
* Everything input with pull-up except:
*/
#define VAL_GPIOCCRL 0x88888888 /* PC7...PC0 */
#define VAL_GPIOCCRH 0x88888888 /* PC15...PC8 */
#define VAL_GPIOCODR 0xFFFFFFFF

/*
* Port D setup.
* Everything input with pull-up except:
* PD0 - Normal input (XTAL).
* PD1 - Normal input (XTAL).
*/
#define VAL_GPIODCRL 0x88888844 /* PD7...PD0 */
#define VAL_GPIODCRH 0x88888888 /* PD15...PD8 */
#define VAL_GPIODODR 0xFFFFFFFF

/*
* Port E setup.
* Everything input with pull-up except:
*/
#define VAL_GPIOECRL 0x88888888 /* PE7...PE0 */
#define VAL_GPIOECRH 0x88888888 /* PE15...PE8 */
#define VAL_GPIOEODR 0xFFFFFFFF

/*
* USB bus activation macro, required by the USB driver.
*/
#define usb_lld_connect_bus(usbp) /* always connected */

/*
* USB bus de-activation macro, required by the USB driver.
*/
#define usb_lld_disconnect_bus(usbp) /* always connected */

#if !defined(_FROM_ASM_)
#ifdef __cplusplus
extern "C" {
#endif
void boardInit(void);
#ifdef __cplusplus
}
#endif
#endif /* _FROM_ASM_ */

#endif /* _BOARD_H_ */
5 changes: 5 additions & 0 deletions keyboards/matrix/m12og/rev1/boards/m12og_v1/board.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# List of all the board related files.
BOARDSRC = $(BOARD_PATH)/boards/m12og_v1/board.c

# Required include directories
BOARDINC = $(BOARD_PATH)/boards/m12og_v1
40 changes: 40 additions & 0 deletions keyboards/matrix/m12og/rev1/chconf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/* 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/matrix/m12og/rev1/chconf.h -r platforms/chibios/common/configs/chconf.h`
*/

#pragma once

#define CH_CFG_ST_TIMEDELTA 0

#define CH_CFG_USE_REGISTRY TRUE

#define CH_CFG_USE_WAITEXIT TRUE

#define CH_CFG_USE_CONDVARS TRUE

#define CH_CFG_USE_CONDVARS_TIMEOUT FALSE

#define CH_CFG_USE_MESSAGES TRUE

#define CH_CFG_USE_MAILBOXES TRUE

#define CH_CFG_USE_HEAP TRUE

#include_next <chconf.h>
54 changes: 54 additions & 0 deletions keyboards/matrix/m12og/rev1/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
Copyright 2021 kb-elmo<mail@elmo.space>
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 0x4D58
#define PRODUCT_ID 0x0369
#define DEVICE_VER 0x0001
#define MANUFACTURER matrix
#define PRODUCT m12og_v1

/* key matrix size */
#define MATRIX_ROWS 6
#define MATRIX_COLS 16

/* Keyboard Matrix Assignments */

#define MATRIX_ROW_PINS { A0, A1, A2, A3, A4, A5 }
#define MATRIX_COL_PINS { C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15 }

/* COL2ROW, ROW2COL */
#define DIODE_DIRECTION COL2ROW

/* Status LEDs */
#define LED_CAPS_LOCK_PIN B6
#define LED_SCROLL_LOCK_PIN B5

/* RGB */
#define RGB_DI_PIN B8
#define RGBLIGHT_ANIMATIONS

#define RGBLED_NUM 16
#define RGBLIGHT_SLEEP
#define WS2812_BYTE_ORDER WS2812_BYTE_ORDER_RGB

/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCE 5
26 changes: 26 additions & 0 deletions keyboards/matrix/m12og/rev1/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/matrix/m12og/rev1/halconf.h -r platforms/chibios/common/configs/halconf.h`
*/

#pragma once

#define HAL_USE_PWM TRUE

#include_next <halconf.h>
Loading

0 comments on commit 0ef145d

Please sign in to comment.