Subversion Repositories shark

Rev

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