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

IR Seeker V2
[HiTechnic]

Files

file  HTIRS2-driver.h
 

HiTechnic IR Seeker V2 driver.


Defines

#define HTIRS2_I2C_ADDR   0x10
#define HTIRS2_DSP_MODE   0x41
#define HTIRS2_OFFSET   0x42
#define HTIRS2_DC_DIR   0x00
#define HTIRS2_DC_SSTR1   0x01
#define HTIRS2_DC_SSTR2   0x02
#define HTIRS2_DC_SSTR3   0x03
#define HTIRS2_DC_SSTR4   0x04
#define HTIRS2_DC_SSTR5   0x05
#define HTIRS2_DC_SAVG   0x06
#define HTIRS2_AC_DIR   0x07
#define HTIRS2_AC_SSTR1   0x08
#define HTIRS2_AC_SSTR2   0x09
#define HTIRS2_AC_SSTR3   0x0A
#define HTIRS2_AC_SSTR4   0x0B
#define HTIRS2_AC_SSTR5   0x0C

Enumerations

enum  tHTIRS2DSPMode { DSP_1200 = 0, DSP_600 = 1 }

Functions

int HTIRS2readDCDir (tSensors link)
bool HTIRS2readAllDCStrength (tSensors link, int &dcS1, int &dcS2, int &dcS3, int &dcS4, int &dcS5)
int HTIRS2readDCAverage (tSensors link)
bool HTIRS2setDSPMode (tSensors link, tHTIRS2DSPMode mode)
int HTIRS2readACDir (tSensors link)
bool HTIRS2readAllACStrength (tSensors link, int &acS1, int &acS2, int &acS3, int &acS4, int &acS5)
int HTIRS2readDCDir (tMUXSensor muxsensor)
bool HTIRS2readAllDCStrength (tMUXSensor muxsensor, int &dcS1, int &dcS2, int &dcS3, int &dcS4, int &dcS5)
int HTIRS2readDCAverage (tMUXSensor muxsensor)
int HTIRS2readACDir (tMUXSensor muxsensor)
bool HTIRS2readAllACStrength (tMUXSensor muxsensor, int &acS1, int &acS2, int &acS3, int &acS4, int &acS5)

Variables

tConfigParams HTIRS2_config = {HTSMUX_CHAN_I2C, 13, 0x10, 0x42}
tByteArray HTIRS2_I2CRequest
tByteArray HTIRS2_I2CReply

Detailed Description

HiTechnic IR Seeker V2


Define Documentation

#define HTIRS2_AC_DIR   0x07

DC Direction data

Definition at line 57 of file HTIRS2-driver.h.

#define HTIRS2_AC_SSTR1   0x08

DC Sensor 0 signal strength above average

Definition at line 58 of file HTIRS2-driver.h.

#define HTIRS2_AC_SSTR2   0x09

DC Sensor 1 signal strength above average

Definition at line 59 of file HTIRS2-driver.h.

#define HTIRS2_AC_SSTR3   0x0A

DC Sensor 2 signal strength above average

Definition at line 60 of file HTIRS2-driver.h.

#define HTIRS2_AC_SSTR4   0x0B

DC Sensor 3 signal strength above average

Definition at line 61 of file HTIRS2-driver.h.

#define HTIRS2_AC_SSTR5   0x0C

DC Sensor 4 signal strength above average AC DSP modes

Definition at line 62 of file HTIRS2-driver.h.

#define HTIRS2_DC_DIR   0x00

DC Direction data

Definition at line 50 of file HTIRS2-driver.h.

#define HTIRS2_DC_SAVG   0x06

DC sensor signal strength average

Definition at line 56 of file HTIRS2-driver.h.

#define HTIRS2_DC_SSTR1   0x01

DC Sensor 0 signal strength above average

Definition at line 51 of file HTIRS2-driver.h.

#define HTIRS2_DC_SSTR2   0x02

DC Sensor 1 signal strength above average

Definition at line 52 of file HTIRS2-driver.h.

#define HTIRS2_DC_SSTR3   0x03

DC Sensor 2 signal strength above average

Definition at line 53 of file HTIRS2-driver.h.

#define HTIRS2_DC_SSTR4   0x04

DC Sensor 3 signal strength above average

Definition at line 54 of file HTIRS2-driver.h.

#define HTIRS2_DC_SSTR5   0x05

DC Sensor 4 signal strength above average

Definition at line 55 of file HTIRS2-driver.h.

#define HTIRS2_DSP_MODE   0x41

AC DSP mode - 0 = 1200Hz, 1 = 600Hz

Definition at line 48 of file HTIRS2-driver.h.

#define HTIRS2_I2C_ADDR   0x10

IR Seeker I2C device address

Definition at line 47 of file HTIRS2-driver.h.

#define HTIRS2_OFFSET   0x42

Offset for data registers

Definition at line 49 of file HTIRS2-driver.h.


Enumeration Type Documentation

Enumerator:
DSP_1200 
DSP_600 

Definition at line 66 of file HTIRS2-driver.h.


Function Documentation

int HTIRS2readACDir ( tSensors  link )

Read the value of the AC Direction data register and return it.

Parameters:
linkthe HTIRS2 port number
Returns:
value of 0-9, the direction index of the detected IR signal or -1 if an error occurred.
Examples:
HTIRS2-SMUX-test1.c, and HTIRS2-test1.c.

Definition at line 276 of file HTIRS2-driver.h.

int HTIRS2readACDir ( tMUXSensor  muxsensor )

Read the value of the AC Direction data register and return it.

Parameters:
muxsensorthe SMUX sensor port number
Returns:
value of 0-9, the direction index of the detected IR signal or -1 if an error occurred.

Definition at line 299 of file HTIRS2-driver.h.

bool HTIRS2readAllACStrength ( tMUXSensor  muxsensor,
int &  acS1,
int &  acS2,
int &  acS3,
int &  acS4,
int &  acS5 
)

Read the value of the all of the internal AC sensors and copy into specified buffer.

Parameters:
muxsensorthe SMUX sensor port number
acS1data from internal sensor nr 1
acS2data from internal sensor nr 2
acS3data from internal sensor nr 3
acS4data from internal sensor nr 4
acS5data from internal sensor nr 5
Returns:
true if no error occured, false if it did

Definition at line 358 of file HTIRS2-driver.h.

bool HTIRS2readAllACStrength ( tSensors  link,
int &  acS1,
int &  acS2,
int &  acS3,
int &  acS4,
int &  acS5 
)

Read the value of the all of the internal AC sensors and copy into specified buffer.

Parameters:
linkthe HTIRS2 port number
acS1data from internal sensor nr 1
acS2data from internal sensor nr 2
acS3data from internal sensor nr 3
acS4data from internal sensor nr 4
acS5data from internal sensor nr 5
Returns:
true if no error occured, false if it did
Examples:
HTIRS2-SMUX-test1.c, and HTIRS2-test1.c.

Definition at line 324 of file HTIRS2-driver.h.

bool HTIRS2readAllDCStrength ( tMUXSensor  muxsensor,
int &  dcS1,
int &  dcS2,
int &  dcS3,
int &  dcS4,
int &  dcS5 
)

Read the value of the all of the internal DC sensors above average.

Parameters:
muxsensorthe SMUX sensor port number
dcS1data from internal sensor nr 1
dcS2data from internal sensor nr 2
dcS3data from internal sensor nr 3
dcS4data from internal sensor nr 4
dcS5data from internal sensor nr 5
Returns:
true if no error occured, false if it did

Definition at line 184 of file HTIRS2-driver.h.

bool HTIRS2readAllDCStrength ( tSensors  link,
int &  dcS1,
int &  dcS2,
int &  dcS3,
int &  dcS4,
int &  dcS5 
)

Read the value of the all of the internal DC sensors above average.

Parameters:
linkthe HTIRS2 port number
dcS1data from internal sensor nr 1
dcS2data from internal sensor nr 2
dcS3data from internal sensor nr 3
dcS4data from internal sensor nr 4
dcS5data from internal sensor nr 5
Returns:
true if no error occured, false if it did
Examples:
HTIRS2-SMUX-test1.c, and HTIRS2-test1.c.

Definition at line 150 of file HTIRS2-driver.h.

int HTIRS2readDCAverage ( tMUXSensor  muxsensor )

Read the value of the average data register and return it.

Parameters:
muxsensorthe SMUX sensor port number
Returns:
value of 0-9, the direction index of the detected IR signal or -1 if an error occurred.

Definition at line 233 of file HTIRS2-driver.h.

int HTIRS2readDCAverage ( tSensors  link )

Read the value of the average data register and return it.

Parameters:
linkthe HTIRS2 port number
Returns:
value of 0-9, the direction index of the detected IR signal or -1 if an error occurred.

Definition at line 210 of file HTIRS2-driver.h.

int HTIRS2readDCDir ( tMUXSensor  muxsensor )

Read the value of the DC Direction data register and return it.

Parameters:
muxsensorthe SMUX sensor port number
Returns:
value of 0-9, the direction index of the detected IR signal or -1 if an error occurred.

Definition at line 125 of file HTIRS2-driver.h.

int HTIRS2readDCDir ( tSensors  link )

Read the value of the DC Direction data register and return it.

Parameters:
linkthe HTIRS2 port number
Returns:
value of 0-9, the direction index of the detected IR signal or -1 if an error occurred.
Examples:
HTIRS2-SMUX-test1.c, and HTIRS2-test1.c.

Definition at line 102 of file HTIRS2-driver.h.

bool HTIRS2setDSPMode ( tSensors  link,
tHTIRS2DSPMode  mode 
)

Set the DSP mode of the AC carrier wave detector.

Mode is one of: -DSP_1200 -DSP_600

Parameters:
linkthe HTIRS2 port number
modethe frequency that should be detected
Returns:
true if no error occured, false if it did
Examples:
HTIRS2-test1.c.

Definition at line 260 of file HTIRS2-driver.h.


Variable Documentation

tConfigParams HTIRS2_config = {HTSMUX_CHAN_I2C, 13, 0x10, 0x42}

Array to hold SMUX config data for sensor

Definition at line 89 of file HTIRS2-driver.h.

Array to hold I2C reply data

Definition at line 93 of file HTIRS2-driver.h.

Array to hold I2C command data

Definition at line 92 of file HTIRS2-driver.h.