code example to use the timeout timer: sha204_start_timeout_timer_ms(timeout); bool status = false; do { status = try_your_thing(); } while ((sha204_timer expired == false) && (status == false));
Functions | |
void | sha204h_delay_ms (uint16_t delay) |
This function delays for a number of milliseconds. More... | |
void | sha204h_start_timeout_timer_ms (uint16_t timeout) |
This function starts a timeout timer. More... | |
void | sha204h_start_timer (uint16_t delay, uint8_t is_blocking) |
This function delays for a number of microseconds (not compiled). More... | |
void | sha204h_timer_init (void) |
This function initializes a delay timer. More... | |
void sha204h_delay_ms | ( | uint16_t | delay | ) |
This function delays for a number of milliseconds.
You can override this function if you like to do something else in your system while delaying.
[in] | delay | number of milliseconds to delay |
References sha204h_start_timer().
Referenced by display_status(), main(), sha204c_send_and_receive(), sha204c_wakeup(), and sha204p_wakeup().
void sha204h_start_timeout_timer_ms | ( | uint16_t | timeout | ) |
This function starts a timeout timer.
[in] | timeout | number of milliseconds before timing out |
References sha204h_start_timer().
Referenced by sha204c_send_and_receive().
void sha204h_start_timer | ( | uint16_t | delay, |
uint8_t | is_blocking | ||
) |
This function delays for a number of microseconds (not compiled).
[in] | delay | number of microseconds to delay This function starts a milliseconds timer. |
[in] | delay | number of milliseconds to delay |
[in] | is_blocking | true: returns after delay; false: returns immediately |
References DELAY_COUNTER, sha204_timer_expired, tc_get_resolution(), tc_restart(), tc_set_resolution(), and tc_write_period().
Referenced by sha204h_delay_ms(), and sha204h_start_timeout_timer_ms().
void sha204h_timer_init | ( | void | ) |
This function initializes a delay timer.
References DELAY_COUNTER, PMIC_LVL_LOW, sha204h_timer_overflow_interrupt_callback(), tc_enable(), tc_set_overflow_interrupt_callback(), tc_set_overflow_interrupt_level(), tc_set_wgm(), and TC_WG_NORMAL.
Referenced by sha204p_init().