rcbench
Servo and ESC test bench: panel, IOmcu and shared C
Loading...
Searching...
No Matches
openyge_status.c File Reference

SPDX-License-Identifier: MIT. More...

#include "openyge.h"
#include <string.h>

Macros

#define STATE_MASK   0x0Fu
 Status byte: low nibble is the motor state, high nibble the warnings.
#define WARN_MASK   0xF0u
#define WARN_UNDERVOLT   0x10u
#define WARN_OVERTEMP   0x20u
#define WARN_OVERCURR   0x40u
#define WARN_DEV_BEC   0x80u
#define WARN_SETPOINT   0xC0u

Functions

const char * openyge_state_name (uint8_t state)
 A short name for a motor state, or "?" for a reserved value.
void openyge_status_decode (uint8_t status1, openyge_status_t *out)
 Decode the status byte of a telemetry frame.

Detailed Description

SPDX-License-Identifier: MIT.

Macro Definition Documentation

◆ WARN_DEV_BEC

#define WARN_DEV_BEC   0x80u

subject is the BEC, not the ESC

◆ WARN_OVERCURR

#define WARN_OVERCURR   0x40u

overcurrent warning bit

◆ WARN_OVERTEMP

#define WARN_OVERTEMP   0x20u

overtemperature warning bit

◆ WARN_SETPOINT

#define WARN_SETPOINT   0xC0u

the overloaded combination

◆ WARN_UNDERVOLT

#define WARN_UNDERVOLT   0x10u

undervoltage warning bit

Function Documentation

◆ openyge_state_name()

const char * openyge_state_name ( uint8_t state)

A short name for a motor state, or "?" for a reserved value.

Parameters
stateState value; only the low nibble is used.
Returns
The name, or "?" for a reserved value.

◆ openyge_status_decode()

void openyge_status_decode ( uint8_t status1,
openyge_status_t * out )

Decode the status byte of a telemetry frame.

Parameters
status1The status byte.
outReceives the decoded status; NULL does nothing.