This repository has been archived on 2020-06-14. You can view files and clone it, but cannot push or open issues or pull requests.
Lennart Eriksson eea60e95da System Clock
2016-09-21 10:01:14 +02:00

51 lines
2.4 KiB
C

/**************************************************************************
* NAME: system_clock.h *
* AUTHOR: Lennart Eriksson *
* PURPOSE: Enable and handle system clock functionality *
* INFORMATION: *
* This file initilizes the system clock and handles delays, get time *
* in both micro- and milliseconds. *
* *
* GLOBAL VARIABLES: *
* Variable Type Description *
* -------- ---- ----------- *
**************************************************************************/
#ifndef DRIVERS_SYSTEM_CLOCK_H_
#define DRIVERS_SYSTEM_CLOCK_H_
/***********************************************************************
* BRIEF: Starts the system clock at 100MHz *
* INFORMATION: In the current version it works with ADC and DMA *
***********************************************************************/
void system_clock_config(void);
/***********************************************************************
* BRIEF: Get the time since the system started in milliseconds
* INFORMATION: return the time in milliseconds
***********************************************************************/
uint32_t clock_get_ms();
/***********************************************************************
* BRIEF: Get the time since the system started in microseconds
* INFORMATION: return the time in microseconds
***********************************************************************/
uint32_t clock_get_us();
/***********************************************************************
* BRIEF: stall the system for number of milliseconds
* INFORMATION:
***********************************************************************/
void clock_delay_ms(uint32_t ms);
/***********************************************************************
* BRIEF: Stall the system for a number of microseconds
* INFORMATION:
***********************************************************************/
void clock_delay_us(uint32_t us);
#endif /* DRIVERS_SYSTEM_CLOCK_H_ */