Hello
do you mean ACS712?
This sensor converts current flowing to voltage on output pin. Current measuring pins are electricaly isolated from the rest pins.
All you need, is to measure the ouput voltage of ACS with one pin of MCU configured as "ADC input" but there are some pitfalls.
ACS712's VCC is 5v and max output is about 4.5~4.6v for 20 A. STM32 ADC inputs voltage range is 0 - ~3.3V(about max MCU's VREF or VDDA)
The sensitivity is 0.1V/A that means the usable range is from -20A to +8A for MCU's VDDA=3.3V (when output is connected directly to an ADC input pin ). Note that zero amperage, gives 2.5V output signal.
To use safely the full range of ACS, consider use a proper T resistor voltage divider connected from ACS output to an ADC input of MCU with factor 4.6/VREF
The rest is more simple. Just configure the ADC input pin.
CUBEMX can do the configuration and produce the code . (like the example below)
Strongly suggest to use a voltage divider, not to stress or damage the MCU.