eive_arduino_interface/ArduinoConfig.h

37 lines
1.1 KiB
C
Raw Normal View History

2020-10-12 23:49:49 +02:00
#ifndef ARDUINOCONFIG_H_
#define ARDUINOCONFIG_H_
2020-10-13 00:43:33 +02:00
static const uint8_t COMMAND_TRANSFER_SPI = 1;
// Can be set to one for additional programming information from the primary
// serial port which is usually also used to flash the Arduino
// Can be disabled if this output interferes with the usual
// serial communication logic
#define PROGRAMMING_OUTPUT 1
2020-10-12 23:49:49 +02:00
#define BAUD_RATE 115200
#define SERIAL_RX_BUFFER_SIZE 256
#define RING_BUFFER_SIZE 100
2020-10-12 23:56:30 +02:00
#define MAX_PACKET_LENGTH 100
2020-10-12 23:49:49 +02:00
2020-10-13 00:43:33 +02:00
// Define which port to use for the SPI Chip Select by using the register
// definitions. The data direction register is assigned as well.
// The ports can be looked up on the official Arduino pinout schematics.
#ifdef ARDUINO_AVR_MEGA2560
// Defines for the Arduino Mega
#define CS_PORT PORTK
#define CS_DDR DDRK
#elif defined(ARDUINO_AVR_UNO)
#define CS_PORT PORTD
#define CS_DDR DDRD
#elif defined(__SAM3X8E__)
// Define for the Arduino Due
#define CS_PORT PORTC
#define CS_DDR DDRC
#else
#define CS_PORT PORTC
#define CS_DDR DDRC
#endif
2020-10-12 23:49:49 +02:00
#endif /* ARDUINOCONFIG_H_ */