# include/delay.h File Reference

Delay functions. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Functions
unsigned int | ns2cyc (unsigned int ns, unsigned int rate)
| Convert from nanoseconds to clock cycles using 32-bit arithmetic.
void | udelay (unsigned long us)
| Delay for a specified number of microseconds.
static void | mdelay (unsigned long ms)
| Delay for a specified number of milliseconds.

## Detailed Description

Delay functions.

- Compiler: IAR EWAVR32 and GNU GCC for AVR32
- Supported devices: All devices
- AppNote:

Author:
  Atmel Corporation: http://www.atmel.com
  Support and FAQ: http://support.atmel.no/

Definition in file delay.h.

## Function Documentation

static void mdelay | ( | unsigned long | ms | ) | `[inline, static]`

Delay for a specified number of milliseconds.

Parameters:

  | ms | Number of milliseconds to delay.

Definition at line 52 of file delay.h.

References udelay().

Here is the call graph for this function:

unsigned int ns2cyc | ( | unsigned int | ns,
|  | unsigned int | rate |
| ) |  |  |

Convert from nanoseconds to clock cycles using 32-bit arithmetic.

Parameters:

  | ns | Number of nanoseconds
  | rate | Clock rate in Hz

Returns:
  (ns * rate) / 1000000000

Definition at line 53 of file delay.c.

References div_ceil.

void udelay | ( | unsigned long | us | ) |

Delay for a specified number of microseconds.

Since the max CPU frequency at this point is 66 MHz, this function supports delays up to

Parameters:

  | us | Number of microseconds to delay.

Definition at line 64 of file delay.c.

References div_ceil, and get_cpu_clock_rate().

Referenced by mdelay().

Here is the call graph for this function: