Page 1 of 1

HAL driver with two different peripherals

Posted: Fri Oct 21, 2016 8:15 pm
by Marco
Hi,

I was wondering what would be the best/preferred way to implement a HAL driver which has two different hardware peripherals.

In my case a PWM driver for a PWM peripheral and a timer peripheral capable of generating PWM signals. If they will not exist in the application at the same time there is not really a problem, but what if they do have to exist both in the same application? Is it even possible in the current HAL?

Marco

Re: HAL driver with two different peripherals

Posted: Fri Oct 21, 2016 11:10 pm
by Giovanni
Hi,

It is possible, look at the ADC driver for the STM32F37x, it uses both the normal ADC and the SDADC, separately or at same time. A similar approach could be used for other peripherals. Start with looking at the configuration options and then the configuration structure.

Giovanni

Re: HAL driver with two different peripherals

Posted: Mon Oct 24, 2016 9:46 am
by Marco
Ah yes i see, thanks for pointing me in the right direction.

Marco