You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
103 lines
2.4 KiB
103 lines
2.4 KiB
// 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) 2009-2015 Jonathan Naylor, G4KLX
|
|
* Copyright (C) 2016 Colin Durbridge, G4EML
|
|
* Copyright (C) 2018 Andy Uribe, CA6JAU
|
|
*
|
|
*/
|
|
/**
|
|
* @file CalDMR.h
|
|
* @ingroup dmr_hfw
|
|
* @file CalDMR.cpp
|
|
* @ingroup dmr_hfw
|
|
*/
|
|
#if !defined(__CAL_DMR_H__)
|
|
#define __CAL_DMR_H__
|
|
|
|
#include "Defines.h"
|
|
#include "dmr/DMRDefines.h"
|
|
|
|
namespace dmr
|
|
{
|
|
// ---------------------------------------------------------------------------
|
|
// Constants
|
|
// ---------------------------------------------------------------------------
|
|
|
|
/**
|
|
* @brief Calibration States
|
|
* @ingroup dmr_mfw
|
|
*/
|
|
enum DMR1KCAL {
|
|
DMRCAL1K_IDLE, //! Idle
|
|
DMRCAL1K_VH, //! Voice Header
|
|
DMRCAL1K_VOICE, //! Voice
|
|
DMRCAL1K_VT, //! Voice Terminator
|
|
DMRCAL1K_WAIT //!
|
|
};
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// Class Declaration
|
|
// ---------------------------------------------------------------------------
|
|
|
|
/**
|
|
* @brief Implements logic for DMR calibration mode.
|
|
* @ingroup dmr_hfw
|
|
*/
|
|
class DSP_FW_API CalDMR {
|
|
public:
|
|
/**
|
|
* @brief Initializes a new instance of the CalDMR class.
|
|
*/
|
|
CalDMR();
|
|
|
|
/**
|
|
* @brief Process local state and transmit on the air interface.
|
|
*/
|
|
void process();
|
|
|
|
/**
|
|
* @brief
|
|
* @param n
|
|
*/
|
|
void createData1k(uint8_t n);
|
|
/**
|
|
* @brief
|
|
* @param n
|
|
*/
|
|
void createDataDMO1k(uint8_t n);
|
|
|
|
/**
|
|
* @brief
|
|
*/
|
|
void dmr1kcal();
|
|
/**
|
|
* @brief
|
|
*/
|
|
void dmrDMO1kcal();
|
|
|
|
/**
|
|
* @brief Write DMR calibration state.
|
|
* @param[in] data Buffer.
|
|
* @param length Length of buffer.
|
|
* @returns uint8_t Reason code.
|
|
*/
|
|
uint8_t write(const uint8_t* data, uint8_t length);
|
|
|
|
private:
|
|
bool m_transmit;
|
|
DMR1KCAL m_state;
|
|
uint32_t m_frameStart;
|
|
|
|
uint8_t m_dmr1k[DMR_FRAME_LENGTH_BYTES + 1U];
|
|
|
|
uint8_t m_audioSeq;
|
|
uint32_t m_count;
|
|
};
|
|
} // namespace dmr
|
|
|
|
#endif // __CAL_DMR_H__
|