STM32F103 as I2C slave the PlatformIO way? (non-Arduino?)

As I have trouble using Arduino Wire library for slave;

How do people solve I2C communications without Arduino?
are there some libraries or examples that works without Arduino framework, that are easy to implement?