atcwdt_get_clock_period(9)
๐ atcwdt_get_clock_period(9) ๐
ok so bestie, welcome to the Kernel API Manual โจ โ today's main character is atcwdt_get_clock_period(9), and honestly? she's doing the math so you don't have to ๐งฎ๐
๐ธ NAME ๐ธ
atcwdt_get_clock_period โ calculates the closest clock period based on a given tick count ๐ฏ like, that's literally her whole job
โจ SYNOPSIS โจ
long long atcwdt_get_clock_period (long long tick , enum timer_type
timer_type , unsigned char *index );
three params in, one long long out โ no cap, she keeps it simple ๐ซถ
๐ ARGUMENTS ๐
tickโ the target tick count you're trying to match ๐ this is the vibe you're aiming fortimer_typeโ the type of timer, and it can beTMR_RST,TMR_INT_16, orTMR_INT_32๐ (yes, exactly those three, don't get creative)indexโ a pointer where the index of the selected parameter gets stored ๐ so she'll write back into it, keep that in mind
๐ฆ DESCRIPTION ๐ฆ
okay so here's the tea โ: this function calculates the closest clock period to the given tick count by iterating through the timer parameters and picking the one that minimizes the difference between your target tick count and the calculated clock period. the way that she just... goes through them all and finds the bestie that fits closest, no drama ๐
then she figures out the index of that closest parameter (remember that pointer? yeah, that's where it goes ๐ฏ) and returns the difference between the target tick count and the selected clock period. so the return value is basically a report card of how close she got ๐โจ
๐ฅ RETURN ๐ฅ
the difference between the target tick count and the selected clock period ๐ that's it, that's the whole return. a number that tells you how far off the chosen period is from what you asked for โจ
๐ SEE ALSO ๐
- Kernel file
./drivers/watchdog/atcwdt200_wdt.c enum timer_type(9)struct atcwdt_drv(9)atcwdt_get_index(9)atcwdt_get_timeout_params(9)atcwdt_get_int_timer_type(9)
like, go read those too, they all hang out together iykyk ๐ซถ๐ฆ
okay bestie that's the whole page, ily, go forth and slay your watchdog timers ๐๐ธ๐ง
signing off from the ./drivers/watchdog directory โ page dated October 2026, straight out of the Kernel API Manual, mwah ๐๐
๐ฆ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms