OpenModem/device.h

121 lines
2.7 KiB
C
Raw Normal View History

2014-12-18 15:45:36 -07:00
#include "util/constants.h"
2014-12-02 17:10:06 -07:00
#ifndef DEVICE_CONFIGURATION
#define DEVICE_CONFIGURATION
2019-02-08 05:18:49 -07:00
// Version info
#define MAJ_VERSION 0x01
2020-06-01 13:27:38 -06:00
#define MIN_VERSION 0x05
2019-02-08 05:18:49 -07:00
2014-12-02 17:10:06 -07:00
// CPU settings
#define TARGET_CPU m1284p
#define F_CPU 20000000UL
2014-12-02 17:10:06 -07:00
#define FREQUENCY_CORRECTION 0
// Voltage references
2019-02-08 05:18:49 -07:00
#define CONFIG_ADC_REF 128
2019-04-05 05:26:53 -06:00
#define CONFIG_DAC_REF 255
2019-04-05 05:26:53 -06:00
#define CONFIG_LED_INTENSITY 192
2019-01-12 08:30:26 -07:00
#define CONFIG_COM_LED_TIMEOUT_MS 40
#define CONFIG_LED_UPDATE_INTERVAL_MS 40
2019-01-12 07:12:51 -07:00
// Demodulator settings
2018-04-24 07:34:50 -06:00
#define OPEN_SQUELCH true
2014-12-18 15:45:36 -07:00
2014-12-02 17:10:06 -07:00
// Serial settings
2014-12-18 15:45:36 -07:00
#define SERIAL_DEBUG false
#define TX_MAXWAIT 2UL
2020-06-01 05:28:02 -06:00
// Queue settings. Don't be fooled by free
// memory indications while compiling! With
// dynamic allocations by SD, exFAT and AES,
// these are more or less the hard limit in
// the current configuration.
#define CONFIG_QUEUE_SIZE 5000
#define CONFIG_QUEUE_MAX_LENGTH 15
2019-04-05 05:26:53 -06:00
#define CONFIG_UART0_BUFFER_SIZE 1536
2019-02-04 09:02:19 -07:00
#define CONFIG_UART1_BUFFER_SIZE 128
#define CONFIG_SERIAL_TIMEOUT_MS 10
2019-01-12 08:30:26 -07:00
#define CONFIG_BENCHMARK_MODE false
2014-12-02 17:10:06 -07:00
2018-12-29 07:57:49 -07:00
// CSMA Settings
2020-01-26 04:59:40 -07:00
#define CONFIG_FULL_DUPLEX false
2019-02-08 05:18:49 -07:00
#define CONFIG_CSMA_P_DEFAULT 255
#define CONFIG_CSMA_SLOTTIME_DEFAULT 20
2018-12-29 07:57:49 -07:00
2019-02-08 13:49:16 -07:00
#define AX25_MIN_FRAME_LEN 4
2019-02-07 10:36:40 -07:00
#define AX25_MAX_FRAME_LEN 611
#define AX25_MAX_PAYLOAD 576
2019-02-08 13:49:16 -07:00
#define AX25_MIN_PAYLOAD 2
2020-01-26 04:59:40 -07:00
#define AX25_ENCRYPTED_MIN_LENGTH 51
// The minimum packet length of an AES-128
// encrypted packet is equal to:
// padding byte + IV + 1 Block + HMAC + CRC
2019-01-08 12:56:58 -07:00
2018-12-29 16:32:19 -07:00
// Packet settings
#define CONFIG_PASSALL false
2014-12-02 17:10:06 -07:00
// Port settings
#if TARGET_CPU == m1284p
2019-01-27 12:25:11 -07: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 08:41:27 -07:00
#define BT_DDR DDRA
#define BT_PORT PORTA
#define BT_INPUT PINA
#define BT_MODE 3
#define BT_RTS 4
2019-02-04 09:02:19 -07:00
#define GPS_DDR DDRA
#define GPS_PORT PORTA
#define GPS_INPUT PINA
#define GPS_EN_PIN 5
2019-01-29 08:41:27 -07: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 07:12:51 -07:00
#endif
2019-11-03 07:55:35 -07: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 05:26:53 -06:00
#endif