NiboRoboLib 3.1 - NIBObee Library
iodefs_nibobee.h
gehe zur Dokumentation dieser Datei
1 /* BSD-License:
2 
3 Copyright (c) 2007 by Nils Springob, nicai-systems, Germany
4 
5 All rights reserved.
6 
7 Redistribution and use in source and binary forms, with or without modification,
8 are permitted provided that the following conditions are met:
9 
10  * Redistributions of source code must retain the above copyright notice,
11  this list of conditions and the following disclaimer.
12  * Redistributions in binary form must reproduce the above copyright notice,
13  this list of conditions and the following disclaimer in the documentation
14  and/or other materials provided with the distribution.
15  * Neither the name nicai-systems nor the names of its contributors may be
16  used to endorse or promote products derived from this software without
17  specific prior written permission.
18 
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
23 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 
31 */
32 
41 #define IO_LEDS_PORT PORTB
42 #define IO_LEDS_MASK 0x0f
43 #define IO_LEDS_DDR DDRB
44 #define IO_LEDS_BIT_L_YE 0
45 #define IO_LEDS_BIT_L_RD 1
46 #define IO_LEDS_BIT_R_RD 2
47 #define IO_LEDS_BIT_R_YE 3
48 
49 
51 #define IO_SENS_PORT PORTC
52 #define IO_SENS_PIN PINC
53 #define IO_SENS_MASK 0xf0
54 #define IO_SENS_DDR DDRC
55 #define IO_SENS_BIT_LEFT1 4
56 #define IO_SENS_BIT_LEFT2 5
57 #define IO_SENS_BIT_RIGHT1 6
58 #define IO_SENS_BIT_RIGHT2 7
59 
60 
62 #define IO_MOTOR_PORT PORTD
63 #define IO_MOTOR_PIN PIND
64 #define IO_MOTOR_MASK 0xf0
65 #define IO_MOTOR_DDR DDRD
66 #define IO_MOTOR_BIT_DIR_LEFT 6
67 #define IO_MOTOR_BIT_DIR_RIGHT 7
68 #define IO_MOTOR_BIT_PWM_LEFT 5
69 #define IO_MOTOR_BIT_PWM_RIGHT 4
70 
71 
73 #define IO_ODO_PORT PORTD
74 #define IO_ODO_PIN PIND
75 #define IO_ODO_MASK 0x0c
76 #define IO_ODO_DDR DDRD
77 #define IO_ODO_BIT_LEFT 2
78 #define IO_ODO_BIT_RIGHT 3
79 
80 
82 #define IO_EXT_PORT PORTC
83 #define IO_EXT_PIN PINC
84 #define IO_EXT_MASK 0x0f
85 #define IO_EXT_DDR DDRC
86 #define IO_EXT_BIT_0 0
87 #define IO_EXT_BIT_1 1
88 #define IO_EXT_BIT_2 2
89 #define IO_EXT_BIT_3 3
90 
91 
93 #define IO_LINE_EN IO_LINE_EN
94 #define IO_LINE_EN_PORT PORTB
95 #define IO_LINE_EN_BIT 4
96 #define IO_LINE_EN_DDR DDRB
97 
98 
100 #define IO_I2C_SDA_PORT PORTC
101 #define IO_I2C_SDA_PIN PINC
102 #define IO_I2C_SDA_BIT 1
103 #define IO_I2C_SDA_DDR DDRC
104 
105 
107 #define IO_I2C_SCL_PORT PORTC
108 #define IO_I2C_SCL_PIN PINC
109 #define IO_I2C_SCL_BIT 0
110 #define IO_I2C_SCL_DDR DDRC
111 
112 
114 #define IO_UART_RXD_PORT PORTD
115 #define IO_UART_RXD_PIN PIND
116 #define IO_UART_RXD_BIT 0
117 #define IO_UART_RXD_DDR DDRD
118 
119 
121 #define IO_UART_TXD_PORT PORTD
122 #define IO_UART_TXD_PIN PIND
123 #define IO_UART_TXD_BIT 1
124 #define IO_UART_TXD_DDR DDRD
125 
126 
127 
129 #define AN_LINE_R 7
130 #define AN_LINE_C 6
131 #define AN_LINE_L 5
132 #define AN_VBAT 4
133 #define AN_X3 3
134 #define AN_X2 2
135 #define AN_X1 1
136 #define AN_X0 0