hem.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define hem_Switch1   (1<<0)
#define hem_Switch2   (1<<1)
#define hem_Switch3   (1<<2)
#define hem_Switch4   (1<<3)
#define hem_LedOnOff   (1<<0)
#define hem_LedPgmExec   (1<<1)
#define hem_LedFrontLeft   (1<<2)
#define hem_LedFrontRight   (1<<3)
#define hem_SensorFront   0
#define hem_SensorFrontRight   1
#define hem_SensorFrontLeft   2
#define hem_SensorRight   3
#define hem_SensorLeft   4
#define hem_SensorRear   5
#define hem_SensorGroundRight   6
#define hem_SensorGroundLeft   7
#define hem_SensorMax   8
#define hem_open()   knet_open( "KoreBot:Hemission" )
#define hem_close(dev)   knet_close( dev)

Functions

int hem_getVersion (knet_dev_t *dev)
int hem_setSpeed (knet_dev_t *dev, int left, int right)
int hem_beep (knet_dev_t *dev, unsigned int state)
int hem_readSwitches (knet_dev_t *dev, unsigned int *state)
int hem_setLEDs (knet_dev_t *dev, unsigned int state)
int hem_readProximitySensors (knet_dev_t *dev, unsigned char *sensors)
int hem_readAmbientLightSensors (knet_dev_t *dev, unsigned char *sensors)
int hem_readTVRemote (knet_dev_t *dev, unsigned char *value)
int hem_readI2C (knet_dev_t *dev, unsigned char slave, unsigned char reg, unsigned char *data, unsigned char count)
int hem_writeI2C (knet_dev_t *dev, unsigned char slave, unsigned char reg, unsigned char *data, unsigned char count)
int hem_fastRead (knet_dev_t *dev, unsigned char *motorLeft, unsigned char *motorRight, unsigned char *proximitySensors, unsigned char *ambientLightSensors, unsigned char *switches, unsigned char *tvRemoteData, unsigned char *version, unsigned char *revision)
int hem_fastWrite (knet_dev_t *dev, unsigned char motorLeft, unsigned char motorRight, unsigned char ledState)


Define Documentation

#define hem_close ( dev   )     knet_close( dev)

This function closes the K-Net device used to communicate with the Hemisson robot.

Definition at line 56 of file hem.h.

#define hem_LedFrontLeft   (1<<2)

Definition at line 27 of file hem.h.

Referenced by hem_setLEDs().

#define hem_LedFrontRight   (1<<3)

Definition at line 28 of file hem.h.

Referenced by hem_setLEDs().

#define hem_LedOnOff   (1<<0)

Hemission Led Bitmasks Definition

Definition at line 25 of file hem.h.

Referenced by hem_setLEDs().

#define hem_LedPgmExec   (1<<1)

Definition at line 26 of file hem.h.

Referenced by hem_setLEDs().

 
#define hem_open (  )     knet_open( "KoreBot:Hemission" )

This function opens a K-Net device to communicate with the Hemisson robot using KoreBot.

Returns:
A Pointer to a K-Net Device Descriptor or NULL.

Definition at line 50 of file hem.h.

#define hem_SensorFront   0

Hemission Infra-Red Sensor Position Definition

Definition at line 33 of file hem.h.

#define hem_SensorFrontLeft   2

Definition at line 35 of file hem.h.

#define hem_SensorFrontRight   1

Definition at line 34 of file hem.h.

#define hem_SensorGroundLeft   7

Definition at line 40 of file hem.h.

#define hem_SensorGroundRight   6

Definition at line 39 of file hem.h.

#define hem_SensorLeft   4

Definition at line 37 of file hem.h.

#define hem_SensorMax   8

Definition at line 41 of file hem.h.

Referenced by hem_fastRead(), hem_readAmbientLightSensors(), and hem_readProximitySensors().

#define hem_SensorRear   5

Definition at line 38 of file hem.h.

#define hem_SensorRight   3

Definition at line 36 of file hem.h.

#define hem_Switch1   (1<<0)

Hemission Switch Bitmasks Definition

Definition at line 17 of file hem.h.

Referenced by hem_readSwitches().

#define hem_Switch2   (1<<1)

Definition at line 18 of file hem.h.

Referenced by hem_readSwitches().

#define hem_Switch3   (1<<2)

Definition at line 19 of file hem.h.

Referenced by hem_readSwitches().

#define hem_Switch4   (1<<3)

Definition at line 20 of file hem.h.

Referenced by hem_readSwitches().


Function Documentation

int hem_beep ( knet_dev_t dev,
unsigned int  state 
)

This function changes the state of the continous beeper.

Definition at line 102 of file hem.c.

References buf, knet_printf(), and knet_read_string().

Here is the call graph for this function:

int hem_fastRead ( knet_dev_t dev,
unsigned char *  motorLeft,
unsigned char *  motorRight,
unsigned char *  proximitySensors,
unsigned char *  ambientLightSensors,
unsigned char *  switches,
unsigned char *  tvRemoteData,
unsigned char *  version,
unsigned char *  revision 
)

This function reads all input of the Hemisson Robot.

Parameters:
dev K-Net Device Descriptor
motorLeft Left motor state
motorRight Right motor state
proximitySensors An array of size hem_SensorMax containing the proximity intensity for each sensor (range [0..255]). The smaller is the value, the further is the object.
ambientLightSensors An array of size hem_SensorMax containing the ambient light intensity for each sensor
switches 4-bit switch value
tvRemoveData TV remote last data received
version HemiOS version number
revision HemiOS revision number
Returns:
<=0 on error or 1 on success

Definition at line 397 of file hem.c.

References buf, hem_SensorMax, knet_llread(), and knet_printf().

Here is the call graph for this function:

int hem_fastWrite ( knet_dev_t dev,
unsigned char  motorLeft,
unsigned char  motorRight,
unsigned char  ledState 
)

This function changes the motor speed and the led state.

Parameters:
dev K-Net Device Descriptor
motorLeft Left motor speed
motorRight Right motor speed
ledState Led state
Returns:
<=0 on error or 1 on success

Definition at line 470 of file hem.c.

References buf, knet_printf(), and knet_read_string().

Here is the call graph for this function:

int hem_getVersion ( knet_dev_t dev  ) 

int hem_readAmbientLightSensors ( knet_dev_t dev,
unsigned char *  sensors 
)

This function reads the ambient light using the infra-red sensors.

Parameters:
dev K-Net Device Descriptor
sensor An array of size hem_SensorMax containing the ambient light intensity for each sensor (range [0..255]). The smaller is the value, the more infra-red light is detected.
Returns:
<=0 on error or >0 on success

Definition at line 241 of file hem.c.

References buf, hem_SensorMax, knet_printf(), and knet_read_string().

Here is the call graph for this function:

int hem_readI2C ( knet_dev_t dev,
unsigned char  slave,
unsigned char  reg,
unsigned char *  data,
unsigned char  count 
)

This function reads a given number of registers of an I²C peripheral.

Parameters:
dev K-Net device descriptor
slave I²C Slave address
reg I²C Start register
data I²C Data read
count Number of registers to read
Returns:
The number of registers read on success or <=0 on error

Definition at line 310 of file hem.c.

References buf, knet_printf(), and knet_read_string().

Here is the call graph for this function:

int hem_readProximitySensors ( knet_dev_t dev,
unsigned char *  sensors 
)

This function reads the proximity of an object using the infra-red sensors.

Parameters:
dev K-Net Device Descriptor
sensor An array of size hem_SensorMax containing the proximity intensity for each sensor (range [0..255]). The smaller is the value, the further is the object.
Returns:
<= on error or >0 on success

Definition at line 201 of file hem.c.

References buf, hem_SensorMax, knet_printf(), and knet_read_string().

Here is the call graph for this function:

int hem_readSwitches ( knet_dev_t dev,
unsigned int *  state 
)

Definition at line 123 of file hem.c.

References buf, hem_Switch1, hem_Switch2, hem_Switch3, hem_Switch4, knet_printf(), and knet_read_string().

Here is the call graph for this function:

int hem_readTVRemote ( knet_dev_t dev,
unsigned char *  value 
)

This function reads the last character received from the TV remote.

Definition at line 275 of file hem.c.

References buf, knet_printf(), and knet_read_string().

Here is the call graph for this function:

int hem_setLEDs ( knet_dev_t dev,
unsigned int  state 
)

This function changes the LED state.

Parameters:
dev K-Net Device Descriptor
state New Led State

Definition at line 169 of file hem.c.

References buf, hem_LedFrontLeft, hem_LedFrontRight, hem_LedOnOff, hem_LedPgmExec, knet_printf(), and knet_read_string().

Here is the call graph for this function:

int hem_setSpeed ( knet_dev_t dev,
int  left,
int  right 
)

This function changes the speed of the left & right motor of the Hemission robot.

Parameters:
dev K-Net Device Descriptor
left Left Motor Speed. (range [-9..9])
right Right Motor Speed. (range [-9..9])
Returns:
<=0 on error or >0 on sucess
Remarks:
A speed of '0' stops the motor.

Definition at line 76 of file hem.c.

References buf, knet_printf(), and knet_read_string().

Here is the call graph for this function:

int hem_writeI2C ( knet_dev_t dev,
unsigned char  slave,
unsigned char  reg,
unsigned char *  data,
unsigned char  count 
)

This function writes a given number of registers to an I²C peripheral.

Definition at line 347 of file hem.c.

References buf, knet_printf(), and knet_read_string().

Here is the call graph for this function:


Generated on Wed Dec 15 11:49:27 2010 for KoreBot Library by  doxygen 1.5.5