Moved GPIO mappings out of hwconfig.h to a dedicated header file

pull/238/head
Silvano Seva 2023-12-26 10:20:14 +01:00
rodzic f771d4ec06
commit 0feb8f9075
13 zmienionych plików z 584 dodań i 446 usunięć

Wyświetl plik

@ -21,7 +21,8 @@
#ifndef HWCONFIG_H
#define HWCONFIG_H
#include "MK22F51212.h"
#include <MK22F51212.h>
#include "pinmap.h"
#ifdef __cplusplus
extern "C" {
@ -44,67 +45,6 @@ extern "C" {
/* Battery type */
#define BAT_LIPO_2S
/* Power keep switch */
#define PWR_SW GPIOE,26
/* Display */
#define LCD_BKLIGHT GPIOC,4
#define LCD_CS GPIOC,8
#define LCD_RST GPIOC,9
#define LCD_RS GPIOC,10
#define LCD_CLK GPIOC,11
#define LCD_DAT GPIOC,12
/* Signalling LEDs */
#define GREEN_LED GPIOA,17
#define RED_LED GPIOC,14
/* Keyboard */
#define KB_ROW0 GPIOB,19
#define KB_ROW1 GPIOB,20
#define KB_ROW2 GPIOB,21
#define KB_ROW3 GPIOB,22
#define KB_ROW4 GPIOB,23
#define KB_COL0 GPIOC,0
#define KB_COL1 GPIOC,1
#define KB_COL2 GPIOC,2
#define KB_COL3 GPIOC,3
#define PTT_SW GPIOA,1
#define FUNC_SW GPIOA,2
#define FUNC2_SW GPIOB,1
#define MONI_SW GPIOB,9
/* External flash */
#define FLASH_CS GPIOE,6
#define FLASH_CLK GPIOE,5
#define FLASH_SDO GPIOE,4
#define FLASH_SDI GPIOA,19
/* I2C for EEPROM and AT1846S */
#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,0
#define UHF_PA_EN GPIOE,1
/* 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,2
#define DMR_SLEEP GPIOE,3
#define DMR_CS GPIOD,0
#define DMR_CLK GPIOD,1
#define DMR_MOSI GPIOD,2
#define DMR_MISO GPIOD,3
#ifdef __cplusplus
}
#endif

Wyświetl plik

@ -0,0 +1,87 @@
/***************************************************************************
* Copyright (C) 2023 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 PINMAP_H
#define PINMAP_H
#include <MK22F51212.h>
/* Power keep switch */
#define PWR_SW GPIOE,26
/* Display */
#define LCD_BKLIGHT GPIOC,4
#define LCD_CS GPIOC,8
#define LCD_RST GPIOC,9
#define LCD_RS GPIOC,10
#define LCD_CLK GPIOC,11
#define LCD_DAT GPIOC,12
/* Signalling LEDs */
#define GREEN_LED GPIOA,17
#define RED_LED GPIOC,14
/* Keyboard */
#define KB_ROW0 GPIOB,19
#define KB_ROW1 GPIOB,20
#define KB_ROW2 GPIOB,21
#define KB_ROW3 GPIOB,22
#define KB_ROW4 GPIOB,23
#define KB_COL0 GPIOC,0
#define KB_COL1 GPIOC,1
#define KB_COL2 GPIOC,2
#define KB_COL3 GPIOC,3
#define PTT_SW GPIOA,1
#define FUNC_SW GPIOA,2
#define FUNC2_SW GPIOB,1
#define MONI_SW GPIOB,9
/* External flash */
#define FLASH_CS GPIOE,6
#define FLASH_CLK GPIOE,5
#define FLASH_SDO GPIOE,4
#define FLASH_SDI GPIOA,19
/* I2C for EEPROM and AT1846S */
#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,0
#define UHF_PA_EN GPIOE,1
/* 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,2
#define DMR_SLEEP GPIOE,3
#define DMR_CS GPIOD,0
#define DMR_CLK GPIOD,1
#define DMR_MOSI GPIOD,2
#define DMR_MISO GPIOD,3
#endif /* PINMAP_H */

Wyświetl plik

@ -21,7 +21,8 @@
#ifndef HWCONFIG_H
#define HWCONFIG_H
#include "MK22F51212.h"
#include <MK22F51212.h>
#include "pinmap.h"
#ifdef __cplusplus
extern "C" {
@ -44,67 +45,6 @@ extern "C" {
/* Battery type */
#define BAT_LIPO_2S
/* Power keep switch */
#define PWR_SW GPIOE,26
/* Display */
#define LCD_BKLIGHT GPIOC,4
#define LCD_CS GPIOC,8
#define LCD_RST GPIOC,9
#define LCD_RS GPIOC,10
#define LCD_CLK GPIOC,11
#define LCD_DAT GPIOC,12
/* Signalling LEDs */
#define GREEN_LED GPIOB,18
#define RED_LED GPIOC,14
/* Keyboard */
#define KB_ROW0 GPIOB,19
#define KB_ROW1 GPIOB,20
#define KB_ROW2 GPIOB,21
#define KB_ROW3 GPIOB,22
#define KB_ROW4 GPIOB,23
#define KB_COL0 GPIOC,0
#define KB_COL1 GPIOC,1
#define KB_COL2 GPIOC,2
#define KB_COL3 GPIOC,3
#define PTT_SW GPIOA,1
#define FUNC_SW GPIOA,2
#define FUNC2_SW GPIOB,1
#define MONI_SW GPIOB,9
/* External flash */
#define FLASH_CS GPIOA,19
#define FLASH_CLK GPIOE,5
#define FLASH_SDO GPIOE,4
#define FLASH_SDI GPIOE,6
/* I2C for EEPROM and AT1846S */
#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
#ifdef __cplusplus
}
#endif

Wyświetl plik

@ -0,0 +1,87 @@
/***************************************************************************
* Copyright (C) 2023 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 PINMAP_H
#define PINMAP_H
#include <MK22F51212.h>
/* Power keep switch */
#define PWR_SW GPIOE,26
/* Display */
#define LCD_BKLIGHT GPIOC,4
#define LCD_CS GPIOC,8
#define LCD_RST GPIOC,9
#define LCD_RS GPIOC,10
#define LCD_CLK GPIOC,11
#define LCD_DAT GPIOC,12
/* Signalling LEDs */
#define GREEN_LED GPIOB,18
#define RED_LED GPIOC,14
/* Keyboard */
#define KB_ROW0 GPIOB,19
#define KB_ROW1 GPIOB,20
#define KB_ROW2 GPIOB,21
#define KB_ROW3 GPIOB,22
#define KB_ROW4 GPIOB,23
#define KB_COL0 GPIOC,0
#define KB_COL1 GPIOC,1
#define KB_COL2 GPIOC,2
#define KB_COL3 GPIOC,3
#define PTT_SW GPIOA,1
#define FUNC_SW GPIOA,2
#define FUNC2_SW GPIOB,1
#define MONI_SW GPIOB,9
/* External flash */
#define FLASH_CS GPIOA,19
#define FLASH_CLK GPIOE,5
#define FLASH_SDO GPIOE,4
#define FLASH_SDI GPIOE,6
/* I2C for EEPROM and AT1846S */
#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 /* PINMAP_H */

Wyświetl plik

@ -21,6 +21,7 @@
#define HWCONFIG_H
#include <stm32f4xx.h>
#include "pinmap.h"
#ifdef __cplusplus
extern "C" {
@ -48,105 +49,6 @@ extern "C" {
/* Battery type */
#define BAT_LIPO_2S
/* Power keep switch */
#define PWR_SW GPIOA,7
/* Display */
#define LCD_D0 GPIOD,14
#define LCD_D1 GPIOD,15
#define LCD_D2 GPIOD,0
#define LCD_D3 GPIOD,1
#define LCD_D4 GPIOE,7
#define LCD_D5 GPIOE,8
#define LCD_D6 GPIOE,9
#define LCD_D7 GPIOE,10
#define LCD_WR GPIOD,5
#define LCD_RD GPIOD,4
#define LCD_CS GPIOD,6
#define LCD_RS GPIOD,12
#define LCD_RST GPIOD,13
#define LCD_BKLIGHT GPIOC,6
/* Signalling LEDs */
#define GREEN_LED GPIOE,0
#define RED_LED GPIOE,1
/* Analog inputs */
#define AIN_VOLUME GPIOA,0
#define AIN_VBAT GPIOA,1
#define AIN_MIC GPIOA,3
#define AIN_RSSI GPIOB,0
#define AIN_RTX GPIOC,3
/* Channel selection rotary encoder */
#define CH_SELECTOR_0 GPIOE,14
#define CH_SELECTOR_1 GPIOE,15
#define CH_SELECTOR_2 GPIOB,10
#define CH_SELECTOR_3 GPIOB,11
/* Push-to-talk switch */
#define PTT_SW GPIOE,11
#define PTT_EXT GPIOE,12
/*
* Keyboard. Here we define only rows, since coloumn lines are the same as
* LCD_Dx. See also: https://www.qsl.net/dl4yhf/RT3/md380_hw.html#keyboard
*
* "Monitor" and "Function" buttons, on the other hand, are connected to
* keyboard row 3 and on LCD_D7 and LCD_D6. See also the schematic.
*/
#define KB_ROW1 GPIOA,6 /* K1 */
#define KB_ROW2 GPIOD,2 /* K2 */
#define KB_ROW3 GPIOD,3 /* K3 */
#define MONI_SW LCD_D7
#define FUNC_SW LCD_D6
/* Tone generator */
#define CTCSS_OUT GPIOC,7 /* System "beep" */
#define BEEP_OUT GPIOC,8 /* CTCSS tone */
/* External flash */
#define FLASH_CS GPIOD,7
#define FLASH_CLK GPIOB,3
#define FLASH_SDO GPIOB,4
#define FLASH_SDI GPIOB,5
/* PLL */
#define PLL_CS GPIOD,11
#define PLL_CLK GPIOE,4
#define PLL_DAT GPIOE,5 /* WARNING: this line is also HR_C5000 MOSI */
#define PLL_LD GPIOD,10
/* HR_C5000 */
#define DMR_CS GPIOE,2
#define DMR_CLK GPIOC,13
#define DMR_MOSI PLL_DAT
#define DMR_MISO GPIOE,3
#define DMR_SLEEP GPIOE,6
#define V_CS GPIOB,12
/* RTX control */
#define PLL_PWR GPIOA,8
#define VCOVCC_SW GPIOA,9
#define DMR_SW GPIOA,10
#define FM_SW GPIOB,2
#define WN_SW GPIOA,13
#define RF_APC_SW GPIOC,4
#define TX_STG_EN GPIOC,5
#define RX_STG_EN GPIOC,9
#define APC_TV GPIOA,4
#define MOD2_BIAS GPIOA,5
/* Audio control */
#define AUDIO_AMP_EN GPIOB,9
#define SPK_MUTE GPIOB,8
#define FM_MUTE GPIOE,13
#define MIC_PWR GPIOA,14
/* GPS, for the devices who have it */
#define GPS_EN GPIOD,8
#define GPS_DATA GPIOD,9
#ifdef __cplusplus
}
#endif

Wyświetl plik

@ -0,0 +1,125 @@
/***************************************************************************
* Copyright (C) 2023 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 PINMAP_H
#define PINMAP_H
#include <stm32f4xx.h>
/* Power keep switch */
#define PWR_SW GPIOA,7
/* Display */
#define LCD_D0 GPIOD,14
#define LCD_D1 GPIOD,15
#define LCD_D2 GPIOD,0
#define LCD_D3 GPIOD,1
#define LCD_D4 GPIOE,7
#define LCD_D5 GPIOE,8
#define LCD_D6 GPIOE,9
#define LCD_D7 GPIOE,10
#define LCD_WR GPIOD,5
#define LCD_RD GPIOD,4
#define LCD_CS GPIOD,6
#define LCD_RS GPIOD,12
#define LCD_RST GPIOD,13
#define LCD_BKLIGHT GPIOC,6
/* Signalling LEDs */
#define GREEN_LED GPIOE,0
#define RED_LED GPIOE,1
/* Analog inputs */
#define AIN_VOLUME GPIOA,0
#define AIN_VBAT GPIOA,1
#define AIN_MIC GPIOA,3
#define AIN_RSSI GPIOB,0
#define AIN_RTX GPIOC,3
/* Channel selection rotary encoder */
#define CH_SELECTOR_0 GPIOE,14
#define CH_SELECTOR_1 GPIOE,15
#define CH_SELECTOR_2 GPIOB,10
#define CH_SELECTOR_3 GPIOB,11
/* Push-to-talk switch */
#define PTT_SW GPIOE,11
#define PTT_EXT GPIOE,12
/*
* Keyboard. Here we define only rows, since coloumn lines are the same as
* LCD_Dx. See also: https://www.qsl.net/dl4yhf/RT3/md380_hw.html#keyboard
*
* "Monitor" and "Function" buttons, on the other hand, are connected to
* keyboard row 3 and on LCD_D7 and LCD_D6. See also the schematic.
*/
#define KB_ROW1 GPIOA,6 /* K1 */
#define KB_ROW2 GPIOD,2 /* K2 */
#define KB_ROW3 GPIOD,3 /* K3 */
#define MONI_SW LCD_D7
#define FUNC_SW LCD_D6
/* Tone generator */
#define CTCSS_OUT GPIOC,7 /* System "beep" */
#define BEEP_OUT GPIOC,8 /* CTCSS tone */
/* External flash */
#define FLASH_CS GPIOD,7
#define FLASH_CLK GPIOB,3
#define FLASH_SDO GPIOB,4
#define FLASH_SDI GPIOB,5
/* PLL */
#define PLL_CS GPIOD,11
#define PLL_CLK GPIOE,4
#define PLL_DAT GPIOE,5 /* WARNING: this line is also HR_C5000 MOSI */
#define PLL_LD GPIOD,10
/* HR_C5000 */
#define DMR_CS GPIOE,2
#define DMR_CLK GPIOC,13
#define DMR_MOSI PLL_DAT
#define DMR_MISO GPIOE,3
#define DMR_SLEEP GPIOE,6
#define V_CS GPIOB,12
/* RTX control */
#define PLL_PWR GPIOA,8
#define VCOVCC_SW GPIOA,9
#define DMR_SW GPIOA,10
#define FM_SW GPIOB,2
#define WN_SW GPIOA,13
#define RF_APC_SW GPIOC,4
#define TX_STG_EN GPIOC,5
#define RX_STG_EN GPIOC,9
#define APC_TV GPIOA,4
#define MOD2_BIAS GPIOA,5
/* Audio control */
#define AUDIO_AMP_EN GPIOB,9
#define SPK_MUTE GPIOB,8
#define FM_MUTE GPIOE,13
#define MIC_PWR GPIOA,14
/* GPS, for the devices who have it */
#define GPS_EN GPIOD,8
#define GPS_DATA GPIOD,9
#endif /* PINMAP_H */

Wyświetl plik

@ -22,6 +22,7 @@
#define HWCONFIG_H
#include <stm32f4xx.h>
#include "pinmap.h"
#ifdef __cplusplus
extern "C" {
@ -47,64 +48,6 @@ extern "C" {
/* Battery type */
#define BAT_NONE
/* Power keep switch */
#define PWR_SW GPIOD,15
/* Display */
#define LCD_BKLIGHT GPIOC,6
#define LCD_RST GPIOD,12
#define LCD_RS GPIOD,13
#define LCD_CS GPIOD,14
/* Analog inputs */
#define AIN_VOLUME GPIOA,0
#define AIN_VBAT GPIOA,1
#define AIN_MIC GPIOA,3
#define AIN_SW2 GPIOA,6
#define AIN_SW1 GPIOA,7
#define AIN_RSSI GPIOB,0
#define AIN_RSSI2 GPIOB,1
#define AIN_HTEMP GPIOC,5
/* Channel selection rotary encoder */
#define CH_SELECTOR_0 GPIOB,10
#define CH_SELECTOR_1 GPIOB,11
/* Push-to-talk switch */
#define PTT_SW GPIOE,10
/* Keyboard */
#define KB_ROW1 GPIOD,2
#define KB_ROW2 GPIOD,3
#define KB_ROW3 GPIOD,4
#define KB_COL1 GPIOD,0
#define KB_COL2 GPIOD,1
#define KB_COL3 GPIOE,0
#define KB_COL4 GPIOE,1
/* Tone generator */
#define CTCSS_OUT GPIOC,7 /* System "beep" */
#define BEEP_OUT GPIOC,8 /* CTCSS tone */
/* SPI2, connected to external flash and LCD */
#define FLASH_CS GPIOB,12
#define SPI2_CLK GPIOB,13
#define SPI2_SDO GPIOB,14
#define SPI2_SDI GPIOB,15
/* Audio control */
#define SPK_MUTE GPIOB,6
/* GPS, for the devices who have it */
#define GPS_EN GPIOA,9
#define GPS_DATA GPIOA,10
/* HR_C6000 control interface */
#define DMR_CS GPIOE,2
#define DMR_CLK GPIOE,3
#define DMR_MOSI GPIOE,4
#define DMR_MISO GPIOE,5
#ifdef __cplusplus
}
#endif

Wyświetl plik

@ -0,0 +1,92 @@
/***************************************************************************
* Copyright (C) 2023 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 PINMAP_H
#define PINMAP_H
#include <stm32f4xx.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Power keep switch */
#define PWR_SW GPIOD,15
/* Display */
#define LCD_BKLIGHT GPIOC,6
#define LCD_RST GPIOD,12
#define LCD_RS GPIOD,13
#define LCD_CS GPIOD,14
/* Analog inputs */
#define AIN_VOLUME GPIOA,0
#define AIN_VBAT GPIOA,1
#define AIN_MIC GPIOA,3
#define AIN_SW2 GPIOA,6
#define AIN_SW1 GPIOA,7
#define AIN_RSSI GPIOB,0
#define AIN_RSSI2 GPIOB,1
#define AIN_HTEMP GPIOC,5
/* Channel selection rotary encoder */
#define CH_SELECTOR_0 GPIOB,10
#define CH_SELECTOR_1 GPIOB,11
/* Push-to-talk switch */
#define PTT_SW GPIOE,10
/* Keyboard */
#define KB_ROW1 GPIOD,2
#define KB_ROW2 GPIOD,3
#define KB_ROW3 GPIOD,4
#define KB_COL1 GPIOD,0
#define KB_COL2 GPIOD,1
#define KB_COL3 GPIOE,0
#define KB_COL4 GPIOE,1
/* Tone generator */
#define CTCSS_OUT GPIOC,7 /* System "beep" */
#define BEEP_OUT GPIOC,8 /* CTCSS tone */
/* SPI2, connected to external flash and LCD */
#define FLASH_CS GPIOB,12
#define SPI2_CLK GPIOB,13
#define SPI2_SDO GPIOB,14
#define SPI2_SDI GPIOB,15
/* Audio control */
#define SPK_MUTE GPIOB,6
/* GPS, for the devices who have it */
#define GPS_EN GPIOA,9
#define GPS_DATA GPIOA,10
/* HR_C6000 control interface */
#define DMR_CS GPIOE,2
#define DMR_CLK GPIOE,3
#define DMR_MOSI GPIOE,4
#define DMR_MISO GPIOE,5
#ifdef __cplusplus
}
#endif
#endif /* PINMAP_H */

Wyświetl plik

@ -21,6 +21,7 @@
#define HWCONFIG_H
#include <stm32f4xx.h>
#include "pinmap.h"
#ifdef __cplusplus
extern "C" {
@ -42,97 +43,6 @@ extern "C" {
/* Battery type */
#define BAT_LIPO_2S
/* Power keep switch */
#define PWR_SW GPIOA,7
/* Display */
#define LCD_D0 GPIOD,14
#define LCD_D1 GPIOD,15
#define LCD_D2 GPIOD,0
#define LCD_D3 GPIOD,1
#define LCD_D4 GPIOE,7
#define LCD_D5 GPIOE,8
#define LCD_D6 GPIOE,9
#define LCD_D7 GPIOE,10
#define LCD_WR GPIOD,5
#define LCD_RD GPIOD,4
#define LCD_CS GPIOD,6
#define LCD_RS GPIOD,12
#define LCD_RST GPIOD,13
#define LCD_BKLIGHT GPIOD,8
/* Signalling LEDs */
#define GREEN_LED GPIOE,0
#define RED_LED GPIOE,1
/* Analog inputs */
#define AIN_VOLUME GPIOA,0
#define AIN_VBAT GPIOA,1
#define AIN_MIC GPIOA,3
#define AIN_RTX GPIOC,3
/* Channel selection rotary encoder */
#define CH_SELECTOR_0 GPIOE,14
#define CH_SELECTOR_1 GPIOB,11
/* Push-to-talk switch */
#define PTT_SW GPIOE,11
#define PTT_EXT GPIOE,12
/*
* Keyboard. Here we define only rows, since coloumn lines are the same as
* LCD_Dx. See also: https://www.qsl.net/dl4yhf/RT3/md380_hw.html#keyboard
*
* "Monitor" and "Function" buttons, on the other hand, are connected to
* keyboard row 3 and on LCD_D6 and LCD_D7. They are SWAPPED with respect to
* connections made on MD-380.
*/
#define KB_ROW1 GPIOA,6 /* K1 */
#define KB_ROW2 GPIOD,2 /* K2 */
#define KB_ROW3 GPIOD,3 /* K3 */
#define MONI_SW LCD_D6
#define FUNC_SW LCD_D7
/* Tone generator */
#define CTCSS_OUT GPIOC,7 /* System "beep" */
#define BEEP_OUT GPIOC,8 /* CTCSS tone */
/* External flash */
#define FLASH_CS GPIOD,7
#define FLASH_CLK GPIOB,3
#define FLASH_SDO GPIOB,4
#define FLASH_SDI GPIOB,5
/* Audio control */
#define AUDIO_AMP_EN GPIOB,9
#define SPK_MUTE GPIOB,8
#define MIC_PWR GPIOA,13
#define RX_AUDIO_MUX GPIOD,9
/* GPS, for the devices who have it */
#define GPS_EN GPIOA,9
#define GPS_DATA GPIOA,10
/* RTX stage control */
#define VHF_LNA_EN GPIOA,5
#define UHF_LNA_EN GPIOA,2
#define PA_EN_1 GPIOC,5
#define PA_EN_2 GPIOC,4
#define PA_SEL_SW GPIOC,6
#define APC_REF GPIOA,4
/* I2C for AT1846S */
#define I2C_SDA GPIOC,9
#define I2C_SCL GPIOA,8
/* HR_C6000 control interface */
#define DMR_SLEEP GPIOE,6
#define DMR_CS GPIOE,2
#define DMR_CLK GPIOE,3
#define DMR_MOSI GPIOE,4
#define DMR_MISO GPIOE,5
/*
* To enable pwm for display backlight dimming uncomment this directive.
*

Wyświetl plik

@ -0,0 +1,116 @@
/***************************************************************************
* Copyright (C) 2023 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 PINMAP_H
#define PINMAP_H
#include <stm32f4xx.h>
/* Power keep switch */
#define PWR_SW GPIOA,7
/* Display */
#define LCD_D0 GPIOD,14
#define LCD_D1 GPIOD,15
#define LCD_D2 GPIOD,0
#define LCD_D3 GPIOD,1
#define LCD_D4 GPIOE,7
#define LCD_D5 GPIOE,8
#define LCD_D6 GPIOE,9
#define LCD_D7 GPIOE,10
#define LCD_WR GPIOD,5
#define LCD_RD GPIOD,4
#define LCD_CS GPIOD,6
#define LCD_RS GPIOD,12
#define LCD_RST GPIOD,13
#define LCD_BKLIGHT GPIOD,8
/* Signalling LEDs */
#define GREEN_LED GPIOE,0
#define RED_LED GPIOE,1
/* Analog inputs */
#define AIN_VOLUME GPIOA,0
#define AIN_VBAT GPIOA,1
#define AIN_MIC GPIOA,3
#define AIN_RTX GPIOC,3
/* Channel selection rotary encoder */
#define CH_SELECTOR_0 GPIOE,14
#define CH_SELECTOR_1 GPIOB,11
/* Push-to-talk switch */
#define PTT_SW GPIOE,11
#define PTT_EXT GPIOE,12
/*
* Keyboard. Here we define only rows, since coloumn lines are the same as
* LCD_Dx. See also: https://www.qsl.net/dl4yhf/RT3/md380_hw.html#keyboard
*
* "Monitor" and "Function" buttons, on the other hand, are connected to
* keyboard row 3 and on LCD_D6 and LCD_D7. They are SWAPPED with respect to
* connections made on MD-380.
*/
#define KB_ROW1 GPIOA,6 /* K1 */
#define KB_ROW2 GPIOD,2 /* K2 */
#define KB_ROW3 GPIOD,3 /* K3 */
#define MONI_SW LCD_D6
#define FUNC_SW LCD_D7
/* Tone generator */
#define CTCSS_OUT GPIOC,7 /* System "beep" */
#define BEEP_OUT GPIOC,8 /* CTCSS tone */
/* External flash */
#define FLASH_CS GPIOD,7
#define FLASH_CLK GPIOB,3
#define FLASH_SDO GPIOB,4
#define FLASH_SDI GPIOB,5
/* Audio control */
#define AUDIO_AMP_EN GPIOB,9
#define SPK_MUTE GPIOB,8
#define MIC_PWR GPIOA,13
#define RX_AUDIO_MUX GPIOD,9
/* GPS, for the devices who have it */
#define GPS_EN GPIOA,9
#define GPS_DATA GPIOA,10
/* RTX stage control */
#define VHF_LNA_EN GPIOA,5
#define UHF_LNA_EN GPIOA,2
#define PA_EN_1 GPIOC,5
#define PA_EN_2 GPIOC,4
#define PA_SEL_SW GPIOC,6
#define APC_REF GPIOA,4
/* I2C for AT1846S */
#define I2C_SDA GPIOC,9
#define I2C_SCL GPIOA,8
/* HR_C6000 control interface */
#define DMR_SLEEP GPIOE,6
#define DMR_CS GPIOE,2
#define DMR_CLK GPIOE,3
#define DMR_MOSI GPIOE,4
#define DMR_MISO GPIOE,5
#endif /* PINMAP_H */

Wyświetl plik

@ -23,6 +23,7 @@
#define HWCONFIG_H
#include <stm32f4xx.h>
#include "pinmap.h"
/* Screen dimensions */
#define SCREEN_WIDTH 128
@ -38,47 +39,4 @@
/* Device has no battery */
#define BAT_NONE
/* Signalling LEDs */
#define PTT_LED GPIOC,8
#define SYNC_LED GPIOC,9
#define ERR_LED GPIOA,8
/* Display */
#define LCD_RST GPIOC,7
#define LCD_RS GPIOC,6
#define LCD_CS GPIOB,14
#define SPI2_CLK GPIOB,13
#define SPI2_SDO GPIOB,9 // UNUSED
#define SPI2_SDI GPIOB,15
//#define LCD_BKLIGHT GPIOE,15
/* Keyboard */
#define ESC_SW GPIOB,8
#define RIGHT_SW GPIOB,11
#define UP_SW GPIOB,10
#define DOWN_SW GPIOC,2
#define LEFT_SW GPIOC,3
#define ENTER_SW GPIOB,12
#define PTT_SW GPIOC,13
#define PTT_OUT GPIOD,2
/* Audio */
#define AUDIO_MIC GPIOA,2
#define AUDIO_SPK GPIOA,5
#define BASEBAND_RX GPIOA,1
#define BASEBAND_TX GPIOA,4
#define SPK_MUTE GPIOB,1
#define MIC_MUTE GPIOC,4
#define MIC_GAIN GPIOC,5
#define AIN_HWVER GPIOA,3
#define POWER_SW GPIOA,15
/* I2C for MCP4551 */
#define I2C_SDA GPIOB,7
#define I2C_SCL GPIOB,6
#define SOFTPOT_RX 0x2E
#define SOFTPOT_TX 0x2F
#endif

Wyświetl plik

@ -0,0 +1,69 @@
/***************************************************************************
* Copyright (C) 2023 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 PINMAP_H
#define PINMAP_H
#include <stm32f4xx.h>
/* Signalling LEDs */
#define PTT_LED GPIOC,8
#define SYNC_LED GPIOC,9
#define ERR_LED GPIOA,8
/* Display */
#define LCD_RST GPIOC,7
#define LCD_RS GPIOC,6
#define LCD_CS GPIOB,14
#define SPI2_CLK GPIOB,13
#define SPI2_SDO GPIOB,9 // UNUSED
#define SPI2_SDI GPIOB,15
//#define LCD_BKLIGHT GPIOE,15
/* Keyboard */
#define ESC_SW GPIOB,8
#define RIGHT_SW GPIOB,11
#define UP_SW GPIOB,10
#define DOWN_SW GPIOC,2
#define LEFT_SW GPIOC,3
#define ENTER_SW GPIOB,12
#define PTT_SW GPIOC,13
#define PTT_OUT GPIOD,2
/* Audio */
#define AUDIO_MIC GPIOA,2
#define AUDIO_SPK GPIOA,5
#define BASEBAND_RX GPIOA,1
#define BASEBAND_TX GPIOA,4
#define SPK_MUTE GPIOB,1
#define MIC_MUTE GPIOC,4
#define MIC_GAIN GPIOC,5
#define AIN_HWVER GPIOA,3
#define POWER_SW GPIOA,15
/* I2C for MCP4551 */
#define I2C_SDA GPIOB,7
#define I2C_SCL GPIOB,6
#define SOFTPOT_RX 0x2E
#define SOFTPOT_TX 0x2F
#endif /* PINMAP_H */

Wyświetl plik

@ -28,37 +28,6 @@ extern "C" {
/* Battery type */
#define BAT_LIPO_2S
#define GPIOA "PA"
#define GPIOB "PB"
#define GPIOC "PC"
#define GPIOD "PD"
#define GPIOE "PE"
#define GPIOF "PF"
#define GPIOG "PG"
#define GPIOH "PH"
#define GPIOI "PI"
#define GPIOJ "PJ"
#define GPIOK "PK"
/* Signalling LEDs */
#define GREEN_LED "GREEN_LED",0
#define RED_LED "RED_LED",1
/* Analog inputs */
#define AIN_VOLUME "AIN_VOLUME",0
#define AIN_VBAT "AIN_VBAT",1
#define AIN_MIC "AIN_MIC",3
#define AIN_RSSI "AIN_RSSI",0
/* Channel selection rotary encoder */
#define CH_SELECTOR_0 "CH_SELECTOR_0",14
#define CH_SELECTOR_1 "CH_SELECTOR_1",15
#define CH_SELECTOR_2 "CH_SELECTOR_2",10
#define CH_SELECTOR_3 "CH_SELECTOR_3",11
/* Push-to-talk switch */
#define PTT_SW "PTT_SW",11
#ifdef __cplusplus
}
#endif