タイマー(timer)¶
低レベルのタイマー関数群です。
Tickerクラスを利用して呼び出すことも可能です。
利用例¶
メンバー¶
timerBegin()¶
hw_timer_t* timerBegin(uint8_t timer, uint16_t divider, bool countUp)
引数
- uint8_t
timer
- uint16_t
divider
- bool
countUp
戻り値
hw_timer_t*
timerEnd()¶
void timerEnd(hw_timer_t *timer)
引数
- hw_timer_t*
timer
戻り値
void
timerSetConfig()¶
void timerSetConfig(hw_timer_t *timer, uint32_t config)
引数
- hw_timer_t*
timer
- uint32_t
config
戻り値
void
timerGetConfig()¶
uint32_t timerGetConfig(hw_timer_t *timer)
引数
- hw_timer_t*
timer
戻り値
uint32_t
timerAttachInterrupt()¶
void timerAttachInterrupt(hw_timer_t *timer, void(*fn)(void), bool edge)
引数
- hw_timer_t*
timer
- void(*)(void)
fn
- bool
edge
戻り値
void
timerDetachInterrupt()¶
void timerDetachInterrupt(hw_timer_t *timer)
引数
- hw_timer_t*
timer
戻り値
void
timerStart()¶
void timerStart(hw_timer_t *timer)
引数
- hw_timer_t*
timer
戻り値
void
timerStop()¶
void timerStop(hw_timer_t *timer)
引数
- hw_timer_t*
timer
戻り値
void
timerRestart()¶
void timerRestart(hw_timer_t *timer)
引数
- hw_timer_t*
timer
戻り値
void
timerWrite()¶
void timerWrite(hw_timer_t *timer, uint64_t val)
引数
- hw_timer_t*
timer
- uint64_t
val
戻り値
void
timerSetDivider()¶
void timerSetDivider(hw_timer_t *timer, uint16_t divider)
引数
- hw_timer_t*
timer
- uint16_t
divider
戻り値
void
timerSetCountUp()¶
void timerSetCountUp(hw_timer_t *timer, bool countUp)
引数
- hw_timer_t*
timer
- bool
countUp
戻り値
void
timerSetAutoReload()¶
void timerSetAutoReload(hw_timer_t *timer, bool autoreload)
引数
- hw_timer_t*
timer
- bool
autoreload
戻り値
void
timerStarted()¶
bool timerStarted(hw_timer_t *timer)
引数
- hw_timer_t*
timer
戻り値
bool
timerRead()¶
uint64_t timerRead(hw_timer_t *timer)
引数
- hw_timer_t*
timer
戻り値
uint64_t
timerReadMicros()¶
uint64_t timerReadMicros(hw_timer_t *timer)
引数
- hw_timer_t*
timer
戻り値
uint64_t
timerReadSeconds()¶
double timerReadSeconds(hw_timer_t *timer)
引数
- hw_timer_t*
timer
戻り値
double
timerGetDivider()¶
uint16_t timerGetDivider(hw_timer_t *timer)
引数
- hw_timer_t*
timer
戻り値
uint16_t
timerGetCountUp()¶
bool timerGetCountUp(hw_timer_t *timer)
引数
- hw_timer_t*
timer
戻り値
bool
timerGetAutoReload()¶
bool timerGetAutoReload(hw_timer_t *timer)
引数
- hw_timer_t*
timer
戻り値
bool
timerAlarmEnable()¶
void timerAlarmEnable(hw_timer_t *timer)
引数
- hw_timer_t*
timer
戻り値
void
timerAlarmDisable()¶
void timerAlarmDisable(hw_timer_t *timer)
引数
- hw_timer_t*
timer
戻り値
void
timerAlarmWrite()¶
void timerAlarmWrite(hw_timer_t *timer, uint64_t interruptAt, bool autoreload)
引数
- hw_timer_t*
timer
- uint64_t
interruptAt
- bool
autoreload
戻り値
void
timerAlarmEnabled()¶
bool timerAlarmEnabled(hw_timer_t *timer)
引数
- hw_timer_t*
timer
戻り値
bool
timerAlarmRead()¶
uint64_t timerAlarmRead(hw_timer_t *timer)
引数
- hw_timer_t*
timer
戻り値
uint64_t
timerAlarmReadMicros()¶
uint64_t timerAlarmReadMicros(hw_timer_t *timer)
引数
- hw_timer_t*
timer
戻り値
uint64_t
timerAlarmReadSeconds()¶
double timerAlarmReadSeconds(hw_timer_t *timer)
引数
- hw_timer_t*
timer
戻り値
double