Main Page | Class Hierarchy | Class List | Class Members

BlueSense::SwitchInputDevice Class Reference

Inheritance diagram for BlueSense::SwitchInputDevice:

BlueSense::Device List of all members.

Public Types

enum  RotaryEnum
enum  PortEnum

Public Member Functions

 SwitchInputDevice (Master master, ushort deviceId)
bool getLastSampledInput (PortEnum port)
ushort getLastSampledInputs ()
uint getLastSampledCounter (PortEnum port)
int getLastSampledRotary (RotaryEnum rport)
uint getSampleCount ()
bool getRequestGetInputsDone ()
void requestGetInputs ()
void requestNeedsBooleans (byte side, bool needs)
void requestNeedsCounter (PortEnum port, bool needs)
void requestNeedsRotary (RotaryEnum rport, bool needs)
bool usesBooleans (byte side)
bool usesCounter (PortEnum port)
bool usesRotary (RotaryEnum rport)
bool configPending ()
bool getRequestGetConfigDone ()
bool getRequestSetConfigDone ()
void requestGetConfiguration ()
void requestSetConfiguration (int boolsMask, int rotaryMask, int counterMask)
uint getTimeOutUs ()
void setTimeOutUs (uint timeOutUs)

Detailed Description

Interface to the switchInputDevice BM7001.

The BM7001 allows you to measure the state of 12 different switches. Besides 12 normal switch the device has been programmed with special software to support automatic measurement of up to six rotary encoders. This means that you don't have to write complicated code anymore. The device simply outputs a number which determines the state of the rotary encoder. Each input can have a configured counter which counts the number of switch state changes. Because these features have been implemented in the device itself you can be sure that your software won't miss any information.


Member Enumeration Documentation

enum BlueSense::SwitchInputDevice::PortEnum
 

Enum describing the switch inputs pA_5 is a switch connected to side A pin 5

enum BlueSense::SwitchInputDevice::RotaryEnum
 

Enum describing the rotary port values rA_1_2 is a rotary connected to side A, ports 1 and 2


Constructor & Destructor Documentation

BlueSense::SwitchInputDevice::SwitchInputDevice Master  master,
ushort  deviceId
[inline]
 

Creates a 'software' switchInput device with a given id. The device will inacessible until a physical device with the same id is detected.

Parameters:
master 
deviceId 


Member Function Documentation

bool BlueSense::SwitchInputDevice::configPending  )  [inline]
 

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

Returns:
true if busy, false if done

uint BlueSense::SwitchInputDevice::getLastSampledCounter PortEnum  port  )  [inline]
 

returns the last received counter value

Parameters:
port the input port.
See also:
PortEnum
Returns:
the value of the counter.

bool BlueSense::SwitchInputDevice::getLastSampledInput PortEnum  port  )  [inline]
 

returns the last taken bit sample on a specific port

Parameters:
port the input port.
See also:
PortEnum
Returns:
true if port activated, false if inactive

ushort BlueSense::SwitchInputDevice::getLastSampledInputs  )  [inline]
 

returns the last taken multiplexed bit sample. A multiplexed sample is built as: port[0]+port[1]*2+port[2]*4+port[3]*8+...+port[11]*2048

Returns:
the multiplex sample containing the port states.

int BlueSense::SwitchInputDevice::getLastSampledRotary RotaryEnum  rport  )  [inline]
 

returns the last received rotary value

Parameters:
rport the rotary port.
See also:
RotaryEnum
Returns:
the value of the rotary encoder, this value can be negative

bool BlueSense::SwitchInputDevice::getRequestGetConfigDone  )  [inline]
 

Checks if the configuration request is finished

Returns:
true if configuration was retrieved, false if still busy

bool BlueSense::SwitchInputDevice::getRequestGetInputsDone  )  [inline]
 

Checks if an 'input values' request is finished

Returns:
true if done, false if still busy

bool BlueSense::SwitchInputDevice::getRequestSetConfigDone  )  [inline]
 

Checks if the configuration set request is finished

Returns:
true if request finished, false if request still busy

uint BlueSense::SwitchInputDevice::getSampleCount  )  [inline]
 

returns the total number of samples taken since the start of the application

Returns:
the number of taken samples

uint BlueSense::SwitchInputDevice::getTimeOutUs  )  [inline]
 

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.

Returns:
the time out value in microseconds.

void BlueSense::SwitchInputDevice::requestGetConfiguration  )  [inline]
 

Request to obtain the configuration settings from a adcInput Device.

void BlueSense::SwitchInputDevice::requestGetInputs  )  [inline]
 

Send a request to obtain the values of the switch inputs

void BlueSense::SwitchInputDevice::requestNeedsBooleans byte  side,
bool  needs
[inline]
 

Sends a request: request that the device should not/should send bool states

Parameters:
side if 0, side A selected, if 1 side B selected.
needs if true, device should send bool states, false device should not send bool states

void BlueSense::SwitchInputDevice::requestNeedsCounter PortEnum  port,
bool  needs
[inline]
 

Sends a request: request that the device should not/should send counter states

Parameters:
port the input port.
See also:
PortEnum
Parameters:
needs if true, device should send counter value, false device should not send counter value

void BlueSense::SwitchInputDevice::requestNeedsRotary RotaryEnum  rport,
bool  needs
[inline]
 

Sends a request: request that the device should not/should send rotary encoder states

Parameters:
rport the rotary ports.
See also:
RotaryEnum
Parameters:
needs if true, device should send rotary states, false device should not send rotary states

void BlueSense::SwitchInputDevice::requestSetConfiguration int  boolsMask,
int  rotaryMask,
int  counterMask
[inline]
 

Request the switchInput device to set the input types

Parameters:
boolsMask receive switch data from side A (bit 0) and/or side B(bit 1)
rotaryMask receive rotary data from pin 1,2 (bit 0), pin 3,4 (bit 1), pin 5,6 (bit 2)...
counterMask receiver counter values from pin 1 (bit 0), pin 2 (bit 1), pin 3 (bit 2)....

void BlueSense::SwitchInputDevice::setTimeOutUs uint  timeOutUs  )  [inline]
 

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:
timeOutUs the value in microseconds which is the maximum duraion between a request and its answer.

bool BlueSense::SwitchInputDevice::usesBooleans byte  side  )  [inline]
 

Find out if we receive the bool states of hardware side A or B.

Parameters:
side if 0, check if side A bools are received, if 1 check if side B bools are received.
Returns:
true if states are received, false if bool states are currently disabled (and will not be received).

bool BlueSense::SwitchInputDevice::usesCounter PortEnum  port  )  [inline]
 

Find out if we receive counter states.

Parameters:
port the switch port.
See also:
PortEnum
Returns:
true if states are received, false if states are currently disabled (and will not be received).

bool BlueSense::SwitchInputDevice::usesRotary RotaryEnum  rport  )  [inline]
 

Find out if we receive rotary states.

Parameters:
rport the rotary port.
See also:
RotaryEnum
Returns:
true if states are received, false if states are currently disabled (and will not be received).


The documentation for this class was generated from the following file:
Generated on Mon Jan 21 17:51:58 2008 for BlueSense.NET/Mono by  doxygen 1.4.4