summaryrefslogtreecommitdiff
path: root/ports/stm32/timer.c
AgeCommit message (Collapse)Author
2019-10-13remove ports/stm32Dan Halbert
2018-06-15stm32/timer: Support TIM1 on F0 MCUs.Damien George
2018-05-28stm32: Add support for STM32F0 MCUs.Damien George
2018-05-28stm32/timer: Make timer_get_source_freq more efficient by using regs.Damien George
Use direct register access to get the APB clock divider. This reduces code size and makes the code more efficient.
2018-05-04stm32: Don't use %lu or %lx for formatting, use just %u or %x.Damien George
On this 32-bit arch there's no need to use the long version of the format specifier. It's only there to appease the compiler which checks the type of the args passed to printf. Removing the "l" saves a bit of code space.
2018-05-02stm32/irq: Define IRQ priorities directly as encoded hardware values.Damien George
For a given IRQn (eg UART) there's no need to carry around both a PRI and SUBPRI value (eg IRQ_PRI_UART, IRQ_SUBPRI_UART). Instead, the IRQ_PRI_UART value has been changed in this patch to be the encoded hardware value, using NVIC_EncodePriority. This way the NVIC_SetPriority function can be used directly, instead of going through HAL_NVIC_SetPriority which must do extra processing to encode the PRI+SUBPRI. For a priority grouping of 4 (4 bits for preempt priority, 0 bits for the sub-priority), which is used in the stm32 port, the IRQ_PRI_xxx constants remain unchanged in their value. This patch also "fixes" the use of raise_irq_pri() which should be passed the encoded value (but as mentioned above the unencoded value is the same as the encoded value for priority grouping 4, so there was no bug from this error).
2018-03-17stm32: Use STM32xx macros instead of MCU_SERIES_xx to select MCU type.Damien George
The CMSIS files for the STM32 range provide macros to distinguish between the different MCU series: STM32F4, STM32F7, STM32H7, STM32L4, etc. Prefer to use these instead of custom ones.
2018-03-09stm32/timer: Add Timer support for H7 MCUs.iabdalkader
2018-02-13stm32/timer: Support MCUs that don't have TIM4 and/or TIM5.Damien George
2018-02-13stm32: Update HAL macro and constant names to use newer versions.Damien George
Newer versions of the HAL use names which are cleaner and more self-consistent amongst the HAL itself. This patch switches to use those names in most places so it is easier to update the HAL in the future.
2017-09-25stm32/timer: Enable ARPE so that timer freq can be changed smoothly.Damien George
The timer prescaler is buffered by default, and this patch enables ARPE which buffers the auto-reload register. With both of these registers buffered it's now possible to smoothly change the timer's frequency and have a smoothly varying PWM output.
2017-09-13stm32/timer: Make pyb.Timer() instances persistent.Damien George
Prior to this patch calling pyb.Timer(id) would always create a new timer instance, even if there was an existing one. This patch fixes this behaviour to match other peripherals, like UART, such that constructing a timer with just the id will retrieve any existing instances. The patch also refactors the way timers are validated on construction to simplify and reduce code size.
2017-09-06ports: Make new ports/ sub-directory and move all ports there.Damien George
This is to keep the top-level directory clean, to make it clear what is core and what is a port, and to allow the repository to grow with new ports in a sustainable way.