Main Page | Directories | File List | Globals | Examples

bsDacOutputDevice.h File Reference

interface to the analog output module BMxxxx. More...

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

Defines

#define BLUESENSE_ANALOGOUTPUT_OUTPUTCOUNT   6

Typedefs

typedef _bsDacOutputDevice_specificsStruct * bsDacOutputDevice_specifics_t

Enumerations

enum  bsDacOutputDevice_portEnum

Functions

DECLSPEC bsDacOutputDevice_specifics_t bsDacOutputDevice_getDeviceSpecifics (bsDeviceTable_deviceInfo_t deviceInstancePtr)
DECLSPEC uint8_t bsDacOutputDevice_requestSetOutputs (bsDacOutputDevice_specifics_t dac, uint8_t relevantDacs, uint8_t *outputs)
DECLSPEC uint8_t bsDacOutputDevice_requestSetOutput (bsDacOutputDevice_specifics_t dac, bsDacOutputDevice_portEnum port, uint8_t output)
DECLSPEC uint8_t bsDacOutputDevice_requestGetOutputs (bsDacOutputDevice_specifics_t dac)
DECLSPEC void bsDacOutputDevice_getPendingOutputs (bsDacOutputDevice_specifics_t dac, uint8_t *outputs)
DECLSPEC uint8_t bsDacOutputDevice_getPendingOutput (bsDacOutputDevice_specifics_t dac, bsDacOutputDevice_portEnum port)
DECLSPEC uint8_t bsDacOutputDevice_getRequestSetOutputsDone (bsDacOutputDevice_specifics_t dac)
DECLSPEC uint8_t bsDacOutputDevice_getRequestGetOutputsDone (bsDacOutputDevice_specifics_t dac)
DECLSPEC uint8_t bsDacOutputDevice_getCurrentOutput (bsDacOutputDevice_specifics_t dac, bsDacOutputDevice_portEnum port)
DECLSPEC void bsDacOutputDevice_getCurrentOutputs (bsDacOutputDevice_specifics_t dac, uint8_t *outputArray)
DECLSPEC void bsDacOutputDevice_reset (bsDacOutputDevice_specifics_t dac)
DECLSPEC void bsDacOutputDevice_setTimeOutUs (bsDacOutputDevice_specifics_t dac, uint32_t timeOutUs)
DECLSPEC uint32_t bsDacOutputDevice_getTimeOutUs (bsDacOutputDevice_specifics_t dac)


Detailed Description

interface to the analog output module BMxxxx.


Define Documentation

#define BLUESENSE_ANALOGOUTPUT_OUTPUTCOUNT   6
 

The number of analog outputs


Typedef Documentation

typedef struct _bsDacOutputDevice_specificsStruct* bsDacOutputDevice_specifics_t
 

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

Examples:
analogue_out.c.


Enumeration Type Documentation

enum bsDacOutputDevice_portEnum
 

This enumeration describes the dac output ports


Function Documentation

DECLSPEC uint8_t bsDacOutputDevice_getCurrentOutput bsDacOutputDevice_specifics_t  dac,
bsDacOutputDevice_portEnum  port
 

Returns the current set output of a specific dac.

Parameters:
dac a pointer to the dacDevice's instance specific data
port the output port.
See also:
bsDacOutputDevice_portEnum
Returns:
the value of the output.
Examples:
analogue_out.c.

DECLSPEC void bsDacOutputDevice_getCurrentOutputs bsDacOutputDevice_specifics_t  dac,
uint8_t *  outputArray
 

Fills an array with the current set outputs.

Parameters:
dac a pointer to the dacDevice's instance specific data
outputArray a pointer to an array of uint8_t values with enough space for all outputs.
See also:
BLUESENSE_ANALOGOUTPUT_ANALOGOUTPUTCOUNT

DECLSPEC bsDacOutputDevice_specifics_t bsDacOutputDevice_getDeviceSpecifics bsDeviceTable_deviceInfo_t  deviceInstancePtr  ) 
 

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

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

DECLSPEC uint8_t bsDacOutputDevice_getPendingOutput bsDacOutputDevice_specifics_t  dac,
bsDacOutputDevice_portEnum  port
 

Returns the value of a specific output, which is currently underway to the device

Parameters:
dac a pointer to the dacDevice's instance specific data
port the dac motor port.
See also:
bsDacOutputDevice_portEnum
Returns:
the output to be set on the dac.

DECLSPEC void bsDacOutputDevice_getPendingOutputs bsDacOutputDevice_specifics_t  dac,
uint8_t *  outputs
 

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

Parameters:
dac a pointer to the dacDevice's instance specific data
outputs a pointer to an array of uint8_t values with enough space for all outputs.
See also:
BLUESENSE_ANALOGOUTPUT_ANALOGOUTPUTCOUNT

DECLSPEC uint8_t bsDacOutputDevice_getRequestGetOutputsDone bsDacOutputDevice_specifics_t  dac  ) 
 

Checks if the output get request is finished

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

DECLSPEC uint8_t bsDacOutputDevice_getRequestSetOutputsDone bsDacOutputDevice_specifics_t  dac  ) 
 

Checks if the output set request is finished

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

DECLSPEC uint32_t bsDacOutputDevice_getTimeOutUs bsDacOutputDevice_specifics_t  dac  ) 
 

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:
dac a pointer to the dacDevice's instance specific data
Returns:
the time out value in microseconds.

DECLSPEC uint8_t bsDacOutputDevice_requestGetOutputs bsDacOutputDevice_specifics_t  dac  ) 
 

Sends a request to retrieve the current set outputs

Parameters:
dac a pointer to the dacDevice's instance specific data

DECLSPEC uint8_t bsDacOutputDevice_requestSetOutput bsDacOutputDevice_specifics_t  dac,
bsDacOutputDevice_portEnum  port,
uint8_t  output
 

Requests the dac device to set one of its outputs to a new value

Parameters:
dac a pointer to the dacDevice's instance specific data
port the dac motor port.
See also:
bsDacOutputDevice_portEnum
Parameters:
output an uint8_t representing the new value of the output. Note that each output is value between 0 and 255, the actual physical output depends on the specifications of the connected dac.
Examples:
analogue_out.c.

DECLSPEC uint8_t bsDacOutputDevice_requestSetOutputs bsDacOutputDevice_specifics_t  dac,
uint8_t  relevantDacs,
uint8_t *  outputs
 

Requests the dac device to set its dacs to new outputs

Parameters:
dac a pointer to the dacDevice's instance specific data
relevantDacs a bit mask indicating which dacs to update
outputs a pointer to an array of uint8_t values with enough space for all dacs.
See also:
BLUESENSE_ANALOGOUTPUT_ANALOGOUTPUTCOUNT Only those outputs for which a bit in the bit mask is set will be sent to the device. Note that each output is a value between 0 and 255.

DECLSPEC void bsDacOutputDevice_reset bsDacOutputDevice_specifics_t  dac  ) 
 

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:
dac a pointer to the dacDevice's instance specific data

DECLSPEC void bsDacOutputDevice_setTimeOutUs bsDacOutputDevice_specifics_t  dac,
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:
dac a pointer to the dacDevice'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