Main Page | Directories | File List | Globals | Examples

bsServoDevice.h File Reference

interface to the servo motor control module BM7004. More...

#include <bluemelon/types.h>
#include <bluesense/external/bsDeviceInterface.h>

Defines

#define BLUESENSE_SERVOCONTROLLER_SERVOCOUNT   8

Typedefs

typedef _bsServoDevice_specificsStruct * bsServoDevice_specifics_t

Enumerations

enum  bsServoDevice_portEnum

Functions

DECLSPEC bsServoDevice_specifics_t bsServoDevice_getDeviceSpecifics (bsDeviceTable_deviceInfo_t deviceInstancePtr)
DECLSPEC uint8_t bsServoDevice_requestSetAngles (bsServoDevice_specifics_t srvDev, uint8_t relevantAngles, uint8_t *angles)
DECLSPEC uint8_t bsServoDevice_requestSetAngle (bsServoDevice_specifics_t srvDev, bsServoDevice_portEnum port, uint8_t angle)
DECLSPEC uint8_t bsServoDevice_requestGetAngles (bsServoDevice_specifics_t srvDev)
DECLSPEC void bsServoDevice_getPendingAngles (bsServoDevice_specifics_t srvDev, uint8_t *angles)
DECLSPEC uint8_t bsServoDevice_getPendingAngle (bsServoDevice_specifics_t srvDev, bsServoDevice_portEnum port)
DECLSPEC uint8_t bsServoDevice_getRequestSetAnglesDone (bsServoDevice_specifics_t srvDev)
DECLSPEC uint8_t bsServoDevice_getCurrentAngle (bsServoDevice_specifics_t srvDev, bsServoDevice_portEnum port)
DECLSPEC void bsServoDevice_getCurrentAngles (bsServoDevice_specifics_t srvDev, uint8_t *angleArray)
DECLSPEC uint8_t bsServoDevice_requestSetConfiguration (bsServoDevice_specifics_t srvDev, uint8_t offset)
DECLSPEC uint8_t bsServoDevice_requestGetConfiguration (bsServoDevice_specifics_t srvDev)
DECLSPEC uint8_t bsServoDevice_getRequestSetConfigDone (bsServoDevice_specifics_t srvDev)
DECLSPEC uint8_t bsServoDevice_getRequestGetConfigDone (bsServoDevice_specifics_t srvDev)
DECLSPEC uint8_t bsServoDevice_configPending (bsServoDevice_specifics_t srvDev)
DECLSPEC uint8_t bsServoDevice_getCurrentOffset (bsServoDevice_specifics_t srvDev)
DECLSPEC void bsServoDevice_reset (bsServoDevice_specifics_t srvDev)
DECLSPEC void bsServoDevice_setTimeOutUs (bsServoDevice_specifics_t srvDev, uint32_t timeOutUs)
DECLSPEC uint32_t bsServoDevice_getTimeOutUs (bsServoDevice_specifics_t srvDev)


Detailed Description

interface to the servo motor control module BM7004.


Define Documentation

#define BLUESENSE_SERVOCONTROLLER_SERVOCOUNT   8
 

The number of servos that can be controlled

Examples:
servo.c.


Typedef Documentation

typedef struct _bsServoDevice_specificsStruct* bsServoDevice_specifics_t
 

This (opaque) structure represents the device specific data of a servo device.

Examples:
servo.c.


Enumeration Type Documentation

enum bsServoDevice_portEnum
 

This enumeration describes the servo output ports


Function Documentation

DECLSPEC uint8_t bsServoDevice_configPending bsServoDevice_specifics_t  srvDev  ) 
 

Checks if a configuration is being currently being set or being retrieved

Parameters:
srvDev a pointer to the servoDevice's instance specific data
Returns:
1 if busy, 0 if done

DECLSPEC uint8_t bsServoDevice_getCurrentAngle bsServoDevice_specifics_t  srvDev,
bsServoDevice_portEnum  port
 

Returns the current set angle of a specific servo.

Parameters:
srvDev a pointer to the servoDevice's instance specific data
port the port of the servo motor.
See also:
bsServoDevice_portEnum
Returns:
the angle off the servo.

DECLSPEC void bsServoDevice_getCurrentAngles bsServoDevice_specifics_t  srvDev,
uint8_t *  angleArray
 

Fills an array with the current set angles.

Parameters:
srvDev a pointer to the servoDevice's instance specific data
angleArray a pointer to an array of uint8_t angles with enough space for all servos.
See also:
BLUESENSE_SERVOCONTROLLER_SERVOCOUNT

DECLSPEC uint8_t bsServoDevice_getCurrentOffset bsServoDevice_specifics_t  srvDev  ) 
 

Returns the current set offset configuration parameter

Parameters:
srvDev a pointer to the servoDevice's instance specific data
Returns:
The offset. The offset allows you to disposition the pwm duty cycle so as to fine tune the position of the servos.

DECLSPEC bsServoDevice_specifics_t bsServoDevice_getDeviceSpecifics bsDeviceTable_deviceInfo_t  deviceInstancePtr  ) 
 

Returns a Servo device instance from a device info pointer (obtained from the device table).

Returns:
the instance of an Servo Interface. Or null if the device is inaccessible (eg. wrong type, not found).
Examples:
servo.c.

DECLSPEC uint8_t bsServoDevice_getPendingAngle bsServoDevice_specifics_t  srvDev,
bsServoDevice_portEnum  port
 

Returns the angle of a specific servo, which is currently underway to the device

Parameters:
srvDev a pointer to the servoDevice's instance specific data
port the servo motor port.
See also:
bsServoDevice_portEnum
Returns:
the angle to be set on the servo.

DECLSPEC void bsServoDevice_getPendingAngles bsServoDevice_specifics_t  srvDev,
uint8_t *  angles
 

Fills an array with angles which are currently underway to the device

Parameters:
srvDev a pointer to the servoDevice's instance specific data
angles a pointer to an array of uint8_t angles with enough space for all servos.
See also:
BLUESENSE_SERVOCONTROLLER_SERVOCOUNT

DECLSPEC uint8_t bsServoDevice_getRequestGetConfigDone bsServoDevice_specifics_t  srvDev  ) 
 

Checks if the configuration request is finished

Parameters:
srvDev a pointer to the servoDevice's instance specific data
Returns:
1 if configuration was retrieved, 0 if still busy

DECLSPEC uint8_t bsServoDevice_getRequestSetAnglesDone bsServoDevice_specifics_t  srvDev  ) 
 

Checks if the angle set request is finished

Parameters:
srvDev a pointer to the servoDevice's instance specific data
Returns:
1 if request finished, 0 if request still busy

DECLSPEC uint8_t bsServoDevice_getRequestSetConfigDone bsServoDevice_specifics_t  srvDev  ) 
 

Checks if the configuration set request is finished

Parameters:
srvDev a pointer to the servoDevice's instance specific data
Returns:
1 if request finished, 0 if request still busy

DECLSPEC uint32_t bsServoDevice_getTimeOutUs bsServoDevice_specifics_t  srvDev  ) 
 

Returns the current set time out delay. The time out delay is used to check if a request was acknowledged in the set time. If an answer to a request is not received within the set time, the request is resent.

Parameters:
srvDev a pointer to the servoDevice's instance specific data
Returns:
the time out value in microseconds.

DECLSPEC uint8_t bsServoDevice_requestGetAngles bsServoDevice_specifics_t  srvDev  ) 
 

Sends a request to retrieve the current set angles

Parameters:
srvDev a pointer to the servoDevice's instance specific data

DECLSPEC uint8_t bsServoDevice_requestGetConfiguration bsServoDevice_specifics_t  srvDev  ) 
 

Request to obtain the configuration settings from a adcInput Device.

Parameters:
srvDev a pointer to the servoDevice's instance specific data

DECLSPEC uint8_t bsServoDevice_requestSetAngle bsServoDevice_specifics_t  srvDev,
bsServoDevice_portEnum  port,
uint8_t  angle
 

Requests the servo device to set one of its servos to a new angle

Parameters:
srvDev a pointer to the servoDevice's instance specific data
port the servo motor port.
See also:
bsServoDevice_portEnum
Parameters:
angle an uint8_t representing the new angle of the servo. Note that each angle is value between 0 and 255, the actual physical angle depends on the specifications of the connected servo.

DECLSPEC uint8_t bsServoDevice_requestSetAngles bsServoDevice_specifics_t  srvDev,
uint8_t  relevantAngles,
uint8_t *  angles
 

Requests the servo device to set its servos to new angles

Parameters:
srvDev a pointer to the servoDevice's instance specific data
relevantAngles a bit mask indicating which servos to update
angles a pointer to an array of uint8_t angles with enough space for all servos.
See also:
BLUESENSE_SERVOCONTROLLER_SERVOCOUNT Only those angles for which a bit in the bit mask is set will be sent to the device. Note that each angle is a value between 0 and 255, the actual physical angle depends on the specifications of the connected servo.
Examples:
servo.c.

DECLSPEC uint8_t bsServoDevice_requestSetConfiguration bsServoDevice_specifics_t  srvDev,
uint8_t  offset
 

Requests to set the configuration of a servo device.

Parameters:
srvDev a pointer to the servoDevice's instance specific data
offset allows you to disposition the pwm duty cycle so as to fine tune the position of the servos.
Examples:
servo.c.

DECLSPEC void bsServoDevice_reset bsServoDevice_specifics_t  srvDev  ) 
 

Resets the internal state of the software, this causes the state of the module to be retrieved from the hardware. Also the timout and offset values are reset to their defaults.

Parameters:
srvDev a pointer to the servoDevice's instance specific data

DECLSPEC void bsServoDevice_setTimeOutUs bsServoDevice_specifics_t  srvDev,
uint32_t  timeOutUs
 

Sets the time out value which is used to check if a request was acknowledged in the set time. If an answer to a request is not received within the set time, the request is resent.

Parameters:
srvDev a pointer to the servoDevice's instance specific data
timeOutUs the value in microseconds which is the maximum duraion between a request and its answer.


Generated on Mon Jan 21 17:51:55 2008 for BlueSense by  doxygen 1.4.4