roverSTM  UM2 2013
Projet M1 Navarro Benjamin
 All Classes Files Functions Groups Pages
Public Member Functions | List of all members
UltrasonicSensor Class Reference
Inheritance diagram for UltrasonicSensor:
I2CDevice

Public Member Functions

 UltrasonicSensor (I2C_TypeDef *I2C_Port, uint8_t address=0xE0, uint32_t speed=400000)
 
void ranging (rangingMode mode)
 Start a ranging in the appropriate mode. More...
 
void FakeRanging (rangingMode mode)
 Start a fake ranging (without sending the burst) More...
 
void sendBurst ()
 Send an ultrasonic burst without doing a ranging. More...
 
uint16_t readResult ()
 Get the result of the previous ranging. More...
 
- Public Member Functions inherited from I2CDevice
 I2CDevice (I2C_TypeDef *I2C_Port, uint8_t address, uint32_t speed=100000)
 Configure and enable the I2C device. More...
 
virtual ~I2CDevice ()
 Deinitialize the device. More...
 

Additional Inherited Members

- Protected Member Functions inherited from I2CDevice
void WriteRegister (uint8_t reg, uint8_t value)
 Write some data into a register. More...
 
void WriteBuffer (uint8_t reg, uint8_t *buffer, uint8_t length)
 Send a buffer of data to the device. More...
 
uint8_t ReadRegister (uint8_t reg)
 Read some data from a register. More...
 
void ReadBuffer (uint8_t reg, uint8_t *buffer, uint8_t length)
 Read a buffer of data from the device. More...
 

Member Function Documentation

void UltrasonicSensor::FakeRanging ( rangingMode  mode)

Start a fake ranging (without sending the burst)

Parameters
mode: centimeters, inches or microseconds
Return values
None
void UltrasonicSensor::ranging ( rangingMode  mode)

Start a ranging in the appropriate mode.

Parameters
mode: centimers, inches or microseconds
Return values
None
uint16_t UltrasonicSensor::readResult ( )

Get the result of the previous ranging.

Parameters
None
Return values
Valueof last ranging
void UltrasonicSensor::sendBurst ( )

Send an ultrasonic burst without doing a ranging.

Parameters
None
Return values
None

The documentation for this class was generated from the following files: