summaryrefslogtreecommitdiff
path: root/keyboards/crkbd/keymaps/vlukash_trackpad_right/trackpad.h
diff options
context:
space:
mode:
authorWilliam Chang <william@factual.com>2019-07-13 10:18:33 -0700
committerWilliam Chang <william@factual.com>2019-07-13 10:18:33 -0700
commit71493b2f9bbd5f3d18373c518fa14ccafcbf48fc (patch)
tree3bb3e5e496621535611e087720aa5c4d7a533e5e /keyboards/crkbd/keymaps/vlukash_trackpad_right/trackpad.h
parent86ad4988fe7ff64916127509d84f44c56fa097aa (diff)
parentda1f05fbc19477c05c0c01bb07fabfaf1ece9d54 (diff)
Merge branch 'master' of https://github.com/qmk/qmk_firmware
Diffstat (limited to 'keyboards/crkbd/keymaps/vlukash_trackpad_right/trackpad.h')
-rw-r--r--keyboards/crkbd/keymaps/vlukash_trackpad_right/trackpad.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/keyboards/crkbd/keymaps/vlukash_trackpad_right/trackpad.h b/keyboards/crkbd/keymaps/vlukash_trackpad_right/trackpad.h
new file mode 100644
index 0000000000..755abc7de2
--- /dev/null
+++ b/keyboards/crkbd/keymaps/vlukash_trackpad_right/trackpad.h
@@ -0,0 +1,32 @@
+#pragma once
+
+#include "pointing_device.h"
+#include "quantum.h"
+#include "report.h"
+#include <util/delay.h>
+#include "../../lib/lufa/LUFA/Drivers/Peripheral/SPI.h"
+
+// Trackpad speed adjustments
+#define POINTER_SPEED_MULTIPLIER 2
+#define SCROLL_SPEED_DIVIDER 6
+
+// Pins on corresponding ports
+#define TP_RESET 1
+#define TP_SHUTDOWN 0
+#define TP_CS 0
+#define LVL_SHIFT_EN 7
+
+// Configure as output
+#define TP_RESET_INIT DDRF |= (1 << TP_RESET);
+#define TP_SHUTDOWN_INIT DDRF |= (1 << TP_SHUTDOWN);
+#define TP_CS_INIT DDRB |= (1 << TP_CS);
+#define LVL_SHIFT_EN_INIT DDRC |= (1 << LVL_SHIFT_EN);
+
+#define TP_RESET_HI PORTF |= (1 << TP_RESET);
+#define TP_RESET_LO PORTF &= ~ (1 << TP_RESET);
+#define TP_SHUTDOWN_HI PORTF |= (1 << TP_SHUTDOWN);
+#define TP_SHUTDOWN_LO PORTF &= ~ (1 << TP_SHUTDOWN);
+#define TP_CS_HI PORTB |= (1 << TP_CS);
+#define TP_CS_LO PORTB &= ~ (1 << TP_CS);
+#define LVL_SHIFT_EN_HI PORTC |= (1 << LVL_SHIFT_EN);
+#define LVL_SHIFT_EN_LO PORTC &= ~ (1 << LVL_SHIFT_EN);