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

[Keyboard] Add nuphy air75 v2 keyboard #22751

Open
wants to merge 36 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
3995b36
[Keyboard] Add nuphy air75 v2 keyboard
nuphy-src Dec 25, 2023
3bcceb8
Merge branch 'master' into nuphy-air75
nuphy-src Dec 25, 2023
f4495d4
Fixed some issues as suggested
nuphy-src Dec 27, 2023
f5f1262
Merge branch 'nuphy-air75' of https://github.com/nuphy-src/qmk_firmwa…
nuphy-src Dec 27, 2023
8c1c967
Merge branch 'master' into nuphy-air75
nuphy-src Jan 2, 2024
7642708
[Keyboard] Adjusted the code format
nuphy-src Jan 7, 2024
9e0eb67
Merge branch 'nuphy-air75' of https://github.com/nuphy-src/qmk_firmwa…
nuphy-src Jan 7, 2024
1b27fec
Merge branch 'master' into nuphy-air75
nuphy-src Jan 7, 2024
1eb1205
Fix mac layer erroe.
nuphy-src Jan 7, 2024
dbab794
Solved the problem of not sending codes in RF mode
nuphy-src Jan 8, 2024
570bc9c
Add nuphy license header
nuphy-src Jan 8, 2024
2263f4d
Merge branch 'master' into nuphy-air75
nuphy-src Jan 9, 2024
c56e210
Merge branch 'master' into nuphy-air75
nuphy-src Jan 15, 2024
f0c395b
Fix error in info.json
nuphy-src Jan 16, 2024
47553fe
Merge branch 'nuphy-air75' of https://github.com/nuphy-src/qmk_firmwa…
nuphy-src Jan 16, 2024
2cabdbd
Use process_record_kb function at ansi.c
nuphy-src Jan 24, 2024
26eaa3f
Merge branch 'master' into nuphy-air75
GateLi Jan 31, 2024
05d4515
Fixed some issues as suggested
nuphy-src Feb 5, 2024
2c03060
Merge branch 'nuphy-air75' of https://github.com/nuphy-src/qmk_firmwa…
nuphy-src Feb 5, 2024
a3ba423
Merge branch 'master' into nuphy-air75
nuphy-src Feb 16, 2024
322c28f
Merge branch 'master' into nuphy-air75
nuphy-src Feb 18, 2024
98a848a
Merge branch 'master' into nuphy-air75
nuphy-src Feb 20, 2024
3e62c4b
Merge branch 'master' into nuphy-air75
nuphy-src Feb 29, 2024
3c28a2e
Fix some formatting issues.
nuphy-src Mar 18, 2024
7789c42
Merge branch 'nuphy-air75' of https://github.com/nuphy-src/qmk_firmwa…
nuphy-src Mar 18, 2024
29502d6
Modify readme.md
nuphy-src Mar 20, 2024
2b81cf3
Merge branch 'master' into nuphy-air75
nuphy-src Mar 20, 2024
166eb06
Merge branch 'master' into nuphy-air75
nuphy-src Mar 21, 2024
e327732
Merge branch 'master' into nuphy-air75
nuphy-src Mar 22, 2024
8d4f887
Rename some variables in the code.
nuphy-src Apr 1, 2024
67c0c7f
Merge branch 'nuphy-air75' of https://github.com/nuphy-src/qmk_firmwa…
nuphy-src Apr 1, 2024
889d8c3
Update keyboards/nuphy/air75_v2/ansi/info.json
nuphy-src May 6, 2024
00bc5af
Merge remote-tracking branch 'upstream/master' into nuphy-air75
nuphy-src Jul 2, 2024
a4f5754
update
nuphy-src Jul 2, 2024
ae0f28c
Update keyboards/nuphy/air75_v2/ansi/readme.md
nuphy-src Aug 23, 2024
0f6d5f7
rename info.json to keyboard.json
nuphy-src Aug 23, 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
729 changes: 729 additions & 0 deletions keyboards/nuphy/air75_v2/ansi/ansi.c
nuphy-src marked this conversation as resolved.
Show resolved Hide resolved

Large diffs are not rendered by default.

172 changes: 172 additions & 0 deletions keyboards/nuphy/air75_v2/ansi/ansi.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
/*
Copyright 2023 @ Nuphy <https://nuphy.com/>

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"

enum custom_keycodes {
RF_DFU = QK_KB_0,
LNK_USB,
LNK_RF,
LNK_BLE1,
LNK_BLE2,
LNK_BLE3,

MAC_TASK,
MAC_SEARCH,
MAC_VOICE,
MAC_CONSOLE,
MAC_PRT,
MAC_PRTA,

SIDE_VAI,
SIDE_VAD,
SIDE_MOD,
SIDE_HUI,
SIDE_SPI,
SIDE_SPD,

DEV_RESET,
SLEEP_MODE,
BAT_SHOW,
MAC_DND,
BAT_NUM,
RGB_TEST
};

typedef enum {
RX_Idle,
RX_Receiving,
RX_Done,
RX_Fail,
RX_OV_ERR,
RX_SUM_ERR,
RX_CMD_ERR,
RX_DATA_ERR,
RX_DATA_OV,
RX_FORMAT_ERR,

TX_OK = 0XE0,
TX_DONE,
TX_BUSY,
TX_TIMEOUT,
TX_DATA_ERR,

} TYPE_RX_STATE;


#define RF_IDLE 0
#define RF_PAIRING 1
#define RF_LINKING 2
#define RF_CONNECT 3
#define RF_DISCONNECT 4
#define RF_SLEEP 5
#define RF_SNIF 6
#define RF_INVAILD 0XFE
#define RF_ERR_STATE 0XFF

#define CMD_POWER_UP 0XF0
#define CMD_SLEEP 0XF1
#define CMD_HAND 0XF2
#define CMD_SNIF 0XF3
#define CMD_24G_SUSPEND 0XF4
#define CMD_IDLE_EXIT 0XFE

#define CMD_RPT_MS 0XE0
#define CMD_RPT_BYTE_KB 0XE1
#define CMD_RPT_BIT_KB 0XE2
#define CMD_RPT_CONSUME 0XE3
#define CMD_RPT_SYS 0XE4

#define CMD_SET_LINK 0XC0
#define CMD_SET_CONFIG 0XC1
#define CMD_GET_CONFIG 0XC2
#define CMD_SET_NAME 0XC3
#define CMD_GET_NAME 0XC4
#define CMD_CLR_DEVICE 0XC5
#define CMD_NEW_ADV 0XC7
#define CMD_RF_STS_SYSC 0XC9
#define CMD_SET_24G_NAME 0XCA
#define CMD_GO_TEST 0XCF
#define CMD_RF_DFU 0XB1

#define CMD_WRITE_DATA 0X80
#define CMD_READ_DATA 0X81

#define LINK_RF_24 0
#define LINK_BT_1 1
#define LINK_BT_2 2
#define LINK_BT_3 3
#define LINK_USB 4

#define UART_HEAD 0x5A
#define FUNC_VALID_LEN 32
#define UART_MAX_LEN 64

#define SYS_SW_WIN 0xa1
#define SYS_SW_MAC 0xa2

#define RF_LINK_SHOW_TIME 300

#define HOST_USB_TYPE 0
#define HOST_BLE_TYPE 1
#define HOST_RF_TYPE 2

#define LINK_TIMEOUT (100 * 120)
#define SLEEP_TIME_DELAY (100 * 360)
#define POWER_DOWN_DELAY (24)

#define RF_LONG_PRESS_DELAY 30
#define DEV_RESET_PRESS_DELAY 30
#define RGB_TEST_PRESS_DELAY 30

typedef struct
{
uint8_t RXDState;
uint8_t RXDLen;
uint8_t RXDOverTime;
uint8_t TXDLenBack;
uint8_t TXDOffset;
uint8_t TXDBuf[UART_MAX_LEN];
uint8_t RXDBuf[UART_MAX_LEN];
} USART_MGR_STRUCT;

typedef struct
{
uint8_t link_mode;
uint8_t rf_channel;
uint8_t ble_channel;
uint8_t rf_state;
uint8_t rf_charge;
uint8_t rf_led;
uint8_t rf_baterry;
uint8_t sys_sw_state;
} DEV_INFO_STRUCT;

typedef struct
{
uint8_t default_brightness_flag;
uint8_t ee_side_mode;
uint8_t ee_side_light;
uint8_t ee_side_speed;
uint8_t ee_side_rgb;
uint8_t ee_side_colour;
uint8_t sleep_enable;
uint8_t retain1;
uint8_t retain2;
} user_config_t;
44 changes: 44 additions & 0 deletions keyboards/nuphy/air75_v2/ansi/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
Copyright 2023 @ Nuphy <https://nuphy.com/>

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 DEV_MODE_PIN C0
#define SYS_MODE_PIN C1
#define DC_BOOST_PIN C2
#define NRF_RESET_PIN B4
#define NRF_TEST_PIN B5
#define NRF_WAKEUP_PIN B8
#define DRIVER_LED_CS_PIN C6

#define DRIVER_SIDE_PIN C8
#define DRIVER_SIDE_CS_PIN C9

#define SERIAL_DRIVER SD1
#define SD1_TX_PIN B6
#define SD1_TX_PAL_MODE 0
#define SD1_RX_PIN B7
#define SD1_RX_PAL_MODE 0

#define TAP_CODE_DELAY 8
#define DYNAMIC_KEYMAP_MACRO_DELAY 8
#define DYNAMIC_KEYMAP_LAYER_COUNT 8
nuphy-src marked this conversation as resolved.
Show resolved Hide resolved

#define EECONFIG_USER_DATA_SIZE 8
nuphy-src marked this conversation as resolved.
Show resolved Hide resolved

#define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_CYCLE_LEFT_RIGHT
#define RGB_DISABLE_WHEN_USB_SUSPENDED
drashna marked this conversation as resolved.
Show resolved Hide resolved
23 changes: 23 additions & 0 deletions keyboards/nuphy/air75_v2/ansi/halconf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
Copyright 2023 @ Nuphy <https://nuphy.com/>

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_next <halconf.h>

#undef HAL_USE_SERIAL
#define HAL_USE_SERIAL TRUE
Loading