Getting started with the system
AN3311
34/58
Doc ID 18209 Rev 1
/* Touchscreen Controller and Joystick DEFINES */
#define TSC_GPIO_PORT_SOURCE GPIO_PortSourceGPIOB
#define TSC_GPIO_PIN_SOURCE GPIO_PinSource14
#define JOY_GPIO_PORT_SOURCE GPIO_PortSourceGPIOB
#define JOY_GPIO_PIN_SOURCE GPIO_PinSource14
#define JOY_GPIO_SELECT_PORT GPIOG
#define JOY_GPIO_SELECT_PIN GPIO_Pin_7
#define JOY_GPIO_RIGHT_PORT GPIOG
#define JOY_GPIO_RIGHT_PIN GPIO_Pin_13
#define JOY_GPIO_LEFT_PORT GPIOG
#define JOY_GPIO_LEFT_PIN GPIO_Pin_14
#define JOY_GPIO_UP_PORT GPIOG
#define JOY_GPIO_UP_PIN GPIO_Pin_15
#define JOY_GPIO_DOWN_PORT GPIOD
#define JOY_GPIO_DOWN_PIN GPIO_Pin_3
#define JOY_GPIO_RCC_APB_PERIPH1 RCC_APB2Periph_GPIOG
#define JOY_GPIO_RCC_APB_PERIPH2 RCC_APB2Periph_GPIOG
#define JOY_GPIO_RCC_APB_PERIPH3 RCC_APB2Periph_GPIOG
#define JOY_GPIO_RCC_APB_PERIPH4 RCC_APB2Periph_GPIOG
#define JOY_GPIO_RCC_APB_PERIPH5 RCC_APB2Periph_GPIOD
#define TSC_EXTI_IRQ_CHANNEL EXTI15_10_IRQn
#define JOY_EXTI_IRQ_CHANNEL EXTI15_10_IRQn
#define TSC_EXTI_LINE EXTI_Line14
#define JOY_EXTI_LINE EXTI_Line14
#define TSC_GPIO_PORT GPIOA
#define TSC_GPIO_PIN GPIO_Pin_14
#define TSC_I2C_DEVICE_REGISTER 0x82
#define JOY_I2C_DEVICE_REGISTER 0x88
#define M24LR64_I2C_DEVICE_REGISTER 0x24
#define TSC_I2C_PORT I2C1
/* User Button GPIO Port and Pin*/
#ifdef USE_STM3210C_EVAL
#define USER_BUTTON_PORT GPIOB
#define USER_BUTTON_PIN GPIO_Pin_9
#elif USE_STM3210E_EVAL
#define USER_BUTTON_PORT GPIOG
#define USER_BUTTON_PIN GPIO_Pin_8
#endif
/* LCD Controller DEFINES */
#define LCD_CTRL_PORT_NCS GPIOB
#define LCD_GPIO_DATA_PORT GPIOC
#define LCD_CTRL_PIN_NCS GPIO_Pin_2
#define LCD_CTRL_PIN_NWR GPIO_Pin_15
#define LCD_CTRL_PIN_RS GPIO_Pin_7
#define LCD_GPIO_PIN_SCK GPIO_Pin_10
#define LCD_GPIO_PIN_MISO GPIO_Pin_11
#define LCD_GPIO_PIN_MOSI GPIO_Pin_12
#define LCD_GPIO_RCC_APB_PERIPH RCC_APB2Periph_GPIOC
#define LCD_GPIO_RCC_APB_PERIPH_NCS RCC_APB2Periph_GPIOB
#define LCD_GPIO_REMAP_PORT GPIO_Remap_SPI3
#define LCD_RCC_APB_PERIPH RCC_APB1Periph_SPI3
#define LCD_RCC_AHB_PERIPH RCC_AHBPeriph_FSMC
#define LCD_SPI_PORT SPI3
#ifdef USE_STM3210C_EVAL
#define LCD_CONNECTION_MODE GL_SPI
#elif USE_STM3210E_EVAL
#define LCD_CONNECTION_MODE GL_FSMC
#endif
#define RCC_AHBPeriph_FSMC ((uint32_t)0x00000100)