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

Add new board km75 #23982

Open
wants to merge 69 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
21899b3
Create keyboard.json
Smartmmd Jun 14, 2024
d093e2b
Delete keyboards/mmd directory
Smartmmd Jun 14, 2024
04e6ace
Create keymap.c
Smartmmd Jun 14, 2024
d60c64f
Create keymap.c
Smartmmd Jun 14, 2024
23d1a53
Create rules.mk
Smartmmd Jun 14, 2024
4835468
Create config.h
Smartmmd Jun 14, 2024
0ff5d3d
Create halconf.h
Smartmmd Jun 14, 2024
bada9b5
Create keyboard.json
Smartmmd Jun 14, 2024
4b11b82
Create mmd-km17.c
Smartmmd Jun 14, 2024
0e1dd85
Create mcuconf.h
Smartmmd Jun 14, 2024
86b36ae
Create rules.mk
Smartmmd Jun 14, 2024
87b764f
Create readme.md
Smartmmd Jun 14, 2024
4ad729f
Update readme.md
Smartmmd Jun 14, 2024
b829504
Update readme.md
Smartmmd Jun 14, 2024
7a82636
Update readme.md
Smartmmd Jun 14, 2024
70c7e10
Merge branch 'qmk:master' into master
Smartmmd Jun 15, 2024
fe5ca2c
Merge branch 'qmk:master' into master
Smartmmd Jun 15, 2024
03c64af
Merge branch 'qmk:master' into master
Smartmmd Jun 22, 2024
c9f6531
Add km17 keyboard
JackyJia73 Jun 22, 2024
07e15d2
default keymap update
JackyJia73 Jun 22, 2024
25e3dda
halconf.h license
JackyJia73 Jun 22, 2024
63c8627
Update readme.md
Smartmmd Jun 22, 2024
e696340
Create KM75
Smartmmd Jun 22, 2024
76a2d9d
Delete keyboards/mmd/KM75
Smartmmd Jun 22, 2024
dbe4c1b
Create km75
Smartmmd Jun 22, 2024
0435cc7
Delete keyboards/mmd/km75
Smartmmd Jun 22, 2024
84ab499
Create keymap.c
Smartmmd Jun 22, 2024
6d62269
Create keymap.c
Smartmmd Jun 22, 2024
2daac2a
Create rules.mk
Smartmmd Jun 22, 2024
11a099f
Create config.h
Smartmmd Jun 22, 2024
bda7888
Create halconf.h
Smartmmd Jun 22, 2024
0965537
Create keyboard.json
Smartmmd Jun 22, 2024
66675ad
Create km75.c
Smartmmd Jun 22, 2024
718c9d6
Create mcuconf.h
Smartmmd Jun 22, 2024
cb8a1ca
Create readme.md
Smartmmd Jun 22, 2024
26933be
Create rules.mk
Smartmmd Jun 22, 2024
abfd6bf
Update readme.md
Smartmmd Jun 22, 2024
108e3d2
keyboards name changed, remove non related wireless code (this is a U…
JackyJia73 Jun 22, 2024
af89dcc
Merge branch 'master' of https://github.com/Smartmmd/qmk_firmware
JackyJia73 Jun 22, 2024
1a88922
Name change to km75 from km17
JackyJia73 Jun 22, 2024
63d3494
Keymaps updates
JackyJia73 Jun 22, 2024
0038afa
Merge branch 'qmk:master' into master
Smartmmd Jun 29, 2024
2cd09a0
Update keyboards/mmd/km75/km75.c
JackyJia73 Jul 3, 2024
760b5d4
Update keyboards/mmd/km75/km75.c
JackyJia73 Jul 3, 2024
b157de1
Update keyboards/mmd/km75/config.h
JackyJia73 Jul 3, 2024
f29b64f
endcoder move to keyboard.json
JackyJia73 Jul 3, 2024
d279d83
TAB change to space
JackyJia73 Jul 3, 2024
c809973
Update keyboards/mmd/km75/config.h
JackyJia73 Jul 5, 2024
83b72a7
Update keyboards/mmd/km75/rules.mk
JackyJia73 Jul 5, 2024
7212e61
Update keyboards/mmd/km75/keyboard.json
JackyJia73 Jul 5, 2024
634412e
Update keyboards/mmd/km75/keyboard.json
JackyJia73 Jul 5, 2024
18ea74f
Update keyboards/mmd/km75/keymaps/default/keymap.c
JackyJia73 Jul 5, 2024
bb046d9
Update keyboards/mmd/km75/keymaps/via/keymap.c
JackyJia73 Jul 5, 2024
d06f16d
Update keyboards/mmd/km75/keyboard.json
JackyJia73 Jul 5, 2024
5de9a8e
licence headers
JackyJia73 Jul 5, 2024
e57a832
Merge branch 'qmk:master' into master
JackyJia73 Jul 12, 2024
2871af5
update hardware location links
JackyJia73 Jul 12, 2024
238ebd9
Merge branch 'master' of https://github.com/Smartmmd/qmk_firmware
JackyJia73 Jul 12, 2024
cf1e065
update RGB MTRIX LAYOUT, KEY LAYOUT
JackyJia73 Jul 12, 2024
fb0e1ac
update rgb effect
JackyJia73 Jul 12, 2024
f3e7a3d
Update keyboards/mmd/km75/keyboard.json
JackyJia73 Jul 12, 2024
baa16d8
wireless code
JackyJia73 Jul 16, 2024
36f4805
Merge branch 'master' of https://github.com/Smartmmd/qmk_firmware
JackyJia73 Jul 16, 2024
350f7ca
Update readme.md
JackyJia73 Jul 17, 2024
4ee8e0d
Merge branch 'qmk:master' into master
JackyJia73 Jul 18, 2024
fa3d262
update readme.md
JackyJia73 Jul 18, 2024
3582988
Merge branch 'qmk:master' into master
JackyJia73 Jul 31, 2024
70ae2a1
Merge branch 'qmk:master' into master
JackyJia73 Aug 27, 2024
a108945
Delete keyboards/mmd/km75/keymaps/via directory
JackyJia73 Aug 27, 2024
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
124 changes: 124 additions & 0 deletions keyboards/mmd/common/smart_ble.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
// /* Copyright 2024 Jacky
// *
// * 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 "uart.h"
#include "ch.h"
#include "hal.h"
#include "host.h"
#include "host_driver.h"
#include "report.h"
#include "smart_ble.h"

static uint8_t sc_ble_leds(void) {
return 0; // TODO: Get LED status BLE
}

static void sc_ble_mouse(report_mouse_t *report) {
static uint8_t last_report[sizeof(report_mouse_t)]={0};

if (!has_mouse_report_changed((report_mouse_t *)last_report, report)) return;
memcpy(last_report,report,sizeof(report_mouse_t));
uart_write(0x55);
uart_write(sizeof(report_mouse_t));
uart_transmit(last_report,sizeof(report_mouse_t));
}


static void sc_ble_extra(report_extra_t *report) {
uart_write(0x55);
uart_write(sizeof(report_extra_t));
uart_transmit((uint8_t *)report,sizeof(report_extra_t));
}

static void sc_ble_keyboard(report_keyboard_t *report) {
uart_write(0x55);
uart_write(0x09);
uart_write(0x01);
uart_transmit((uint8_t *)report,KEYBOARD_REPORT_SIZE);
}

static void sc_send_nkro(report_nkro_t *report)
{
uart_write(0x55);
uart_write(0x12);
uart_transmit((uint8_t *)report,0x12);
}

static host_driver_t *last_host_driver = NULL;
static host_driver_t sc_ble_driver = {
sc_ble_leds, sc_ble_keyboard,sc_send_nkro,sc_ble_mouse, sc_ble_extra
};


void smart_ble_startup(void) {
if (host_get_driver() == &sc_ble_driver) {
return;
}
clear_keyboard();
last_host_driver = host_get_driver();
host_set_driver(&sc_ble_driver);
}

void smart_ble_disconnect(void) {
if (host_get_driver() != &sc_ble_driver) {
return;
}
clear_keyboard();
host_set_driver(last_host_driver);
}


void sc_ble_battary(uint8_t batt_level) {
uart_write(0x55);
uart_write(0x02);
uart_write(0x09);
uart_write(batt_level);
}

void WIRELESS_START(uint32_t mode)
{
uint8_t ble_command[24];
smart_ble_startup();
if(mode<1 || mode>4)
{
mode=1;
}
ble_command[0]=0x55;
ble_command[1]=20;
ble_command[2]=0;
ble_command[3]=mode;
strcpy((char * restrict)(ble_command+4),PRODUCT);
ble_command[strlen(PRODUCT)+4]='-';
ble_command[strlen(PRODUCT)+5]='0' + mode;
ble_command[strlen(PRODUCT)+6]= 0;
uart_transmit(ble_command,sizeof(ble_command));
}

void WIRELESS_STOP(void)
{
smart_ble_disconnect();
uart_write(0x55);
uart_write(0x02);
uart_write(0x00);
uart_write(0x00);
}







32 changes: 32 additions & 0 deletions keyboards/mmd/common/smart_ble.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// /* Copyright 2024 Jacky
// *
// * 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"

void sc_ble_battary(uint8_t batt_level);
void WIRELESS_START(uint32_t mode);
void WIRELESS_STOP(void);










25 changes: 25 additions & 0 deletions keyboards/mmd/km75/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/* Copyright 2022 Jacky
*
* 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

#define WS2812_PWM_DRIVER PWMD3
#define WS2812_PWM_CHANNEL 1
#define WS2812_PWM_PAL_MODE 2
#define WS2812_DMA_STREAM STM32_DMA1_STREAM3
#define WS2812_DMA_CHANNEL 3

22 changes: 22 additions & 0 deletions keyboards/mmd/km75/halconf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* Copyright 2022 Jacky
*
* 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

#define HAL_USE_PWM TRUE

#include_next <halconf.h>
Loading