Merge remote-tracking branch 'origin/develop' into xap

This commit is contained in:
QMK Bot 2023-03-19 21:12:44 +00:00
commit 07142ffaa2
115 changed files with 238 additions and 242 deletions

View file

@ -10,6 +10,9 @@
// deprecated: Default `false`. Set to `true` to turn on warning when a value exists
// invalid: Default `false`. Set to `true` to generate errors when a value exists
// replace_with: use with a key marked deprecated or invalid to designate a replacement
"APA102_DI_PIN": {"info_key": "apa102.data_pin"},
"APA102_CI_PIN": {"info_key": "apa102.clock_pin"},
"APA102_DEFAULT_BRIGHTNESS": {"info_key": "apa102.default_brightness", "value_type": "int"},
"AUDIO_VOICES": {"info_key": "audio.voices", "value_type": "bool"},
"BACKLIGHT_BREATHING": {"info_key": "backlight.breathing", "value_type": "bool"},
"BREATHING_PERIOD": {"info_key": "backlight.breathing_period", "value_type": "int"},

View file

@ -96,6 +96,19 @@
"unknown"
]
},
"apa102": {
"type": "object",
"additionalProperties": false,
"properties": {
"data_pin": {"$ref": "qmk.definitions.v1#/mcu_pin"},
"clock_pin": {"$ref": "qmk.definitions.v1#/mcu_pin"},
"default_brightness": {
"type": "integer",
"minimum": 0,
"maximum": 31
}
}
},
"audio": {
"type": "object",
"additionalProperties": false,

View file

@ -383,9 +383,9 @@ Configure the hardware via your `config.h`:
```c
// The pin connected to the data pin of the LEDs
#define RGB_DI_PIN D7
#define APA102_DI_PIN D7
// The pin connected to the clock pin of the LEDs
#define RGB_CI_PIN D6
#define APA102_CI_PIN D6
// The number of LEDs connected
#define RGB_MATRIX_LED_COUNT 70
```

View file

@ -35,8 +35,9 @@ At minimum you must define the data pin your LED strip is connected to, and the
|Define |Description |
|---------------|---------------------------------------------------------------------------------------------------------|
|`RGB_DI_PIN` |The pin connected to the data pin of the LEDs |
|`RGB_CI_PIN` |The pin connected to the clock pin of the LEDs (APA102 only) |
|`RGB_DI_PIN` |The pin connected to the data pin of the LEDs (WS2812) |
|`APA102_DI_PIN`|The pin connected to the data pin of the LEDs (APA102) |
|`APA102_CI_PIN`|The pin connected to the clock pin of the LEDs (APA102) |
|`RGBLED_NUM` |The number of LEDs connected |
|`RGBLED_SPLIT` |(Optional) For split keyboards, the number of LEDs connected on each half directly wired to `RGB_DI_PIN` |

View file

@ -27,7 +27,7 @@
# if defined(STM32F0XX) || defined(STM32F1XX) || defined(STM32F3XX) || defined(STM32F4XX) || defined(STM32L0XX) || defined(GD32VF103)
# define APA102_NOPS (100 / (1000000000L / (CPU_CLOCK / 4))) // This calculates how many loops of 4 nops to run to delay 100 ns
# else
# error("APA102_NOPS configuration required")
# error APA102_NOPS configuration required
# define APA102_NOPS 0 // this just pleases the compile so the above error is easier to spot
# endif
# endif
@ -43,14 +43,14 @@
} \
} while (0)
#define APA102_SEND_BIT(byte, bit) \
do { \
writePin(RGB_DI_PIN, (byte >> bit) & 1); \
io_wait; \
writePinHigh(RGB_CI_PIN); \
io_wait; \
writePinLow(RGB_CI_PIN); \
io_wait; \
#define APA102_SEND_BIT(byte, bit) \
do { \
writePin(APA102_DI_PIN, (byte >> bit) & 1); \
io_wait; \
writePinHigh(APA102_CI_PIN); \
io_wait; \
writePinLow(APA102_CI_PIN); \
io_wait; \
} while (0)
uint8_t apa102_led_brightness = APA102_DEFAULT_BRIGHTNESS;
@ -77,11 +77,11 @@ void rgblight_call_driver(LED_TYPE *start_led, uint8_t num_leds) {
}
void static apa102_init(void) {
setPinOutput(RGB_DI_PIN);
setPinOutput(RGB_CI_PIN);
setPinOutput(APA102_DI_PIN);
setPinOutput(APA102_CI_PIN);
writePinLow(RGB_DI_PIN);
writePinLow(RGB_CI_PIN);
writePinLow(APA102_DI_PIN);
writePinLow(APA102_CI_PIN);
}
void apa102_set_brightness(uint8_t brightness) {

View file

@ -1,7 +1,9 @@
#include "oled_helper.h"
#include "quantum.h"
#include <stdio.h>
#include <string.h>
#ifdef OLED_ENABLE
# include QMK_KEYBOARD_H
# include <stdio.h>
# include <string.h>
void render_logo(void) {
static const char PROGMEM logo[] = {0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0};

View file

@ -24,7 +24,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
* to repeating that information all over the place.
*/
#include QMK_KEYBOARD_H
#include "matrix.h"
#include "debug.h"
#include "wait.h"
#include "i2c_master.h"
extern i2c_status_t tca9555_status;

View file

@ -24,7 +24,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
* to repeating that information all over the place.
*/
#include QMK_KEYBOARD_H
#include "matrix.h"
#include "debug.h"
#include "wait.h"
#include "i2c_master.h"
extern i2c_status_t tca9555_status;

View file

@ -14,7 +14,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H
#include "quantum.h"
led_config_t g_led_config = {
{

View file

@ -14,7 +14,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H
#include "quantum.h"
#ifdef OLED_ENABLE
static void render_logo(void) {

View file

@ -17,7 +17,9 @@ 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 QMK_KEYBOARD_H
#include "matrix.h"
#include "debug.h"
#include "wait.h"
#include "uart.h"
#include "timer.h"
@ -134,14 +136,14 @@ uint8_t rts_reset(void) {
if (firstread) {
writePinLow(RTS_PIN);
}
_delay_ms(10);
wait_ms(10);
writePinHigh(RTS_PIN);
/* the future is Arm
if (!palReadPad(RTS_PIN_IOPRT))
{
_delay_ms(10);
wait_ms(10);
palSetPadMode(RTS_PINn_IOPORT, PinDirectionOutput_PUSHPULL);
palSetPad(RTS_PORT, RTS_PIN);
}
@ -150,13 +152,13 @@ uint8_t rts_reset(void) {
palSetPadMode(RTS_PIN_RTS_PORT, PinDirectionOutput_PUSHPULL);
palSetPad(RTS_PORT, RTS_PIN);
palClearPad(RTS_PORT, RTS_PIN);
_delay_ms(10);
wait_ms(10);
palSetPad(RTS_PORT, RTS_PIN);
}
*/
_delay_ms(5);
wait_ms(5);
//print("rts\n");
return 1;
}
@ -222,7 +224,7 @@ uint8_t handspring_handshake(void) {
uint8_t handspring_reset(void) {
writePinLow(VCC_PIN);
_delay_ms(5);
wait_ms(5);
writePinHigh(VCC_PIN);
if ( handspring_handshake() ) {
@ -257,7 +259,7 @@ void matrix_init(void)
last_activity = timer_read();
} else {
print("failed handshake");
_delay_ms(1000);
wait_ms(1000);
//BUG /should/ power cycle or toggle RTS & reset, but this usually works.
}
@ -271,7 +273,7 @@ void matrix_init(void)
last_activity = timer_read();
} else {
print("failed handshake");
_delay_ms(1000);
wait_ms(1000);
//BUG /should/ power cycle or toggle RTS & reset, but this usually works.
}

View file

@ -1,64 +0,0 @@
#include QMK_KEYBOARD_H
#include "uart.h"
bool sun_bell = false;
bool sun_click = false;
bool command_extra(uint8_t code)
{
switch (code) {
case KC_H:
case KC_SLASH: /* ? */
print("\n\n----- Sun converter Help -----\n");
print("Home: Toggle Bell\n");
print("End: Toggle Click\n");
print("PgUp: LED all On\n");
print("PgDown: LED all Off\n");
print("Insert: Layout\n");
print("Delete: Reset\n");
return false;
case KC_DEL:
print("Reset\n");
uart_write(0x01);
break;
case KC_HOME:
sun_bell = !sun_bell;
if (sun_bell) {
print("Bell On\n");
uart_write(0x02);
} else {
print("Bell Off\n");
uart_write(0x03);
}
break;
case KC_END:
sun_click = !sun_click;
if (sun_click) {
print("Click On\n");
uart_write(0x0A);
} else {
print("Click Off\n");
uart_write(0x0B);
}
break;
case KC_PGUP:
print("LED all on\n");
uart_write(0x0E);
uart_write(0xFF);
break;
case KC_PGDN:
print("LED all off\n");
uart_write(0x0E);
uart_write(0x00);
break;
case KC_INSERT:
print("layout\n");
uart_write(0x0F);
break;
default:
xprintf("Unknown extra command: %02X\n", code);
return false;
}
return true;
}

View file

@ -15,7 +15,8 @@ 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 QMK_KEYBOARD_H
#include "led.h"
#include "print.h"
#include "uart.h"
void led_set(uint8_t usb_led)

View file

@ -15,7 +15,11 @@ 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 QMK_KEYBOARD_H
#include "matrix.h"
#include "host.h"
#include "led.h"
#include "debug.h"
#include "wait.h"
#include "uart.h"
/*
@ -86,9 +90,9 @@ void matrix_init(void)
/* print("."); */
/* while (uart_read()); */
/* uart_write(0x01); */
/* _delay_ms(500); */
/* wait_ms(500); */
/* if (uart_read() == 0xFF) { */
/* _delay_ms(500); */
/* wait_ms(500); */
/* if (uart_read() == 0x04) */
/* break; */
/* } */
@ -112,7 +116,7 @@ uint8_t matrix_scan(void)
switch (code) {
case 0xFF: // reset success: FF 04
print("reset: ");
_delay_ms(500);
wait_ms(500);
code = uart_read();
xprintf("%02X\n", code);
if (code == 0x04) {
@ -122,12 +126,12 @@ uint8_t matrix_scan(void)
return 0;
case 0xFE: // layout: FE <layout>
print("layout: ");
_delay_ms(500);
wait_ms(500);
xprintf("%02X\n", uart_read());
return 0;
case 0x7E: // reset fail: 7E 01
print("reset fail: ");
_delay_ms(500);
wait_ms(500);
xprintf("%02X\n", uart_read());
return 0;
case 0x7F:

View file

@ -3,7 +3,7 @@
// SPDX-License-Identifier: GPL-2.0-or-later
#include QMK_KEYBOARD_H
#include "quantum.h"
#if defined (XMK_DEBUG)
void keyboard_post_init_kb(void) {

View file

@ -4,6 +4,8 @@
// SPDX-License-Identifier: GPL-2.0-or-later
#include "xmk_matrix.h"
#include "matrix.h"
#include "debug.h"
bool xmk_changed = false;
matrix_row_t xmk_rows[MATRIX_ROWS];

View file

@ -5,6 +5,7 @@
#pragma once
#include QMK_KEYBOARD_H
#include <stdbool.h>
#include <stdint.h>
void xmk_matrix_key(bool press, uint8_t key);

View file

@ -1,7 +1,5 @@
#include QMK_KEYBOARD_H
#include "quantum.h"
#include <stdio.h>
#include "crkbd.h"
// in the future, should use (1U<<_LAYER_NAME) instead, but needs to be moved to keymap,c
#define L_BASE 0

View file

@ -1,6 +1,5 @@
#ifdef RGBLIGHT_ENABLE
#include QMK_KEYBOARD_H
#include <stdio.h>
extern rgblight_config_t rgblight_config;

View file

@ -1,7 +1,7 @@
// Copyright 2023 Colin Kinloch (@ColinKinloch)
// SPDX-License-Identifier: GPL-2.0-or-later
#include QMK_KEYBOARD_H
#include "quantum.h"
static uint8_t anim = 0;

Some files were not shown because too many files have changed in this diff Show more