libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
TIMER Defines

Defined Constants and Types for the NRF52xx Timer More...

Collaboration diagram for TIMER Defines:

Modules

 TIMER instances
 
 Timer event -> task shortcuts
 

Macros

#define TIMER_TASK_START(T)   MMIO32((T) + 0x000)
 
#define TIMER_TASK_STOP(T)   MMIO32((T) + 0x004)
 
#define TIMER_TASK_COUNT(T)   MMIO32((T) + 0x008)
 
#define TIMER_TASK_CLEAR(T)   MMIO32((T) + 0x00C)
 
#define TIMER_TASK_SHUTDOWN(T)   MMIO32((T) + 0x010)
 
#define TIMER_TASK_CAPTURE(T, C)   MMIO32((T) + 0x040 + (uint32_t)(0x4 * (C)))
 
#define TIMER_EVENT_COMPARE(T, C)   MMIO32((T) + 0x140 + (uint32_t)(0x4 * (C)))
 
#define TIMER_SHORTS(T)   _PERIPH_SHORTS(T)
 
#define TIMER_INTENSET(T)   _PERIPH_INTENSET(T)
 
#define TIMER_INTENCLR(T)   _PERIPH_INTENCLR(T)
 
#define TIMER_MODE(T)   MMIO32((T) + 0x504)
 
#define TIMER_BITMODE(T)   MMIO32((T) + 0x508)
 
#define TIMER_PRESCALER(T)   MMIO32((T) + 0x510)
 
#define TIMER_PRESCALER_MASK   (0xf)
 
#define TIMER_CC(T, C)   MMIO32((T) + 0x540 + 0x4 * (C))
 
#define TIMER_INTEN_COMPARE(C)   (1 << (16 + (C)))
 
#define TIMER_MODE_SELECT   (1 << 0)
 

Enumerations

enum  timer_mode { TIMER_MODE_TIMER , TIMER_MODE_COUNTER }
 
enum  timer_bitmode { TIMER_BITMODE_16BIT , TIMER_BITMODE_08BIT , TIMER_BITMODE_24BIT , TIMER_BITMODE_32BIT }
 

Detailed Description

Defined Constants and Types for the NRF52xx Timer

Version
1.0.0
Date
Nov 2021

LGPL License Terms libopencm3 License

Author
© 2016 Maxim Sloyko maxim.nosp@m.s@go.nosp@m.ogle..nosp@m.com
© 2021 Eduard Drusa <ventyl86 at netkosice dot sk>

Macro Definition Documentation

◆ TIMER_BITMODE

#define TIMER_BITMODE (   T)    MMIO32((T) + 0x508)

Definition at line 68 of file common/timer.h.

◆ TIMER_CC

#define TIMER_CC (   T,
 
)    MMIO32((T) + 0x540 + 0x4 * (C))

Definition at line 72 of file common/timer.h.

◆ TIMER_EVENT_COMPARE

#define TIMER_EVENT_COMPARE (   T,
 
)    MMIO32((T) + 0x140 + (uint32_t)(0x4 * (C)))

Definition at line 60 of file common/timer.h.

◆ TIMER_INTEN_COMPARE

#define TIMER_INTEN_COMPARE (   C)    (1 << (16 + (C)))

Definition at line 87 of file common/timer.h.

◆ TIMER_INTENCLR

#define TIMER_INTENCLR (   T)    _PERIPH_INTENCLR(T)

Definition at line 66 of file common/timer.h.

◆ TIMER_INTENSET

#define TIMER_INTENSET (   T)    _PERIPH_INTENSET(T)

Definition at line 65 of file common/timer.h.

◆ TIMER_MODE

#define TIMER_MODE (   T)    MMIO32((T) + 0x504)

Definition at line 67 of file common/timer.h.

◆ TIMER_MODE_SELECT

#define TIMER_MODE_SELECT   (1 << 0)

Definition at line 89 of file common/timer.h.

◆ TIMER_PRESCALER

#define TIMER_PRESCALER (   T)    MMIO32((T) + 0x510)

Definition at line 69 of file common/timer.h.

◆ TIMER_PRESCALER_MASK

#define TIMER_PRESCALER_MASK   (0xf)

Definition at line 70 of file common/timer.h.

◆ TIMER_SHORTS

#define TIMER_SHORTS (   T)    _PERIPH_SHORTS(T)

Definition at line 64 of file common/timer.h.

◆ TIMER_TASK_CAPTURE

#define TIMER_TASK_CAPTURE (   T,
 
)    MMIO32((T) + 0x040 + (uint32_t)(0x4 * (C)))

Definition at line 53 of file common/timer.h.

◆ TIMER_TASK_CLEAR

#define TIMER_TASK_CLEAR (   T)    MMIO32((T) + 0x00C)

Definition at line 51 of file common/timer.h.

◆ TIMER_TASK_COUNT

#define TIMER_TASK_COUNT (   T)    MMIO32((T) + 0x008)

Definition at line 50 of file common/timer.h.

◆ TIMER_TASK_SHUTDOWN

#define TIMER_TASK_SHUTDOWN (   T)    MMIO32((T) + 0x010)

Definition at line 52 of file common/timer.h.

◆ TIMER_TASK_START

#define TIMER_TASK_START (   T)    MMIO32((T) + 0x000)

Definition at line 48 of file common/timer.h.

◆ TIMER_TASK_STOP

#define TIMER_TASK_STOP (   T)    MMIO32((T) + 0x004)

Definition at line 49 of file common/timer.h.

Enumeration Type Documentation

◆ timer_bitmode

Enumerator
TIMER_BITMODE_16BIT 
TIMER_BITMODE_08BIT 
TIMER_BITMODE_24BIT 
TIMER_BITMODE_32BIT 

Definition at line 96 of file common/timer.h.

◆ timer_mode

enum timer_mode
Enumerator
TIMER_MODE_TIMER 
TIMER_MODE_COUNTER 

Definition at line 91 of file common/timer.h.