Skip to content

Commit

Permalink
Add receiver gain compilation options
Browse files Browse the repository at this point in the history
  • Loading branch information
juribeparada committed Jul 17, 2018
1 parent 6729d23 commit 46ba5cc
Show file tree
Hide file tree
Showing 15 changed files with 141 additions and 3 deletions.
10 changes: 9 additions & 1 deletion ADF7021.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,15 @@ void CIO::ifConf(MMDVM_STATE modemState, bool reset)
Send_AD7021_control();

// AGC (auto, defaults) (9)
AD7021_control_word = 0x000231E9;
#if defined(AD7021_GAIN_AUTO)
AD7021_control_word = 0x000231E9; // AGC ON, normal operation
#elif defined(AD7021_GAIN_AUTO_LIN)
AD7021_control_word = 0x100231E9; // AGC ON, LNA high linearity
#elif defined(AD7021_GAIN_LOW)
AD7021_control_word = 0x120631E9; // AGC OFF, low gain, LNA high linearity
#elif defined(AD7021_GAIN_HIGH)
AD7021_control_word = 0x00A631E9; // AGC OFF, high gain
#endif
Send_AD7021_control();

// AFC (10)
Expand Down
4 changes: 2 additions & 2 deletions ADF7021.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ www.analog.com/media/en/technical-documentation/data-sheets/ADF7021.pdf

// Post demodulator bandwith (REG 04)
#define ADF7021_POST_BW_DSTAR 10U
#define ADF7021_POST_BW_DMR 150U
#define ADF7021_POST_BW_DMR 80U
#define ADF7021_POST_BW_YSF 20U
#define ADF7021_POST_BW_P25 6U
#define ADF7021_POST_BW_NXDN 7U
Expand Down Expand Up @@ -219,7 +219,7 @@ www.analog.com/media/en/technical-documentation/data-sheets/ADF7021.pdf

// Post demodulator bandwith (REG 04)
#define ADF7021_POST_BW_DSTAR 10U
#define ADF7021_POST_BW_DMR 150U
#define ADF7021_POST_BW_DMR 80U
#define ADF7021_POST_BW_YSF 20U
#define ADF7021_POST_BW_P25 6U
#define ADF7021_POST_BW_NXDN 8U
Expand Down
10 changes: 10 additions & 0 deletions Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@
// For 12.2880 MHz:
// #define ADF7021_12_2880

// Configure receiver gain for ADF7021
// AGC automatic, default settings:
#define AD7021_GAIN_AUTO
// AGC automatic with high LNA linearity:
// #define AD7021_GAIN_AUTO_LIN
// AGC OFF, lowest gain:
// #define AD7021_GAIN_LOW
// AGC OFF, highest gain:
// #define AD7021_GAIN_HIGH

// Host communication selection:
// #define STM32_USART1_HOST
#define STM32_USB_HOST
Expand Down
10 changes: 10 additions & 0 deletions configs/MMDVM_HS_Dual_Hat-12mhz.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@
// For 12.2880 MHz:
#define ADF7021_12_2880

// Configure receiver gain for ADF7021
// AGC automatic, default settings:
#define AD7021_GAIN_AUTO
// AGC automatic with high LNA linearity:
// #define AD7021_GAIN_AUTO_LIN
// AGC OFF, lowest gain:
// #define AD7021_GAIN_LOW
// AGC OFF, highest gain:
// #define AD7021_GAIN_HIGH

// Host communication selection:
#define STM32_USART1_HOST
// #define STM32_USB_HOST
Expand Down
10 changes: 10 additions & 0 deletions configs/MMDVM_HS_Dual_Hat.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@
// For 12.2880 MHz:
// #define ADF7021_12_2880

// Configure receiver gain for ADF7021
// AGC automatic, default settings:
#define AD7021_GAIN_AUTO
// AGC automatic with high LNA linearity:
// #define AD7021_GAIN_AUTO_LIN
// AGC OFF, lowest gain:
// #define AD7021_GAIN_LOW
// AGC OFF, highest gain:
// #define AD7021_GAIN_HIGH

// Host communication selection:
#define STM32_USART1_HOST
// #define STM32_USB_HOST
Expand Down
10 changes: 10 additions & 0 deletions configs/MMDVM_HS_Hat-12mhz.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@
// For 12.2880 MHz:
#define ADF7021_12_2880

// Configure receiver gain for ADF7021
// AGC automatic, default settings:
#define AD7021_GAIN_AUTO
// AGC automatic with high LNA linearity:
// #define AD7021_GAIN_AUTO_LIN
// AGC OFF, lowest gain:
// #define AD7021_GAIN_LOW
// AGC OFF, highest gain:
// #define AD7021_GAIN_HIGH

// Host communication selection:
#define STM32_USART1_HOST
// #define STM32_USB_HOST
Expand Down
10 changes: 10 additions & 0 deletions configs/MMDVM_HS_Hat.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@
// For 12.2880 MHz:
// #define ADF7021_12_2880

// Configure receiver gain for ADF7021
// AGC automatic, default settings:
#define AD7021_GAIN_AUTO
// AGC automatic with high LNA linearity:
// #define AD7021_GAIN_AUTO_LIN
// AGC OFF, lowest gain:
// #define AD7021_GAIN_LOW
// AGC OFF, highest gain:
// #define AD7021_GAIN_HIGH

// Host communication selection:
#define STM32_USART1_HOST
// #define STM32_USB_HOST
Expand Down
10 changes: 10 additions & 0 deletions configs/NanoDV.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@
// For 12.2880 MHz:
#define ADF7021_12_2880

// Configure receiver gain for ADF7021
// AGC automatic, default settings:
#define AD7021_GAIN_AUTO
// AGC automatic with high LNA linearity:
// #define AD7021_GAIN_AUTO_LIN
// AGC OFF, lowest gain:
// #define AD7021_GAIN_LOW
// AGC OFF, highest gain:
// #define AD7021_GAIN_HIGH

// Host communication selection:
#define STM32_USART1_HOST
// #define STM32_USB_HOST
Expand Down
10 changes: 10 additions & 0 deletions configs/Nano_hotSPOT.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@
// For 12.2880 MHz:
// #define ADF7021_12_2880

// Configure receiver gain for ADF7021
// AGC automatic, default settings:
#define AD7021_GAIN_AUTO
// AGC automatic with high LNA linearity:
// #define AD7021_GAIN_AUTO_LIN
// AGC OFF, lowest gain:
// #define AD7021_GAIN_LOW
// AGC OFF, highest gain:
// #define AD7021_GAIN_HIGH

// Host communication selection:
#define STM32_USART1_HOST
// #define STM32_USB_HOST
Expand Down
10 changes: 10 additions & 0 deletions configs/ZUMspot_Libre.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@
// For 12.2880 MHz:
// #define ADF7021_12_2880

// Configure receiver gain for ADF7021
// AGC automatic, default settings:
#define AD7021_GAIN_AUTO
// AGC automatic with high LNA linearity:
// #define AD7021_GAIN_AUTO_LIN
// AGC OFF, lowest gain:
// #define AD7021_GAIN_LOW
// AGC OFF, highest gain:
// #define AD7021_GAIN_HIGH

// Host communication selection:
// #define STM32_USART1_HOST
#define STM32_USB_HOST
Expand Down
10 changes: 10 additions & 0 deletions configs/ZUMspot_RPi.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@
// For 12.2880 MHz:
// #define ADF7021_12_2880

// Configure receiver gain for ADF7021
// AGC automatic, default settings:
#define AD7021_GAIN_AUTO
// AGC automatic with high LNA linearity:
// #define AD7021_GAIN_AUTO_LIN
// AGC OFF, lowest gain:
// #define AD7021_GAIN_LOW
// AGC OFF, highest gain:
// #define AD7021_GAIN_HIGH

// Host communication selection:
#define STM32_USART1_HOST
// #define STM32_USB_HOST
Expand Down
10 changes: 10 additions & 0 deletions configs/ZUMspot_USB.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@
// For 12.2880 MHz:
// #define ADF7021_12_2880

// Configure receiver gain for ADF7021
// AGC automatic, default settings:
#define AD7021_GAIN_AUTO
// AGC automatic with high LNA linearity:
// #define AD7021_GAIN_AUTO_LIN
// AGC OFF, lowest gain:
// #define AD7021_GAIN_LOW
// AGC OFF, highest gain:
// #define AD7021_GAIN_HIGH

// Host communication selection:
// #define STM32_USART1_HOST
#define STM32_USB_HOST
Expand Down
10 changes: 10 additions & 0 deletions configs/ZUMspot_duplex.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@
// For 12.2880 MHz:
// #define ADF7021_12_2880

// Configure receiver gain for ADF7021
// AGC automatic, default settings:
#define AD7021_GAIN_AUTO
// AGC automatic with high LNA linearity:
// #define AD7021_GAIN_AUTO_LIN
// AGC OFF, lowest gain:
// #define AD7021_GAIN_LOW
// AGC OFF, highest gain:
// #define AD7021_GAIN_HIGH

// Host communication selection:
// #define STM32_USART1_HOST
#define STM32_USB_HOST
Expand Down
10 changes: 10 additions & 0 deletions configs/generic_duplex_gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@
// For 12.2880 MHz:
// #define ADF7021_12_2880

// Configure receiver gain for ADF7021
// AGC automatic, default settings:
#define AD7021_GAIN_AUTO
// AGC automatic with high LNA linearity:
// #define AD7021_GAIN_AUTO_LIN
// AGC OFF, lowest gain:
// #define AD7021_GAIN_LOW
// AGC OFF, highest gain:
// #define AD7021_GAIN_HIGH

// Host communication selection:
#define STM32_USART1_HOST
// #define STM32_USB_HOST
Expand Down
10 changes: 10 additions & 0 deletions configs/generic_gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@
// For 12.2880 MHz:
// #define ADF7021_12_2880

// Configure receiver gain for ADF7021
// AGC automatic, default settings:
#define AD7021_GAIN_AUTO
// AGC automatic with high LNA linearity:
// #define AD7021_GAIN_AUTO_LIN
// AGC OFF, lowest gain:
// #define AD7021_GAIN_LOW
// AGC OFF, highest gain:
// #define AD7021_GAIN_HIGH

// Host communication selection:
#define STM32_USART1_HOST
// #define STM32_USB_HOST
Expand Down

0 comments on commit 46ba5cc

Please sign in to comment.