Main Page | Directories | File List | Globals | Examples

bsRelayOutputDevice.h File Reference

interface to the open collector output device BM7002. More...

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

Typedefs

typedef _bsRelayOutputDevice_specificsStruct * bsRelayOutputDevice_specifics_t

Enumerations

enum  bsRelayOutputDevice_portEnum

Functions

DECLSPEC bsRelayOutputDevice_specifics_t bsRelayOutputDevice_getDeviceSpecifics (bsDeviceTable_deviceInfo_t deviceInstancePtr)
DECLSPEC uint8_t bsRelayOutputDevice_getCurrentOutput (bsRelayOutputDevice_specifics_t rlo, bsRelayOutputDevice_portEnum port)
DECLSPEC uint16_t bsRelayOutputDevice_getCurrentOutputs (bsRelayOutputDevice_specifics_t rlo)
DECLSPEC uint8_t bsRelayOutputDevice_requestGetOutputs (bsRelayOutputDevice_specifics_t rlo)
DECLSPEC uint8_t bsRelayOutputDevice_getRequestGetOutputsDone (bsRelayOutputDevice_specifics_t rlo)
DECLSPEC uint8_t bsRelayOutputDevice_getRequestSetOutputsDone (bsRelayOutputDevice_specifics_t rlo)
DECLSPEC uint8_t bsRelayOutputDevice_requestSetOutputs (bsRelayOutputDevice_specifics_t rlo, uint16_t relevantBits, uint16_t outputs)
DECLSPEC uint8_t bsRelayOutputDevice_requestSetOutput (bsRelayOutputDevice_specifics_t rlo, bsRelayOutputDevice_portEnum port, uint8_t output)
DECLSPEC uint16_t bsRelayOutputDevice_getPendingOutputs (bsRelayOutputDevice_specifics_t rlo)
DECLSPEC uint8_t bsRelayOutputDevice_getPendingOutput (bsRelayOutputDevice_specifics_t rlo, bsRelayOutputDevice_portEnum port)
DECLSPEC void bsRelayOutputDevice_setTimeOutUs (bsRelayOutputDevice_specifics_t rlo, uint32_t timeOutUs)
DECLSPEC uint32_t bsRelayOutputDevice_getTimeOutUs (bsRelayOutputDevice_specifics_t rlo)
DECLSPEC void bsRelayOutputDevice_reset (bsRelayOutputDevice_specifics_t rlo)


Detailed Description

interface to the open collector output device BM7002.

The BM7002 enables you to switch so called 'open collector' outputs. This opens up possibilities to directly switch small lights, relays, solenoids or other components which have their own power supply. By routing positive voltage connection of your own power supply to the board you can use the boards internal diodes. This allows you to switch an inductive load, for example a relay without any components!


Typedef Documentation

typedef struct _bsRelayOutputDevice_specificsStruct* bsRelayOutputDevice_specifics_t
 

This (opaque) structure represents the device specific data of an RelayOutputDevice


Enumeration Type Documentation

enum bsRelayOutputDevice_portEnum
 

Enumeration describing the open collector output ports


Function Documentation

DECLSPEC uint8_t bsRelayOutputDevice_getCurrentOutput bsRelayOutputDevice_specifics_t  rlo,
bsRelayOutputDevice_portEnum  port
 

Returns the state of an output pin 'port'

Parameters:
rlo a pointer to the RelayOutputDevice's instance specific data
port the port to read.

DECLSPEC uint16_t bsRelayOutputDevice_getCurrentOutputs bsRelayOutputDevice_specifics_t  rlo  ) 
 

Returns the multiplexed states of the outputs

Parameters:
rlo a pointer to the RelayOutputDevice's instance specific data

DECLSPEC bsRelayOutputDevice_specifics_t bsRelayOutputDevice_getDeviceSpecifics bsDeviceTable_deviceInfo_t  deviceInstancePtr  ) 
 

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

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

DECLSPEC uint8_t bsRelayOutputDevice_getPendingOutput bsRelayOutputDevice_specifics_t  rlo,
bsRelayOutputDevice_portEnum  port
 

Returns the 'tobe set' state of an output

Parameters:
rlo a pointer to the RelayOutputDevice's instance specific data
port the output port.
Returns:
1 if the output will be activated, or 0 when it will be deactivated.

DECLSPEC uint16_t bsRelayOutputDevice_getPendingOutputs bsRelayOutputDevice_specifics_t  rlo  ) 
 

Returns a bitmask containing which outputs are be set after the request finishes

Parameters:
rlo a pointer to the RelayOutputDevice's instance specific data
Returns:
an uint16_t containing for each output a bit. If the bit is 1, then the output will be set when the request is completed

DECLSPEC uint8_t bsRelayOutputDevice_getRequestGetOutputsDone bsRelayOutputDevice_specifics_t  rlo  ) 
 

Checks if the output/pwm get request is finished

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

DECLSPEC uint8_t bsRelayOutputDevice_getRequestSetOutputsDone bsRelayOutputDevice_specifics_t  rlo  ) 
 

Checks if the output/pwm set request is finished

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

DECLSPEC uint32_t bsRelayOutputDevice_getTimeOutUs bsRelayOutputDevice_specifics_t  rlo  ) 
 

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

DECLSPEC uint8_t bsRelayOutputDevice_requestGetOutputs bsRelayOutputDevice_specifics_t  rlo  ) 
 

Sends a request to retrieve the current set output/pwm states

Parameters:
rlo a pointer to the RelayOutputDevice's instance specific data

DECLSPEC uint8_t bsRelayOutputDevice_requestSetOutput bsRelayOutputDevice_specifics_t  rlo,
bsRelayOutputDevice_portEnum  port,
uint8_t  output
 

Sends a request to set a single output to a new state

Parameters:
rlo a pointer to the RelayOutputDevice's instance specific data
port the output port to set.
output the new state of the output. 1 activates, 0 disables.

DECLSPEC uint8_t bsRelayOutputDevice_requestSetOutputs bsRelayOutputDevice_specifics_t  rlo,
uint16_t  relevantBits,
uint16_t  outputs
 

Sends a request to update the output states of the device.

Parameters:
rlo a pointer to the RelayOutputDevice's instance specific data
relevantBits a bit mask indicating which outputs to update
outputs an uint16_t bit mask containing the new output states. Only those outputs will be updated for which a bit is set in the relevantBits parameter

DECLSPEC void bsRelayOutputDevice_reset bsRelayOutputDevice_specifics_t  rlo  ) 
 

Resets the device proxy to its initial state. The the actual device settings are requested from the module.

Parameters:
rlo a pointer to the RelayOutputDevice's instance specific data

DECLSPEC void bsRelayOutputDevice_setTimeOutUs bsRelayOutputDevice_specifics_t  rlo,
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:
rlo a pointer to the RelayOutputDevice'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