#include <qualia/core/common.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "binary.h"
Go to the source code of this file.
|
#define | true 0x1 |
|
#define | false 0x0 |
|
#define | PI 3.1415926535897932384626433832795 |
|
#define | HALF_PI 1.5707963267948966192313216916398 |
|
#define | TWO_PI 6.283185307179586476925286766559 |
|
#define | DEG_TO_RAD 0.017453292519943295769236907684886 |
|
#define | RAD_TO_DEG 57.295779513082320876798154814105 |
|
#define | min(a, b) ((a)<(b)?(a):(b)) |
|
#define | max(a, b) ((a)>(b)?(a):(b)) |
|
#define | abs(x) ((x)>=0?(x):-(x)) |
|
#define | constrain(amt, low, high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt))) |
|
#define | round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5)) |
|
#define | radians(deg) ((deg)*DEG_TO_RAD) |
|
#define | degrees(rad) ((rad)*RAD_TO_DEG) |
|
#define | sq(x) ((x)*(x)) |
|
#define | lowByte(w) ((uint8_t) ((w) & 0xff)) |
|
#define | highByte(w) ((uint8_t) ((w) >> 8)) |
|
#define | bitRead(value, bit) (((value) >> (bit)) & 0x01) |
|
#define | bitSet(value, bit) ((value) |= (1UL << (bit))) |
|
#define | bitClear(value, bit) ((value) &= ~(1UL << (bit))) |
|
#define | bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : bitClear(value, bit)) |
|
#define | bit(b) (1UL << (b)) |
|
#define abs |
( |
|
x | ) |
((x)>=0?(x):-(x)) |
#define bit |
( |
|
b | ) |
(1UL << (b)) |
#define bitClear |
( |
|
value, |
|
|
|
bit |
|
) |
| ((value) &= ~(1UL << (bit))) |
#define bitRead |
( |
|
value, |
|
|
|
bit |
|
) |
| (((value) >> (bit)) & 0x01) |
#define bitSet |
( |
|
value, |
|
|
|
bit |
|
) |
| ((value) |= (1UL << (bit))) |
#define constrain |
( |
|
amt, |
|
|
|
low, |
|
|
|
high |
|
) |
| ((amt)<(low)?(low):((amt)>(high)?(high):(amt))) |
#define DEG_TO_RAD 0.017453292519943295769236907684886 |
#define HALF_PI 1.5707963267948966192313216916398 |
#define highByte |
( |
|
w | ) |
((uint8_t) ((w) >> 8)) |
#define lowByte |
( |
|
w | ) |
((uint8_t) ((w) & 0xff)) |
#define max |
( |
|
a, |
|
|
|
b |
|
) |
| ((a)>(b)?(a):(b)) |
#define min |
( |
|
a, |
|
|
|
b |
|
) |
| ((a)<(b)?(a):(b)) |
#define PI 3.1415926535897932384626433832795 |
#define RAD_TO_DEG 57.295779513082320876798154814105 |
#define round |
( |
|
x | ) |
((x)>=0?(long)((x)+0.5):(long)((x)-0.5)) |
#define sq |
( |
|
x | ) |
((x)*(x)) |
This is a port of the Arduino.h file from the Arduino distribution. It ports some of the basic functionalities of the Arduino, making them available on non-Arduino AVR as well as computer platforms.
#define TWO_PI 6.283185307179586476925286766559 |
typedef unsigned int word |
void delay |
( |
unsigned |
long | ) |
|
void delayMicroseconds |
( |
unsigned int |
us | ) |
|
unsigned long micros |
( |
void |
| ) |
|
unsigned long millis |
( |
void |
| ) |
|