2014-12-18 17:45:36 -05:00
|
|
|
#include "util/constants.h"
|
|
|
|
|
2014-12-02 19:10:06 -05:00
|
|
|
#ifndef DEVICE_CONFIGURATION
|
|
|
|
#define DEVICE_CONFIGURATION
|
|
|
|
|
2019-02-08 07:18:49 -05:00
|
|
|
// Version info
|
|
|
|
#define MAJ_VERSION 0x01
|
2019-11-03 09:55:35 -05:00
|
|
|
#define MIN_VERSION 0x01
|
2019-02-08 07:18:49 -05:00
|
|
|
|
2014-12-02 19:10:06 -05:00
|
|
|
// CPU settings
|
2018-12-27 14:24:21 -05:00
|
|
|
#define TARGET_CPU m1284p
|
2019-01-01 14:34:02 -05:00
|
|
|
#define F_CPU 20000000UL
|
2014-12-02 19:10:06 -05:00
|
|
|
#define FREQUENCY_CORRECTION 0
|
|
|
|
|
2019-01-04 10:13:29 -05:00
|
|
|
// Voltage references
|
2019-02-08 07:18:49 -05:00
|
|
|
#define CONFIG_ADC_REF 128
|
2019-04-05 07:26:53 -04:00
|
|
|
#define CONFIG_DAC_REF 255
|
2019-01-04 10:13:29 -05:00
|
|
|
|
2019-04-05 07:26:53 -04:00
|
|
|
#define CONFIG_LED_INTENSITY 192
|
2019-01-12 10:30:26 -05:00
|
|
|
#define CONFIG_COM_LED_TIMEOUT_MS 40
|
|
|
|
#define CONFIG_LED_UPDATE_INTERVAL_MS 40
|
2019-01-12 09:12:51 -05:00
|
|
|
|
2019-01-04 10:13:29 -05:00
|
|
|
// Demodulator settings
|
2018-04-24 09:34:50 -04:00
|
|
|
#define OPEN_SQUELCH true
|
2014-12-18 17:45:36 -05:00
|
|
|
|
2014-12-02 19:10:06 -05:00
|
|
|
// Serial settings
|
2014-12-18 17:45:36 -05:00
|
|
|
#define SERIAL_DEBUG false
|
|
|
|
#define TX_MAXWAIT 2UL
|
2019-04-05 07:26:53 -04:00
|
|
|
#define CONFIG_QUEUE_SIZE 6000
|
2019-01-08 14:56:58 -05:00
|
|
|
#define CONFIG_QUEUE_MAX_LENGTH 15
|
2019-04-05 07:26:53 -04:00
|
|
|
#define CONFIG_UART0_BUFFER_SIZE 1536
|
2019-02-04 11:02:19 -05:00
|
|
|
#define CONFIG_UART1_BUFFER_SIZE 128
|
2019-01-08 16:24:29 -05:00
|
|
|
#define CONFIG_SERIAL_TIMEOUT_MS 10
|
2019-01-12 10:30:26 -05:00
|
|
|
#define CONFIG_BENCHMARK_MODE false
|
2014-12-02 19:10:06 -05:00
|
|
|
|
2018-12-29 09:57:49 -05:00
|
|
|
// CSMA Settings
|
2019-01-05 07:47:46 -05:00
|
|
|
#define CONFIG_FULL_DUPLEX false // TODO: Actually implement fdx
|
2019-02-08 07:18:49 -05:00
|
|
|
#define CONFIG_CSMA_P_DEFAULT 255
|
|
|
|
#define CONFIG_CSMA_SLOTTIME_DEFAULT 20
|
2018-12-29 09:57:49 -05:00
|
|
|
|
2019-02-08 15:49:16 -05:00
|
|
|
#define AX25_MIN_FRAME_LEN 4
|
2019-02-07 12:36:40 -05:00
|
|
|
#define AX25_MAX_FRAME_LEN 611
|
|
|
|
#define AX25_MAX_PAYLOAD 576
|
2019-02-08 15:49:16 -05:00
|
|
|
#define AX25_MIN_PAYLOAD 2
|
|
|
|
#define AX25_ENCRYPTED_MIN_LENGTH 51 // Padding byte + IV + 1 Block + HMAC + CRC
|
2019-01-08 14:56:58 -05:00
|
|
|
|
2018-12-29 18:32:19 -05:00
|
|
|
// Packet settings
|
|
|
|
#define CONFIG_PASSALL false
|
|
|
|
|
2014-12-02 19:10:06 -05:00
|
|
|
// Port settings
|
2018-12-27 14:24:21 -05:00
|
|
|
#if TARGET_CPU == m1284p
|
2019-01-27 14:25:11 -05:00
|
|
|
#define ADC_PORT PORTA
|
|
|
|
#define ADC_DDR DDRA
|
|
|
|
|
|
|
|
#define DAC_PORT PORTC
|
|
|
|
#define DAC_DDR DDRC
|
|
|
|
|
|
|
|
#define VREF_PORT PORTD
|
|
|
|
#define VREF_DDR DDRD
|
|
|
|
|
|
|
|
#define LED_PORT PORTB
|
|
|
|
#define LED_DDR DDRB
|
|
|
|
|
|
|
|
#define PTT_DDR DDRD
|
|
|
|
#define PTT_PORT PORTD
|
|
|
|
#define PTT_PIN 5
|
|
|
|
#define PTT_NEG_PIN 4
|
|
|
|
|
|
|
|
#define SPI_PORT PORTB
|
|
|
|
#define SPI_DDR DDRB
|
|
|
|
#define SPI_MOSI 5
|
|
|
|
#define SPI_MISO 6
|
|
|
|
#define SPI_CLK 7
|
|
|
|
|
|
|
|
#define SD_CS_DDR DDRA
|
|
|
|
#define SD_CS_PORT PORTA
|
|
|
|
#define SD_CS_PIN 6
|
|
|
|
#define SD_DETECT_DDR DDRA
|
|
|
|
#define SD_DETECT_PORT PORTA
|
|
|
|
#define SD_DETECT_INPUT PINA
|
|
|
|
#define SD_DETECT_PIN 7
|
2019-01-29 10:41:27 -05:00
|
|
|
|
|
|
|
#define BT_DDR DDRA
|
|
|
|
#define BT_PORT PORTA
|
|
|
|
#define BT_INPUT PINA
|
|
|
|
#define BT_MODE 3
|
|
|
|
#define BT_RTS 4
|
|
|
|
|
2019-02-04 11:02:19 -05:00
|
|
|
#define GPS_DDR DDRA
|
|
|
|
#define GPS_PORT PORTA
|
|
|
|
#define GPS_INPUT PINA
|
|
|
|
#define GPS_EN_PIN 5
|
|
|
|
|
2019-01-29 10:41:27 -05:00
|
|
|
#define USR_IO_DDR DDRA
|
|
|
|
#define USR_IO_PORT PORTA
|
|
|
|
#define USR_IO_1 1
|
|
|
|
#define USR_IO_2 2
|
|
|
|
#define USR_IO_3 3
|
|
|
|
#define USR_IO_4 4
|
2019-01-12 09:12:51 -05:00
|
|
|
#endif
|
|
|
|
|
2019-11-03 09:55:35 -05:00
|
|
|
// File system paths
|
|
|
|
#define PATH_BASE "OpenModem"
|
|
|
|
#define PATH_LOG "OpenModem/Log"
|
|
|
|
#define PATH_LOG_INDEX "OpenModem/Log/packet.index"
|
|
|
|
|
|
|
|
#define PATH_ENTROPY_INDEX "OpenModem/entropy.index"
|
|
|
|
#define PATH_ENTROPY_SOURCE "OpenModem/entropy.source"
|
|
|
|
#define PATH_AES_128_KEY "OpenModem/aes128.key"
|
|
|
|
#define PATH_CRYPTO_DISABLE "OpenModem/aes128.disable"
|
|
|
|
|
2019-04-05 07:26:53 -04:00
|
|
|
#endif
|