Mindstorms 3rd Party ROBOTC Drivers RobotC
[Home] [Download] [Submit a bug/suggestion] [ROBOTC Forums] [Blog] [Support this project]
Files | Defines | Functions | Variables

RCX Sensor MUX
[Mindsensors]

Files

file  mindsensors-rcxsensorsmux.h
 

Mindsensors MSRXMUX RCX Sensor MUX Sensor driver.


Defines

#define MSRXMUX_I2C_ADDR   0x7E
#define MSRXMUX_CHAN1   0xFE
#define MSRXMUX_CHAN2   0xFD
#define MSRXMUX_CHAN3   0xFB
#define MSRXMUX_CHAN4   0xF7
#define MSRXMUX_NONE   0xFF

Functions

void MSRXMUXsetupChan (tSensors link, ubyte chan, TSensorTypes chantype, TSensorModes chanmode, ubyte delay)
int MSRXMUXreadChan (tSensors link, byte chan)

Variables

tByteArray MSRXMUX_I2CRequest
TSensorTypes RCXSensorTypes [4][4]
TSensorModes RCXSensorModes [4][4]
ubyte RCXSensorDelays [4][4] = {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}

Detailed Description

RCX Sensor MUX


Define Documentation

#define MSRXMUX_CHAN1   0xFE

Select MUX channel 1

Definition at line 43 of file mindsensors-rcxsensorsmux.h.

#define MSRXMUX_CHAN2   0xFD

Select MUX channel 2

Definition at line 44 of file mindsensors-rcxsensorsmux.h.

#define MSRXMUX_CHAN3   0xFB

Select MUX channel 3

Definition at line 45 of file mindsensors-rcxsensorsmux.h.

#define MSRXMUX_CHAN4   0xF7

Select MUX channel 4

Definition at line 46 of file mindsensors-rcxsensorsmux.h.

#define MSRXMUX_I2C_ADDR   0x7E

I2C address for sensor

Definition at line 42 of file mindsensors-rcxsensorsmux.h.

#define MSRXMUX_NONE   0xFF

Deselect all MUX channels

Definition at line 47 of file mindsensors-rcxsensorsmux.h.


Function Documentation

int MSRXMUXreadChan ( tSensors  link,
byte  chan 
)
Examples:
mindsensors-rcxsensorsmux-test1.c.

Definition at line 81 of file mindsensors-rcxsensorsmux.h.

void MSRXMUXsetupChan ( tSensors  link,
ubyte  chan,
TSensorTypes  chantype,
TSensorModes  chanmode,
ubyte  delay 
)

Send a direct command to the MUX sensor

Note: this is an internal command and should not be called directly.

Parameters:
linkthe PFMate port number
chanthe channel to be configured
chantypethe sensor type connected to the channel
chanmodethe sensor mode of the sensor
delaythe initialisation delay time
Returns:
true if no error occured, false if it did
Examples:
mindsensors-rcxsensorsmux-test1.c.

Definition at line 72 of file mindsensors-rcxsensorsmux.h.


Variable Documentation

Array to hold I2C command data

Definition at line 49 of file mindsensors-rcxsensorsmux.h.

ubyte RCXSensorDelays[4][4] = {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}

Definition at line 59 of file mindsensors-rcxsensorsmux.h.

TSensorModes RCXSensorModes[4][4]
Initial value:
 {{modeRaw, modeRaw, modeRaw, modeRaw},
                                     {modeRaw, modeRaw, modeRaw, modeRaw},
                                     {modeRaw, modeRaw, modeRaw, modeRaw},
                                     {modeRaw, modeRaw, modeRaw, modeRaw}}

Definition at line 55 of file mindsensors-rcxsensorsmux.h.

TSensorTypes RCXSensorTypes[4][4]
Initial value:
 {{sensorNone, sensorNone, sensorNone, sensorNone},
                                     {sensorNone, sensorNone, sensorNone, sensorNone},
                                     {sensorNone, sensorNone, sensorNone, sensorNone},
                                     {sensorNone, sensorNone, sensorNone, sensorNone}}

Definition at line 51 of file mindsensors-rcxsensorsmux.h.