|
Files | |
file | hitechnic-irseeker-v2.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) |
bool | HTIRS2readEnhanced (tSensors link, int &dir, int &strength) |
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) |
bool | HTIRS2readEnhanced (tMUXSensor muxsensor, int &dir, int &strength) |
Variables | |
tConfigParams | HTIRS2_config = {HTSMUX_CHAN_I2C, 13, 0x10, 0x42} |
tByteArray | HTIRS2_I2CRequest |
tByteArray | HTIRS2_I2CReply |
HiTechnic IR Seeker V2
#define HTIRS2_AC_DIR 0x07 |
DC Direction data
Definition at line 60 of file hitechnic-irseeker-v2.h.
#define HTIRS2_AC_SSTR1 0x08 |
AC Sensor 0 signal strength above average
Definition at line 61 of file hitechnic-irseeker-v2.h.
#define HTIRS2_AC_SSTR2 0x09 |
AC Sensor 1 signal strength above average
Definition at line 62 of file hitechnic-irseeker-v2.h.
#define HTIRS2_AC_SSTR3 0x0A |
AC Sensor 2 signal strength above average
Definition at line 63 of file hitechnic-irseeker-v2.h.
#define HTIRS2_AC_SSTR4 0x0B |
AC Sensor 3 signal strength above average
Definition at line 64 of file hitechnic-irseeker-v2.h.
#define HTIRS2_AC_SSTR5 0x0C |
AC Sensor 4 signal strength above average AC DSP modes
Definition at line 65 of file hitechnic-irseeker-v2.h.
#define HTIRS2_DC_DIR 0x00 |
DC Direction data
Definition at line 53 of file hitechnic-irseeker-v2.h.
#define HTIRS2_DC_SAVG 0x06 |
DC sensor signal strength average
Definition at line 59 of file hitechnic-irseeker-v2.h.
#define HTIRS2_DC_SSTR1 0x01 |
DC Sensor 0 signal strength above average
Definition at line 54 of file hitechnic-irseeker-v2.h.
#define HTIRS2_DC_SSTR2 0x02 |
DC Sensor 1 signal strength above average
Definition at line 55 of file hitechnic-irseeker-v2.h.
#define HTIRS2_DC_SSTR3 0x03 |
DC Sensor 2 signal strength above average
Definition at line 56 of file hitechnic-irseeker-v2.h.
#define HTIRS2_DC_SSTR4 0x04 |
DC Sensor 3 signal strength above average
Definition at line 57 of file hitechnic-irseeker-v2.h.
#define HTIRS2_DC_SSTR5 0x05 |
DC Sensor 4 signal strength above average
Definition at line 58 of file hitechnic-irseeker-v2.h.
#define HTIRS2_DSP_MODE 0x41 |
AC DSP mode - 0 = 1200Hz, 1 = 600Hz
Definition at line 51 of file hitechnic-irseeker-v2.h.
#define HTIRS2_I2C_ADDR 0x10 |
IR Seeker I2C device address
Definition at line 50 of file hitechnic-irseeker-v2.h.
#define HTIRS2_OFFSET 0x42 |
Offset for data registers
Definition at line 52 of file hitechnic-irseeker-v2.h.
enum tHTIRS2DSPMode |
Definition at line 69 of file hitechnic-irseeker-v2.h.
int HTIRS2readACDir | ( | tSensors | link ) |
Read the value of the AC Direction data register and return it.
link | the HTIRS2 port number |
Definition at line 277 of file hitechnic-irseeker-v2.h.
int HTIRS2readACDir | ( | tMUXSensor | muxsensor ) |
Read the value of the AC Direction data register and return it.
muxsensor | the SMUX sensor port number |
Definition at line 297 of file hitechnic-irseeker-v2.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.
link | the HTIRS2 port number |
acS1 | data from internal sensor nr 1 |
acS2 | data from internal sensor nr 2 |
acS3 | data from internal sensor nr 3 |
acS4 | data from internal sensor nr 4 |
acS5 | data from internal sensor nr 5 |
Definition at line 322 of file hitechnic-irseeker-v2.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.
muxsensor | the SMUX sensor port number |
acS1 | data from internal sensor nr 1 |
acS2 | data from internal sensor nr 2 |
acS3 | data from internal sensor nr 3 |
acS4 | data from internal sensor nr 4 |
acS5 | data from internal sensor nr 5 |
Definition at line 353 of file hitechnic-irseeker-v2.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.
muxsensor | the SMUX sensor port number |
dcS1 | data from internal sensor nr 1 |
dcS2 | data from internal sensor nr 2 |
dcS3 | data from internal sensor nr 3 |
dcS4 | data from internal sensor nr 4 |
dcS5 | data from internal sensor nr 5 |
Definition at line 188 of file hitechnic-irseeker-v2.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.
link | the HTIRS2 port number |
dcS1 | data from internal sensor nr 1 |
dcS2 | data from internal sensor nr 2 |
dcS3 | data from internal sensor nr 3 |
dcS4 | data from internal sensor nr 4 |
dcS5 | data from internal sensor nr 5 |
Definition at line 154 of file hitechnic-irseeker-v2.h.
int HTIRS2readDCAverage | ( | tMUXSensor | muxsensor ) |
Read the value of the average data register and return it.
muxsensor | the SMUX sensor port number |
Definition at line 234 of file hitechnic-irseeker-v2.h.
int HTIRS2readDCAverage | ( | tSensors | link ) |
Read the value of the average data register and return it.
link | the HTIRS2 port number |
Definition at line 214 of file hitechnic-irseeker-v2.h.
int HTIRS2readDCDir | ( | tMUXSensor | muxsensor ) |
Read the value of the DC Direction data register and return it.
muxsensor | the SMUX sensor port number |
Definition at line 129 of file hitechnic-irseeker-v2.h.
int HTIRS2readDCDir | ( | tSensors | link ) |
Read the value of the DC Direction data register and return it.
link | the HTIRS2 port number |
Definition at line 109 of file hitechnic-irseeker-v2.h.
bool HTIRS2readEnhanced | ( | tMUXSensor | muxsensor, |
int & | dir, | ||
int & | strength | ||
) |
This function calculates the strength and direction based on both the DC and AC signal strengths.
muxsensor | the SMUX sensor port number |
dir | direction where the ball is detected, value of 0-9 (0 when no ball is detected) |
strength | the strength (and distance) of the ball's IR signal |
Definition at line 460 of file hitechnic-irseeker-v2.h.
bool HTIRS2readEnhanced | ( | tSensors | link, |
int & | dir, | ||
int & | strength | ||
) |
This function calculates the strength and direction based on both the DC and AC signal strengths.
link | the HTIRS2 port number |
dir | direction where the ball is detected, value of 0-9 (0 when no ball is detected) |
strength | the strength (and distance) of the ball's IR signal |
Definition at line 382 of file hitechnic-irseeker-v2.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
link | the HTIRS2 port number |
mode | the frequency that should be detected |
Definition at line 261 of file hitechnic-irseeker-v2.h.
tConfigParams HTIRS2_config = {HTSMUX_CHAN_I2C, 13, 0x10, 0x42} |
Array to hold SMUX config data for sensor
Definition at line 96 of file hitechnic-irseeker-v2.h.
Array to hold I2C reply data
Definition at line 100 of file hitechnic-irseeker-v2.h.
Array to hold I2C command data
Definition at line 99 of file hitechnic-irseeker-v2.h.