File sstep_defs.h¶
File List > inc > sstep_defs.h
Go to the documentation of this file
/*******************************************************************************
* Stepper-C: Stepper Motor Control Implementation
*
* Project: Stepper-C - Hardware-Agnostic Stepper Motor Control Library
* Description: Public constants: status codes, topologies, power stage legs, faults, states.
*
* Author: Anton Vynohradov
* Email: avynohradov@systemfromscratch.com
*
* License: Apache License 2.0
*
* Copyright (c) 2026 Anton Vynohradov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* SPDX-License-Identifier: Apache-2.0
******************************************************************************/
#ifndef SSTEP_DEFS_H
#define SSTEP_DEFS_H
/* ==============================================================================
* INCLUDES
* =============================================================================*/
#include <stdint.h>
/* ==============================================================================
* STATUS CODES
* =============================================================================*/
#define SSTEP_OK 0
#define SSTEP_ERR_PARAM (-1)
#define SSTEP_ERR_CONFIG (-2)
#define SSTEP_ERR_STATE (-3)
#define SSTEP_ERR_UNSUPPORTED (-4)
/* ==============================================================================
* POWER STAGE
* =============================================================================*/
#define SSTEP_LEGS_MAX 4U
enum sstep_topology
{
SSTEP_TOPOLOGY_FULL_BRIDGE = 0,
SSTEP_TOPOLOGY_SHARED_LEG = 1
};
/* ==============================================================================
* FAULTS
* =============================================================================*/
#define SSTEP_FAULT_NONE 0x0000U
#define SSTEP_FAULT_OVERCURRENT 0x0001U
#define SSTEP_FAULT_OVERVOLTAGE 0x0002U
#define SSTEP_FAULT_UNDERVOLTAGE 0x0004U
#define SSTEP_FAULT_HAL 0x0008U
#define SSTEP_FAULT_EXTERNAL 0x0010U
#define SSTEP_FAULT_STALL 0x0020U
/* ==============================================================================
* STATES
* =============================================================================*/
enum sstep_state
{
SSTEP_STATE_DISABLED = 0,
SSTEP_STATE_HOLDING = 1,
SSTEP_STATE_MOVING = 2,
SSTEP_STATE_FAULT = 3
};
#endif /* SSTEP_DEFS_H */