Purpose of an Electronic Speed Controller(ESC)
An ESC (Electronic Speed Control) is a device that accepts "user" inputs and controls the operation of a BLDCM (Brushless DC Motor). What that amounts to depends on the ESC concerned. It might be as simple as an on off fixed speed controller, a somewhat more complex unit with variable speed control, and/or constant power and/or torque, dynamic braking with energy recovery, require Hall sensors, or allow sensorless operation, .... . There are a vast number of off-the-shelf ESCs available, and a number of open source ESCs that allow you to decide where the boundaries lie between the ESC and the system driving it. 

You can probably learn all you wish to know (and more) about where an ESC fits into the overall control scheme from the widely used Open Source ESC project "VESC" by Benjamin Vedder. It has grown / forked / become a team effort over time and you may be able to find what you want in the earlier versions.

January 2016 update VESC page by Benjamin here

E-Motion VESC project - with many many bells and whistles here



Worth a look despite being some years since update.
Blue Robotics Blue-ESC and many other interesting projects here
Has the good and bad feature of using discrete FETs as motor drivers.  

A SimonK firmware based ESC
firmware



Betaflight-ESC
Circuit maker page for
Github Beta-flight ESC -  current



$10 DIY ESC intro video here
RC Groups related page here  

'Simple Projects' sensorless ESC Sensorless BLDC motor controller using PIC18F4550 microcontroller  and here

Other:

Paparazzi open source auto pilo ESC page here

Brief but useful 2019 discussion here

Legion