diff options
author | Ryan <fauxpark@gmail.com> | 2021-03-18 11:48:09 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-18 11:48:09 +1100 |
commit | 9331c22620fb9a4012a370d717e6362a5ab84ec4 (patch) | |
tree | 999f3893d22eb551a351ef28a53fbfca2809ab43 /tmk_core/protocol/xt.h | |
parent | cc84831cae1d1f7159aea3bc03001a6293d43ee7 (diff) |
XT converter cleanup (#12264)
Diffstat (limited to 'tmk_core/protocol/xt.h')
-rw-r--r-- | tmk_core/protocol/xt.h | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/tmk_core/protocol/xt.h b/tmk_core/protocol/xt.h index 6dc5f19d00..cc55b7dbca 100644 --- a/tmk_core/protocol/xt.h +++ b/tmk_core/protocol/xt.h @@ -38,33 +38,36 @@ POSSIBILITY OF SUCH DAMAGE. #pragma once -#define XT_DATA_IN() \ - do { \ - XT_DATA_DDR &= ~(1 << XT_DATA_BIT); \ - XT_DATA_PORT |= (1 << XT_DATA_BIT); \ +#include "quantum.h" + +#define XT_DATA_IN() \ + do { \ + setPinInput(XT_DATA_PIN); \ + writePinHigh(XT_DATA_PIN); \ } while (0) -#define XT_DATA_READ() (XT_DATA_PIN & (1 << XT_DATA_BIT)) +#define XT_DATA_READ() readPin(XT_DATA_PIN) -#define XT_DATA_LO() \ - do { \ - XT_DATA_PORT &= ~(1 << XT_DATA_BIT); \ - XT_DATA_DDR |= (1 << XT_DATA_BIT); \ +#define XT_DATA_LO() \ + do { \ + writePinLow(XT_DATA_PIN); \ + setPinOutput(XT_DATA_PIN); \ } while (0) -#define XT_CLOCK_IN() \ - do { \ - XT_CLOCK_DDR &= ~(1 << XT_CLOCK_BIT); \ - XT_CLOCK_PORT |= (1 << XT_CLOCK_BIT); \ +#define XT_CLOCK_IN() \ + do { \ + setPinInput(XT_CLOCK_PIN); \ + writePinHigh(XT_CLOCK_PIN); \ } while (0) -#define XT_CLOCK_READ() (XT_CLOCK_PIN & (1 << XT_CLOCK_BIT)) +#define XT_CLOCK_READ() readPin(XT_CLOCK_PIN) -#define XT_CLOCK_LO() \ - do { \ - XT_CLOCK_PORT &= ~(1 << XT_CLOCK_BIT); \ - XT_CLOCK_DDR |= (1 << XT_CLOCK_BIT); \ +#define XT_CLOCK_LO() \ + do { \ + writePinLow(XT_CLOCK_PIN); \ + setPinOutput(XT_CLOCK_PIN); \ } while (0) void xt_host_init(void); + uint8_t xt_host_recv(void); |