SyterKit 0.4.0.x
SyterKit is a bare-metal framework
Loading...
Searching...
No Matches
Functions
timer.c File Reference
#include <byteorder.h>
#include <endian.h>
#include <io.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <types.h>
Include dependency graph for timer.c:

Functions

int raise (int signum)
 
static uint64_t get_arch_counter (void)
 
static void udelay (uint32_t us)
 
void __usdelay (uint32_t loop)
 
void mdelay (uint32_t ms)
 Delay execution for a specified number of milliseconds.
 
uint32_t time_ms (void)
 Get the current time in milliseconds.
 

Function Documentation

◆ __usdelay()

void __usdelay ( uint32_t  loop)

◆ get_arch_counter()

static uint64_t get_arch_counter ( void  )
inlinestatic

◆ mdelay()

void mdelay ( uint32_t  ms)

Delay execution for a specified number of milliseconds.

This function converts milliseconds to microseconds and calls the udelay function to implement the delay.

Parameters
msNumber of milliseconds to delay.

◆ raise()

int raise ( int  signum)

◆ time_ms()

uint32_t time_ms ( void  )

Get the current time in milliseconds.

This function calculates the current time based on the architecture counter and returns it in milliseconds.

Returns
Current time in milliseconds.

This function calculates the current time by dividing the architecture counter value by the current HOSC frequency (in MHz) scaled to milliseconds.

Returns
Current time in milliseconds.

◆ udelay()

static void udelay ( uint32_t  us)
static