Prusa MINI Firmware overview
|
Go to the documentation of this file.
19 #ifndef _WIRING_CONSTANTS_
20 #define _WIRING_CONSTANTS_
32 #define abs(x) ((x) > 0 ? (x) : -(x))
36 #define min(a, b) ((a) < (b) ? (a) : (b))
40 #define max(a, b) ((a) > (b) ? (a) : (b))
48 #define INPUT_PULLUP 0x2
50 #define INPUT_FLOATING INPUT
51 #define INPUT_PULLDOWN 0x3
52 #define INPUT_ANALOG 0x4
53 #define OUTPUT_OPEN_DRAIN 0x5
55 #define PI 3.1415926535897932384626433832795
56 #define HALF_PI 1.5707963267948966192313216916398
57 #define TWO_PI 6.283185307179586476925286766559
58 #define DEG_TO_RAD 0.017453292519943295769236907684886
59 #define RAD_TO_DEG 57.295779513082320876798154814105
60 #define EULER 2.718281828459045235360287471352
79 #define constrain(amt, low, high) ((amt) < (low) ? (low) : ((amt) > (high) ? (high) : (amt)))
81 #define radians(deg) ((deg)*DEG_TO_RAD)
82 #define degrees(rad) ((rad)*RAD_TO_DEG)
83 #define sq(x) ((x) * (x))
85 #define interrupts() __enable_irq()
86 #define noInterrupts() __disable_irq()
88 #define lowByte(w) ((uint8_t)((w)&0xff))
89 #define highByte(w) ((uint8_t)((w) >> 8))
91 #define bitRead(value, bit) (((value) >> (bit)) & 0x01)
92 #define bitSet(value, bit) ((value) |= (1UL << (bit)))
93 #define bitClear(value, bit) ((value) &= ~(1UL << (bit)))
94 #define bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : bitClear(value, bit))
96 #define bit(b) (1UL << (b))
99 #define _BV(bit) (1 << (bit))
102 #define cbi(reg, bitmask) *reg &= ~bitmask
105 #define sbi(reg, bitmask) *reg |= bitmask
Definition: wiring_constants.h:66
bool boolean __attribute__((deprecated))
Definition: wiring_constants.h:110
#define max(a, b)
Definition: wiring_constants.h:40
BitOrder
Definition: wiring_constants.h:65
#define min(a, b)
Definition: wiring_constants.h:36
Definition: wiring_constants.h:67
const uint8_t[]
Definition: 404_html.c:3
unsigned int word
Definition: wiring_constants.h:108
uint8_t byte
Definition: wiring_constants.h:112