You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

104 lines
3.6 KiB
C

/*
* pc_board.h
*
* Created: 5/3/2020 6:47:40 PM
* Author: Penguin
*/
#ifndef _PC_BOARD_H_
#define _PC_BOARD_H_
#include <hal_gpio.h>
// SAME54 has 14 pin functions
#define GPIO_PIN_FUNCTION_A 0
#define GPIO_PIN_FUNCTION_B 1
#define GPIO_PIN_FUNCTION_C 2
#define GPIO_PIN_FUNCTION_D 3
#define GPIO_PIN_FUNCTION_E 4
#define GPIO_PIN_FUNCTION_F 5
#define GPIO_PIN_FUNCTION_G 6
#define GPIO_PIN_FUNCTION_H 7
#define GPIO_PIN_FUNCTION_I 8
#define GPIO_PIN_FUNCTION_J 9
#define GPIO_PIN_FUNCTION_K 10
#define GPIO_PIN_FUNCTION_L 11
#define GPIO_PIN_FUNCTION_M 12
#define GPIO_PIN_FUNCTION_N 13
// I2C Config
#define I2C_MASTER_SDA (GPIO_PORTA, 22)
#define I2C_MASTER_SDA_MUX PINMUX_PA22C_SERCOM3_PAD0
#define I2C_MASTER_SCL (GPIO_PORTA, 23)
#define I2C_MASTER_SCL_MUX PINMUX_PA23C_SERCOM3_PAD1
#define I2C_MASTER_SERCOM SERCOM3
// Debug USART Config
#define USART_DEBUG_RX GPIO(GPIO_PORTA, 5)
#define USART_DEBUG_RX_MUX PINMUX_PA05D_SERCOM0_PAD1
#define USART_DEBUG_TX GPIO(GPIO_PORTA, 4)
#define USART_DEBUG_TX_MUX PINMUX_PA04D_SERCOM0_PAD0
#define USART_DEBUG_SERCOM SERCOM0
//SSD1963 HW Config
#define SSD1963_TFT_DATA_MASK (0x00FFFFFF)
#define SSD1963_TFT_DATA_GROUP ((PortGroup*)&PORT->Group[1])
#define SSD1963_TFT_DATA_PORT GPIO_PORTB
#define SSD1963_TFT_DATA_PORT_GROUP (&PORT->Group[1])
#define SSD1963_TFT_DATA_DIRECTION GPIO_DIRECTION_OUT
#define SSD1963_TFT_DATA_PULL_MODE GPIO_PULL_OFF
#define SSD1963_TFT_DATA_FUNCTION GPIO_PIN_FUNCTION_OFF
#define SSD1963_TFT_nRST_PIN PIN_PC28
#define SSD1963_TFT_nRST_PORT_PIN 28
#define SSD1963_TFT_nRST_PORT GPIO_PORTC
#define SSD1963_TFT_nRST_FUNCTION GPIO_PIN_FUNCTION_OFF
#define SSD1963_TFT_nRST_DIRECTION GPIO_DIRECTION_OUT
#define SSD1963_TFT_nRST_PULL_MODE GPIO_PULL_UP
#define SSD1963_TFT_nRST GPIO(SSD1963_TFT_nRST_PORT, SSD1963_TFT_nRST_PORT_PIN)
#define SSD1963_TFT_RSDC_PIN PIN_PA09
#define SSD1963_TFT_RSDC_PORT_PIN 9
#define SSD1963_TFT_RSDC_PORT GPIO_PORTA
#define SSD1963_TFT_RSDC_FUNCTION GPIO_PIN_FUNCTION_OFF
#define SSD1963_TFT_RSDC_DIRECTION GPIO_DIRECTION_OUT
#define SSD1963_TFT_RSDC_PULL_MODE GPIO_PULL_DOWN
#define SSD1963_TFT_RSDC GPIO(SSD1963_TFT_RSDC_PORT, SSD1963_TFT_RSDC_PORT_PIN)
#define SSD1963_TFT_CS_PIN PIN_PA08
#define SSD1963_TFT_CS_PORT_PIN 8
#define SSD1963_TFT_CS_PORT GPIO_PORTA
#define SSD1963_TFT_CS_FUNCTION GPIO_PIN_FUNCTION_OFF
#define SSD1963_TFT_CS_DIRECTION GPIO_DIRECTION_OUT
#define SSD1963_TFT_CS_PULL_MODE GPIO_PULL_DOWN
#define SSD1963_TFT_CS GPIO(SSD1963_TFT_CS_PORT, SSD1963_TFT_CS_PORT_PIN)
#define SSD1963_TFT_WR_PIN PIN_PB24
#define SSD1963_TFT_WR_PORT_PIN 24
#define SSD1963_TFT_WR_PORT GPIO_PORTB
#define SSD1963_TFT_WR_FUNCTION GPIO_PIN_FUNCTION_OFF
#define SSD1963_TFT_WR_DIRECTION GPIO_DIRECTION_OUT
#define SSD1963_TFT_WR_PULL_MODE GPIO_PULL_DOWN
#define SSD1963_TFT_WR GPIO(SSD1963_TFT_WR_PORT, SSD1963_TFT_WR_PORT_PIN)
#define SSD1963_TFT_RD_PIN PIN_PB23
#define SSD1963_TFT_RD_PORT_PIN 23
#define SSD1963_TFT_RD_PORT GPIO_PORTB
#define SSD1963_TFT_RD_FUNCTION GPIO_PIN_FUNCTION_OFF
#define SSD1963_TFT_RD_DIRECTION GPIO_DIRECTION_OUT
#define SSD1963_TFT_RD_PULL_MODE GPIO_PULL_DOWN
#define SSD1963_TFT_RD GPIO(SSD1963_TFT_RD_PORT, SSD1963_TFT_RD_PORT_PIN)
#define SSD1963_TFT_TE_PIN PIN_PA03
#define SSD1963_TFT_TE_PORT_PIN 3
#define SSD1963_TFT_TE_PORT GPIO_PORTA
#define SSD1963_TFT_TE_FUNCTION GPIO_PIN_FUNCTION_OFF
#define SSD1963_TFT_TE_DIRECTION GPIO_DIRECTION_IN
#define SSD1963_TFT_TE_PULL_MODE GPIO_PULL_DOWN
#define SSD1963_TFT_TE GPIO(SSD1963_TFT_TE_PORT, SSD1963_TFT_TE_PORT_PIN)
#endif