summaryrefslogtreecommitdiff
path: root/keyboards/converter
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/converter')
-rw-r--r--keyboards/converter/m0110_usb/readme.md2
-rw-r--r--keyboards/converter/palm_usb/config.h55
-rw-r--r--keyboards/converter/palm_usb/matrix.c15
-rw-r--r--keyboards/converter/palm_usb/post_rules.mk7
-rw-r--r--keyboards/converter/palm_usb/rules.mk1
-rw-r--r--keyboards/converter/sun_usb/command_extra.c22
-rw-r--r--keyboards/converter/sun_usb/config.h47
-rw-r--r--keyboards/converter/sun_usb/led.c6
-rw-r--r--keyboards/converter/sun_usb/matrix.c27
-rw-r--r--keyboards/converter/sun_usb/post_rules.mk6
-rw-r--r--keyboards/converter/sun_usb/rules.mk1
-rw-r--r--keyboards/converter/usb_usb/ble/config.h4
-rw-r--r--keyboards/converter/usb_usb/ble/rules.mk2
-rw-r--r--keyboards/converter/usb_usb/custom_matrix.cpp6
14 files changed, 35 insertions, 166 deletions
diff --git a/keyboards/converter/m0110_usb/readme.md b/keyboards/converter/m0110_usb/readme.md
index a148091cd9..d066aa5a7c 100644
--- a/keyboards/converter/m0110_usb/readme.md
+++ b/keyboards/converter/m0110_usb/readme.md
@@ -5,7 +5,7 @@ This is a port of the original M0110 converter from TMK to QMK. The original con
## Enabling Bluetooth for the Adafruit Feather 32U4 BLE
-Simply add `BLUETOOTH = AdafruitBLE` to your `rules.mk` file. This enables code specifically for the Adafruit Feather 32U4 BLE. If enabled, the device will use the `PRODUCT` value from `config.h` for the device name displayed by the Feather on host devices. You can simply change these values to change the device name.
+Simply add `BLUETOOTH = BluefruitLE` to your `rules.mk` file. This enables code specifically for the Adafruit Feather 32U4 BLE. If enabled, the device will use the `PRODUCT` value from `config.h` for the device name displayed by the Feather on host devices. You can simply change these values to change the device name.
## Pins
diff --git a/keyboards/converter/palm_usb/config.h b/keyboards/converter/palm_usb/config.h
index 4afc654e85..35032835cd 100644
--- a/keyboards/converter/palm_usb/config.h
+++ b/keyboards/converter/palm_usb/config.h
@@ -60,58 +60,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
get_mods() == (MOD_BIT(KC_LGUI) | MOD_BIT(KC_RGUI)) || \
get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
)
-
-
-/* Serial(USART) configuration
- * asynchronous, negative logic, 9600baud, no flow control
- * 1-start bit, 8-data bit, non parity, 1-stop bit
- */
-#define SERIAL_SOFT_BAUD 9600
-#define SERIAL_SOFT_PARITY_NONE
-#define SERIAL_SOFT_BIT_ORDER_LSB
-#if (HANDSPRING == 0)
- #define SERIAL_SOFT_LOGIC_NEGATIVE //RS232 logic
-#endif
-/* RXD Port */
-#define SERIAL_SOFT_RXD_ENABLE
-
-// we are using Pro micro pin 3 / D0 as serial
-#define SERIAL_SOFT_RXD_DDR DDRD
-#define SERIAL_SOFT_RXD_PORT PORTD
-#define SERIAL_SOFT_RXD_PIN PIND
-#define SERIAL_SOFT_RXD_BIT 0
-#define SERIAL_SOFT_RXD_VECT INT0_vect
-
-/* RXD Interupt */
-#define SERIAL_SOFT_RXD_INIT() do { \
- /* pin configuration: input with pull-up */ \
- SERIAL_SOFT_RXD_DDR &= ~(1<<SERIAL_SOFT_RXD_BIT); \
- SERIAL_SOFT_RXD_PORT |= (1<<SERIAL_SOFT_RXD_BIT); \
- /* enable interrupt: INT0(rising edge) */ \
- EICRA |= ((1<<ISC01)|(1<<ISC00)); \
- EIMSK |= (1<<INT0); \
- sei(); \
-} while (0)
-#define SERIAL_SOFT_RXD_INT_ENTER()
-#define SERIAL_SOFT_RXD_INT_EXIT() do { \
- /* clear interrupt flag */ \
- EIFR = (1<<INTF0); \
-} while (0)
-#define SERIAL_SOFT_RXD_READ() (SERIAL_SOFT_RXD_PIN&(1<<SERIAL_SOFT_RXD_BIT))
-
-/* TXD Port */
-#define SERIAL_SOFT_TXD_ENABLE
-#define SERIAL_SOFT_TXD_DDR DDRD
-#define SERIAL_SOFT_TXD_PORT PORTD
-#define SERIAL_SOFT_TXD_PIN PIND
-#define SERIAL_SOFT_TXD_BIT 3
-#define SERIAL_SOFT_TXD_HI() do { SERIAL_SOFT_TXD_PORT |= (1<<SERIAL_SOFT_TXD_BIT); } while (0)
-#define SERIAL_SOFT_TXD_LO() do { SERIAL_SOFT_TXD_PORT &= ~(1<<SERIAL_SOFT_TXD_BIT); } while (0)
-#define SERIAL_SOFT_TXD_INIT() do { \
- /* pin configuration: output */ \
- SERIAL_SOFT_TXD_DDR |= (1<<SERIAL_SOFT_TXD_BIT); \
- /* idle */ \
- SERIAL_SOFT_TXD_ON(); \
-} while (0)
-
-
diff --git a/keyboards/converter/palm_usb/matrix.c b/keyboards/converter/palm_usb/matrix.c
index 289284b616..010fd56c79 100644
--- a/keyboards/converter/palm_usb/matrix.c
+++ b/keyboards/converter/palm_usb/matrix.c
@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H
-#include "protocol/serial.h"
+#include "uart.h"
#include "timer.h"
@@ -58,8 +58,6 @@ static uint16_t disconnect_counter = 0;
#define COL(code) ((code & COL_MASK) )
#define KEYUP(code) ((code & KEY_MASK) >>7 )
-static bool is_modified = false;
-
__attribute__ ((weak))
void matrix_init_kb(void) {
matrix_init_user();
@@ -166,7 +164,7 @@ uint8_t rts_reset(void) {
uint8_t get_serial_byte(void) {
static uint8_t code;
while(1) {
- code = serial_recv();
+ code = uart_read();
if (code) {
debug_hex(code); debug(" ");
return code;
@@ -242,7 +240,7 @@ void matrix_init(void)
debug_enable = true;
//debug_matrix =true;
- serial_init(); // arguments all #defined
+ uart_init(9600); // arguments all #defined
#if (HANDSPRING == 0)
pins_init(); // set all inputs and outputs.
@@ -292,7 +290,7 @@ void matrix_init(void)
uint8_t matrix_scan(void)
{
uint8_t code;
- code = serial_recv();
+ code = uart_read();
if (!code) {
/*
disconnect_counter ++;
@@ -354,11 +352,6 @@ uint8_t matrix_scan(void)
return code;
}
-bool matrix_is_modified(void)
-{
- return is_modified;
-}
-
inline
bool matrix_has_ghost(void)
{
diff --git a/keyboards/converter/palm_usb/post_rules.mk b/keyboards/converter/palm_usb/post_rules.mk
deleted file mode 100644
index 9c11076701..0000000000
--- a/keyboards/converter/palm_usb/post_rules.mk
+++ /dev/null
@@ -1,7 +0,0 @@
-ifdef HARDWARE_SERIAL
- # Untested with palm_usb
- SRC += protocol/serial_uart.c
- OPT_DEFS += -DHARDWARE_SERIAL
-else
- SRC += protocol/serial_soft.c
-endif
diff --git a/keyboards/converter/palm_usb/rules.mk b/keyboards/converter/palm_usb/rules.mk
index c5e680b883..a1d2e39b23 100644
--- a/keyboards/converter/palm_usb/rules.mk
+++ b/keyboards/converter/palm_usb/rules.mk
@@ -20,5 +20,6 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
CUSTOM_MATRIX = yes
SRC += matrix.c
+QUANTUM_LIB_SRC += uart.c
DEFAULT_FOLDER = converter/palm_usb/stowaway
diff --git a/keyboards/converter/sun_usb/command_extra.c b/keyboards/converter/sun_usb/command_extra.c
index 756a9160bb..332776ab90 100644
--- a/keyboards/converter/sun_usb/command_extra.c
+++ b/keyboards/converter/sun_usb/command_extra.c
@@ -1,5 +1,5 @@
#include QMK_KEYBOARD_H
-#include "protocol/serial.h"
+#include "uart.h"
bool sun_bell = false;
bool sun_click = false;
@@ -20,41 +20,41 @@ bool command_extra(uint8_t code)
return false;
case KC_DEL:
print("Reset\n");
- serial_send(0x01);
+ uart_write(0x01);
break;
case KC_HOME:
sun_bell = !sun_bell;
if (sun_bell) {
print("Bell On\n");
- serial_send(0x02);
+ uart_write(0x02);
} else {
print("Bell Off\n");
- serial_send(0x03);
+ uart_write(0x03);
}
break;
case KC_END:
sun_click = !sun_click;
if (sun_click) {
print("Click On\n");
- serial_send(0x0A);
+ uart_write(0x0A);
} else {
print("Click Off\n");
- serial_send(0x0B);
+ uart_write(0x0B);
}
break;
case KC_PGUP:
print("LED all on\n");
- serial_send(0x0E);
- serial_send(0xFF);
+ uart_write(0x0E);
+ uart_write(0xFF);
break;
case KC_PGDOWN:
print("LED all off\n");
- serial_send(0x0E);
- serial_send(0x00);
+ uart_write(0x0E);
+ uart_write(0x00);
break;
case KC_INSERT:
print("layout\n");
- serial_send(0x0F);
+ uart_write(0x0F);
break;
default:
xprintf("Unknown extra command: %02X\n", code);
diff --git a/keyboards/converter/sun_usb/config.h b/keyboards/converter/sun_usb/config.h
index c67ae5ebae..0a4aa019f7 100644
--- a/keyboards/converter/sun_usb/config.h
+++ b/keyboards/converter/sun_usb/config.h
@@ -33,50 +33,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
get_mods() == (MOD_BIT(KC_LGUI) | MOD_BIT(KC_RGUI)) || \
get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
)
-
-
-/* Serial(USART) configuration
- * asynchronous, negative logic, 1200baud, no flow control
- * 1-start bit, 8-data bit, non parity, 1-stop bit
- */
-#define SERIAL_SOFT_BAUD 1200
-#define SERIAL_SOFT_PARITY_NONE
-#define SERIAL_SOFT_BIT_ORDER_LSB
-#define SERIAL_SOFT_LOGIC_NEGATIVE
-/* RXD Port */
-#define SERIAL_SOFT_RXD_ENABLE
-#define SERIAL_SOFT_RXD_DDR DDRD
-#define SERIAL_SOFT_RXD_PORT PORTD
-#define SERIAL_SOFT_RXD_PIN PIND
-#define SERIAL_SOFT_RXD_BIT 2
-#define SERIAL_SOFT_RXD_VECT INT2_vect
-/* RXD Interupt */
-#define SERIAL_SOFT_RXD_INIT() do { \
- /* pin configuration: input with pull-up */ \
- SERIAL_SOFT_RXD_DDR &= ~(1<<SERIAL_SOFT_RXD_BIT); \
- SERIAL_SOFT_RXD_PORT |= (1<<SERIAL_SOFT_RXD_BIT); \
- /* enable interrupt: INT2(rising edge) */ \
- EICRA |= ((1<<ISC21)|(1<<ISC20)); \
- EIMSK |= (1<<INT2); \
- sei(); \
-} while (0)
-#define SERIAL_SOFT_RXD_INT_ENTER()
-#define SERIAL_SOFT_RXD_INT_EXIT() do { \
- /* clear interrupt flag */ \
- EIFR = (1<<INTF2); \
-} while (0)
-#define SERIAL_SOFT_RXD_READ() (SERIAL_SOFT_RXD_PIN&(1<<SERIAL_SOFT_RXD_BIT))
-/* TXD Port */
-#define SERIAL_SOFT_TXD_ENABLE
-#define SERIAL_SOFT_TXD_DDR DDRD
-#define SERIAL_SOFT_TXD_PORT PORTD
-#define SERIAL_SOFT_TXD_PIN PIND
-#define SERIAL_SOFT_TXD_BIT 3
-#define SERIAL_SOFT_TXD_HI() do { SERIAL_SOFT_TXD_PORT |= (1<<SERIAL_SOFT_TXD_BIT); } while (0)
-#define SERIAL_SOFT_TXD_LO() do { SERIAL_SOFT_TXD_PORT &= ~(1<<SERIAL_SOFT_TXD_BIT); } while (0)
-#define SERIAL_SOFT_TXD_INIT() do { \
- /* pin configuration: output */ \
- SERIAL_SOFT_TXD_DDR |= (1<<SERIAL_SOFT_TXD_BIT); \
- /* idle */ \
- SERIAL_SOFT_TXD_ON(); \
-} while (0)
diff --git a/keyboards/converter/sun_usb/led.c b/keyboards/converter/sun_usb/led.c
index a409699e92..f8d183fd48 100644
--- a/keyboards/converter/sun_usb/led.c
+++ b/keyboards/converter/sun_usb/led.c
@@ -16,7 +16,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H
-#include "protocol/serial.h"
+#include "uart.h"
void led_set(uint8_t usb_led)
{
@@ -27,6 +27,6 @@ void led_set(uint8_t usb_led)
if (usb_led & (1<<USB_LED_CAPS_LOCK)) sun_led |= (1<<3);
xprintf("LED: %02X\n", usb_led);
- serial_send(0x0E);
- serial_send(sun_led);
+ uart_write(0x0E);
+ uart_write(sun_led);
}
diff --git a/keyboards/converter/sun_usb/matrix.c b/keyboards/converter/sun_usb/matrix.c
index 21f45111ec..e28d165d52 100644
--- a/keyboards/converter/sun_usb/matrix.c
+++ b/keyboards/converter/sun_usb/matrix.c
@@ -16,7 +16,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H
-#include "protocol/serial.h"
+#include "uart.h"
/*
* Matrix Array usage:
@@ -38,8 +38,6 @@ static uint8_t matrix[MATRIX_ROWS];
#define ROW(code) ((code>>3)&0xF)
#define COL(code) (code&0x07)
-static bool is_modified = false;
-
__attribute__ ((weak))
void matrix_init_kb(void) {
matrix_init_user();
@@ -76,7 +74,7 @@ void matrix_init(void)
/* PORTD |= (1<<6); */
debug_enable = true;
- serial_init();
+ uart_init(1200);
// initialize matrix state: all keys off
for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00;
@@ -86,12 +84,12 @@ void matrix_init(void)
/* print("Reseting "); */
/* while (1) { */
/* print("."); */
- /* while (serial_recv()); */
- /* serial_send(0x01); */
+ /* while (uart_read()); */
+ /* uart_write(0x01); */
/* _delay_ms(500); */
- /* if (serial_recv() == 0xFF) { */
+ /* if (uart_read() == 0xFF) { */
/* _delay_ms(500); */
- /* if (serial_recv() == 0x04) */
+ /* if (uart_read() == 0x04) */
/* break; */
/* } */
/* } */
@@ -106,7 +104,7 @@ void matrix_init(void)
uint8_t matrix_scan(void)
{
uint8_t code;
- code = serial_recv();
+ code = uart_read();
if (!code) return 0;
debug_hex(code); debug(" ");
@@ -115,7 +113,7 @@ uint8_t matrix_scan(void)
case 0xFF: // reset success: FF 04
print("reset: ");
_delay_ms(500);
- code = serial_recv();
+ code = uart_read();
xprintf("%02X\n", code);
if (code == 0x04) {
// LED status
@@ -125,12 +123,12 @@ uint8_t matrix_scan(void)
case 0xFE: // layout: FE <layout>
print("layout: ");
_delay_ms(500);
- xprintf("%02X\n", serial_recv());
+ xprintf("%02X\n", uart_read());
return 0;
case 0x7E: // reset fail: 7E 01
print("reset fail: ");
_delay_ms(500);
- xprintf("%02X\n", serial_recv());
+ xprintf("%02X\n", uart_read());
return 0;
case 0x7F:
// all keys up
@@ -154,11 +152,6 @@ uint8_t matrix_scan(void)
return code;
}
-bool matrix_is_modified(void)
-{
- return is_modified;
-}
-
inline
bool matrix_has_ghost(void)
{
diff --git a/keyboards/converter/sun_usb/post_rules.mk b/keyboards/converter/sun_usb/post_rules.mk
deleted file mode 100644
index 2ea1f0a5bf..0000000000
--- a/keyboards/converter/sun_usb/post_rules.mk
+++ /dev/null
@@ -1,6 +0,0 @@
-ifdef HARDWARE_SERIAL
- SRC += protocol/serial_uart.c
- OPT_DEFS += -DHARDWARE_SERIAL
-else
- SRC += protocol/serial_soft.c
-endif
diff --git a/keyboards/converter/sun_usb/rules.mk b/keyboards/converter/sun_usb/rules.mk
index 2f2ddde1d0..d25bcc7ffa 100644
--- a/keyboards/converter/sun_usb/rules.mk
+++ b/keyboards/converter/sun_usb/rules.mk
@@ -20,5 +20,6 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
CUSTOM_MATRIX = yes
SRC += matrix.c led.c
+QUANTUM_LIB_SRC += uart.c
DEFAULT_FOLDER = converter/sun_usb/type5
diff --git a/keyboards/converter/usb_usb/ble/config.h b/keyboards/converter/usb_usb/ble/config.h
index 80e4968c41..92df24d003 100644
--- a/keyboards/converter/usb_usb/ble/config.h
+++ b/keyboards/converter/usb_usb/ble/config.h
@@ -4,8 +4,8 @@
#define PRODUCT QMK BLE Adapter
// Turn off the mode leds on the BLE module
-#define ADAFRUIT_BLE_ENABLE_MODE_LEDS 0
-#define ADAFRUIT_BLE_ENABLE_POWER_LED 0
+#define BLUEFRUIT_LE_ENABLE_MODE_LEDS 0
+#define BLUEFRUIT_LE_ENABLE_POWER_LED 0
#define NO_ACTION_MACRO
#define NO_ACTION_FUNCTION
diff --git a/keyboards/converter/usb_usb/ble/rules.mk b/keyboards/converter/usb_usb/ble/rules.mk
index 596f719630..df5bc36635 100644
--- a/keyboards/converter/usb_usb/ble/rules.mk
+++ b/keyboards/converter/usb_usb/ble/rules.mk
@@ -12,6 +12,6 @@ RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
AUDIO_ENABLE = no # Audio output
BLUETOOTH_ENABLE = yes
-BLUETOOTH_DRIVER = AdafruitBLE
+BLUETOOTH_DRIVER = BluefruitLE
LTO_ENABLE = yes
diff --git a/keyboards/converter/usb_usb/custom_matrix.cpp b/keyboards/converter/usb_usb/custom_matrix.cpp
index 296f7fcd02..265fb2c68d 100644
--- a/keyboards/converter/usb_usb/custom_matrix.cpp
+++ b/keyboards/converter/usb_usb/custom_matrix.cpp
@@ -185,17 +185,13 @@ extern "C"
// restore LED state when keyboard comes up
if (usb_state == USB_STATE_RUNNING) {
dprintf("speed: %s\n", usb_host.getVbusState()==FSHOST ? "full" : "low");
- keyboard_set_leds(host_keyboard_leds());
+ led_set(host_keyboard_leds());
}
}
matrix_scan_quantum();
return 1;
}
- bool matrix_is_modified(void) {
- return matrix_is_mod;
- }
-
bool matrix_is_on(uint8_t row, uint8_t col) {
uint8_t code = CODE(row, col);