This module provides simple loop-based delay routines for those applications requiring a brief wait during execution.
Common API for UC3, XMEGA, and AVR MEGA.
Macros | |
#define | delay_init(fcpu_hz) |
Initialize the delay driver. More... | |
#define | delay_ms(delay) ((delay) ? cpu_delay_ms(delay, F_CPU) : cpu_delay_us(1, F_CPU)) |
Delay in milliseconds. More... | |
#define | delay_s(delay) ((delay) ? cpu_delay_ms(1000 * delay, F_CPU) : cpu_delay_us(1, F_CPU)) |
Delay in seconds. More... | |
#define | delay_us(delay) ((delay) ? cpu_delay_us(delay, F_CPU) : cpu_delay_us(1, F_CPU)) |
Delay in microseconds. More... | |
#define | F_CPU sysclk_get_cpu_hz() |
MCU Clock Frequency (Hertz) More... | |
#define delay_init | ( | fcpu_hz | ) |
Initialize the delay driver.
fcpu_hz | CPU frequency in Hz |
The functions in this module call sysclk_get_cpu_hz() function to obtain the system clock frequency.
Referenced by main(), and nm_bsp_init().
#define delay_ms | ( | delay | ) | ((delay) ? cpu_delay_ms(delay, F_CPU) : cpu_delay_us(1, F_CPU)) |
Delay in milliseconds.
delay | Delay in milliseconds |
Referenced by bno055_delay_msek(), bno055_reset(), ili9341_exit_standby(), ili9341_reset_display(), main(), mxt_init(), nm_bsp_sleep(), ov_reset(), ov_write_regs(), run_afec_comp_test(), run_afec_tc_trig_test(), run_cbc_mode_test(), run_cfb128_mode_test(), run_ctr_mode_test(), run_ecb_mode_test(), run_icm_test(), run_ofb_mode_test(), s25fl1xx_erase_chip(), s25fl1xx_set_quad_mode(), s25fl1xx_set_read_latency_control(), and serial_bridge_process_reconfigure().
#define delay_s | ( | delay | ) | ((delay) ? cpu_delay_ms(1000 * delay, F_CPU) : cpu_delay_us(1, F_CPU)) |
#define delay_us | ( | delay | ) | ((delay) ? cpu_delay_us(delay, F_CPU) : cpu_delay_us(1, F_CPU)) |
Delay in microseconds.
delay | Delay in microseconds |
Referenced by at24macxx_reset(), and main().
#define F_CPU sysclk_get_cpu_hz() |
MCU Clock Frequency (Hertz)
Referenced by main().