pwm_out multi-instance support

PX4 uses banks of 8 outputs as a logical structure. Boards that have
more outputs than 8 get multiple instances. This is an arbitrary choice
that helps with overall structure and enables the mixing of different
device classes (like FMU, IO or UAVCAN).
This commit is contained in:
Daniel Agar
2021-03-17 22:03:18 +01:00
committed by Lorenz Meier
parent c1c0a62be5
commit e7722b11eb
5 changed files with 258 additions and 79 deletions
+3 -1
View File
@@ -178,6 +178,8 @@ public:
void setIgnoreLockdown(bool ignore_lockdown) { _ignore_lockdown = ignore_lockdown; }
void setMaxNumOutputs(uint8_t max_num_outputs) { _max_num_outputs = max_num_outputs; }
protected:
void updateParams() override;
@@ -261,7 +263,7 @@ private:
bool _wq_switched{false};
uint8_t _driver_instance{0}; ///< for boards that supports multiple outputs (e.g. PX4IO + FMU)
const uint8_t _max_num_outputs;
uint8_t _max_num_outputs;
struct MotorTest {
uORB::Subscription test_motor_sub{ORB_ID(test_motor)};