F439_CPP_SPI_RA8875_TFT_LCD_03 1.0
STM32F439 SPI RA8875 7-inch TFT display demo built on the STM32_GFX and STM32_RA8875 libraries
Loading...
Searching...
No Matches
STM32_Arduino_Compat.h
Go to the documentation of this file.
1
27#ifndef STM32_ARDUINO_COMPAT_H_
28#define STM32_ARDUINO_COMPAT_H_
29
30#include "main.h"
31#include <math.h>
32#include <stdbool.h>
33#include <stddef.h>
34#include <stdint.h>
35#include <stdlib.h>
36#include <string.h>
37
38#ifdef __cplusplus
39
42#ifndef ARDUINO
43#define ARDUINO 10800
44#endif
45
47#ifndef PI
48#define PI 3.1415926535897932384626433832795
49#endif
50#ifndef HALF_PI
51#define HALF_PI 1.5707963267948966192313216916398
52#endif
53#ifndef TWO_PI
54#define TWO_PI 6.283185307179586476925286766559
55#endif
56#ifndef DEG_TO_RAD
57#define DEG_TO_RAD 0.017453292519943295769236907684886
58#endif
59#ifndef RAD_TO_DEG
60#define RAD_TO_DEG 57.295779513082320876798154814105
61#endif
62#ifndef radians
63#define radians(deg) ((deg) * DEG_TO_RAD)
64#endif
65#ifndef degrees
66#define degrees(rad) ((rad) * RAD_TO_DEG)
67#endif
68#ifndef sq
69#define sq(x) ((x) * (x))
70#endif
71#ifndef constrain
72#define constrain(amt, low, high) \
73 ((amt) < (low) ? (low) : ((amt) > (high) ? (high) : (amt)))
74#endif
75
76typedef uint8_t byte;
77typedef bool boolean;
78
80#ifndef PROGMEM
81#define PROGMEM
82#endif
83#define pgm_read_byte(addr) (*(const unsigned char *)(addr))
84#define pgm_read_word(addr) (*(const unsigned short *)(addr))
85#define pgm_read_dword(addr) (*(const unsigned long *)(addr))
86#define pgm_read_pointer(addr) ((void *)pgm_read_dword(addr))
87
90class __FlashStringHelper;
91#define F(string_literal) (reinterpret_cast<const __FlashStringHelper *>(string_literal))
92
94static inline uint32_t millis(void) { return HAL_GetTick(); }
95
96#ifndef STM32_ARDUINO_COMPAT_NO_DELAY
100static inline void delay(uint32_t ms) { HAL_Delay(ms); }
101#endif
102
104static inline void yield(void) {}
105
106#endif // __cplusplus
107#endif // STM32_ARDUINO_COMPAT_H_
: Header for main.c file. This file contains the common defines of the application.