Tagged: interrupt

MPU-6050 6-axes gyroscope and accelerometer 1

HAL Library 30- MPU6050 for STM32Fxxx

After MPU6050 library for STM32F4xx series only based on STM32F4xx Standard peripheral drivers, I’ve redesign this library for HAL support over all STM32 series. It has some more features then my first library. It can now read data from MPU6050 (obvious), set interrupts for data ready and motion detection, read interrupts status, set custom data rate for data ready interrupt and set new gyro and accelerometer sensitivities on the fly. More about lib is describe below and on HAL API site. Library...

HAL Library 07- USART for STM32Fxxx 59

HAL Library 07- USART for STM32Fxxx

Here it is. UART library for HAL based libraries. If you don’t know, how UART work on STM32Fxxx devices, then you might take a look at my first library, where I also explained how to used it. This library works successfully on F4 and F7 based devices for now. I will add support for F0 too as soon as possible. Library Read more about new HAL libraries Features Supports up to 8 UART peripherals at a time Interrupt driven RX...

HAL library 04- EXTI for STM32Fxxx 9

HAL library 04- EXTI for STM32Fxxx

EXTI library is used to set GPIO pin as external interrupt. It is designed to easily enable/disable interrupt and handle irq requests. If you don’t know how EXTI works on STM32F4 or STM32F7 lines, you should take a look here. Library Read more about new HAL libraries Features Allows up to 16 external interrupts at a time Allows to setup rising or falling edge for pin Allows to disable interrupt Single function for interrupt handling Works for STM32F0, STM32F4 and...

How to properly enable/disable interrupts in ARM Cortex-M? 9

How to properly enable/disable interrupts in ARM Cortex-M?

Point of this post is not how to use NVIC (Nested Vectored Interrupt Controller) in Cortex-M processors but how to disable/enable interrupts properly for your system to avoid strange behaviours in your code. Let’s assume you have 2 functions, which do some important stuff and they have to make sure that noone interrupts these 2 functions

ARM Cortex-M SCB ICSR register structure. From arm.com 1

Get interrupt execution status on Cortex-M processors

You might come to a situation when you wanna know if current code is executing inside interrupt or not. This might be handy when you do a library and you have one function which you wanna call in interrupt handler for specific event or without interrupt handler, buf wanna execute something specific in function only if you are currently in interrupt. You can create 2 different functions of course, but what if you have one very big function, and for...

Library 63- DMA for STM32F4xx 12

Library 63- DMA for STM32F4xx

Having each stream on separate bits for checking flags has really annoying for me! I had to made a library for DMA which will handle all that stuff any maybe a little more for me because it is really stressfull, when I have to change DMA stream. Then you have to change interrupt handler function name, all flag bit locations and so on. Too much work for easily fail and bug is here! To enable/disable interrupts, get/clear flags, you have to...