This is an old revision of the document!
Timer Clock Source
Programming Example
The code snippet bellow shows how to configure and use a GPIO pin as input.
#include "reg_stm32f4xx.h" /* TO-DODELI DOO. */
Configuration Registers
CR1
SMCR
Slave mode control register
ETP | 0 | ETR is noninverted, active at high level or rising edge (reset state) | ||
1 | ETR is inverted, active at low level or falling edge | |||
ETPS | 00 | Prescaler off (reset state) | ||
01 | fETRP / 2 | |||
10 | fETRP / 4 | |||
11 | fETRP / 8 | |||
EXTSEL | 0000 | No filter, fDTS (reset state) | 1000 | fsampling ⇒ fDTS / 8, N=6 |
0001 | fsampling ⇒ fCKINT, N=2 | 1001 | fsampling ⇒ fDTS / 8, N=8 | |
0010 | fsampling ⇒ fCKINT, N=4 | 1010 | fsampling ⇒ fDTS / 16, N=5 | |
0011 | fsampling ⇒ fCKINT, N=8 | 1011 | fsampling ⇒ fDTS / 16, N=6 | |
0100 | fsampling ⇒ fDTS / 2, N=6 | 1100 | fsampling ⇒ fDTS / 16, N=8 | |
0101 | fsampling ⇒ fDTS / 2, N=8 | 1101 | fsampling ⇒ fDTS / 32, N=5 | |
0110 | fsampling ⇒ fDTS / 4, N=6 | 1110 | fsampling ⇒ fDTS / 32, N=6 | |
0111 | fsampling ⇒ fDTS / 4, N=8 | 1111 | fsampling ⇒ fDTS / 32, N=8 |