Pluto Logo

by Drona Aviation

Profile
Menu
Documentation
Pluto-IDE & MagisV2 SDK
Pluto-IDE & MagisV2 API Reference

RxConfig

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.

Get Pluto-IDE

RxConfig.h

Receiver configuration for setting up RC modes and channel assignments.

Enumerations

rx_mode_e

typedef enum {
    Rx_ESP,     // ESP-based receiver
    Rx_PPM,     // PPM receiver
    Rx_CAM      // Camera-based receiver
} rx_mode_e;

flight_mode

typedef enum {
    Mode_ARM,       // Arm mode
    Mode_ANGLE,     // Angle mode
    Mode_BARO,      // Barometer mode
    Mode_MAG,       // Magnetometer mode
    Mode_HEADFREE   // Head-free mode
} flight_mode;

rx_channel_e

typedef enum {
    Rx_AUX1 = 4,    // AUX1 channel (channel 5)
    Rx_AUX2,        // AUX2 channel (channel 6)
    Rx_AUX3,        // AUX3 channel (channel 7)
    Rx_AUX4,        // AUX4 channel (channel 8)
    Rx_AUX5         // AUX5 channel (channel 9)
} rx_channel_e;

Global Variables

  • uint8_t DevModeAUX - Developer mode AUX channel
  • uint16_t DevModeMinRange - Developer mode minimum range
  • uint16_t DevModeMaxRange - Developer mode maximum range

Functions

void Receiver_Mode(rx_mode_e rxMode)

Sets receiver mode/type.

void Receiver_Config_Arm(rx_channel_e rxChannel, uint16_t minRange, uint16_t maxRange)

Configures arm switch channel and range.

Flight Mode Configuration

  • void Receiver_Config_Mode_Angle(rx_channel_e rxChannel, uint16_t minRange, uint16_t maxRange)
  • void Receiver_Config_Mode_Baro(rx_channel_e rxChannel, uint16_t minRange, uint16_t maxRange)
  • void Receiver_Config_Mode_Mag(rx_channel_e rxChannel, uint16_t minRange, uint16_t maxRange)
  • void Receiver_Config_Mode_HeadFree(rx_channel_e rxChannel, uint16_t minRange, uint16_t maxRange)
  • void Receiver_Config_Mode_Dev(rx_channel_e rxChannel, uint16_t minRange, uint16_t maxRange)

void STM_PB3_ESP_IO14_Init(void)

Initializes STM32 PB3 to ESP IO14 connection.

Usage Example

void plutoRxConfig() {
    // Set receiver mode
    Receiver_Mode(Rx_ESP);
    
    // Configure arm switch
    Receiver_Config_Arm(Rx_AUX1, 1700, 2000);          // High position
    
    // Configure flight modes
    Receiver_Config_Mode_Angle(Rx_AUX2, 1000, 1300);   // Low position
    Receiver_Config_Mode_Baro(Rx_AUX2, 1700, 2000);    // High position
    Receiver_Config_Mode_Mag(Rx_AUX3, 1700, 2000);     // High position
    Receiver_Config_Mode_HeadFree(Rx_AUX4, 1700, 2000); // High position
    Receiver_Config_Mode_Dev(Rx_AUX5, 1700, 2000);     // High position
    
    // Initialize ESP connection
    STM_PB3_ESP_IO14_Init();
}