File: quadservo.h

package info (click to toggle)
libphidgets 0.3.8-1.2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,996 kB
  • ctags: 257
  • sloc: sh: 8,803; ansic: 1,753; makefile: 276
file content (63 lines) | stat: -rw-r--r-- 2,054 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef __INCLUDED_PHIDGETS_QUADSERVO_H__
#define __INCLUDED_PHIDGETS_QUADSERVO_H__

#include <phidgets/servomotor.h>
#include <phidgets/phidgets.h>

typedef enum PhidgetQuadServoSelector_t {
  PHIDGET_QUADSERVO_MOTOR0 = 0,
  PHIDGET_QUADSERVO_MOTOR1 = 1,
  PHIDGET_QUADSERVO_MOTOR2 = 2,
  PHIDGET_QUADSERVO_MOTOR3 = 3
} PhidgetQuadServoSelector;

typedef struct PhidgetQuadServo_t {
  Phidget* phidget;
  PhidgetServoMotor servos[4];
} PhidgetQuadServo;

#ifdef __cplusplus
extern "C" {
#endif
  
PhidgetQuadServo* phidget_new_PhidgetQuadServo();

void phidget_delete_PhidgetQuadServo(PhidgetQuadServo** const qsc);

void phidget_reset_PhidgetQuadServo(PhidgetQuadServo* const qsc);

phidget_return phidget_quadservo_open(PhidgetQuadServo* const qsc,
    unsigned int serial, unsigned short retries);

phidget_return phidget_quadservo_close(PhidgetQuadServo* const qsc);

bool phidget_quadservo_is_opened(PhidgetQuadServo const* const qsc);

phidget_return phidget_quadservo_set_servo_parameters(PhidgetQuadServo* const qsc,
    PhidgetQuadServoSelector const servo, unsigned short const min,
    unsigned short const max, float const factor);

phidget_return phidget_quadservo_set_single_position(PhidgetQuadServo* const qsc,
    PhidgetQuadServoSelector const servo, unsigned int const position);

phidget_return phidget_quadservo_set_all_positions(PhidgetQuadServo* const qsc,
    unsigned int const p0, unsigned int const p1, unsigned int const p2,
    unsigned int const p3);

#ifdef __cplusplus
}
#endif

#endif // __INCLUDED_PHIDGETS_QUADSERVO_H__

/* COPYRIGHT --
 *
 * This file is part of libphidgets, a user-space library for phidgets.
 * libphidgets is (c) 2003-2005 Martin F. Krafft <krafft@ailab.ch>
 * and distributed under the terms of the Artistic Licence.
 * See the ./COPYING file in the source tree root for more information.
 *
 * THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES
 * OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 */