DJI::OSDK::MFIO Class Reference
APIs for Multi-Function Input-Output functionality. More...
#include <dji_mfio.hpp>
Public Member Functions | |
MFIO (Vehicle *vehicle) | |
void | config (MODE mode, CHANNEL channel, uint32_t defaultValue, uint16_t freq, VehicleCallBack fn=0, UserData userData=0) |
Non-blocking call for initializing an MFIO channel. More... | |
void | setValue (CHANNEL channel, uint32_t value, VehicleCallBack fn=0, UserData data=0) |
Non-blocking call for setting an MFIO value to a channel. More... | |
void | getValue (CHANNEL channel, VehicleCallBack fn=0, UserData data=0) |
Non-blocking call for getting data from an MFIO channel. More... | |
ACK::ErrorCode | config (MODE mode, CHANNEL channel, uint32_t defaultValue, uint16_t freq, int wait_timeout) |
Blocking call for initializing an MFIO channel. More... | |
ACK::ErrorCode | setValue (CHANNEL channel, uint32_t value, int wait_timeout) |
ACK::MFIOGet | getValue (CHANNEL channel, int wait_timeout) |
Detailed Description
APIs for Multi-Function Input-Output functionality.
This class offers control over the F-channel pins on DJI products. Five modes are available through the F-channels:
- PWM Input (not supported yet)
- PWM Output
- Digital Input (GPI)
- Digital Output (GPO)
- Analog-Digital Conversion (ADC) Input
Member Function Documentation
◆ config() [1/2]
void MFIO::config | ( | MFIO::MODE | mode, |
CHANNEL | channel, | ||
uint32_t | defaultValue, | ||
uint16_t | freq, | ||
VehicleCallBack | fn = 0 , |
||
UserData | userData = 0 |
||
) |
Non-blocking call for initializing an MFIO channel.
- Supported Platforms : A3, N3
- Parameters
-
mode The mode (PWM, GPIO, ADC) to initialize to channel The channel (0-7) to initialize defaultValue The starting value [for output] freq The frequency fn Callback function you want called upon ACK userData Additional data you want the callback function to have access to
◆ config() [2/2]
ACK::ErrorCode MFIO::config | ( | MFIO::MODE | mode, |
CHANNEL | channel, | ||
uint32_t | defaultValue, | ||
uint16_t | freq, | ||
int | wait_timeout | ||
) |
Blocking call for initializing an MFIO channel.
- Supported Platforms : A3, N3
- Parameters
-
mode The mode (PWM, GPIO, ADC) to initialize to channel The channel (0-7) to initialize defaultValue The starting value [for output] freq The frequency wait_timeout Time(in s) you want the function to wait for an ACK
- Returns
- ACK::ErrorCode struct containing the ACK and metadata
◆ getValue() [1/2]
void MFIO::getValue | ( | MFIO::CHANNEL | channel, |
VehicleCallBack | fn = 0 , |
||
UserData | data = 0 |
||
) |
◆ getValue() [2/2]
ACK::MFIOGet MFIO::getValue | ( | CHANNEL | channel, |
int | wait_timeout | ||
) |
Blocking call for getting data from an MFIO channel
- Supported Platforms : A3, N3
- Parameters
-
channel The channel (0-7) to get the value from wait_timeout Time(in s) you want the function to wait for an ACK
- Returns
- ACK::ErrorCode struct containing the ACK and metadata
◆ setValue() [1/2]
void MFIO::setValue | ( | MFIO::CHANNEL | channel, |
uint32_t | value, | ||
VehicleCallBack | fn = 0 , |
||
UserData | data = 0 |
||
) |
◆ setValue() [2/2]
ACK::ErrorCode MFIO::setValue | ( | CHANNEL | channel, |
uint32_t | value, | ||
int | wait_timeout | ||
) |
Blocking call for setting an MFIO value to a channel
- Supported Platforms : A3, N3
- Parameters
-
channel The channel (0-7) to set the value to value The value you want to set wait_timeout Time(in s) you want the function to wait for an ACK
- Returns
- ACK::ErrorCode struct containing the ACK and metadata
The documentation for this class was generated from the following files:
- osdk-core/api/inc/dji_mfio.hpp
- osdk-core/api/src/dji_mfio.cpp