Fixed error in function to set HR_C5000 modulation bias, merged rx and tx testsuites for MD380

replace/34d4511f3dd8345fd9aecca7adb00c6c2414ee45
Silvano Seva 2020-11-18 15:18:40 +01:00
rodzic 29f5b82488
commit aa0e1f479e
3 zmienionych plików z 13 dodań i 73 usunięć

Wyświetl plik

@ -131,7 +131,7 @@ void C5000_setModOffset(uint8_t offset)
* Original TYT MD-380 code does this, both for DMR and FM.
*/
uint8_t offUpper = (offset < 0x80) ? 0x00 : 0x03;
uint8_t offLower = offset - 0x7F;
uint8_t offLower = 0x7F - offset;
_writeReg(0x00, 0x48, offUpper); // Two-point bias, upper value
_writeReg(0x00, 0x47, offLower); // Two-point bias, lower value

Wyświetl plik

@ -1,70 +0,0 @@
/***************************************************************************
* Copyright (C) 2020 by Federico Amedeo Izzo IU2NUO, *
* Niccolò Izzo IU2KIN *
* Frederik Saraci IU2NRO *
* Silvano Seva IU2KWO *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, see <http://www.gnu.org/licenses/> *
***************************************************************************/
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <os.h>
#include "gpio.h"
#include "delays.h"
#include "rtx.h"
#include "ADC1_MDxx380.h"
#include "graphics.h"
#include "platform.h"
#include "hwconfig.h"
int main(void)
{
platform_init();
gpio_setMode(SPK_MUTE, OUTPUT);
gpio_setMode(AMP_EN, OUTPUT);
gpio_setMode(FM_MUTE, OUTPUT);
gpio_setPin(AMP_EN); /* Turn on audio amplifier */
gpio_setPin(FM_MUTE); /* Unmute path from AF_out to amplifier */
gpio_clearPin(SPK_MUTE); /* Unmute speaker */
rtx_init();
rtx_setRxFreq(430100000.0f);
rtx_setBandwidth(BW_25);
rtx_setOpmode(FM);
rtx_setFuncmode(RX);
gfx_init();
platform_setBacklightLevel(255);
color_t white = {255, 255, 255};
point_t origin = {0, SCREEN_HEIGHT / 9};
char buf[30] = {0};
while (1)
{
snprintf(sizeof(buf), buf, "RSSI level %f\n", rtx_getRssi());
gfx_clearScreen();
gfx_print(origin, buf, FONT_SIZE_3, TEXT_ALIGN_CENTER, white);
gfx_render();
while (gfx_renderingInProgress());
OS_ERR err;
OSTimeDlyHMSM(0u, 0u, 0u, 500u, OS_OPT_TIME_HMSM_STRICT, &err);
}
return 0;
}

Wyświetl plik

@ -25,7 +25,6 @@
#include "gpio.h"
#include "delays.h"
#include "rtx.h"
#include "ADC1_MDxx380.h"
#include "platform.h"
#include "hwconfig.h"
#include "HR-C5000_MD3x0.h"
@ -47,19 +46,22 @@ int main(void)
rtx_init();
rtx_setTxFreq(430100000.0f);
rtx_setRxFreq(430100000.0f);
rtx_setBandwidth(BW_25);
rtx_setOpmode(FM);
rtx_setFuncmode(OFF);
rtx_setFuncmode(RX);
gpio_setMode(GPIOA, 14, OUTPUT); /* Micpwr_sw */
gpio_setPin(GPIOA, 14);
bool txActive = false;
uint8_t count = 0;
while (1)
{
if(platform_getPttStatus() && (txActive == false))
{
rtx_setFuncmode(OFF);
rtx_setFuncmode(TX);
C5000_startAnalogTx();
platform_ledOn(RED);
@ -71,9 +73,17 @@ int main(void)
rtx_setFuncmode(OFF);
C5000_stopAnalogTx();
platform_ledOff(RED);
rtx_setFuncmode(RX);
txActive = false;
}
count++;
if(count == 50)
{
printf("RSSI: %f\r\n", rtx_getRssi());
count = 0;
}
OS_ERR err;
OSTimeDlyHMSM(0u, 0u, 0u, 10u, OS_OPT_TIME_HMSM_STRICT, &err);
}