From 200288c425a5ffa03776c1f859ea444a6c6e6444 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Wed, 6 Feb 2013 23:28:26 +0000 Subject: fixed checkin git-svn-id: https://svn.spreadspace.org/avr/trunk@151 aa12f405-d877-488e-9caf-2d797e2a1cc7 --- usb-i2c-sl018/limits.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ usb-i2c-sl018/limits.h | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 usb-i2c-sl018/limits.c create mode 100644 usb-i2c-sl018/limits.h (limited to 'usb-i2c-sl018') 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 + * Othmar Gsenger + * + * 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 . + */ + +#include "limits.h" +#include + +#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< + * Othmar Gsenger + * + * 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 . + */ + +#ifndef R3TUER_limits_h_INCLUDED +#define R3TUER_limits_h_INCLUDED + +typedef enum { none, open, close, both } limits_t; + +void init_limits(void); +limits_t limits_get(void); + +#endif -- cgit v1.2.3