Subversion Repositories shark

Rev

Rev 316 | Rev 358 | 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
 
323 giacomo 35
int servo_set_levels(int bank, int mask);
315 giacomo 36
int servo_get_levels();
37
int servo_store_levels();
38
 
290 giacomo 39
int servo_set_max_angle_sec(int servo, int angle_sec);
40
int servo_set_min_angle_sec(int servo, int angle_sec);
281 giacomo 41
 
290 giacomo 42
int servo_set_angle_sec(int servo, int angle_sec);
43
int servo_get_angle_sec(int servo);
44
 
45
int servo_store_default_position(int servo);
46
 
281 giacomo 47
/* Analog control */
48
 
316 giacomo 49
#define MAX_ANALOG 0x03FF
50
 
281 giacomo 51
int servo_get_analog(int port);
52
 
53
#endif
54