| ||||||
Files | |
| file | hitechnic-protoboard.h |
HiTechnic Prototype Board driver. | |
Defines | |
| #define | HTPB_I2C_ADDR 0x02 |
| #define | HTPB_OFFSET 0x42 |
| #define | HTPB_A0_U 0x00 |
| #define | HTPB_A0_L 0x01 |
| #define | HTPB_DIGIN 0x0A |
| #define | HTPB_DIGOUT 0x0B |
| #define | HTPB_DIGCTRL 0x0C |
| #define | HTPB_SRATE 0x0D |
Functions | |
| ubyte | HTPBreadIO (tSensors link, ubyte mask) |
| bool | HTPBwriteIO (tSensors link, ubyte mask) |
| bool | HTPBsetupIO (tSensors link, ubyte mask) |
| int | HTPBreadADC (tSensors link, byte channel, byte width) |
| bool | HTPBreadAllADC (tSensors link, int &adch0, int &adch1, int &adch2, int &adch3, int &adch4, byte width) |
| bool | HTPBsetSamplingTime (tSensors link, byte interval) |
| ubyte | HTPBreadIO (tMUXSensor muxsensor, ubyte mask) |
| int | HTPBreadADC (tMUXSensor muxsensor, byte channel, byte width) |
| bool | HTPBreadAllADC (tMUXSensor muxsensor, int &adch0, int &adch1, int &adch2, int &adch3, int &adch4, byte width) |
Variables | |
| tByteArray | HTPB_I2CRequest |
| tByteArray | HTPB_I2CReply |
| tConfigParams | HTPB_config = {HTSMUX_CHAN_I2C + HTSMUX_CHAN_9V, 14, 0x02, 0x42} |
HiTechnic Prototype Board
| #define HTPB_A0_L 0x01 |
Address of lower bits of first ADC, bits 1-0
Definition at line 68 of file hitechnic-protoboard.h.
| #define HTPB_A0_U 0x00 |
Address of upper bits of first ADC, bits 9-2
Definition at line 67 of file hitechnic-protoboard.h.
| #define HTPB_DIGCTRL 0x0C |
Controls direction of digital ports
Definition at line 71 of file hitechnic-protoboard.h.
| #define HTPB_DIGIN 0x0A |
Address of digital inputs
Definition at line 69 of file hitechnic-protoboard.h.
| #define HTPB_DIGOUT 0x0B |
Address of digital outputs
Definition at line 70 of file hitechnic-protoboard.h.
| #define HTPB_I2C_ADDR 0x02 |
Protoboard I2C device address
Definition at line 65 of file hitechnic-protoboard.h.
| #define HTPB_OFFSET 0x42 |
Definition at line 66 of file hitechnic-protoboard.h.
| #define HTPB_SRATE 0x0D |
Controls sample rate, default set to 10ms
Definition at line 72 of file hitechnic-protoboard.h.
| int HTPBreadADC | ( | tSensors | link, |
| byte | channel, | ||
| byte | width | ||
| ) |
Read the value of the specified analogue channel.
| link | the HTPB port number |
| channel | the specified ADC channel |
| width | the bit width of the result, can be either 8 or 10 |
Definition at line 174 of file hitechnic-protoboard.h.
| int HTPBreadADC | ( | tMUXSensor | muxsensor, |
| byte | channel, | ||
| byte | width | ||
| ) |
Read the value of the specified analogue channel.
| muxsensor | the SMUX sensor port number |
| channel | the specified ADC channel |
| width | the bit width of the result, can be either 8 or 10 |
Definition at line 207 of file hitechnic-protoboard.h.
| bool HTPBreadAllADC | ( | tMUXSensor | muxsensor, |
| int & | adch0, | ||
| int & | adch1, | ||
| int & | adch2, | ||
| int & | adch3, | ||
| int & | adch4, | ||
| byte | width | ||
| ) |
This function read the value of all of the analogue channels.
| muxsensor | the SMUX sensor port number |
| adch0 | parameter to hold value for ad channel 0 |
| adch1 | parameter to hold value for ad channel 1 |
| adch2 | parameter to hold value for ad channel 2 |
| adch3 | parameter to hold value for ad channel 3 |
| adch4 | parameter to hold value for ad channel 4 |
| width | the bit width of the result, can be either 8 or 10 |
Definition at line 287 of file hitechnic-protoboard.h.
| bool HTPBreadAllADC | ( | tSensors | link, |
| int & | adch0, | ||
| int & | adch1, | ||
| int & | adch2, | ||
| int & | adch3, | ||
| int & | adch4, | ||
| byte | width | ||
| ) |
This function read the value of all of the analogue channels.
| link | the HTPB port number |
| adch0 | parameter to hold value for ad channel 0 |
| adch1 | parameter to hold value for ad channel 1 |
| adch2 | parameter to hold value for ad channel 2 |
| adch3 | parameter to hold value for ad channel 3 |
| adch4 | parameter to hold value for ad channel 4 |
| width | the bit width of the result, can be either 8 or 10 |
Definition at line 243 of file hitechnic-protoboard.h.
| ubyte HTPBreadIO | ( | tSensors | link, |
| ubyte | mask | ||
| ) |
Read the values of the digital inputs as specified by the mask.
| link | the HTPB port number |
| mask | the specified digital ports |
Definition at line 97 of file hitechnic-protoboard.h.
| ubyte HTPBreadIO | ( | tMUXSensor | muxsensor, |
| ubyte | mask | ||
| ) |
Read the values of the digital inputs as specified by the mask.
| muxsensor | the SMUX sensor port number |
| mask | the specified digital ports |
Definition at line 116 of file hitechnic-protoboard.h.
| bool HTPBsetSamplingTime | ( | tSensors | link, |
| byte | interval | ||
| ) |
This function configured the time between samples. This value is not stored permanently.
| link | the HTPB port number |
| interval | a value between 4 and 100ms, default is 10ms |
Definition at line 325 of file hitechnic-protoboard.h.
| bool HTPBsetupIO | ( | tSensors | link, |
| ubyte | mask | ||
| ) |
Configure the ports for input or output according to the mask.
| link | the HTPB port number |
| mask | the specified digital ports, 0 = input, 1 = output |
Definition at line 155 of file hitechnic-protoboard.h.
| bool HTPBwriteIO | ( | tSensors | link, |
| ubyte | mask | ||
| ) |
Write the values the digital outpus as specified by the mask.
| link | the HTPB port number |
| mask | the specified digital ports |
Definition at line 136 of file hitechnic-protoboard.h.
| tConfigParams HTPB_config = {HTSMUX_CHAN_I2C + HTSMUX_CHAN_9V, 14, 0x02, 0x42} |
Array to hold SMUX config data for sensor
Definition at line 89 of file hitechnic-protoboard.h.
Array to hold I2C reply data
Definition at line 75 of file hitechnic-protoboard.h.
Array to hold I2C command data
Definition at line 74 of file hitechnic-protoboard.h.
1.7.2