Add QMK equivalent attributes of DiodeOrientation
This commit is contained in:
parent
d3b315d059
commit
7601a6f21f
@ -33,7 +33,7 @@ keyboard = KMKKeyboard()
|
|||||||
|
|
||||||
keyboard.col_pins = (board.GP0,)
|
keyboard.col_pins = (board.GP0,)
|
||||||
keyboard.row_pins = (board.GP1,)
|
keyboard.row_pins = (board.GP1,)
|
||||||
keyboard.diode_orientation = DiodeOrientation.COLUMNS
|
keyboard.diode_orientation = DiodeOrientation.COL2ROW
|
||||||
|
|
||||||
keyboard.keymap = [
|
keyboard.keymap = [
|
||||||
[KC.A,]
|
[KC.A,]
|
||||||
|
@ -40,7 +40,7 @@ from kmk.matrix import DiodeOrientation
|
|||||||
col_pins = (board.SCK, board.MOSI, board.MISO, board.RX, board.TX, board.D4)
|
col_pins = (board.SCK, board.MOSI, board.MISO, board.RX, board.TX, board.D4)
|
||||||
row_pins = (board.D10, board.D11, board.D12, board.D13, board.D9, board.D6, board.D5, board.SCL)
|
row_pins = (board.D10, board.D11, board.D12, board.D13, board.D9, board.D6, board.D5, board.SCL)
|
||||||
rollover_cols_every_rows = 4
|
rollover_cols_every_rows = 4
|
||||||
diode_orientation = DiodeOrientation.COLUMNS
|
diode_orientation = DiodeOrientation.COL2ROW
|
||||||
```
|
```
|
||||||
|
|
||||||
The pins should be based on whatever CircuitPython calls pins on your particular
|
The pins should be based on whatever CircuitPython calls pins on your particular
|
||||||
@ -52,7 +52,7 @@ print(dir(board))
|
|||||||
```
|
```
|
||||||
|
|
||||||
> Note: `rollover_cols_every_rows` is only supported with
|
> Note: `rollover_cols_every_rows` is only supported with
|
||||||
> `DiodeOrientation.COLUMNS`, not `DiodeOrientation.ROWS`. It is used for boards
|
> `DiodeOrientation.COLUMNS`/`DiodeOrientation.COL2ROW`, not `DiodeOrientation.ROWS`/`DiodeOrientation.ROW2COL`. It is used for boards
|
||||||
> such as the Planck Rev6 which reuse column pins to simulate a 4x12 matrix in
|
> such as the Planck Rev6 which reuse column pins to simulate a 4x12 matrix in
|
||||||
> the form of an 8x6 matrix
|
> the form of an 8x6 matrix
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ keyboard = KMKKeyboard()
|
|||||||
|
|
||||||
keyboard.col_pins = (board.GP0,)
|
keyboard.col_pins = (board.GP0,)
|
||||||
keyboard.row_pins = (board.GP1,)
|
keyboard.row_pins = (board.GP1,)
|
||||||
keyboard.diode_orientation = DiodeOrientation.COLUMNS
|
keyboard.diode_orientation = DiodeOrientation.COL2ROW
|
||||||
|
|
||||||
keyboard.keymap = [
|
keyboard.keymap = [
|
||||||
[KC.A,]
|
[KC.A,]
|
||||||
|
@ -20,7 +20,7 @@ colums and the diode direction (if any), should be defined like this
|
|||||||
```python
|
```python
|
||||||
row_pins = [board.p0_31, board.p0_29, board.p0_02, board.p1_15]
|
row_pins = [board.p0_31, board.p0_29, board.p0_02, board.p1_15]
|
||||||
col_pins = [board.p0_22, board.p0_24, board.p1_00, board.p0_11, board.p1_04]
|
col_pins = [board.p0_22, board.p0_24, board.p1_00, board.p0_11, board.p1_04]
|
||||||
diode_orientation = DiodeOrientation.COLUMNS
|
diode_orientation = DiodeOrientation.COL2ROW
|
||||||
```
|
```
|
||||||
|
|
||||||
## Additional pins for extensions
|
## Additional pins for extensions
|
||||||
|
@ -47,7 +47,7 @@ keyboard = KMKKeyboard()
|
|||||||
|
|
||||||
keyboard.col_pins = (board.GP0,)
|
keyboard.col_pins = (board.GP0,)
|
||||||
keyboard.row_pins = (board.GP1,)
|
keyboard.row_pins = (board.GP1,)
|
||||||
keyboard.diode_orientation = DiodeOrientation.COLUMNS
|
keyboard.diode_orientation = DiodeOrientation.COL2ROW
|
||||||
|
|
||||||
keyboard.keymap = [
|
keyboard.keymap = [
|
||||||
[KC.A,]
|
[KC.A,]
|
||||||
|
@ -41,7 +41,7 @@ from kmk.matrix import DiodeOrientation
|
|||||||
col_pins = (board.SCK, board.MOSI, board.MISO, board.RX, board.TX, board.D4)
|
col_pins = (board.SCK, board.MOSI, board.MISO, board.RX, board.TX, board.D4)
|
||||||
row_pins = (board.D10, board.D11, board.D12, board.D13, board.D9, board.D6, board.D5, board.SCL)
|
row_pins = (board.D10, board.D11, board.D12, board.D13, board.D9, board.D6, board.D5, board.SCL)
|
||||||
rollover_cols_every_rows = 4
|
rollover_cols_every_rows = 4
|
||||||
diode_orientation = DiodeOrientation.COLUMNS
|
diode_orientation = DiodeOrientation.COL2ROW
|
||||||
```
|
```
|
||||||
|
|
||||||
Os pinos devem ser baseados naquilo que o CircuitPython chama de pinos na sua
|
Os pinos devem ser baseados naquilo que o CircuitPython chama de pinos na sua
|
||||||
@ -54,7 +54,7 @@ print(dir(board))
|
|||||||
```
|
```
|
||||||
|
|
||||||
> Note: `rollover_cols_every_rows` só é suportado com
|
> Note: `rollover_cols_every_rows` só é suportado com
|
||||||
> `DiodeOrientation.COLUMNS`, não `DiodeOrientation.ROWS`. Este é usado em
|
> `DiodeOrientation.COLUMNS`/`DiodeOrientation.COL2ROW`, não `DiodeOrientation.ROWS`/`DiodeOrientation.ROW2COL`. Este é usado em
|
||||||
> placas como a Planck Rev6 que reusa pinos de coluna para simular uma matriz
|
> placas como a Planck Rev6 que reusa pinos de coluna para simular uma matriz
|
||||||
> 4x12 na forma de uma matriz 8x6.
|
> 4x12 na forma de uma matriz 8x6.
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ forma:
|
|||||||
```python
|
```python
|
||||||
row_pins = [board.p0_31, board.p0_29, board.p0_02, board.p1_15]
|
row_pins = [board.p0_31, board.p0_29, board.p0_02, board.p1_15]
|
||||||
col_pins = [board.p0_22, board.p0_24, board.p1_00, board.p0_11, board.p1_04]
|
col_pins = [board.p0_22, board.p0_24, board.p1_00, board.p0_11, board.p1_04]
|
||||||
diode_orientation = DiodeOrientation.COLUMNS
|
diode_orientation = DiodeOrientation.COL2ROW
|
||||||
```
|
```
|
||||||
|
|
||||||
## Pinos Adicionais para Extensões
|
## Pinos Adicionais para Extensões
|
||||||
|
@ -10,10 +10,14 @@ class DiodeOrientation:
|
|||||||
Orientation of diodes on handwired boards. You can think of:
|
Orientation of diodes on handwired boards. You can think of:
|
||||||
COLUMNS = vertical
|
COLUMNS = vertical
|
||||||
ROWS = horizontal
|
ROWS = horizontal
|
||||||
|
|
||||||
|
COL2ROW and ROW2COL are equivalent to their meanings in QMK.
|
||||||
'''
|
'''
|
||||||
|
|
||||||
COLUMNS = 0
|
COLUMNS = 0
|
||||||
ROWS = 1
|
ROWS = 1
|
||||||
|
COL2ROW = COLUMNS
|
||||||
|
ROW2COL = ROWS
|
||||||
|
|
||||||
|
|
||||||
class MatrixScanner:
|
class MatrixScanner:
|
||||||
|
Loading…
Reference in New Issue
Block a user