aboutsummaryrefslogtreecommitdiffstats
path: root/tmk_core/protocol/ps2_io_mbed.c
diff options
context:
space:
mode:
Diffstat (limited to 'tmk_core/protocol/ps2_io_mbed.c')
-rw-r--r--tmk_core/protocol/ps2_io_mbed.c29
1 files changed, 10 insertions, 19 deletions
diff --git a/tmk_core/protocol/ps2_io_mbed.c b/tmk_core/protocol/ps2_io_mbed.c
index 83bdcef7f..9cec3dfbb 100644
--- a/tmk_core/protocol/ps2_io_mbed.c
+++ b/tmk_core/protocol/ps2_io_mbed.c
@@ -2,32 +2,27 @@
#include "ps2_io.h"
#include "gpio_api.h"
-
static gpio_t clock;
static gpio_t data;
/*
* Clock
*/
-void clock_init(void)
-{
+void clock_init(void) {
gpio_init(&clock, P0_9);
- gpio_mode(&clock, OpenDrain|PullNone);
+ gpio_mode(&clock, OpenDrain | PullNone);
}
-void clock_lo(void)
-{
+void clock_lo(void) {
gpio_dir(&clock, PIN_OUTPUT);
gpio_write(&clock, 0);
}
-void clock_hi(void)
-{
+void clock_hi(void) {
gpio_dir(&clock, PIN_OUTPUT);
gpio_write(&clock, 1);
}
-bool clock_in(void)
-{
+bool clock_in(void) {
gpio_dir(&clock, PIN_INPUT);
return gpio_read(&clock);
}
@@ -35,26 +30,22 @@ bool clock_in(void)
/*
* Data
*/
-void data_init(void)
-{
+void data_init(void) {
gpio_init(&data, P0_8);
- gpio_mode(&data, OpenDrain|PullNone);
+ gpio_mode(&data, OpenDrain | PullNone);
}
-void data_lo(void)
-{
+void data_lo(void) {
gpio_dir(&data, PIN_OUTPUT);
gpio_write(&data, 0);
}
-void data_hi(void)
-{
+void data_hi(void) {
gpio_dir(&data, PIN_OUTPUT);
gpio_write(&data, 1);
}
-bool data_in(void)
-{
+bool data_in(void) {
gpio_dir(&data, PIN_INPUT);
return gpio_read(&data);
}