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

SuperPro Prototype Board
[HiTechnic]

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

Detailed Description

HiTechnic SuperPro Prototype Board


Define Documentation

#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.

Examples:
hitechnic-superpro-exp9.c.

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

Examples:
hitechnic-superpro-exp9.c.

Definition at line 62 of file hitechnic-superpro.h.

#define HTSPB_DACO1   0x15

Address of analog parameters output O1

Examples:
hitechnic-superpro-exp9.c.

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.


Function Documentation

int HTSPBreadADC ( tSensors  link,
byte  channel,
byte  width 
)

Read the value of the specified analogue channel.

Parameters:
linkthe HTSPB port number
channelthe specified ADC channel
widththe bit width of the result, can be either 8 or 10
Returns:
the value of the ADC channel, or -1 if an error occurred
Examples:
hitechnic-superpro-exp1.c, hitechnic-superpro-exp2.c, hitechnic-superpro-exp4.c, hitechnic-superpro-exp5.c, and hitechnic-superpro-exp8.c.

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.

Parameters:
linkthe HTSPB port number
adch0parameter to hold value for ad channel 0
adch1parameter to hold value for ad channel 1
adch2parameter to hold value for ad channel 2
adch3parameter to hold value for ad channel 3
widththe bit width of the result, can be either 8 or 10
Returns:
true if no error occured, false if it did

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.

Parameters:
linkthe HTSPB port number
maskthe specified digital ports
Returns:
8 bits representing the state of the specified IOs
Examples:
hitechnic-superpro-exp6a.c, hitechnic-superpro-exp6b.c, and hitechnic-superpro-exp7.c.

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.

Parameters:
linkthe HTSPB port number
maskthe specified digital ports, 0 = input, 1 = output
Returns:
true if no error occured, false if it did
Examples:
hitechnic-superpro-exp1.c, hitechnic-superpro-exp2.c, hitechnic-superpro-exp3.c, hitechnic-superpro-exp5.c, hitechnic-superpro-exp6a.c, hitechnic-superpro-exp6b.c, hitechnic-superpro-exp7.c, hitechnic-superpro-exp8.c, and hitechnic-superpro-exp9.c.

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.

Parameters:
linkthe HTSPB port number
dacthe specified analog port, use HTSPB_DACO0 or HTSPB_DACO1
modethe analog mode
freqthe analog frequency from 1 to 8193
voltthe analog voltage from 0 to 1023 (for 0 to 3.3v)
Returns:
true if no error occured, false if it did
Examples:
hitechnic-superpro-exp9.c.

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.

Parameters:
linkthe HTSPB port number
maskthe specified digital ports
Returns:
true if no error occured, false if it did
Examples:
hitechnic-superpro-exp1.c, hitechnic-superpro-exp2.c, hitechnic-superpro-exp3.c, hitechnic-superpro-exp5.c, hitechnic-superpro-exp6a.c, hitechnic-superpro-exp6b.c, hitechnic-superpro-exp7.c, and hitechnic-superpro-exp8.c.

Definition at line 113 of file hitechnic-superpro.h.


Variable Documentation

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.