summaryrefslogtreecommitdiff
path: root/usb-i2c-sl018/limits.c
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2013-02-06 23:28:26 +0000
committerChristian Pointner <equinox@spreadspace.org>2013-02-06 23:28:26 +0000
commit200288c425a5ffa03776c1f859ea444a6c6e6444 (patch)
tree24f7b0ea0b6f09ba9e247168df855a7a00191270 /usb-i2c-sl018/limits.c
parentadded limits (diff)
fixed checkin
git-svn-id: https://svn.spreadspace.org/avr/trunk@151 aa12f405-d877-488e-9caf-2d797e2a1cc7
Diffstat (limited to 'usb-i2c-sl018/limits.c')
-rw-r--r--usb-i2c-sl018/limits.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/usb-i2c-sl018/limits.c b/usb-i2c-sl018/limits.c
new file mode 100644
index 0000000..98144ed
--- /dev/null
+++ b/usb-i2c-sl018/limits.c
@@ -0,0 +1,48 @@
+/*
+ * spreadspace avr utils
+ *
+ *
+ * Copyright (C) 2013 Christian Pointner <equinox@spreadspace.org>
+ * Othmar Gsenger <otti@wirdorange.org>
+ *
+ * This file is part of spreadspace avr utils.
+ *
+ * spreadspace avr utils is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * any later version.
+ *
+ * spreadspace avr utils is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with spreadspace avr utils. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "limits.h"
+#include <LUFA/Drivers/Misc/RingBuffer.h>
+
+#define LIMITS_PIN PINC
+#define LIMITS_PORT PORTC
+#define LIMITS_DDR DDRC
+#define LIMITS_OPEN 6
+#define LIMITS_CLOSE 7
+
+void init_limits(void)
+{
+ LIMITS_DDR = LIMITS_PORT & ~(1<<LIMITS_OPEN | 1<<LIMITS_CLOSE);
+ LIMITS_PORT |= (1<<LIMITS_OPEN | 1<<LIMITS_CLOSE);
+}
+
+limits_t limits_get(void)
+{
+ limits_t state = none;
+
+ uint8_t tmp = LIMITS_PORT;
+
+
+ return state;
+}
+