-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmorse.h
38 lines (29 loc) · 802 Bytes
/
morse.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
* morse.h
*
* Created: 2012-01-10 17:02:54
* Author: pn264889
*/
#ifndef MORSE_H_
#define MORSE_H_
#include <avr/io.h>
#define MORSE_TABLE_SIZE 128
#define MORSE_CODE_SIZE 8
//spacing are defined in dits (aka dots)
#define MORSE_DIT 1
#define MORSE_DAH 3
#define MORSE_BIT_SPACE 1
#define MORSE_CHAR_SPACE 3
#define MORSE_WORD_SPACE 7
#define MORSE_MESSAGE_SPACE 30
extern const uint16_t _ditRepeat;
extern const uint16_t _dahRepeat;
extern const uint16_t _bitSpaceRepeat;
extern const uint16_t _charSpaceRepeat;
extern const uint16_t _wordSpaceRepeat;
extern const uint16_t _messageSpaceRepeat;
// extern char morseTable[MORSE_TABLE_SIZE][MORSE_CODE_SIZE];
void morseInit();
const char* getMorseString(uint8_t c);
uint8_t getMorseChar(const char *morseString);
#endif /* MORSE_H_ */