Documentation
Pluto-IDE & MagisV2 SDK
Pluto-IDE & MagisV2 API Reference
API Utils
Code with Pluto-IDE
Pluto-IDE is the professional development environment required to build, flash, and monitor firmware using the MagisV2 library on Pluto Drones.
API-Utils.h
System utilities and global variables for MagisV2 flight controller.
Global Variables
System Counters
uint8_t resetCounter- System reset counteruint8_t intLogCounter- Integer logging counteruint8_t floatLogCounter- Float logging counter
Navigation Variables
int16_t appHeading- Application heading in degreesint16_t userHeading- User-defined headingint16_t AUX3_VALUE- AUX3 channel valueuint32_t userLoopFrequency- User-defined loop frequency
Arrays
int32_t user_GPS_coord[2]- User GPS coordinates [lat, lon]int32_t app_GPS_coord[2]- Application GPS coordinates [lat, lon]int32_t MOTOR_ARRAY[4]- Motor PWM values [M1, M2, M3, M4]int32_t RC_ARRAY[4]- RC command values [Roll, Pitch, Yaw, Throttle]
System Flags
bool runUserCode- Enable/disable user code executionbool developerMode- Developer mode flagbool hasTakeOff- Takeoff completion flagbool fsLowBattery- Low battery failsafebool External_RC_FLAG[4]- External RC channel flags
Functions
void userEnabledLand(void)
Initiates user-controlled landing sequence.
void resetUserRCflag(void)
Resets all user RC flags to default state.
void resetUser(void)
Resets all user-defined variables and flags to default values.
GPIO Utility Functions
int getGPIOport(unibus_e pin)- Gets GPIO port numberGPIO_Pin getGPIOpin(unibus_e pin)- Gets GPIO pin structureuint32_t getGPIOclock(unibus_e pin)- Gets clock configuration
Usage Example
// Check system state
if (hasTakeOff && !fsLowBattery) {
// Continue flight operations
}
// Reset user settings
resetUser();
resetUserRCflag();
