Is AP_periph the best way to control my new device?

I am creating a CAN connected unit that will control all the operations in one wing of a large multi-engine plane. My plan is for it to control ailerons, flaps, (2) throttles, landing gear and any nav lights I decide to add.
It seems like AP_periph has code that would handle PWM outputs, but for the landing gear, I am using a DC motor via an H-bridge motor controller chip (will be STSPIN250 or similar). I was thinking that I’d need to add some of my own code to handle the conversion between a value from the landing gear channel and the logic that controls the H-bridge. This also has to take into account the limit switches that will signal when the gear is fully extended/retracted.

What I would like to know:
Is there provision for adding a module/routine that I can code myself? How would it get called from the main AP_periph code? Can I setup a custom callback for changes on a channel for example?
or -
Is there another way to drive this type of hardware with the existing code? Is scripting a realistic/performant option?

The other option is that I implement all of this directly and just receive and interpret the CAN messages with my own code. I had thought this was the only option until I spotted AP_periph. I’m sure that it would be much more reliable and well tested if I can use the existing firmware for my purposes. Maybe I can contribute the extra functionality to the project? Maybe something similar to this has already been done?
Thoughts?