HerkuleXLib  1.1
Arduino library to drive HerkuleX DRS-0101 and DRS-0201
Public Member Functions | Private Attributes | List of all members
HkxStatus Class Reference

Class to manage the status of the servos. More...

#include <HkxStatus.h>

Public Member Functions

 HkxStatus ()
 Default constructor. More...
 
boolean isError (uint8_t mask) const
 Check for errors. More...
 
boolean isDetail (uint8_t mask) const
 Check for details. More...
 
void getRawData (uint8_t statusED[]) const
 Get the status raw data. More...
 
void setRawData (const uint8_t statusED[])
 Set the status raw data. More...
 

Private Attributes

uint8_t _statusED [2]
 

Detailed Description

Class to manage the status of the servos.

This class manages the status of the servos with an explicit syntax.

Constructor & Destructor Documentation

HkxStatus::HkxStatus ( )
inline

Default constructor.

Default constructor of HkxStatus.

Member Function Documentation

void HkxStatus::getRawData ( uint8_t  statusED[]) const
inline

Get the status raw data.

Get the raw data of the status

Parameters
[out]statusED[]: table of 2 elements to return the raw data of the status.
boolean HkxStatus::isDetail ( uint8_t  mask) const
inline

Check for details.

Check if the details has an error according to the mask.

Parameters
[in]mask: The mask is defined with the parameters :
  • HKX_STAT_MOVING_FLAG : Moving flag
  • HKX_STAT_INPOSITION_FLAG : In position flag
  • HKX_STAT_CKECKSUM : Checksum Error
  • HKX_STAT_COMMAND : Unknown Command
  • HKX_STAT_EXCEED_REGISTER : Exceed REG range
  • HKX_STAT_GARBAGE : Garbage detected
  • HKX_STAT_MOTOR_FLAG : MOTOR_ON flag
  • HKX_STAT_ALL : all the list

Example 1 : check if any detail => mask = HKX_STAT_ALL.

Example 2 : check if any detail from the checksum or garbage => mask = HKX_STAT_CKECKSUM | HKX_STAT_GARBAGE.

Returns
true if the status contains any detail from to the mask (at least one).
false if the details contains none of detail from the mask.
boolean HkxStatus::isError ( uint8_t  mask) const
inline

Check for errors.

Check if the status has an error according to the mask.

Parameters
[in]mask: The mask is defined with the parameters :
  • HKX_STAT_VOLTAGE : Exceed Input Voltage limit
  • HKX_STAT_POSITION : Exceed allowed POT limit
  • HKX_STAT_TEMPERATURE : Exceed Temperature limit
  • HKX_STAT_PACKET : Invalid Packet
  • HKX_STAT_OVERLOAD : Overload detected
  • HKX_STAT_DRIVER : Driver fault detected
  • HKX_STAT_ROM_DISTORTED : EEP REG distorted
  • HKX_STAT_ALL : all the list

Example 1 : check if any error => mask = HKX_STAT_ALL.

Example 2 : check if any error from the temperature or the voltage => mask = HKX_STAT_VOLTAGE | HKX_STAT_TEMPERATURE.

Returns
true if the status contains any error from to the mask (at least one).
false if the status contains none of error from the mask.
void HkxStatus::setRawData ( const uint8_t  statusED[])
inline

Set the status raw data.

Set the raw data of the status.

Parameters
[in]statusED[]: table of 2 elements to return the raw data of the status.

Member Data Documentation

uint8_t HkxStatus::_statusED[2]
private

status table ([0] errors and [1] details)


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