Add MD-9600 support, boot and USB serial working

replace/2a96156748bfcd669410b9541b10f127cac73f23
Federico Amedeo Izzo 2021-01-01 18:32:05 +01:00
rodzic a8b18b68d7
commit 8163eba67b
5 zmienionych plików z 169 dodań i 0 usunięć

Wyświetl plik

@ -245,6 +245,13 @@ dm1801_inc = inc + mk22fn512_inc + ['platform/targets/DM-1801']
dm1801_def = def + mk22fn512_def + {'PLATFORM_DM1801': ''}
## TYT MD-9600
md9600_src = src + stm32f405_src + ['platform/targets/MD-9600/platform.c']
md9600_inc = inc + stm32f405_inc + ['platform/targets/MD-9600']
md9600_def = def + stm32f405_def + {'PLATFORM_MDUV380': ''}
##
## Compilation defines
##
@ -310,6 +317,15 @@ foreach k, v : dm1801_def
endif
endforeach
md9600_args = []
foreach k, v : md9600_def
if v == ''
md9600_args += '-D@0@'.format(k)
else
md9600_args += '-D@0@=@1@'.format(k, v)
endif
endforeach
linux_opts = {'sources': linux_src,
'c_args': linux_c_args,
'include_directories': linux_inc,
@ -346,6 +362,12 @@ dm1801_opts = {'sources': dm1801_src,
'-Wl,--print-memory-usage'],
'include_directories':dm1801_inc}
md9600_opts = {'sources': md9600_src,
'c_args': md9600_args,
'link_args' : ['-Wl,-T../platform/mcu/STM32F4xx/linker_script.ld',
'-Wl,--print-memory-usage'],
'include_directories': md9600_inc}
##
## Targets
##
@ -384,6 +406,12 @@ targets = [
'flashable': true,
'wrap': 'UV3X0',
'load_addr': '0x0800C000'},
{'name': 'md9600',
'opts': md9600_opts,
'flashable': true,
'wrap': 'MD9600',
'load_addr': '0x0800C000'},
]
objcopy = find_program('objcopy', required:false, disabler:true)

Wyświetl plik

@ -35,6 +35,9 @@ float bat_v_max = 8.30f;
#elif defined BAT_LIPO_3S
float bat_v_min = 10.83;
float bat_v_max = 12.45;
#elif defined BAT_NONE
float bat_v_min = 0.0;
float bat_v_max = 0.0;
#else
#error Please define a battery type into platform/targets/.../hwconfig.h
#endif

Wyświetl plik

@ -0,0 +1,46 @@
/***************************************************************************
* 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/> *
***************************************************************************/
#ifndef HWCONFIG_H
#define HWCONFIG_H
#include <stm32f4xx.h>
/* Supported radio bands */
#define BAND_VHF
#define BAND_UHF
/* Band limits in Hz */
#define FREQ_LIMIT_VHF_LO 136000000
#define FREQ_LIMIT_VHF_HI 174000000
#define FREQ_LIMIT_UHF_LO 400000000
#define FREQ_LIMIT_UHF_HI 480000000
/* Screen dimensions */
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
/* Screen pixel format */
#define PIX_FMT_BW
/* Battery type */
#define BAT_NONE
#endif

Wyświetl plik

@ -0,0 +1,55 @@
/***************************************************************************
* 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 <interfaces/platform.h>
#include <interfaces/gpio.h>
#include <os.h>
#include <hwconfig.h>
#include <interfaces/nvmem.h>
#include <interfaces/rtc.h>
void platform_init()
{
}
void platform_terminate()
{
}
float platform_getMicLevel()
{
return 0.0f;
}
float platform_getVolumeLevel()
{
return 0.0f;
}
void platform_beepStart(uint16_t freq)
{
/* TODO */
(void) freq;
}
void platform_beepStop()
{
/* TODO */
}

Wyświetl plik

@ -0,0 +1,37 @@
/***************************************************************************
* 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 <os.h>
#include <stdio.h>
#include <interfaces/platform.h>
int main()
{
platform_init();
while(1)
{
OS_ERR err;
printf("Hello world\n");
OSTimeDlyHMSM(0u, 0u, 1u, 0u, OS_OPT_TIME_HMSM_STRICT, &err);
}
return 0;
}