1# Copyright (c) 2020 Vestas Wind Systems A/S
2# SPDX-License-Identifier: Apache-2.0
3
4description: NXP LPTMR
5
6compatible: "nxp,lptmr"
7
8include: rtc.yaml
9
10properties:
11  reg:
12    required: true
13
14  clock-frequency:
15    required: true
16    description: Counter clock frequency
17
18  prescaler:
19    required: true
20    description: The frequency of the counter is divided by this value.
21
22  clk-source:
23    type: int
24    required: true
25    enum: [0, 1, 2, 3]
26    description: |
27      Selects the clock to be used by the LPMTR prescaler/glitch filter.
28      In time counter mode, this field selects the input clock to the prescaler.
29      In pulse counter mode, this field selects the input clock to the glitch filter.
30      The clock connections vary by device, see the device reference manual for
31      more details.
32
33  input-pin:
34    type: int
35    description: |
36      When LPTMR is in Pulse mode, this value
37      will be used to determine the "rising-edge
38      source pin" to increment the lptmr counter.
39
40  active-low:
41    type: boolean
42    description: |
43      When LPTMR is in Pulse mode, this value
44      will set the counter to active low.
45
46  resolution:
47    type: int
48    required: true
49    description: Represents the width of the counter in bits.
50
51  prescale-glitch-filter:
52    type: int
53    default: 1
54    enum: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
55    description: |
56      When in prescaler mode, the counter is incremented every
57        2 ^ [prescaler-glitch-filter] clock cycles.
58      When in pulse mode, the counter is incremented every
59        2 ^ [prescaler-glitch-filter] rising edges detected
60        by the pin configured from the input-pin value.
61        Note, that the pulse mode cannot be 2 ^ 16.
62
63  timer-mode-sel:
64    type: int
65    enum: [0, 1]
66    default: 0
67    description: |
68      This value determines rather the LPTMR is configured
69      for Time-Counter mode or for Pulse mode.
70      0 <- LPTMR is configured for Time Counter Mode.
71      1 <- LPTMR is configured for Pulse Mode.
72