|
|
|
#ifndef FUNCTIONS_H_INCLUDED
|
|
|
|
#define FUNCTIONS_H_INCLUDED
|
|
|
|
|
|
|
|
#include "main.h"
|
|
|
|
|
|
|
|
#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
|
|
|
|
|
|
|
|
uint8_t sreg_tmp;
|
|
|
|
|
|
|
|
// Prototypes
|
|
|
|
void SymbolLoop(uint8_t Len);
|
|
|
|
uint8_t ReadKeyPin(uint8_t pin);
|
|
|
|
void CheckPaddles(void);
|
|
|
|
void SetRatio(uint8_t WpMCorrectFactor);
|
|
|
|
void DitDahBuffers(void);
|
|
|
|
|
|
|
|
void SendDit(void);
|
|
|
|
void SendDah(void);
|
|
|
|
void SendIambic(void);
|
|
|
|
// Sidetone
|
|
|
|
void SideToneOn(void);
|
|
|
|
void SideToneOff(void);
|
|
|
|
void Tone(uint16_t f, uint8_t duration);
|
|
|
|
void Boop(void);
|
|
|
|
void Beep(void);
|
|
|
|
void BeepBoop(void);
|
|
|
|
// Interrupt
|
|
|
|
void IntDisable(void);
|
|
|
|
void IntEnable(void);
|
|
|
|
void DisablePinChangeIRQ(void);
|
|
|
|
void EnablePinChangeIRQ(void);
|
|
|
|
// EEPROM
|
|
|
|
void WriteEEprom(void);
|
|
|
|
void ReadEEprom(void);
|
|
|
|
void WriteEEpromWpM(void);
|
|
|
|
void ReadEEpromWpM(void);
|
|
|
|
void SetEEprom(void);
|
|
|
|
// Serielle Schnittstelle
|
|
|
|
void SerialWriteString(char *s);
|
|
|
|
void SerialWriteChar(unsigned char data);
|
|
|
|
void SerialInfo(void);
|
|
|
|
void SerialAbout(void);
|
|
|
|
// Delay Millis
|
|
|
|
void DelayMilliSeconds(uint16_t ms);
|
|
|
|
void ResetMilliSeconds(void);
|
|
|
|
uint16_t GetMilliSeconds(void);
|
|
|
|
#endif
|