STM8L151 UART software
I am not familiar with STM8, but with STM32 there is STM32CubeMX, where you can configure your code and find examples. It seems that there is version for STM8 too.

Once you download it, it should have some examples (they should be in STM8Cube folder in C:/Users/your user, if it is similar to STM32CubeMX) and you would be able to generate your starting code, it should be similar as for STM32CubeMX, which has a lot of tutorials in the internet.