Documentation
Pluto-IDE & MagisV2 SDK
Pluto-IDE & MagisV2 API Reference
BMS
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.
BMS.h
Battery Management System interface for monitoring battery parameters.
Enumerations
BMS_Option_e
typedef enum BMS_Option {
Voltage, // Battery voltage
Current, // Current flow through battery
mAh_Consumed, // Milliampere-hours consumed
mAh_Remain, // Milliampere-hours remaining
Battery_Capicity, // Total battery capacity
Estimated_Capacity // Estimated battery capacity
} BMS_Option_e;
Functions
uint16_t Bms_Get(BMS_Option_e _bms_option)
Retrieves battery management system parameters.
Parameters:
_bms_option- BMS parameter to retrieve
Returns: Value of requested parameter (0 if invalid)
void Bms_Using_Other_Battery(uint16_t _new_cap_mAh)
Updates battery capacity with new value.
Parameters:
_new_cap_mAh- New battery capacity in mAh
Usage Example
// Monitor battery status
uint16_t voltage = Bms_Get(Voltage);
uint16_t remaining = Bms_Get(mAh_Remain);
uint16_t capacity = Bms_Get(Battery_Capicity);
// Calculate percentage
uint8_t percentage = (remaining * 100) / capacity;
// Update for different battery
Bms_Using_Other_Battery(2200);
// Low battery check
if (percentage < 20) {
Monitor_Println("Low Battery Warning");
}
