RobotSystem-Lite
Loading...
Searching...
No Matches
motor.h
Go to the documentation of this file.
1
2// //
3// Copyright (c) 2016-2025 Leonardo Consoni <leonardojc@protonmail.com> //
4// //
5// This file is part of RobotSystem-Lite. //
6// //
7// RobotSystem-Lite is free software: you can redistribute it and/or modify //
8// it under the terms of the GNU Lesser General Public License as published //
9// by the Free Software Foundation, either version 3 of the License, or //
10// (at your option) any later version. //
11// //
12// RobotSystem-Lite is distributed in the hope that it will be useful, //
13// but WITHOUT ANY WARRANTY; without even the implied warranty of //
14// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
15// GNU Lesser General Public License for more details. //
16// //
17// You should have received a copy of the GNU Lesser General Public License //
18// along with RobotSystem-Lite. If not, see <http://www.gnu.org/licenses/>. //
19// //
21
22
27
54
55#ifndef MOTOR_H
56#define MOTOR_H
57
58
59#include <stdbool.h>
60
61typedef struct _MotorData MotorData;
62typedef MotorData* Motor;
63
64
68Motor Motor_Init( const char* configName );
69
72void Motor_End( Motor motor );
73
77bool Motor_Enable( Motor motor );
78
81void Motor_Disable( Motor motor );
82
85void Motor_SetOffset( Motor motor );
86
90
94void Motor_WriteControl( Motor motor, double setpoint );
95
96
97#endif // MOTOR_H
void Motor_SetOffset(Motor motor)
Enables motor setpoint offset acquisition.
void Motor_WriteControl(Motor motor, double setpoint)
Writes specified value to given motor ouput device.
bool Motor_Enable(Motor motor)
Allows hardware/virtual device of given motor to output signal.
Motor Motor_Init(const char *configName)
Creates and initializes motor data structure based on given information.
MotorData * Motor
Opaque reference to motor internal data structure.
Definition motor.h:62
void Motor_Disable(Motor motor)
Prevents hardware/virtual device of given motor from outputing signal.
struct _MotorData MotorData
Single motor internal data structure.
Definition motor.h:61
void Motor_SetOperation(Motor motor)
Enables motor output/operation.
void Motor_End(Motor motor)
Deallocates internal data of given motor.