This is an old revision of the document!
Timer Input
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
Configuration register 1
| CKD | 00 | Counter used as upcounter |
| 01 | Counter used as downcounter | |
| 10 | Counter used as downcounter | |
| 11 | Counter used as downcounter |
SMCR
Slave mode control register
| ETR | 0 | ETR is not inverted, active at high level or rising edge |
| 1 | ETR is inverted, active at low level or falling edge | |
| ECE | 0 | External clock mode 2 disabled |
| 1 | External clock mode 2 enabled. Clock enabled by any active edge on ETRF |