Files
clockclock/clockclock/include/board.h
2021-06-08 21:44:43 +02:00

94 lines
1.8 KiB
C

#pragma once
#include "Arduino.h"
#ifndef HARDWAREVERSION
#define HARDWAREVERSION 12
#endif
#if HARDWAREVERSION == 10
#define MOT_STCK0 PA1
#define MOT_DIR0 PA2
#define MOT_RST0 PA3
#define MOT_EN0 PA4
#define MOT_VREF1 PA5
#define MOT_STCK1 PA6
#define MOT_DIR1 PA7
#define MOT_RST1 PB0
#define MOT_EN1 PB1
#define ADDR0 PA12
#define ADDR1 PA11
#define ADDR2 PA8
#define ADDR3 PB7
#define I2C_CLK PA9
#define I2C_SDA PA10
#define MCU_BUT_MIN PB4
#define MCU_BUT_PLUS PB5
#elif HARDWAREVERSION == 11
#define HASLEDS
#define MOT_STCK0 5
#define MOT_DIR0 4
#define MOT_RST0 14
#define MOT_STCK1 17
#define MOT_DIR1 16
#define MOT_RST1 18
#define MOT_VREF 25
#define MOT_EN 13
#define ADDR0 33
#define ADDR1 32
#define ADDR2 35
#define ADDR3 34
#define I2C_SCL 22
#define I2C_SDA 21
#define PROX_LED 27
#define LED_DATA 26
#define PROX_IN 36
#define MCU_BUT_MIN 19
#define MCU_BUT_PLUS 23
#elif HARDWAREVERSION == 12
#define HASLEDS
#define MOT_A1 17
#define MOT_A2 16
#define MOT_A3 18
#define MOT_B1 19
#define MOT_B2 20
#define MOT_B3 21
#define MOT_VREF 25
#define MOT_EN 13
#define ADDR0 33
#define ADDR1 32
#define ADDR2 35
#define ADDR3 34
#define I2C_SCL 22
#define I2C_SDA 21
#define PROX_LED 27
#define LED_DATA 26
#define PROX_IN 36
#define MCU_BUT_MIN 19
#define MCU_BUT_PLUS 23
#else
#warning NO BOARD SPECIFIED
#endif
void initBoard( void );