Skip to content

Commit

Permalink
convert documentation format to Doxygen;
Browse files Browse the repository at this point in the history
  • Loading branch information
gatekeep committed Jul 3, 2024
1 parent 7840a3d commit 994c348
Show file tree
Hide file tree
Showing 54 changed files with 2,532 additions and 2,136 deletions.
142 changes: 48 additions & 94 deletions ADF7021.cpp
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
// SPDX-License-Identifier: GPL-2.0-only
/**
* Digital Voice Modem - Hotspot Firmware
* GPLv2 Open Source. Use is subject to license terms.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* @package DVM / Hotspot Firmware
* @derivedfrom MMDVM_HS (https://github.com/g4klx/MMDVM_HS)
* @license GPLv2 License (https://opensource.org/licenses/GPL-2.0)
*
* Copyright (C) 2020,2021 Jonathan Naylor, G4KLX
* Copyright (C) 2016 Jim McLaughlin, KI6ZUM
* Copyright (C) 2016,2017,2018,2019,2020 Andy Uribe, CA6JAU
* Copyright (C) 2017 Danilo, DB4PLE
* Copyright (C) 2021 Bryan Biedenkapp, N2PLL
*
*/
/*
* Digital Voice Modem - Hotspot Firmware
* GPLv2 Open Source. Use is subject to license terms.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright (C) 2020,2021 Jonathan Naylor, G4KLX
* Copyright (C) 2016 Jim McLaughlin, KI6ZUM
* Copyright (C) 2016,2017,2018,2019,2020 Andy Uribe, CA6JAU
* Copyright (C) 2017 Danilo, DB4PLE
* Copyright (C) 2021 Bryan Biedenkapp, N2PLL
*
*/
#include <math.h>

#include "Globals.h"
Expand Down Expand Up @@ -74,9 +70,8 @@ uint8_t m_afcRange;
// Global Functions
// ---------------------------------------------------------------------------

/// <summary>
///
/// </summary>
/* */

static void AD7021_IOCTL_Shift()
{
for (int i = 31; i >= 0; i--) {
Expand All @@ -95,20 +90,17 @@ static void AD7021_IOCTL_Shift()
io.SDATA(LOW);
}

/// <summary>
///
/// </summary>
/* */

static void AD7021_IOCTL_SLEPulse()
{
io.SLE1(HIGH);
io.delayBit();
io.SLE1(LOW);
}

/// <summary>
///
/// </summary>
/// <param name="doSle"></param>
/* */

static void AD7021_1_IOCTL(bool doSle = true)
{
AD7021_IOCTL_Shift();
Expand All @@ -118,20 +110,17 @@ static void AD7021_1_IOCTL(bool doSle = true)
}

#if defined(DUPLEX)
/// <summary>
///
/// </summary>
/* */

static void AD7021_2_IOCTL_SLEPulse()
{
io.SLE2(HIGH);
io.delayBit();
io.SLE2(LOW);
}

/// <summary>
///
/// </summary>
/// <param name="doSle"></param>
/* */

static void AD7021_2_IOCTL(bool doSle = true)
{
AD7021_IOCTL_Shift();
Expand All @@ -145,9 +134,8 @@ static void AD7021_2_IOCTL(bool doSle = true)
// Public Class Members
// ---------------------------------------------------------------------------

/// <summary>
/// Hardware interrupt handler.
/// </summary>
/* Hardware interrupt handler. */

void IO::interrupt1()
{
uint8_t bit = 0U;
Expand Down Expand Up @@ -256,9 +244,8 @@ void IO::interrupt1()
}

#if defined(DUPLEX)
/// <summary>
/// Hardware interrupt handler.
/// </summary>
/* Hardware interrupt handler. */

void IO::interrupt2()
{
uint8_t bit = 0U;
Expand All @@ -276,11 +263,8 @@ void IO::interrupt2()
}
#endif

/// <summary>
/// Sets the ADF7021 RF configuration.
/// </summary>
/// <param name="modemState"></param>
/// <param name="reset"></param>
/* Sets the ADF7021 RF configuration. */

void IO::rf1Conf(DVM_STATE modemState, bool reset)
{
uint32_t txFrequencyTmp, rxFrequencyTmp;
Expand Down Expand Up @@ -482,11 +466,8 @@ void IO::rf1Conf(DVM_STATE modemState, bool reset)
}

#if defined(DUPLEX)
/// <summary>
/// Sets the ADF7021 RF configuration.
/// </summary>
/// <param name="modemState"></param>
/// <param name="reset"></param>
/* Sets the ADF7021 RF configuration. */

void IO::rf2Conf(DVM_STATE modemState)
{
DEBUG3("IO::rf2Conf() ADF2 (Rx); modemState/rxGain", modemState, m_gainMode);
Expand Down Expand Up @@ -609,30 +590,17 @@ void IO::rf2Conf(DVM_STATE modemState)
}
#endif // DUPLEX

/// <summary>
///
/// </summary>
/// <param name="dmrTXLevel"></param>
/// <param name="p25TXLevel"></param>
/// <param name="nxdnTXLevel"></param>
/* Sets the deviation levels. */

void IO::setDeviations(uint8_t dmrTXLevel, uint8_t p25TXLevel, uint8_t nxdnTXLevel)
{
dmrDev = uint16_t((ADF7021_DEV_DMR * uint16_t(dmrTXLevel)) / 128U);
p25Dev = uint16_t((ADF7021_DEV_P25 * uint16_t(p25TXLevel)) / 128U);
nxdnDev = uint16_t((ADF7021_DEV_NXDN * uint16_t(nxdnTXLevel)) / 128U);
}

/// <summary>
/// Sets the RF adjustment parameters.
/// </summary>
/// <param name="dmrDevAdj"></param>
/// <param name="p25DevAdj"></param>
/// <param name="dmrDiscBWAdj"></param>
/// <param name="p25DiscBWAdj"></param>
/// <param name="nxdnDiscBWAdj"></param>
/// <param name="dmrPostBWAdj"></param>
/// <param name="p25PostBWAdj"></param>
/// <param name="nxdnPostBWAdj"></param>
/* Sets the RF adjustment parameters. */

void IO::setRFAdjust(int8_t dmrDiscBWAdj, int8_t p25DiscBWAdj, int8_t nxdnDiscBWAdj, int8_t dmrPostBWAdj, int8_t p25PostBWAdj, int8_t nxdnPostBWADJ)
{
m_dmrDiscBWAdj = dmrDiscBWAdj;
Expand All @@ -646,13 +614,8 @@ void IO::setRFAdjust(int8_t dmrDiscBWAdj, int8_t p25DiscBWAdj, int8_t nxdnDiscBW
DEBUG4("IO::setRFAdjust() RF adjustment, postBW", dmrPostBWAdj, p25PostBWAdj, nxdnPostBWADJ);
}

/// <summary>
/// Sets the RF AFC parameters.
/// </summary>
/// <param name="afcEnable"></param>
/// <param name="afcKI"></param>
/// <param name="afcKP"></param>
/// <param name="afcRange"></param>
/* Sets the RF AFC parameters. */

void IO::setAFCParams(bool afcEnable, uint8_t afcKI, uint8_t afcKP, uint8_t afcRange)
{
m_afcEnable = afcEnable;
Expand All @@ -663,9 +626,8 @@ void IO::setAFCParams(bool afcEnable, uint8_t afcKI, uint8_t afcKP, uint8_t afcR
DEBUG5("IO::setAFCParams() AFC params", afcEnable, afcKI, afcKP, afcRange);
}

/// <summary>
///
/// </summary>
/* */

void IO::updateCal(DVM_STATE modemState)
{
uint32_t ADF7021_REG2;
Expand Down Expand Up @@ -726,10 +688,8 @@ void IO::updateCal(DVM_STATE modemState)
setRX();
}

/// <summary>
///
/// </summary>
/// <returns></returns>
/* */

uint16_t IO::readRSSI()
{
uint32_t AD7021_RB;
Expand Down Expand Up @@ -818,9 +778,8 @@ uint16_t IO::readRSSI()
// Private Class Members
// ---------------------------------------------------------------------------

/// <summary>
///
/// </summary>
/* */

void IO::configureBand()
{
/*
Expand Down Expand Up @@ -890,10 +849,8 @@ void IO::configureBand()
DEBUG3("IO::configureBand() ADF freq band; reg1/f_div", ADF7021_REG1, f_div);
}

/// <summary>
///
/// </summary>
/// <param name="modemState"></param>
/* */

void IO::configureTxRx(DVM_STATE modemState)
{
uint16_t dmrDiscBW = ADF7021_DISC_BW_DMR, dmrPostBW = ADF7021_POST_BW_DMR;
Expand Down Expand Up @@ -1375,9 +1332,8 @@ void IO::configureTxRx(DVM_STATE modemState)
(uint16_t)((ADF7021_PFD * p25Dev) / (f_div * 65536)), (uint16_t)((ADF7021_PFD * nxdnDev) / (f_div * 65536)), m_rfPower);
}

/// <summary>
///
/// </summary>
/* */

void IO::setTX()
{
// PTT pin on (doing it earlier helps to measure timing impact)
Expand All @@ -1396,10 +1352,8 @@ void IO::setTX()
while(CLK());
}

/// <summary>
///
/// </summary>
/// <param name="doSle"></param>
/* */

void IO::setRX(bool doSle)
{
// PTT pin off (doing it earlier helps to measure timing impact)
Expand Down
36 changes: 21 additions & 15 deletions ADF7021.h
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Digital Voice Modem - Hotspot Firmware
* GPLv2 Open Source. Use is subject to license terms.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright (C) 2020 Jonathan Naylor, G4KLX
* Copyright (C) 2016 Jim McLaughlin, KI6ZUM
* Copyright (C) 2016,2017,2018 Andy Uribe, CA6JAU
* Copyright (C) 2017 Danilo, DB4PLE
* Copyright (C) 2021 Bryan Biedenkapp, N2PLL
*
*/
/**
* Digital Voice Modem - Hotspot Firmware
* GPLv2 Open Source. Use is subject to license terms.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* @package DVM / Hotspot Firmware
* @derivedfrom MMDVM_HS (https://github.com/g4klx/MMDVM_HS)
* @license GPLv2 License (https://opensource.org/licenses/GPL-2.0)
*
* Copyright (C) 2020 Jonathan Naylor, G4KLX
* Copyright (C) 2016 Jim McLaughlin, KI6ZUM
* Copyright (C) 2016,2017,2018 Andy Uribe, CA6JAU
* Copyright (C) 2017 Danilo, DB4PLE
* Copyright (C) 2021 Bryan Biedenkapp, N2PLL
*
*/
* @file ADF7021.h
* @ingroup hotspot_fw
*/
#if !defined(__ADF7021_H__)
#define __ADF7021_H__

Expand All @@ -24,6 +24,11 @@
// Constants
// ---------------------------------------------------------------------------

/**
* @addtogroup hotspot_fw
* @{
*/

#define LOW 0
#define HIGH 1

Expand Down Expand Up @@ -312,4 +317,5 @@
#endif // ADF7021_N_VER

#endif // ENABLE_ADF7021
/** @} */
#endif // __ADF7021_H__
Loading

0 comments on commit 994c348

Please sign in to comment.