spectrum_analyzer.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #define NUM_CHANNELS 132
  2. #define NUM_CHUNKS 6
  3. #define CHUNK_SIZE (NUM_CHANNELS / NUM_CHUNKS)
  4. // Screen coordinates
  5. #define FREQ_BOTTOM_Y 50
  6. #define FREQ_START_X 14
  7. // How many channels displayed on the scale (On screen still 218)
  8. #define FREQ_LENGTH_X 102
  9. // dBm threshold to show peak value
  10. #define PEAK_THRESHOLD -85
  11. /*
  12. * ultrawide mode: 80 MHz on screen, 784 kHz per channel
  13. * wide mode (default): 20 MHz on screen, 196 kHz per channel
  14. * narrow mode: 4 MHz on screen, 39 kHz per channel
  15. * ultranarrow mode: 2 MHz on screen, 19 kHz per channel
  16. * precise mode: 400 KHz on screen, 3.92 kHz per channel
  17. */
  18. #define WIDE 0
  19. #define NARROW 1
  20. #define ULTRAWIDE 2
  21. #define ULTRANARROW 3
  22. #define PRECISE 4
  23. /* channel spacing in Hz */
  24. #define WIDE_SPACING 196078
  25. #define NARROW_SPACING 39215
  26. #define ULTRAWIDE_SPACING 784313
  27. #define ULTRANARROW_SPACING 19607
  28. #define PRECISE_SPACING 3921
  29. /* vertical scrolling */
  30. #define VERTICAL_SHORT_STEP 16
  31. #define MAX_VSCROLL 120
  32. #define MIN_VSCROLL 0
  33. #define DEFAULT_VSCROLL 48
  34. /* frequencies in KHz */
  35. #define DEFAULT_FREQ 440000
  36. #define WIDE_STEP 5000
  37. #define NARROW_STEP 1000
  38. #define ULTRAWIDE_STEP 20000
  39. #define ULTRANARROW_STEP 500
  40. #define PRECISE_STEP 100
  41. /* margin in KHz */
  42. #define WIDE_MARGIN 13000
  43. #define NARROW_MARGIN 3000
  44. #define ULTRAWIDE_MARGIN 42000
  45. #define ULTRANARROW_MARGIN 1000
  46. #define PRECISE_MARGIN 200
  47. /* frequency bands supported by device */
  48. #define BAND_300 0
  49. #define BAND_400 1
  50. #define BAND_900 2
  51. /* band limits in KHz */
  52. #define MIN_300 281000
  53. #define CEN_300 315000
  54. #define MAX_300 361000
  55. #define MIN_400 378000
  56. #define CEN_400 435000
  57. #define MAX_400 481000
  58. #define MIN_900 749000
  59. #define CEN_900 855000
  60. #define MAX_900 962000
  61. /* band transition points in KHz */
  62. #define EDGE_400 369000
  63. #define EDGE_900 615000
  64. /* VCO transition points in Hz */
  65. #define MID_300 318000000
  66. #define MID_400 424000000
  67. #define MID_900 848000000
  68. #define UPPER(a, b, c) ((((a) - (b) + ((c) / 2)) / (c)) * (c))
  69. #define LOWER(a, b, c) ((((a) + (b)) / (c)) * (c))
  70. /* Modulation references */
  71. #define DEFAULT_MODULATION 0
  72. #define NARROW_MODULATION 1