File syn_defs.h¶
FileList > common > syn_defs.h
Go to the source code of this file
Common type definitions and status codes for SyntropicOS. More...
#include <stddef.h>#include <stdint.h>
Public Types¶
| Type | Name |
|---|---|
| enum | SYN_GPIO_Mode GPIO pin mode / direction. |
| typedef uint16_t | SYN_GPIO_Pin Abstract GPIO pin identifier. |
| enum | SYN_GPIO_State Logical state of a GPIO pin. |
| enum | SYN_Status Return status used by all SyntropicOS functions. |
| typedef uint8_t | SYN_UARTInstance Identifies a UART peripheral instance (0, 1, 2, …). |
| enum | bool C99 bool fallback for pre-C99 compilers. |
Macros¶
| Type | Name |
|---|---|
| define | SYN_ABS (x) (((x) < 0) ? -(x) : (x)) |
| define | SYN_ARRAY_SIZE (arr) (sizeof(arr) / sizeof((arr)[0])) |
| define | SYN_CLAMP (val, lo, hi) (((val) < (lo)) ? (lo) : (((val) > (hi)) ? (hi) : (val))) |
| define | SYN_MAX (a, b) (((a) > (b)) ? (a) : (b))Maximum of two values. |
| define | SYN_MIN (a, b) (((a) < (b)) ? (a) : (b))Minimum of two values. |
| define | SYN_SIGN (x) (((x) > 0) - ((x) < 0)) |
| define | SYN_UNUSED_VAR (x) ((void)(x)) |
Detailed Description¶
This header is included by virtually every other SyntropicOS file. It provides the fundamental types, enumerations, and constants used throughout the library.
Public Types Documentation¶
enum SYN_GPIO_Mode¶
GPIO pin mode / direction.
enum SYN_GPIO_Mode {
SYN_GPIO_INPUT = 0,
SYN_GPIO_OUTPUT = 1,
SYN_GPIO_INPUT_PULLUP = 2,
SYN_GPIO_INPUT_PULLDOWN = 3,
SYN_GPIO_OUTPUT_OD = 4
};
typedef SYN_GPIO_Pin¶
Abstract GPIO pin identifier.
The meaning of this value is platform-specific. It may encode a port+pin pair, a flat pin number, or any scheme the port layer defines.
enum SYN_GPIO_State¶
Logical state of a GPIO pin.
enum SYN_Status¶
Return status used by all SyntropicOS functions.
enum SYN_Status {
SYN_OK = 0,
SYN_ERROR = -1,
SYN_BUSY = -2,
SYN_TIMEOUT = -3,
SYN_INVALID_PARAM = -4,
SYN_NOT_IMPLEMENTED = -5
};
typedef SYN_UARTInstance¶
Identifies a UART peripheral instance (0, 1, 2, …).
enum bool¶
C99 bool fallback for pre-C99 compilers.
Macro Definition Documentation¶
define SYN_ABS¶
Absolute value
define SYN_ARRAY_SIZE¶
Number of elements in a statically-allocated array.
define SYN_CLAMP¶
Clamp value to [lo, hi]
define SYN_MAX¶
Maximum of two values.
define SYN_MIN¶
Minimum of two values.
define SYN_SIGN¶
Sign: returns -1, 0, or +1
define SYN_UNUSED_VAR¶
Suppress unused-variable warnings.
The documentation for this class was generated from the following file src/syntropic/common/syn_defs.h