9 #include "../firmware.h"
11 #define CW_PERIOD_MS 100
15 static const uint16_t Packet_cw_lookup[59][2] =
18 { 4, GCC_BINARY(0b00000000) },
20 { 6, GCC_BINARY(0b110111011111) },
22 { 6, GCC_BINARY(0b011101011101) },
26 { 7, GCC_BINARY(0b01010111010111) },
32 { 6, GCC_BINARY(0b011111111101) },
34 { 5, GCC_BINARY(0b1101111101) },
36 { 6, GCC_BINARY(0b110111110111) },
40 { 5, GCC_BINARY(0b0111011101) },
42 { 6, GCC_BINARY(0b111101011111) },
44 { 6, GCC_BINARY(0b110101010111) },
46 { 6, GCC_BINARY(0b011101110111) },
48 { 5, GCC_BINARY(0b1101011101) },
50 { 5, GCC_BINARY(0b1111111111) },
52 { 5, GCC_BINARY(0b0111111111) },
54 { 5, GCC_BINARY(0b0101111111) },
56 { 5, GCC_BINARY(0b0101011111) },
58 { 5, GCC_BINARY(0b0101010111) },
60 { 5, GCC_BINARY(0b0101010101) },
62 { 5, GCC_BINARY(0b1101010101) },
64 { 5, GCC_BINARY(0b1111010101) },
66 { 5, GCC_BINARY(0b1111110101) },
68 { 5, GCC_BINARY(0b1111111101) },
70 { 6, GCC_BINARY(0b111111010101) },
72 { 6, GCC_BINARY(0b110111011101) },
76 { 5, GCC_BINARY(0b1101010111) },
80 { 6, GCC_BINARY(0b010111110101) },
82 { 6, GCC_BINARY(0b011111011101) },
84 { 2, GCC_BINARY(0b0111) },
86 { 4, GCC_BINARY(0b11010101) },
88 { 4, GCC_BINARY(0b11011101) },
90 { 3, GCC_BINARY(0b110101) },
92 { 1, GCC_BINARY(0b01) },
94 { 4, GCC_BINARY(0b01011101) },
96 { 3, GCC_BINARY(0b111101) },
98 { 4, GCC_BINARY(0b01010101) },
100 { 2, GCC_BINARY(0b0101) },
102 { 4, GCC_BINARY(0b01111111) },
104 { 3, GCC_BINARY(0b110111) },
106 { 4, GCC_BINARY(0b01110101) },
108 { 2, GCC_BINARY(0b1111) },
110 { 2, GCC_BINARY(0b1101) },
112 { 3, GCC_BINARY(0b111111) },
114 { 4, GCC_BINARY(0b01111101) },
116 { 4, GCC_BINARY(0b11110111) },
118 { 3, GCC_BINARY(0b011101) },
120 { 3, GCC_BINARY(0b010101) },
122 { 1, GCC_BINARY(0b11) },
124 { 3, GCC_BINARY(0b010111) },
126 { 4, GCC_BINARY(0b01010111) },
128 { 3, GCC_BINARY(0b011111) },
130 { 4, GCC_BINARY(0b11010111) },
132 { 4, GCC_BINARY(0b11011111) },
134 { 4, GCC_BINARY(0b11110101) }
137 void Packet_cw_transmit_buffer(uint8_t *cw_buffer, uint32_t cw_length,
void _cw_on(
void),
void _cw_off(
void))
142 for(i=0; i<cw_length; i++)
147 if((c >= 97) && (c <= 122))
149 c = (uint8_t)(c - 32);
153 if((c < 32) || (c > 91))
159 c = (uint8_t)(c - 32);
162 j = (uint32_t)(2 * (Packet_cw_lookup[c][0] - 1));
167 switch((Packet_cw_lookup[c][1] >> j) & GCC_BINARY(0b11))
169 case GCC_BINARY(0b00):
174 case GCC_BINARY(0b01):
179 case GCC_BINARY(0b11):
void Delay_ms(uint32_t milliseconds)