stm32mp157 盘古开发板 Linux内核版本4.19
这个定时器字系统,严格的来说应该是stm32-timer-trigger
1、内核相关文档
设备树配置文档linux-st\Documentation\devicetree\bindings\iio\timer\stm32-timer-trigger.txt
STMicroelectronics STM32 Timers IIO timer bindings
Must be a sub-node of an STM32 Timers device tree node.
See ../mfd/stm32-timers.txt for details about the parent node.
Required parameters:
- compatible: Must be one of:
"st,stm32-timer-trigger"
"st,stm32h7-timer-trigger"
- reg: Identify trigger hardware block.
Optional properties:
- pinctrl-names: Set to "default". An additional "sleep" state can be
defined to set pins in sleep state when in low power.
- pinctrl-n: Phandle(s) pointing to pin configuration node for PWM,
respectively for "default" and "sleep" states.
Example:
timers@40010000 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "st,stm32-timers";
reg = <0x40010000 0x400>;
clocks = <&rcc 0 160>;
clock-names = "int";
timer@0 {
compatible = "st,stm32-timer-trigger";
reg = <0>;
pinctrl-0 = <&tim1_pins>;
pinctrl-1 = <&tim1_sleep_pins>;
pinctrl-names = "default", "sleep";
};
};
应用层操作文档:linux-st\Documentation\ABI\testing\sysfs-bus-iio-timer-stm32
What: /sys/bus/iio/devices/triggerX/master_mode_available KernelVersion: 4.11 Contact: benjamin.gaignard@st.com Description: Reading returns the list possible master modes which are: - "reset" : The UG bit from the TIMx_EGR register is used as trigger output (TRGO). - "enable" : The Counter Enable signal CNT_EN is used as trigger output. - "update" : The update event is selected as trigger output. For instance a master timer can then be used as a prescaler for a slave timer. - "compare_pulse" : The trigger output send a positive pulse when the CC1IF flag is to be set. - "OC1REF" : OC1REF signal is used as trigger output. - "OC2REF" : OC2REF signal is used as trigger output. - "OC3REF" : OC3REF signal is used as trigger output. - "OC4REF" : OC4REF signal is used as trigger output. Additional modes (on TRGO2 only): - "OC5REF" : OC5REF signal is used as trigger output. - "OC6REF" : OC6REF signal is used as trigger output. - "compare_pulse_OC4REF": OC4REF rising or falling edges generate pulses. - "compare_pulse_OC6REF": OC6REF rising or falling edges generate pulses. - "compare_pulse_OC4REF_r_or_OC6REF_r": OC4REF or OC6REF rising edges generate pulses. - "compare_pulse_OC4REF_r_or_OC6REF_f": OC4REF rising or OC6REF falling edges generate pulses. - "compare_pulse_OC5REF_r_or_OC6REF_r": OC5REF or OC6REF rising edges generate pulses. - "compare_pulse_OC5REF_r_or_OC6REF_f": OC5REF rising or OC6REF falling edges generate pulses. +-----------+ +-------------+ +---------+ | Prescaler +-> | Counter | +-> | Master | TRGO(2) +-----------+ +--+--------+-+ |-> | Control +--> | | || +---------+ +--v--------+