Pixhawk Programming according to sensor

Hello everyone
how do I program pixhawk to work according to the inputs provided my an external arduino?
what i’m trying to do is my drone should fly according to the inputs that arduino gives.
basically the arduino will provide the inputs for the motors but the pixhawk should process it and work accordingly.