PropWare  3.0.0.229
C++ objects and CMake build system for Parallax Propeller
PropWare.h
Go to the documentation of this file.
1 
26 #pragma once
27 
28 #ifdef ASM_OBJ_FILE
29 #include <PropWare/PropWare_asm.h>
30 #else
31 
32 #include <propeller.h>
33 
34 // FIXME: PropGCC GCCv5+ does not contain C++ headers yet; Re-enable when possible
35 #if 0 //(defined __cplusplus && __cplusplus >= 201103L)
36 #include <cstdint>
37 #include <cstdlib>
38 #include <cctype>
39 #else
40 #include <stdint.h>
41 #include <stdlib.h>
42 #include <ctype.h>
43 #endif
44 
45 #ifdef __PROPELLER_COG__
46 #define PropWare PropWare_cog
47 #endif
48 
52 namespace PropWare {
53 
54 #ifdef DAREDEVIL
55 #define check_errors(x) x
56 #else
57 #define check_errors(x) if ((err = x)) return err
58 #endif
59 
60 #define SECOND ((uint32_t) CLKFREQ)
61 #define MILLISECOND ((uint32_t) (CLKFREQ / 1000))
62 #define MICROSECOND ((uint32_t) (MILLISECOND / 1000))
63 
64 #ifdef __PROPELLER_COG__
65 #define FC_START(start, end)
66 #define FC_END(end)
67 #define FC_ADDR(to, start) to
68 #else
69 #define FC_START(start, end) \
70  " fcache #(" end " - " start ")\n\t" \
71  " .compress off\n\t" \
72  start ":\n\t"
73 #define FC_END(end) \
74  " jmp __LMM_RET\n\t" \
75  end ":\n\t" \
76  " .compress default\n\t"
77 #define FC_ADDR(to, start) "__LMM_FCACHE_START+(" to " - " start ")"
78 #endif
79 
80 typedef enum {
81  NULL_BIT = 0x0,
82  BIT_0 = 0x1,
83  BIT_1 = 0x2,
84  BIT_2 = 0x4,
85  BIT_3 = 0x8,
86  BIT_4 = 0x10,
87  BIT_5 = 0x20,
88  BIT_6 = 0x40,
89  BIT_7 = 0x80,
90  BIT_8 = 0x100,
91  BIT_9 = 0x200,
92  BIT_10 = 0x400,
93  BIT_11 = 0x800,
94  BIT_12 = 0x1000,
95  BIT_13 = 0x2000,
96  BIT_14 = 0x4000,
97  BIT_15 = 0x8000,
98  BIT_16 = 0x10000,
99  BIT_17 = 0x20000,
100  BIT_18 = 0x40000,
101  BIT_19 = 0x80000,
102  BIT_20 = 0x100000,
103  BIT_21 = 0x200000,
104  BIT_22 = 0x400000,
105  BIT_23 = 0x800000,
106  BIT_24 = 0x1000000,
107  BIT_25 = 0x2000000,
108  BIT_26 = 0x4000000,
109  BIT_27 = 0x8000000,
110  BIT_28 = 0x10000000,
111  BIT_29 = 0x20000000,
112  BIT_30 = 0x40000000,
113  BIT_31 = 0x80000000
114 } Bit;
115 
116 typedef enum {
117  NIBBLE_0 = 0xf,
118  NIBBLE_1 = 0xf0,
119  NIBBLE_2 = 0xf00,
120  NIBBLE_3 = 0xf000,
121  NIBBLE_4 = 0xf0000,
122  NIBBLE_5 = 0xf00000,
123  NIBBLE_6 = 0xf000000,
124  NIBBLE_7 = 0xf0000000
125 } Nibble;
126 
127 typedef enum {
128  BYTE_0 = 0xff,
129  BYTE_1 = 0xff00,
130  BYTE_2 = 0xff0000,
131  BYTE_3 = 0xff000000
132 } Byte;
133 
134 typedef enum {
135  WORD_0 = 0xffff,
136  WORD_1 = 0xffff0000
137 } Word;
138 
139 typedef int ErrorCode;
140 
141 }
142 
143 #endif /* ifdef ASM_OBJ_FILE */
PropWare_asm.h
Generic definitions for assembly files for the Parallax Propeller.
PropWare
Generic definitions and functions for the Parallax Propeller.
Definition: runnable.h:33