APM:Libraries
|
New-style timer interface. More...
Go to the source code of this file.
Macros | |
#define | NR_ADV_HANDLERS 8 |
#define | NR_GEN_HANDLERS 7 |
#define | NR_BAS_HANDLERS 1 |
#define | PRIO_DISABLE_FLAG 0x80 |
Functions | |
static void | disable_channel (const timer_dev *dev, uint8_t channel) |
static void | pwm_mode (const timer_dev *dev, uint8_t channel) |
static void | output_compare_mode (const timer_dev *dev, uint8_t channel) |
static void | enable_irq (const timer_dev *dev, uint8_t interrupt, uint8_t priority) |
void | timer_init (const timer_dev *dev) |
void | timer_reset (const timer_dev *dev) |
void | timer_disable (const timer_dev *dev) |
Disable a timer. More... | |
uint32_t | configTimeBase (const timer_dev *dev, uint16_t period, uint16_t khz) |
static void | disable_channel (const timer_dev *dev, timer_Channel channel) |
static void | pwm_mode (const timer_dev *dev, timer_Channel channel) |
static void | output_compare_mode (const timer_dev *dev, timer_Channel channel) |
void | timer_set_mode (const timer_dev *dev, timer_Channel channel, timer_mode mode) |
void | timer_foreach (void(*fn)(const timer_dev *)) |
Call a function on timer devices. More... | |
void | timer_attach_interrupt (const timer_dev *dev, timer_interrupt_id interrupt, Handler handler, uint8_t priority) |
Attach a timer interrupt. More... | |
void | timer_attach_all_interrupts (const timer_dev *dev, Handler handler) |
void | timer_detach_interrupt (const timer_dev *dev, timer_interrupt_id interrupt) |
Detach a timer interrupt. More... | |
static void | dispatch_adv_brk (const timer_dev *dev) |
static void | dispatch_adv_up (const timer_dev *dev) |
static void | dispatch_adv_trg_com (const timer_dev *dev) |
static void | dispatch_adv_cc (const timer_dev *dev) |
static void | dispatch_general (const timer_dev *dev) |
static void | dispatch_general_h (const timer_dev *dev) |
static void | dispatch_basic (const timer_dev *dev) |
void | TIM1_BRK_TIM9_IRQHandler (void) |
void | TIM1_UP_TIM10_IRQHandler (void) |
void | TIM1_TRG_COM_TIM11_IRQHandler (void) |
void | TIM1_CC_IRQHandler (void) |
void | TIM2_IRQHandler (void) |
void | TIM3_IRQHandler (void) |
void | TIM4_IRQHandler (void) |
void | TIM5_IRQHandler (void) |
void | TIM6_DAC_IRQHandler (void) |
void | TIM7_IRQHandler (void) |
void | TIM8_BRK_TIM12_IRQHandler (void) |
void | TIM8_CC_IRQHandler (void) |
void | TIM8_UP_TIM13_IRQHandler (void) |
void | TIM8_TRG_COM_TIM14_IRQHandler (void) |
static INLINE void | dispatch_single_irq (const timer_dev *dev, timer_interrupt_id iid, uint32_t irq_mask) |
static INLINE void | handle_irq (const timer_dev *dev, uint32_t dier_sr, uint32_t irq_mask, uint32_t iid) |
static void | enable_advanced_irq (const timer_dev *dev, timer_interrupt_id id, uint8_t priority) |
static void | enable_irq (const timer_dev *dev, timer_interrupt_id iid, uint8_t priority) |
void | timer_enable_NVICirq (const timer_dev *dev, uint8_t interrupt, uint8_t priority) |
void | timer_disable_NVICirq (const timer_dev *dev, uint8_t interrupt) |
Variables | |
static Handler tim1_handlers [NR_ADV_HANDLERS] | IN_CCM |
const timer_dev | timers [] |
New-style timer interface.
Definition in file timer.c.
#define PRIO_DISABLE_FLAG 0x80 |
Definition at line 779 of file timer.c.
Referenced by enable_advanced_irq(), enable_irq(), and timer_disable_NVICirq().
uint32_t configTimeBase | ( | const timer_dev * | dev, |
uint16_t | period, | ||
uint16_t | khz | ||
) |
Definition at line 357 of file timer.c.
Referenced by F4Light::RCOutput::_set_output_mode(), F4Light::RCOutput::_set_pin_output_mode(), Soft_I2C::_start(), F4Light::Scheduler::init(), pwmInitializeInput(), and F4Light::GPIO::write().
|
static |
|
static |
|
inlinestatic |
Definition at line 652 of file timer.c.
Referenced by TIM1_BRK_TIM9_IRQHandler(), TIM8_BRK_TIM12_IRQHandler(), and timer_detach_interrupt().
|
inlinestatic |
Definition at line 699 of file timer.c.
Referenced by TIM1_CC_IRQHandler(), TIM8_CC_IRQHandler(), and timer_detach_interrupt().
|
inlinestatic |
Definition at line 676 of file timer.c.
Referenced by TIM1_TRG_COM_TIM11_IRQHandler(), TIM8_TRG_COM_TIM14_IRQHandler(), and timer_detach_interrupt().
|
inlinestatic |
Definition at line 664 of file timer.c.
Referenced by TIM1_UP_TIM10_IRQHandler(), TIM8_UP_TIM13_IRQHandler(), and timer_detach_interrupt().
|
inlinestatic |
Definition at line 769 of file timer.c.
Referenced by TIM6_DAC_IRQHandler(), TIM7_IRQHandler(), and timer_detach_interrupt().
|
inlinestatic |
Definition at line 720 of file timer.c.
Referenced by TIM2_IRQHandler(), TIM3_IRQHandler(), TIM4_IRQHandler(), TIM5_IRQHandler(), and timer_detach_interrupt().
|
inlinestatic |
Definition at line 745 of file timer.c.
Referenced by TIM1_BRK_TIM9_IRQHandler(), TIM1_TRG_COM_TIM11_IRQHandler(), TIM1_UP_TIM10_IRQHandler(), TIM8_BRK_TIM12_IRQHandler(), TIM8_TRG_COM_TIM14_IRQHandler(), TIM8_UP_TIM13_IRQHandler(), and timer_detach_interrupt().
|
static |
Definition at line 625 of file timer.c.
Referenced by dispatch_adv_brk(), dispatch_adv_up(), and dispatch_basic().
|
static |
Definition at line 812 of file timer.c.
Referenced by dispatch_basic(), and enable_irq().
|
inlinestatic |
Referenced by timer_attach_interrupt(), timer_disable_NVICirq(), and timer_enable_NVICirq().
|
inlinestatic |
|
static |
Definition at line 643 of file timer.c.
Referenced by dispatch_adv_cc(), dispatch_adv_trg_com(), dispatch_general(), and dispatch_general_h().
|
static |
|
static |
|
static |
|
static |
void TIM1_BRK_TIM9_IRQHandler | ( | void | ) |
Definition at line 549 of file timer.c.
Referenced by timer_detach_interrupt().
void TIM1_CC_IRQHandler | ( | void | ) |
Definition at line 567 of file timer.c.
Referenced by timer_detach_interrupt().
void TIM1_TRG_COM_TIM11_IRQHandler | ( | void | ) |
Definition at line 561 of file timer.c.
Referenced by timer_detach_interrupt().
void TIM1_UP_TIM10_IRQHandler | ( | void | ) |
Definition at line 556 of file timer.c.
Referenced by timer_detach_interrupt().
void TIM2_IRQHandler | ( | void | ) |
Definition at line 571 of file timer.c.
Referenced by timer_detach_interrupt().
void TIM3_IRQHandler | ( | void | ) |
Definition at line 575 of file timer.c.
Referenced by timer_detach_interrupt().
void TIM4_IRQHandler | ( | void | ) |
Definition at line 579 of file timer.c.
Referenced by timer_detach_interrupt().
void TIM5_IRQHandler | ( | void | ) |
Definition at line 583 of file timer.c.
Referenced by timer_detach_interrupt().
void TIM6_DAC_IRQHandler | ( | void | ) |
Definition at line 587 of file timer.c.
Referenced by timer_detach_interrupt().
void TIM7_IRQHandler | ( | void | ) |
Definition at line 591 of file timer.c.
Referenced by timer_detach_interrupt().
void TIM8_BRK_TIM12_IRQHandler | ( | void | ) |
Definition at line 596 of file timer.c.
Referenced by timer_detach_interrupt().
void TIM8_CC_IRQHandler | ( | void | ) |
Definition at line 601 of file timer.c.
Referenced by timer_detach_interrupt().
void TIM8_TRG_COM_TIM14_IRQHandler | ( | void | ) |
Definition at line 612 of file timer.c.
Referenced by timer_detach_interrupt().
void TIM8_UP_TIM13_IRQHandler | ( | void | ) |
Definition at line 606 of file timer.c.
Referenced by timer_detach_interrupt().
Definition at line 494 of file timer.c.
Referenced by pwmInitializeInput().
void timer_attach_interrupt | ( | const timer_dev * | dev, |
timer_interrupt_id | interrupt, | ||
Handler | handler, | ||
uint8_t | priority | ||
) |
Attach a timer interrupt.
dev | Timer device |
interrupt | Interrupt number to attach to; this may be any timer_interrupt_id or timer_channel value appropriate for the timer. |
handler | Handler to attach to the given interrupt. |
Definition at line 485 of file timer.c.
Referenced by Soft_I2C::_start(), and F4Light::Scheduler::init().
void timer_detach_interrupt | ( | const timer_dev * | dev, |
timer_interrupt_id | interrupt | ||
) |
Detach a timer interrupt.
dev | Timer device |
interrupt | Interrupt number to detach; this may be any timer_interrupt_id or timer_channel value appropriate for the timer. |
Definition at line 512 of file timer.c.
Referenced by disable_channel(), and Soft_I2C::wait_done().
void timer_disable | ( | const timer_dev * | dev | ) |
Disable a timer.
The timer will stop counting, all DMA requests and interrupts will be disabled, and no state changes will be output.
dev | Timer to disable. |
Definition at line 340 of file timer.c.
Referenced by timer_disable_all().
void timer_disable_NVICirq | ( | const timer_dev * | dev, |
uint8_t | interrupt | ||
) |
void timer_enable_NVICirq | ( | const timer_dev * | dev, |
uint8_t | interrupt, | ||
uint8_t | priority | ||
) |
Definition at line 845 of file timer.c.
Referenced by pwmInitializeInput().
void timer_foreach | ( | void(*)(const timer_dev *) | fn | ) |
Call a function on timer devices.
fn | Function to call on each timer device. |
Definition at line 468 of file timer.c.
Referenced by F4Light::Scheduler::init(), timer_disable_all(), and timer_init_all().
void timer_init | ( | const timer_dev * | dev | ) |
Initialize a timer (enable timer clock)
dev | Timer to initialize |
Definition at line 303 of file timer.c.
Referenced by configTimeBase(), and timer_init_all().
void timer_reset | ( | const timer_dev * | dev | ) |
Initialize a timer, and reset its register map.
dev | Timer to initialize |
Definition at line 316 of file timer.c.
Referenced by F4Light::Scheduler::init().
void timer_set_mode | ( | const timer_dev * | dev, |
timer_Channel | channel, | ||
timer_mode | mode | ||
) |
Sets the mode of an individual timer channel.
Note that not all timers can be configured in every mode. For example, basic timers cannot be configured to output compare mode. Be sure to use a timer which is appropriate for the mode you want.
dev | Timer whose channel mode to set |
channel | Relevant channel |
mode | New timer mode for channel |
Definition at line 442 of file timer.c.
Referenced by F4Light::GPIO::_pinMode(), and F4Light::RCOutput::init_channel().
|
static |
const timer_dev timers[] |
Definition at line 75 of file timer.c.
Referenced by timer_foreach().