Files
MTGcompanion/main/hw_pins.h

47 lines
1.6 KiB
C

/*
* MTG RFID Companion - Hardware pin assignments
*
* Do NOT change these unless explicitly instructed. SPI2_HOST (VSPI) is
* shared by the ST7789 display and the MFRC522 RFID reader.
*/
#pragma once
#include "sdkconfig.h"
#include "hal/gpio_types.h"
#include "driver/spi_master.h"
/* SPI2_HOST (VSPI): dedicated to the ST7789 display.
* On 7-pin ST7789 modules the display labels these SDA (MOSI) and
* SCL (SCK). */
#define HW_SPI_HOST (SPI2_HOST)
#define HW_SPI_SCK_GPIO (GPIO_NUM_18) /* display SCL */
#define HW_SPI_MOSI_GPIO (GPIO_NUM_23) /* display SDA */
#define HW_SPI_MISO_GPIO (GPIO_NUM_19) /* unused by display; kept for bus */
/* MFRC522 RFID reader - OWN SPI3_HOST (HSPI) bus, separate from the display.
* Using a independent controller avoids any bus interference between the
* panel and the reader. */
#define HW_RFID_SPI_HOST (SPI3_HOST)
#define HW_RFID_SCK_GPIO (GPIO_NUM_16)
#define HW_RFID_MOSI_GPIO (GPIO_NUM_17)
#define HW_RFID_MISO_GPIO (GPIO_NUM_13)
#define HW_RC522_CS_GPIO (GPIO_NUM_26)
#define HW_RC522_RST_GPIO (GPIO_NUM_22)
/* ST7789 display - 7-pin breakout: CS / DC / RST / SDA / SCL / GND / VCC.
* SDA and SCL share the SPI bus above (SCL=HW_SPI_SCK, SDA=HW_SPI_MOSI). */
#define HW_LCD_CS_GPIO (GPIO_NUM_15)
#define HW_LCD_DC_GPIO (GPIO_NUM_2)
#define HW_LCD_RST_GPIO (GPIO_NUM_4)
/* EC11 rotary encoder */
#define HW_ENC_CLK_GPIO (GPIO_NUM_32)
#define HW_ENC_DT_GPIO (GPIO_NUM_33)
#define HW_ENC_SW_GPIO (GPIO_NUM_25)
/* WS2812B Neopixel */
#define HW_NEOPIXEL_GPIO (GPIO_NUM_27)
/* Piezo buzzer */
#define HW_BUZZER_GPIO (GPIO_NUM_14)