Skip to content

Commit

Permalink
Move MotorFaultState to EoMotionControl
Browse files Browse the repository at this point in the history
  • Loading branch information
MSECode committed Mar 13, 2024
1 parent 1788a2a commit 31504bb
Showing 1 changed file with 53 additions and 1 deletion.
54 changes: 53 additions & 1 deletion eth/embobj/plus/comm-v2/icub/EoMotionControl.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ extern "C" {
#include "EoMeasures.h"
#include "EoBoards.h"
#include "EOarray.h"
#include "EoError.h"
#include "iCubCanProto_motorControlMessages.h"


Expand All @@ -56,6 +57,57 @@ extern "C" {

// - declaration of public user-defined types -------------------------------------------------------------------------

typedef union
{
struct
{
//B0 L
unsigned ExternalFaultAsserted :1;
unsigned UnderVoltageFailure :1;
unsigned OverVoltageFailure :1;
unsigned OverCurrentFailure :1;
//B0 H
unsigned DHESInvalidValue :1;
unsigned AS5045CSumError :1;
unsigned DHESInvalidSequence :1;
unsigned CANInvalidProtocol :1;
//B1 L
unsigned CAN_BufferOverRun :1;
unsigned SetpointExpired :1;
unsigned CAN_TXIsPasv :1;
unsigned CAN_RXIsPasv :1;
//B1 H
unsigned CAN_IsWarnTX :1;
unsigned CAN_IsWarnRX :1;
unsigned OverHeatingFailure :1;
unsigned unused :1;
//B2 L
unsigned ADCCalFailure :1;
unsigned I2TFailure :1;
unsigned EMUROMFault :1;
unsigned EMUROMCRCFault :1;
//B2 H
unsigned EncoderFault :1;
unsigned FirmwareSPITimingError :1;
unsigned AS5045CalcError :1;
unsigned FirmwarePWMFatalError :1;
//B3 L
unsigned CAN_TXWasPasv :1;
unsigned CAN_RXWasPasv :1;
unsigned CAN_RTRFlagActive :1;
unsigned CAN_WasWarn :1;
//B3 H
unsigned CAN_DLCError :1;
unsigned SiliconRevisionFault :1;
unsigned PositionLimitUpper :1;
unsigned PositionLimitLower :1;
} bits;

uint32_t bitmask;

} eOmc_motorFaultState_t;

enum {eOmc_motorFaultState_numberof = 32};

/** @typedef typedef enum eOmc_entity_t;
@brief It contains all the possible entities managed by motion control.
Expand Down Expand Up @@ -991,7 +1043,7 @@ typedef struct // size is: 4+4+4+2+2+2+2 = 20
typedef struct // size is: 20+4+0 = 24
{
eOmc_motor_status_basic_t basic; /**< the basic status of a motor */
uint32_t mc_fault_state; /**< represents the most recent motion controller fault state */
eOerror_code_t mc_fault_state; /**< represents the most recent motion controller fault state */
} eOmc_motor_status_t; EO_VERIFYsizeof(eOmc_motor_status_t, 24)


Expand Down

0 comments on commit 31504bb

Please sign in to comment.