NIBObee Library 1.4
|
00001 /* BSD-License: 00002 00003 Copyright (c) 2007 by Nils Springob, nicai-systems, Germany 00004 00005 All rights reserved. 00006 00007 Redistribution and use in source and binary forms, with or without modification, 00008 are permitted provided that the following conditions are met: 00009 00010 * Redistributions of source code must retain the above copyright notice, 00011 this list of conditions and the following disclaimer. 00012 * Redistributions in binary form must reproduce the above copyright notice, 00013 this list of conditions and the following disclaimer in the documentation 00014 and/or other materials provided with the distribution. 00015 * Neither the name nicai-systems nor the names of its contributors may be 00016 used to endorse or promote products derived from this software without 00017 specific prior written permission. 00018 00019 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00020 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00021 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 00022 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 00023 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 00024 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 00025 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 00026 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 00027 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 00028 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00029 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00030 00031 */ 00032 00041 #define IO_LEDS_PORT PORTB 00042 #define IO_LEDS_MASK 0x0f 00043 #define IO_LEDS_DDR DDRB 00044 #define IO_LEDS_BIT_L_YE 0 00045 #define IO_LEDS_BIT_L_RD 1 00046 #define IO_LEDS_BIT_R_RD 2 00047 #define IO_LEDS_BIT_R_YE 3 00048 00049 00051 #define IO_SENS_PORT PORTC 00052 #define IO_SENS_PIN PINC 00053 #define IO_SENS_MASK 0xf0 00054 #define IO_SENS_DDR DDRC 00055 #define IO_SENS_BIT_LEFT1 4 00056 #define IO_SENS_BIT_LEFT2 5 00057 #define IO_SENS_BIT_RIGHT1 6 00058 #define IO_SENS_BIT_RIGHT2 7 00059 00060 00062 #define IO_MOTOR_PORT PORTD 00063 #define IO_MOTOR_PIN PIND 00064 #define IO_MOTOR_MASK 0xf0 00065 #define IO_MOTOR_DDR DDRD 00066 #define IO_MOTOR_BIT_DIR_LEFT 6 00067 #define IO_MOTOR_BIT_DIR_RIGHT 7 00068 #define IO_MOTOR_BIT_PWM_LEFT 5 00069 #define IO_MOTOR_BIT_PWM_RIGHT 4 00070 00071 00073 #define IO_ODO_PORT PORTD 00074 #define IO_ODO_PIN PIND 00075 #define IO_ODO_MASK 0x0c 00076 #define IO_ODO_DDR DDRD 00077 #define IO_ODO_BIT_LEFT 2 00078 #define IO_ODO_BIT_RIGHT 3 00079 00080 00082 #define IO_EXT_PORT PORTC 00083 #define IO_EXT_PIN PINC 00084 #define IO_EXT_MASK 0x0f 00085 #define IO_EXT_DDR DDRC 00086 #define IO_EXT_BIT_0 0 00087 #define IO_EXT_BIT_1 1 00088 #define IO_EXT_BIT_2 2 00089 #define IO_EXT_BIT_3 3 00090 00091 00093 #define IO_LINE_EN IO_LINE_EN 00094 #define IO_LINE_EN_PORT PORTB 00095 #define IO_LINE_EN_BIT 4 00096 #define IO_LINE_EN_DDR DDRB 00097 00098 00100 #define IO_I2C_SDA_PORT PORTC 00101 #define IO_I2C_SDA_PIN PINC 00102 #define IO_I2C_SDA_BIT 1 00103 #define IO_I2C_SDA_DDR DDRC 00104 00105 00107 #define IO_I2C_SCL_PORT PORTC 00108 #define IO_I2C_SCL_PIN PINC 00109 #define IO_I2C_SCL_BIT 0 00110 #define IO_I2C_SCL_DDR DDRC 00111 00112 00114 #define IO_UART_RXD_PORT PORTD 00115 #define IO_UART_RXD_PIN PIND 00116 #define IO_UART_RXD_BIT 0 00117 #define IO_UART_RXD_DDR DDRD 00118 00119 00121 #define IO_UART_TXD_PORT PORTD 00122 #define IO_UART_TXD_PIN PIND 00123 #define IO_UART_TXD_BIT 1 00124 #define IO_UART_TXD_DDR DDRD 00125 00126 00127 00129 #define AN_LINE_R 7 00130 #define AN_LINE_C 6 00131 #define AN_LINE_L 5 00132 #define AN_VBAT 4 00133 #define AN_X3 3 00134 #define AN_X2 2 00135 #define AN_X1 1 00136 #define AN_X0 0