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

holitdata-motormux.h File Reference

Holit Data Systems Motor MUX driver. More...

#include "common.h"
#include "common-MMUX.h"

Go to the source code of this file.

Defines

#define HDMMUX_I2C_ADDR   0x02
#define HDMMUX_CMD_MOTOR   0x01
#define HDMMUX_CMD_ADDRCHNG   0x02
#define HDMMUX_CMD_RST_TACH_A   0x03
#define HDMMUX_CMD_RST_TACH_B   0x04
#define HDMMUX_CMD_RST_TACH_C   0x05
#define HDMMUX_MOTOR_A   0x01
#define HDMMUX_MOTOR_B   0x02
#define HDMMUX_MOTOR_C   0x03
#define HDMMUX_MOTOR_OTHER   0x04
#define HDMMUX_MOTOR_RIGHT   0x02
#define HDMMUX_MOTOR_LEFT   0x00
#define HDMMUX_ROT_FORWARD   (0x01 << 6)
#define HDMMUX_ROT_REVERSE   (0x02 << 6)
#define HDMMUX_ROT_STOP   (0x03 << 6)
#define HDMMUX_ROT_CONSTSPEED   (0x01 << 4)
#define HDMMUX_ROT_RAMPUP   (0x02 << 4)
#define HDMMUX_ROT_RAMPDOWN   (0x03 << 4)
#define HDMMUX_ROT_UNLIMITED   (0x00 << 2)
#define HDMMUX_ROT_DEGREES   (0x01 << 2)
#define HDMMUX_ROT_ROTATIONS   (0x02 << 2)
#define HDMMUX_ROT_SECONDS   (0x03 << 2)
#define HDMMUX_ROT_POWERCONTROL   (0x01 << 1)
#define HDMMUX_ROT_BRAKE   0x01
#define HDMMUX_ROT_FLOAT   0x00

Functions

void HDMMUXinit ()
bool HDMMUXreadStatus (tSensors link, ubyte &motorStatus, long &tachoA, long &tachoB, long &tachoC)
bool HDMMUXsendCommand (tSensors link, ubyte mode, ubyte channel, ubyte rotparams, long duration, byte power, byte steering)
bool HDMMotor (tMUXmotor muxmotor, byte power)
bool HDMotorStop (tMUXmotor muxmotor)
bool HDMotorStop (tMUXmotor muxmotor, bool brake)
void HDMMotorSetRotationTarget (tMUXmotor muxmotor, float rottarget)
void HDMMotorSetTimeTarget (tMUXmotor muxmotor, float timetarget)
void HDMMotorSetEncoderTarget (tMUXmotor muxmotor, long enctarget)
long HDMMotorEncoder (tMUXmotor muxmotor)
bool HDMMotorEncoderReset (tMUXmotor muxmotor)
bool HDMMotorEncoderResetAll (tSensors link)
bool HDMMotorBusy (tMUXmotor muxmotor)
void HDMMotorSetBrake (tMUXmotor muxmotor)
void HDMMotorSetFloat (tMUXmotor muxmotor)
void HDMMotorSetSpeedCtrl (tMUXmotor muxmotor, bool constspeed)
void HDMMotorSetRamping (tMUXmotor muxmotor, ubyte ramping)

Variables

tByteArray HDMMUX_I2CRequest
tByteArray HDMMUX_I2CReply

Detailed Description

Holit Data Systems Motor MUX driver.

holitdata-motormux.h provides an API for the Holit Data Systems Motor MUX.

Changelog:

Credits:

TODO:

License: You may use this code as you wish, provided you give credit where its due.

THIS CODE WILL ONLY WORK WITH ROBOTC VERSION 3.59 AND HIGHER.

Author:
Xander Soldaat (xander_at_botbench.com)
Date:
20 February 2011
Version:
0.2

Definition in file holitdata-motormux.h.