aboutsummaryrefslogtreecommitdiff
path: root/keyboards/amjkeyboard/amj96
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/amjkeyboard/amj96')
-rw-r--r--keyboards/amjkeyboard/amj96/config.h5
-rw-r--r--keyboards/amjkeyboard/amj96/keyboard.json (renamed from keyboards/amjkeyboard/amj96/info.json)14
-rw-r--r--keyboards/amjkeyboard/amj96/matrix.c63
-rw-r--r--keyboards/amjkeyboard/amj96/rules.mk13
4 files changed, 46 insertions, 49 deletions
diff --git a/keyboards/amjkeyboard/amj96/config.h b/keyboards/amjkeyboard/amj96/config.h
index b16c84d50e..81cbb4a5e0 100644
--- a/keyboards/amjkeyboard/amj96/config.h
+++ b/keyboards/amjkeyboard/amj96/config.h
@@ -36,11 +36,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* COL2ROW, ROW2COL*/
#define DIODE_DIRECTION COL2ROW
-/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
-#define LOCKING_SUPPORT_ENABLE
-/* Locking resynchronize hack */
-#define LOCKING_RESYNC_ENABLE
-
/*
* Feature disable options
* These options are also useful to firmware size reduction.
diff --git a/keyboards/amjkeyboard/amj96/info.json b/keyboards/amjkeyboard/amj96/keyboard.json
index 60cb8ee9e8..23a131c615 100644
--- a/keyboards/amjkeyboard/amj96/info.json
+++ b/keyboards/amjkeyboard/amj96/keyboard.json
@@ -8,6 +8,20 @@
"pid": "0x6074",
"device_version": "0.0.2"
},
+ "features": {
+ "bootmagic": false,
+ "mousekey": true,
+ "extrakey": true,
+ "console": true,
+ "nkro": true,
+ "rgblight": true
+ },
+ "qmk": {
+ "locking": {
+ "enabled": true,
+ "resync": true
+ }
+ },
"rgblight": {
"led_count": 16,
"animations": {
diff --git a/keyboards/amjkeyboard/amj96/matrix.c b/keyboards/amjkeyboard/amj96/matrix.c
index 7faf40d4fe..448508971f 100644
--- a/keyboards/amjkeyboard/amj96/matrix.c
+++ b/keyboards/amjkeyboard/amj96/matrix.c
@@ -65,8 +65,8 @@ void matrix_init(void)
#endif
// 85 REST
- DDRD |= _BV(PD7);
- PORTD |= _BV(PD7);
+ gpio_set_pin_output(D7);
+ gpio_write_pin_high(D7);
// initialize row and col
init_rows();
@@ -143,36 +143,35 @@ static void init_cols(void)
DDRD &= 0b00011100;
PORTD |= 0b11100011;
- DDRB &= ~(_BV(PB6) | _BV(PB7)| _BV(PB0));
- PORTB |= (_BV(PB6) | _BV(PB7)| _BV(PB0));
+ gpio_set_pin_input_high(B0);
+ gpio_set_pin_input_high(B6);
+ gpio_set_pin_input_high(B7);
- DDRE &= ~_BV(PE6);
- PORTE |= _BV(PE6);
+ gpio_set_pin_input_high(E6);
- DDRC &= ~_BV(PC7);
- PORTC |= _BV(PC7);
+ gpio_set_pin_input_high(C7);
}
static matrix_row_t read_cols(void)
{
- return (PINF&_BV(PF7) ? 0 : (1<<0)) |
- (PINF&_BV(PF6) ? 0 : (1<<1)) |
- (PINF&_BV(PF5) ? 0 : (1<<2)) |
- (PINF&_BV(PF4) ? 0 : (1<<3)) |
- (PINF&_BV(PF1) ? 0 : (1<<4)) |
- (PINF&_BV(PF0) ? 0 : (1<<5)) |
- (PINE&_BV(PE6) ? 0 : (1<<6)) |
- (PIND&_BV(PD7) ? 0 : (1<<7)) |
- (PIND&_BV(PD6) ? 0 : (1<<8)) |
- (PIND&_BV(PD5) ? 0 : (1<<9)) |
- (PIND&_BV(PD1) ? 0 : (1<<10)) |
- (PIND&_BV(PD0) ? 0 : (1<<11)) |
- (PINB&_BV(PB7) ? 0 : (1<<12)) |
- (PINB&_BV(PB6) ? 0 : (1<<13)) |
- (PINB&_BV(PB0) ? 0 : (1<<14)) |
- (PINC&_BV(PC7) ? 0 : (1<<15));
+ return (gpio_read_pin(F7) ? 0 : (1<<0)) |
+ (gpio_read_pin(F6) ? 0 : (1<<1)) |
+ (gpio_read_pin(F5) ? 0 : (1<<2)) |
+ (gpio_read_pin(F4) ? 0 : (1<<3)) |
+ (gpio_read_pin(F1) ? 0 : (1<<4)) |
+ (gpio_read_pin(F0) ? 0 : (1<<5)) |
+ (gpio_read_pin(E6) ? 0 : (1<<6)) |
+ (gpio_read_pin(D7) ? 0 : (1<<7)) |
+ (gpio_read_pin(D6) ? 0 : (1<<8)) |
+ (gpio_read_pin(D5) ? 0 : (1<<9)) |
+ (gpio_read_pin(D1) ? 0 : (1<<10)) |
+ (gpio_read_pin(D0) ? 0 : (1<<11)) |
+ (gpio_read_pin(B7) ? 0 : (1<<12)) |
+ (gpio_read_pin(B6) ? 0 : (1<<13)) |
+ (gpio_read_pin(B0) ? 0 : (1<<14)) |
+ (gpio_read_pin(C7) ? 0 : (1<<15));
}
/* Row pin configuration
@@ -184,21 +183,23 @@ static matrix_row_t read_cols(void)
static void init_rows(void)
{
- DDRB |= (1<<PB1 | 1<<PB2 | 1<<PB3);
+ gpio_set_pin_input(B1);
+ gpio_set_pin_input(B2);
+ gpio_set_pin_input(B3);
}
static void unselect_rows(void)
{
// Hi-Z(DDR:0, PORT:0) to unselect
- PORTB |= (1<<PB1);
- PORTB |= (1<<PB2);
- PORTB |= (1<<PB3);
+ gpio_write_pin_high(B1);
+ gpio_write_pin_high(B2);
+ gpio_write_pin_high(B3);
}
static void select_row(uint8_t row)
{
// Output low(DDR:1, PORT:0) to select
- (row & (1<<0)) ? (PORTB |= (1<<PB3)) : (PORTB &= ~(1<<PB3));
- (row & (1<<1)) ? (PORTB |= (1<<PB2)) : (PORTB &= ~(1<<PB2));
- (row & (1<<2)) ? (PORTB |= (1<<PB1)) : (PORTB &= ~(1<<PB1));
+ gpio_write_pin(B3, row & (1<<0));
+ gpio_write_pin(B2, row & (1<<1));
+ gpio_write_pin(B1, row & (1<<2));
}
diff --git a/keyboards/amjkeyboard/amj96/rules.mk b/keyboards/amjkeyboard/amj96/rules.mk
index dfe1d12b55..8784813b33 100644
--- a/keyboards/amjkeyboard/amj96/rules.mk
+++ b/keyboards/amjkeyboard/amj96/rules.mk
@@ -1,15 +1,2 @@
-# Build Options
-# change yes to no to disable
-#
-BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite
-MOUSEKEY_ENABLE = yes # Mouse keys
-EXTRAKEY_ENABLE = yes # Audio control and System control
-CONSOLE_ENABLE = yes # Console for debug
-COMMAND_ENABLE = no # Commands for debug and configuration
-NKRO_ENABLE = yes # Enable N-Key Rollover
-BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
-RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
-AUDIO_ENABLE = no # Audio output
-
CUSTOM_MATRIX = yes
SRC += matrix.c