drv_timer.h
Go to the documentation of this file.
1 /*
2  drv_timer.h : timer support for STM32F103CB
3 
4  Adapted from https://github.com/multiwii/baseflight/blob/master/src/drv_timer.h
5 
6  This file is part of BreezySTM32.
7 
8  BreezySTM32 is free software: you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation, either version 3 of the License, or
11  (at your option) any later version.
12 
13  BreezySTM32 is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with BreezySTM32. If not, see <http://www.gnu.org/licenses/>.
20  */
21 
22 #pragma once
23 
24 typedef void timerCCCallbackPtr(uint8_t port, uint16_t capture);
25 
26 typedef struct {
29  uint32_t pin;
30  uint8_t channel;
31  uint8_t irq;
32  uint8_t outputEnable;
34 
35 extern const timerHardware_t timerHardware[];
36 
37 void configTimeBase(TIM_TypeDef *tim, uint16_t period, uint8_t mhz);
38 void timerConfigure(const timerHardware_t *timerHardwarePtr, uint16_t period, uint8_t mhz);
39 void timerNVICConfigure(uint8_t irq);
40 
41 void configureTimerInputCaptureCompareChannel(TIM_TypeDef *tim, const uint8_t channel);
42 void configureTimerCaptureCompareInterrupt(const timerHardware_t *timerHardwarePtr, uint8_t reference, timerCCCallbackPtr *callback);
43 void configureTimerChannelCallback(TIM_TypeDef *tim, uint8_t channel, uint8_t reference, timerCCCallbackPtr *callback);
const timerHardware_t timerHardware[]
Definition: drv_timer.c:74
void configureTimerChannelCallback(TIM_TypeDef *tim, uint8_t channel, uint8_t reference, timerCCCallbackPtr *callback)
Definition: drv_timer.c:147
void configureTimerCaptureCompareInterrupt(const timerHardware_t *timerHardwarePtr, uint8_t reference, timerCCCallbackPtr *callback)
Definition: drv_timer.c:181
void timerCCCallbackPtr(uint8_t port, uint16_t capture)
Definition: drv_timer.h:24
TIM_TypeDef * tim
Definition: drv_timer.h:27
uint8_t channel
Definition: drv_timer.h:30
General Purpose I/O.
Definition: stm32f4xx.h:1281
void timerConfigure(const timerHardware_t *timerHardwarePtr, uint16_t period, uint8_t mhz)
Definition: drv_timer.c:215
void timerNVICConfigure(uint8_t irq)
Definition: drv_timer.c:187
uint32_t pin
Definition: drv_timer.h:29
void configTimeBase(TIM_TypeDef *tim, uint16_t period, uint8_t mhz)
Definition: drv_timer.c:198
uint8_t outputEnable
Definition: drv_timer.h:32
void configureTimerInputCaptureCompareChannel(TIM_TypeDef *tim, const uint8_t channel)
Definition: drv_timer.c:163
GPIO_TypeDef * gpio
Definition: drv_timer.h:28
uint8_t irq
Definition: drv_timer.h:31


rosflight_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Thu Apr 15 2021 05:07:46