Subversion Repositories shark

Rev

Rev 291 | Rev 315 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
281 giacomo 1
#ifndef __SERVO_H__
2
#define __SERVO_H__
3
 
292 giacomo 4
#define SERVO_COM1 0
5
#define SERVO_COM2 1
6
#define SERVO_COM3 2
7
#define SERVO_COM4 3
8
 
291 giacomo 9
int servo_open(int port);
10
int servo_close(void);
11
 
281 giacomo 12
/* Setup */
13
 
14
int servo_set_RS232_baudrate(int baud); /* BaudRate */
15
int servo_get_RS232_baudrate(void);
16
int servo_store_RS232_baudrate(void);
17
 
18
int servo_set_period(int period); /* Servo period in us */
19
int servo_get_period(void);
20
int servo_store_period(void);
21
 
22
int servo_get_setup_switch(void); /* RC0 RC1 RC2 */
23
int servo_set_RC5_switch(int data);
24
 
25
/* Servo control */
26
 
290 giacomo 27
/* Convert angle (degree, minute, second -> second) */
28
#define ANGLE2SEC(deg,min,sec) ((deg)*3600 + (min)*60 + (sec))
281 giacomo 29
 
30
int servo_turn_off(int servo);
31
int servo_turn_on(int servo);
32
int servo_turn_off_all(void);
33
int servo_turn_on_all(void);
34
 
290 giacomo 35
int servo_set_max_angle_sec(int servo, int angle_sec);
36
int servo_set_min_angle_sec(int servo, int angle_sec);
281 giacomo 37
 
290 giacomo 38
int servo_set_angle_sec(int servo, int angle_sec);
39
int servo_get_angle_sec(int servo);
40
 
41
int servo_store_default_position(int servo);
42
 
281 giacomo 43
/* Analog control */
44
 
45
int servo_get_analog(int port);
46
 
47
#endif
48