Skip to content

Commit c78e45a

Browse files
ZhaoxiangJincfriedt
authored andcommitted
drivers: counter/lptmr: Enable lptmr get_freq feature
Enable lptmr get_freq feature. Signed-off-by: Zhaoxiang Jin <[email protected]>
1 parent e3c8230 commit c78e45a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/counter/counter_mcux_lptmr.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,13 @@ static uint32_t mcux_lptmr_get_top_value(const struct device *dev)
106106
return (config->base->CMR & LPTMR_CMR_COMPARE_MASK) + 1U;
107107
}
108108

109+
static uint32_t mcux_lptmr_get_freq(const struct device *dev)
110+
{
111+
const struct mcux_lptmr_config *config = dev->config;
112+
113+
return config->info.freq;
114+
}
115+
109116
static void mcux_lptmr_isr(const struct device *dev)
110117
{
111118
const struct mcux_lptmr_config *config = dev->config;
@@ -153,6 +160,7 @@ static DEVICE_API(counter, mcux_lptmr_driver_api) = {
153160
.set_top_value = mcux_lptmr_set_top_value,
154161
.get_pending_int = mcux_lptmr_get_pending_int,
155162
.get_top_value = mcux_lptmr_get_top_value,
163+
.get_freq = mcux_lptmr_get_freq,
156164
};
157165

158166
#define COUNTER_MCUX_LPTMR_DEVICE_INIT(n) \

0 commit comments

Comments
 (0)