If your CNC mill or router controls the spindle with a VFD, you can interface that VFD with Smoothieboard using Modbus ( or the chinese derivative of it the VFD uses ), to control the spindle’s rotation via Gcode.
Just takes a breakout board and two wires to the VFD :
Be aware that I’ve just implmented the Huanyang “Protocol” (crippled chines sh**) and not yet had the chance to test on a real Modbus device. But It should be fairly easy to get that up and running if it adheres to the specs and has a real documentation