Servo output via serial port

Hello, I need to get servo outputs via Serial port. I have tried to find where is servo PWM is located in source code, but my c++ skill is not this high-level. Where I should start?

Best regards, Nikita.

There is an RC_OUT library in https://github.com/ArduPilot/ardupilot/blob/master/libraries/AP_HAL/RCOutput.h.
Each flight controll provides its own implementation
You could find the version for your Flight controller and modify it to your needs. Here for example is how Px4 board deals with it.
https://github.com/ArduPilot/ardupilot/blob/master/libraries/AP_HAL_PX4/RCOutput.h
https://github.com/ArduPilot/ardupilot/blob/master/libraries/AP_HAL_PX4/RCOutput.cpp

Alternatively setup SBUS output and then use an Arduino or similar to read it and to convert to your serial port protocol. Look on Github for inspiration. Maybe someone has already done something that you can use as a starting point

For example see here re the SBUS protocol