dtmf_dolphin_dialer_tones.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #pragma once
  2. #include <stdint.h>
  3. #define DTMF_DOLPHIN_DIALER_TONE_COUNT 16
  4. typedef struct DTMFDolphinDialerTonePos {
  5. const uint8_t row;
  6. const uint8_t col;
  7. const uint8_t span;
  8. } DTMFDolphinDialerTonePos;
  9. typedef struct {
  10. const char *name;
  11. const float frequency_1;
  12. const float frequency_2;
  13. const struct DTMFDolphinDialerTonePos pos;
  14. } DTMFDolphinDialerTones;
  15. /* Via https://en.wikipedia.org/wiki/Dual-tone_multi-frequency_signaling
  16. 1209 Hz 1336 Hz 1477 Hz 1633 Hz
  17. 697 Hz 1 2 3 A
  18. 770 Hz 4 5 6 B
  19. 852 Hz 7 8 9 C
  20. 941 Hz * 0 # D */
  21. static const DTMFDolphinDialerTones dtmf_dolphin_dialer_tone[DTMF_DOLPHIN_DIALER_TONE_COUNT] = {
  22. {"1", 697.0, 1209.0, {0, 0, 1}},
  23. {"2", 697.0, 1336.0, {0, 1, 1}},
  24. {"3", 697.0, 1477.0, {0, 2, 1}},
  25. {"A", 697.0, 1633.0, {0, 3, 1}},
  26. {"4", 770.0, 1209.0, {1, 0, 1}},
  27. {"5", 770.0, 1336.0, {1, 1, 1}},
  28. {"6", 770.0, 1477.0, {1, 2, 1}},
  29. {"B", 770.0, 1633.0, {1, 3, 1}},
  30. {"7", 852.0, 1209.0, {2, 0, 1}},
  31. {"8", 852.0, 1336.0, {2, 1, 1}},
  32. {"9", 852.0, 1477.0, {2, 2, 1}},
  33. {"C", 852.0, 1633.0, {2, 3, 1}},
  34. {"*", 941.0, 1209.0, {3, 0, 1}},
  35. {"0", 941.0, 1336.0, {3, 1, 1}},
  36. {"#", 941.0, 1477.0, {3, 2, 1}},
  37. {"D", 941.0, 1633.0, {3, 3, 1}},
  38. };