PHiLIP
app_common.h
Go to the documentation of this file.
1 /*
2  * Copyright 2020 Kevin Weiss for HAW Hamburg
3  *
4  * This file is subject to the terms and conditions of the MIT License. See the
5  * file LICENSE in the top level directory for more details.
6  * SPDX-License-Identifier: MIT
7  */
8 
22 #ifndef APP_COMMON_H_
23 #define APP_COMMON_H_
24 
25 /* Defines ********************************************************************/
27 #define DIS_INT __disable_irq();
28 
30 #define EN_INT __enable_irq();
31 
37 #define SOFT_RESET soft_reset()
38 
40 #define TICK_BIT_OFFSET 16
41 
42 /* Function prototypes ********************************************************/
48 void delay_us(uint16_t micros);
49 
58 void copy_until_same(void *dest, void *src, size_t size);
59 
61 void soft_reset();
62 
64 uint64_t get_tick();
65 
67 uint32_t get_tick32();
68 
74 uint32_t get_tick32_div(uint8_t div);
75 
76 #endif /* APP_COMMON_H_ */
77 
uint64_t get_tick()
Gets tick value in amount to system tick (72 MHz).
Definition: app_common.c:60
uint32_t get_tick32()
Gets tick value in amount to system tick (72 MHz) in 32bit.
Definition: app_common.c:70
void delay_us(uint16_t micros)
Imprecise blocking delay in microseconds.
Definition: app_common.c:54
void soft_reset()
Wrapper function to provide software reset.
Definition: app_common.c:112
uint32_t get_tick32_div(uint8_t div)
Gets 32 bit tick shifted down by an amount.
Definition: app_common.c:81
void copy_until_same(void *dest, void *src, size_t size)
Copies and compares data until copied data matches.
Definition: app_common.c:103