I'm using the example code from STM8L15x-16x-05x-AL31-L_StdPeriph_Lib as a starting point.
I'm able to get GPIO and I2C working but the configuration to get the DAC1 on pin PB4 not working.
I have the following configuration:
SYSCFG_RIIOSwitchConfig(RI_IOSwitch_15, ENABLE); //get DAC1 on PB4 pin
DAC_Init(DAC_Channel_1, DAC_Trigger_None, DAC_OutputBuffer_Enable);
but the output on PB4 stay's zero.
Also tried adding a check to be sure the DAC value is set correctly with:
while(4000 != DAC_GetDataOutputValue(DAC_Channel_1));
and the loop is just exited.
The problem must be in the IO switch configuration, but i have no clue what it could be.