/* Start the IO functionality used and enable the AF for selected IO pin(s).  */
void mfxstm32l152_IO_Start(uint16_t DeviceAddr, uint32_t IO_Pin)
/* Start the IO functionality used and enable the AF for selected IO pin(s).  */
void mfxstm32l152_IO_Start(uint16_t DeviceAddr, uint32_t IO_Pin)
{
  uint8_t mode;
  mode = MFX_IO_Read(DeviceAddr, MFXSTM32L152_REG_ADR_SYS_CTRL);    
  mode |= MFXSTM32L152_GPIO_EN;
  if (IO_Pin > 0xFFFF)
  {
    mode |= MFXSTM32L152_ALTERNATE_GPIO_EN;  
  }
  else
  {
    mode &= ~MFXSTM32L152_ALTERNATE_GPIO_EN;  
  }  
  MFX_IO_Write(DeviceAddr, MFXSTM32L152_REG_ADR_SYS_CTRL, mode);
  rt_thread_delay(1);
}