kopia lustrzana https://github.com/OpenRTX/OpenRTX
RTX support for GD77 target
rodzic
b9ddaca42c
commit
41a413cfdd
|
@ -248,7 +248,10 @@ gd77_src = src + mk22fn512_src + ['platform/targets/GD77/platform.c',
|
|||
'platform/drivers/NVM/spiFlash_GDx.c',
|
||||
'platform/drivers/NVM/nvmem_GDx.c',
|
||||
'platform/drivers/ADC/ADC0_GDx.c',
|
||||
'platform/drivers/baseband/rtx_GDx.c']
|
||||
'platform/drivers/baseband/rtx_GDx.c',
|
||||
'platform/drivers/baseband/AT1846S.c',
|
||||
'platform/drivers/baseband/HR_C6000.c',
|
||||
'platform/drivers/baseband/interfaces_GDx.c']
|
||||
|
||||
gd77_inc = inc + mk22fn512_inc + ['platform/targets/GD77']
|
||||
gd77_def = def + mk22fn512_def + {'PLATFORM_GD77': ''}
|
||||
|
|
|
@ -93,6 +93,7 @@
|
|||
#define RX_AUDIO_MUX GPIOC,5
|
||||
#define TX_AUDIO_MUX GPIOC,6
|
||||
|
||||
/* HR_C6000 control interface */
|
||||
#define DMR_RESET GPIOE,2
|
||||
#define DMR_SLEEP GPIOE,3
|
||||
#define DMR_CS GPIOD,0
|
||||
|
|
|
@ -72,7 +72,6 @@
|
|||
#define FUNC2_SW GPIOB,1
|
||||
#define MONI_SW GPIOB,9
|
||||
|
||||
|
||||
/* External flash */
|
||||
#define FLASH_CS GPIOE,6
|
||||
#define FLASH_CLK GPIOE,5
|
||||
|
@ -83,4 +82,23 @@
|
|||
#define I2C_SDA GPIOE,25
|
||||
#define I2C_SCL GPIOE,24
|
||||
|
||||
/* RTX stage control */
|
||||
#define VHF_LNA_EN GPIOC,13
|
||||
#define UHF_LNA_EN GPIOC,15
|
||||
#define VHF_PA_EN GPIOE,3
|
||||
#define UHF_PA_EN GPIOE,2
|
||||
|
||||
/* Audio control */
|
||||
#define AUDIO_AMP_EN GPIOB,0
|
||||
#define RX_AUDIO_MUX GPIOC,5
|
||||
#define TX_AUDIO_MUX GPIOC,6
|
||||
|
||||
/* HR_C6000 control interface */
|
||||
#define DMR_RESET GPIOE,0
|
||||
#define DMR_SLEEP GPIOE,1
|
||||
#define DMR_CS GPIOD,0
|
||||
#define DMR_CLK GPIOD,1
|
||||
#define DMR_MOSI GPIOD,2
|
||||
#define DMR_MISO GPIOD,3
|
||||
|
||||
#endif
|
||||
|
|
|
@ -19,8 +19,11 @@
|
|||
***************************************************************************/
|
||||
|
||||
#include <interfaces/platform.h>
|
||||
#include <ADC0_GDx.h>
|
||||
#include <interfaces/nvmem.h>
|
||||
#include <interfaces/gpio.h>
|
||||
#include <calibInfo_GDx.h>
|
||||
#include <ADC0_GDx.h>
|
||||
#include <I2C0.h>
|
||||
#include <os.h>
|
||||
#include "hwconfig.h"
|
||||
|
||||
|
@ -28,6 +31,8 @@
|
|||
OS_MUTEX adc_mutex;
|
||||
OS_ERR e;
|
||||
|
||||
gdxCalibration_t calibration;
|
||||
|
||||
void platform_init()
|
||||
{
|
||||
/* Configure GPIOs */
|
||||
|
@ -60,6 +65,21 @@ void platform_init()
|
|||
*/
|
||||
adc0_init();
|
||||
OSMutexCreate(&adc_mutex, "", &e);
|
||||
|
||||
/*
|
||||
* Initialise I2C driver, once for all the modules
|
||||
*/
|
||||
gpio_setMode(I2C_SDA, OPEN_DRAIN);
|
||||
gpio_setMode(I2C_SCL, OPEN_DRAIN);
|
||||
gpio_setAlternateFunction(I2C_SDA, 3);
|
||||
gpio_setAlternateFunction(I2C_SCL, 3);
|
||||
i2c0_init();
|
||||
|
||||
/*
|
||||
* Initialise non volatile memory manager and load calibration data.
|
||||
*/
|
||||
nvm_init();
|
||||
nvm_readCalibData(&calibration);
|
||||
}
|
||||
|
||||
void platform_terminate()
|
||||
|
@ -159,3 +179,8 @@ void platform_setBacklightLevel(uint8_t level)
|
|||
{
|
||||
FTM0->CONTROLS[3].CnV = level;
|
||||
}
|
||||
|
||||
const void *platform_getCalibrationData()
|
||||
{
|
||||
return ((const void *) &calibration);
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue