NiboRoboLib 3.6 - NIBO Library
copro.h
gehe zur Dokumentation dieser Datei
1 /* BSD-License:
2 
3 Copyright (c) 2008 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 
43 #ifndef NIBO_COPRO_H_
44 #define NIBO_COPRO_H_
45 #if defined(NIBO_USE_COPRO) || defined (DOXYGEN)
46 
47 #include <stdint.h>
48 
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52 
56 extern int16_t copro_speed_l;
57 
61 extern int16_t copro_speed_r;
62 
66 extern int16_t copro_ticks_l;
67 
71 extern int16_t copro_ticks_r;
72 
76 extern int16_t copro_current_l;
77 
81 extern int16_t copro_current_r;
82 
87 extern uint16_t copro_target_distance;
88 
92 uint8_t copro_update();
93 
97 uint8_t copro_stop();
98 
102 uint8_t copro_stopImmediate();
103 
110 uint8_t copro_setPWM(int16_t left, int16_t right);
111 
122 uint8_t copro_setSpeed(int16_t left, int16_t right);
123 
131 uint8_t copro_setTargetAbs(int16_t left, int16_t right, uint16_t speed);
132 
149 uint8_t copro_setTargetRel(int16_t left, int16_t right, uint16_t speed);
150 
160 uint8_t copro_setSpeedParameters(int8_t kp, int8_t ki, int8_t kd);
161 
170 uint8_t copro_setPositionParameters(int8_t ki, int8_t kp, int8_t kd);
171 
177 uint8_t copro_resetOdometry(int16_t left, int16_t right);
178 
179 
180 
181 enum {
182  COPRO_IR_PASSIVE = 0,
183  COPRO_IR_RC5TX = 1,
184  COPRO_IR_MEASURE = 2,
185 };
186 
190 extern uint8_t copro_ir_mode;
191 
195 extern uint16_t copro_distance[5];
196 
200 extern uint16_t copro_rc5_cmd;
201 
205 extern uint8_t copro_sysconf[4];
206 
210 uint8_t copro_ir_stop();
211 
215 uint8_t copro_ir_startMeasure();
216 
217 
228 uint8_t copro_transmitRC5(uint16_t code);
229 
230 
231 
232 
233 
234 
235 #ifdef __cplusplus
236 } // extern "C"
237 #endif
238 
239 #endif // NIBO_USE_COPRO
240 #endif // NIBO_COPRO_H_
uint8_t copro_setPWM(int16_t left, int16_t right)
uint8_t copro_ir_startMeasure()
uint8_t copro_setSpeedParameters(int8_t kp, int8_t ki, int8_t kd)
int16_t copro_speed_r
int16_t copro_ticks_r
uint8_t copro_update()
uint8_t copro_resetOdometry(int16_t left, int16_t right)
uint8_t copro_sysconf[4]
uint8_t copro_stop()
int16_t copro_current_r
uint16_t copro_rc5_cmd
int16_t copro_ticks_l
uint8_t copro_setPositionParameters(int8_t ki, int8_t kp, int8_t kd)
uint8_t copro_ir_stop()
uint8_t copro_transmitRC5(uint16_t code)
uint8_t copro_setSpeed(int16_t left, int16_t right)
uint16_t copro_target_distance
int16_t copro_speed_l
uint8_t copro_ir_mode
uint8_t copro_stopImmediate()
uint8_t copro_setTargetAbs(int16_t left, int16_t right, uint16_t speed)
int16_t copro_current_l
uint16_t copro_distance[5]
uint8_t copro_setTargetRel(int16_t left, int16_t right, uint16_t speed)