wut v1.8.0
Wii U Toolchain
Loading...
Searching...
No Matches
Typedefs | Enumerations | Functions

WBC is a library for accessing the Balance Board. More...

Collaboration diagram for WBC:

Typedefs

typedef enum WBCError WBCError
 

Enumerations

enum  WBCError {
  WBC_ERROR_NONE = 0 ,
  WBC_ERROR_NO_CONTROLLER = -1 ,
  WBC_ERROR_NOT_READY = -2 ,
  WBC_ERROR_BAD_TEMPERATURE = -3 ,
  WBC_ERROR_INVALID = -4
}
 

Functions

uint32_t WBCGetABSWeight (void)
 
uint32_t WBCGetBatteryLevel (uint8_t battery)
 Converts raw battery value to a level.
 
BOOL WBCGetCalibrationStatus (void)
 Checks if the Balance Board calibration is completed.
 
double WBCGetGCWeight (double weight)
 Returns gravity-corrected weight.
 
double WBCGetGravCoff (void)
 Returns the gravity coefficient.
 
uint32_t WBCGetProductArea (void)
 Always returns 0.
 
WBCError WBCGetTCWeight (double weight, double *correctedWeight, const WPADStatusBalanceBoard *status)
 Returns temperature-corrected weight.
 
WBCError WBCGetTGCWeight (double inputWeight, double *correctedWeight, const WPADStatusBalanceBoard *status)
 Applies temperature and gravity correction to weight value.
 
WBCError WBCGetZEROPoint (double zeros[], uint32_t count)
 Return the current zeros for each sensor.
 
int32_t WBCRead (WPADStatusBalanceBoard *status, double weights[], uint32_t count)
 Converts the raw pressure data into weight values.
 
WBCError WBCSetZEROPoint (const double zeros[], uint32_t count)
 Resets the zero weight value.
 
BOOL WBCSetupCalibration (void)
 Starts the calibration of Balance Board.
 

Detailed Description

WBC is a library for accessing the Balance Board.

Typedef Documentation

◆ WBCError

typedef enum WBCError WBCError

Enumeration Type Documentation

◆ WBCError

enum WBCError
Enumerator
WBC_ERROR_NONE 
WBC_ERROR_NO_CONTROLLER 
WBC_ERROR_NOT_READY 
WBC_ERROR_BAD_TEMPERATURE 
WBC_ERROR_INVALID 

Definition at line 18 of file wbc.h.

Function Documentation

◆ WBCGetABSWeight()

uint32_t WBCGetABSWeight ( void  )

◆ WBCGetBatteryLevel()

uint32_t WBCGetBatteryLevel ( uint8_t  battery)

Converts raw battery value to a level.

Parameters
batteryThe battery field from WPADStatusBalanceBoard.
Returns
A level from 0 to 4.

◆ WBCGetCalibrationStatus()

BOOL WBCGetCalibrationStatus ( void  )

Checks if the Balance Board calibration is completed.

Returns
TRUE if calibration is completed, FALSE if in progress, or an error occurred.
See also
WBCSetupCalibration()

◆ WBCGetGCWeight()

double WBCGetGCWeight ( double  weight)

Returns gravity-corrected weight.

Used internally by WBCGetTGCWeight().

◆ WBCGetGravCoff()

double WBCGetGravCoff ( void  )

Returns the gravity coefficient.

◆ WBCGetProductArea()

uint32_t WBCGetProductArea ( void  )

Always returns 0.

◆ WBCGetTCWeight()

WBCError WBCGetTCWeight ( double  weight,
double *  correctedWeight,
const WPADStatusBalanceBoard status 
)

Returns temperature-corrected weight.

Used internally by WBCGetTGCWeight().

◆ WBCGetTGCWeight()

WBCError WBCGetTGCWeight ( double  inputWeight,
double *  correctedWeight,
const WPADStatusBalanceBoard status 
)

Applies temperature and gravity correction to weight value.

Parameters
inputWeightThe input weight value.
correctedWeidhtWhere to store the corrected weight.
statusThe status data used in WPADRead() and WBCRead().
Returns
Zero on success, or an error code.

◆ WBCGetZEROPoint()

WBCError WBCGetZEROPoint ( double  zeros[],
uint32_t  count 
)

Return the current zeros for each sensor.

◆ WBCRead()

int32_t WBCRead ( WPADStatusBalanceBoard status,
double  weights[],
uint32_t  count 
)

Converts the raw pressure data into weight values.

Parameters
statusThe status argument filled in by WPADRead().
weightsPointer to an array of 4 elements to store the weights in Kg.
countHow many elements in weight (should be 4).
Returns
  • 1: at least 7 Kg were detected.
  • 0: measuring less than 7 Kg.
  • Negative: one of the WBCError values.
See also
WBCSetupCalibration()

◆ WBCSetZEROPoint()

WBCError WBCSetZEROPoint ( const double  zeros[],
uint32_t  count 
)

Resets the zero weight value.

Parameters
zerosArray raw pressure values that correspond to zero weight, one for each sensor.
countThe size of the zeros array, should be 4.
See also

◆ WBCSetupCalibration()

BOOL WBCSetupCalibration ( void  )

Starts the calibration of Balance Board.

Note: this function is asynchronous.

Returns
TRUE if calibration started successfully, FALSE if it failed to start.
See also
WBCGetCalibrationStatus()