Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: PSL_ROBOT_lorenzo robot_lorenzo recepteur_mbed_os_6
Diff: MX12.h
- Revision:
- 1:a9ba9cf928fe
- Parent:
- 0:7556356a8bcd
- Child:
- 2:02f3323a107d
--- a/MX12.h Wed Nov 03 11:17:12 2021 +0000 +++ b/MX12.h Wed Nov 03 12:56:02 2021 +0000 @@ -1,20 +1,32 @@ #ifndef MBED_MX12_H #define MBED_MX12_H -/** Class to communicate with Dynamixel MX12 servomotors. - * - * - */ +/** +* @file MX12.h +* @brief this header file will contain all required +* definitions and basic utilities functions. +* +* @author Titouan Soulard +* @author Bruno Denis (for comments) +* +*/ #include "mbed.h" #define MX12_ANSWER_MAX_SIZE 32 #define MX12_MOTOR_COUNT 16 +/** Class to communicate with Dynamixel MX12 servomotors. + * + * + */ class MX12 { public: + /** Status of servomotor + * + */ enum Status { InstructionError, OverloadError, @@ -27,7 +39,10 @@ Ok }; - enum State { + /** State of communication automaton + * + */ + enum State { ReadingPosition, Writing, Available, @@ -57,6 +72,7 @@ MX12::Status GetStatus(void); + void ReadPosition(unsigned char mot_id); float GetPosition(unsigned char mot_id); @@ -65,6 +81,10 @@ void rw(unsigned char mot_id, char adress, char len, char *data); + /** Interupt Routine to read in data from UART daisy chain link + * (serial port) + * + */ void _ReadCallback(); char _chksm;