|
Files | |
file | hitechnic-superpro.h |
HiTechnic SuperPro Prototype Board driver. | |
Defines | |
#define | HTSPB_I2C_ADDR 0x10 |
#define | HTSPB_OFFSET 0x42 |
#define | HTSPB_A0_U 0x00 |
#define | HTSPB_A0_L 0x01 |
#define | HTSPB_DIGIN 0x0A |
#define | HTSPB_DIGOUT 0x0B |
#define | HTSPB_DIGCTRL 0x0C |
#define | HTSPB_STROBE 0x0E |
#define | HTSPB_LED 0x0F |
#define | HTSPB_O0MODE 0x10 |
#define | HTSPB_O0FREQ 0x11 |
#define | HTSPB_O0VOLT 0x13 |
#define | HTSPB_O1MODE 0x15 |
#define | HTSPB_O1FREQ 0x16 |
#define | HTSPB_O1VOLT 0x18 |
#define | HTSPB_DACO0 0x10 |
#define | HTSPB_DACO1 0x15 |
#define | DAC_MODE_DCOUT 0 |
#define | DAC_MODE_SINEWAVE 1 |
#define | DAC_MODE_SQUAREWAVE 2 |
#define | DAC_MODE_SAWPOSWAVE 3 |
#define | DAC_MODE_SAWNEGWAVE 4 |
#define | DAC_MODE_TRIANGLEWAVE 5 |
#define | DAC_MODE_PWMVOLTAGE 6 |
Functions | |
ubyte | HTSPBreadIO (tSensors link, ubyte mask) |
bool | HTSPBwriteIO (tSensors link, ubyte mask) |
bool | HTSPBsetupIO (tSensors link, ubyte mask) |
int | HTSPBreadADC (tSensors link, byte channel, byte width) |
bool | HTSPBreadAllADC (tSensors link, int &adch0, int &adch1, int &adch2, int &adch3, int &adch4, byte width) |
bool | HTSPBsetSamplingTime (tSensors link, byte interval) |
bool | HTSPBreadAllADC (tSensors link, int &adch0, int &adch1, int &adch2, int &adch3, byte width) |
bool | HTSPBwriteAnalog (tSensors link, byte dac, byte mode, int freq, int volt) |
Variables | |
tByteArray | HTSPB_I2CRequest |
tByteArray | HTSPB_I2CReply |
HiTechnic SuperPro Prototype Board
#define DAC_MODE_DCOUT 0 |
Steady (DC) voltage output.
Definition at line 67 of file hitechnic-superpro.h.
#define DAC_MODE_PWMVOLTAGE 6 |
PWM square wave output.
Definition at line 73 of file hitechnic-superpro.h.
#define DAC_MODE_SAWNEGWAVE 4 |
Negative going sawtooth output.
Definition at line 71 of file hitechnic-superpro.h.
#define DAC_MODE_SAWPOSWAVE 3 |
Positive going sawtooth output.
Definition at line 70 of file hitechnic-superpro.h.
#define DAC_MODE_SINEWAVE 1 |
Sine wave output.
Definition at line 68 of file hitechnic-superpro.h.
#define DAC_MODE_SQUAREWAVE 2 |
Square wave output.
Definition at line 69 of file hitechnic-superpro.h.
#define DAC_MODE_TRIANGLEWAVE 5 |
Triangle wave output.
Definition at line 72 of file hitechnic-superpro.h.
#define HTSPB_A0_L 0x01 |
Address of lower bits of first ADC, bits 1-0
Definition at line 49 of file hitechnic-superpro.h.
#define HTSPB_A0_U 0x00 |
Address of upper bits of first ADC, bits 9-2
Definition at line 48 of file hitechnic-superpro.h.
#define HTSPB_DACO0 0x10 |
Address of analog parameters output O0
Definition at line 62 of file hitechnic-superpro.h.
#define HTSPB_DACO1 0x15 |
Address of analog parameters output O1
Definition at line 63 of file hitechnic-superpro.h.
#define HTSPB_DIGCTRL 0x0C |
Controls direction of digital ports
Definition at line 52 of file hitechnic-superpro.h.
#define HTSPB_DIGIN 0x0A |
Address of digital inputs
Definition at line 50 of file hitechnic-superpro.h.
#define HTSPB_DIGOUT 0x0B |
Address of digital outputs
Definition at line 51 of file hitechnic-superpro.h.
#define HTSPB_I2C_ADDR 0x10 |
Protoboard I2C device address
Definition at line 46 of file hitechnic-superpro.h.
#define HTSPB_LED 0x0F |
Address of on-board led outputs, bits 1-0
Definition at line 54 of file hitechnic-superpro.h.
#define HTSPB_O0FREQ 0x11 |
Address of analog output 0 frequency
Definition at line 56 of file hitechnic-superpro.h.
#define HTSPB_O0MODE 0x10 |
Address of analog output 0 mode
Definition at line 55 of file hitechnic-superpro.h.
#define HTSPB_O0VOLT 0x13 |
Address of analog output 0 voltage
Definition at line 57 of file hitechnic-superpro.h.
#define HTSPB_O1FREQ 0x16 |
Address of analog output 1 frequency
Definition at line 59 of file hitechnic-superpro.h.
#define HTSPB_O1MODE 0x15 |
Address of analog output 1 mode
Definition at line 58 of file hitechnic-superpro.h.
#define HTSPB_O1VOLT 0x18 |
Address of analog output 1 voltage
Definition at line 60 of file hitechnic-superpro.h.
#define HTSPB_OFFSET 0x42 |
Definition at line 47 of file hitechnic-superpro.h.
#define HTSPB_STROBE 0x0E |
Address of strobe outputs, bits 6-0
Definition at line 53 of file hitechnic-superpro.h.
int HTSPBreadADC | ( | tSensors | link, |
byte | channel, | ||
byte | width | ||
) |
Read the value of the specified analogue channel.
link | the HTSPB port number |
channel | the specified ADC channel |
width | the bit width of the result, can be either 8 or 10 |
Definition at line 151 of file hitechnic-superpro.h.
bool HTSPBreadAllADC | ( | tSensors | link, |
int & | adch0, | ||
int & | adch1, | ||
int & | adch2, | ||
int & | adch3, | ||
int & | adch4, | ||
byte | width | ||
) |
bool HTSPBreadAllADC | ( | tSensors | link, |
int & | adch0, | ||
int & | adch1, | ||
int & | adch2, | ||
int & | adch3, | ||
byte | width | ||
) |
This function read the value of all of the analogue channels.
link | the HTSPB 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 |
width | the bit width of the result, can be either 8 or 10 |
Definition at line 187 of file hitechnic-superpro.h.
ubyte HTSPBreadIO | ( | tSensors | link, |
ubyte | mask | ||
) |
Read the values of the digital inputs as specified by the mask.
link | the HTSPB port number |
mask | the specified digital ports |
Definition at line 93 of file hitechnic-superpro.h.
bool HTSPBsetSamplingTime | ( | tSensors | link, |
byte | interval | ||
) |
bool HTSPBsetupIO | ( | tSensors | link, |
ubyte | mask | ||
) |
Configure the ports for input or output according to the mask.
link | the HTSPB port number |
mask | the specified digital ports, 0 = input, 1 = output |
Definition at line 132 of file hitechnic-superpro.h.
bool HTSPBwriteAnalog | ( | tSensors | link, |
byte | dac, | ||
byte | mode, | ||
int | freq, | ||
int | volt | ||
) |
Write to the analog output.
link | the HTSPB port number |
dac | the specified analog port, use HTSPB_DACO0 or HTSPB_DACO1 |
mode | the analog mode |
freq | the analog frequency from 1 to 8193 |
volt | the analog voltage from 0 to 1023 (for 0 to 3.3v) |
Definition at line 227 of file hitechnic-superpro.h.
bool HTSPBwriteIO | ( | tSensors | link, |
ubyte | mask | ||
) |
Write the values the digital outpus as specified by the mask.
link | the HTSPB port number |
mask | the specified digital ports |
Definition at line 113 of file hitechnic-superpro.h.
Array to hold I2C reply data
Definition at line 78 of file hitechnic-superpro.h.
Array to hold I2C command data
Definition at line 77 of file hitechnic-superpro.h.