Subversion Repositories shark

Rev

Rev 323 | Rev 381 | 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
 
358 giacomo 4
#ifndef COM1
5
#define COM1 0
6
#define COM2 1
7
#define COM3 2
8
#define COM4 3
9
#endif
292 giacomo 10
 
358 giacomo 11
int servo_open(int port, int speed);
12
int servo_close(int port);
291 giacomo 13
 
281 giacomo 14
/* Setup */
15
 
358 giacomo 16
int servo_set_RS232_baudrate(int port, int baud); /* BaudRate */
17
int servo_get_RS232_baudrate(int port);
18
int servo_store_RS232_baudrate(int port);
281 giacomo 19
 
358 giacomo 20
int servo_set_period(int port, int period); /* Servo period in us */
21
int servo_get_period(int port);
22
int servo_store_period(int port);
281 giacomo 23
 
358 giacomo 24
int servo_get_setup_switch(int port); /* RC0 RC1 RC2 */
25
int servo_set_RC5_switch(int port, int data);
281 giacomo 26
 
27
/* Servo control */
28
 
290 giacomo 29
/* Convert angle (degree, minute, second -> second) */
30
#define ANGLE2SEC(deg,min,sec) ((deg)*3600 + (min)*60 + (sec))
281 giacomo 31
 
358 giacomo 32
int servo_turn_off(int port, int servo);
33
int servo_turn_on(int port, int servo);
34
int servo_turn_off_all(int port);
35
int servo_turn_on_all(int port);
281 giacomo 36
 
358 giacomo 37
int servo_set_levels(int port, int bank, int mask);
38
int servo_get_levels(int port, int bank);
39
int servo_store_levels(int port);
315 giacomo 40
 
358 giacomo 41
int servo_set_max_angle_sec(int port, int servo, int angle_sec);
42
int servo_set_min_angle_sec(int port, int servo, int angle_sec);
281 giacomo 43
 
358 giacomo 44
int servo_set_angle_sec(int port, int servo, int angle_sec);
45
int servo_get_angle_sec(int port, int servo);
290 giacomo 46
 
358 giacomo 47
int servo_store_default_position(int port, int servo);
290 giacomo 48
 
281 giacomo 49
/* Analog control */
50
 
316 giacomo 51
#define MAX_ANALOG 0x03FF
52
 
358 giacomo 53
int servo_get_analog(int port, int adport);
281 giacomo 54
 
55
#endif
56