29 lines
602 B
C
29 lines
602 B
C
|
#pragma once
|
||
|
|
||
|
#include "settings.h"
|
||
|
|
||
|
// Stuff for communicating between cores
|
||
|
enum class KeyerQueueCommand {
|
||
|
Run,
|
||
|
Stop,
|
||
|
Config,
|
||
|
Wait,
|
||
|
SendMessage,
|
||
|
};
|
||
|
|
||
|
struct KeyerQueueData {
|
||
|
KeyerQueueCommand cmd;
|
||
|
uint8_t wpm;
|
||
|
Mode mode;
|
||
|
uint8_t message;
|
||
|
};
|
||
|
|
||
|
/* Calculates the WPM speed from the volt percentage */
|
||
|
uint8_t calcWPM(float percent, uint8_t wpmMin, uint8_t wpmMax);
|
||
|
|
||
|
/* Returns the voltage level in percent (3,3V == 100%) */
|
||
|
float potiRead();
|
||
|
|
||
|
// Sending bytes over USB
|
||
|
void usbSend(uint8_t itf, uint8_t buf[], uint32_t count);
|
||
|
void usbSend(uint8_t itf, uint8_t value);
|