-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from Seeed-Studio/mipi_dsi
Merge: reTerminal driver into master
- Loading branch information
Showing
260 changed files
with
217,540 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Prerequisites | ||
*.d | ||
|
||
# Object files | ||
*.o | ||
*.ko | ||
*.obj | ||
*.elf | ||
|
||
# Linker output | ||
*.ilk | ||
*.map | ||
*.exp | ||
|
||
# Precompiled Headers | ||
*.gch | ||
*.pch | ||
|
||
# Libraries | ||
*.lib | ||
*.a | ||
*.la | ||
*.lo | ||
|
||
# Shared objects (inc. Windows DLLs) | ||
*.dll | ||
*.so | ||
*.so.* | ||
*.dylib | ||
|
||
# Executables | ||
Release | ||
*.exe | ||
*.out | ||
*.app | ||
*.i*86 | ||
*.x86_64 | ||
*.hex | ||
|
||
# Debug files | ||
Debug | ||
*.dSYM/ | ||
*.su | ||
*.idb | ||
*.pdb | ||
|
||
# Kernel Module Compile Results | ||
*.mod* | ||
*.cmd | ||
.tmp_versions/ | ||
modules.order | ||
Module.symvers | ||
Mkfile.old | ||
dkms.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
#ifndef __DEVICE_H__ | ||
#define __DEVICE_H__ | ||
|
||
|
||
#include <stdio.h> | ||
#include <string.h> | ||
|
||
#include "main.h" | ||
|
||
|
||
#define _DEBUG | ||
#ifdef _DEBUG | ||
extern uint8_t TxCplt; | ||
extern UART_HandleTypeDef huart2; | ||
#define DBG_PRINT(_s...) { \ | ||
int len = 0; char str[256]; \ | ||
len = sprintf(str, _s); \ | ||
HAL_UART_Transmit(&huart2, (uint8_t*)str, len, 1000); \ | ||
} | ||
#else | ||
#define DBG_PRINT(_s...) | ||
#endif | ||
|
||
|
||
#if 0// TIMER | ||
typedef uint32_t TIMER_HANDLE; | ||
typedef enum { | ||
TIMER_IDLE = 0, | ||
TIMER_RESET, | ||
TIMER_START, | ||
TIMER_STOP, | ||
}TIMER_STATE; | ||
void Timer_Init(void); | ||
void Timer_Tick(void); | ||
TIMER_HANDLE Timer_Register(uint32_t timeout, void(*func)(void*), void *param); | ||
uint8_t Timer_State(TIMER_HANDLE htimer, TIMER_STATE state); | ||
void Timer_Process(void); | ||
#endif | ||
|
||
|
||
// PWM | ||
void PWM_config(uint8_t duty); | ||
|
||
|
||
// GPIO output | ||
void LCD_VDD_out(uint8_t level); | ||
void LCD_RST_out(uint8_t level); | ||
void TP_INT_out(uint8_t level); | ||
void TP_INT_cfg(void); | ||
void TP_RST_out(uint8_t level); | ||
|
||
|
||
// Touchpanel | ||
/* Register defines */ | ||
#define GOODIX_REG_COMMAND 0x8040 | ||
#define GOODIX_CMD_SCREEN_OFF 0x05 | ||
|
||
#define GOODIX_READ_COOR_ADDR 0x814E | ||
#define GOODIX_GT1X_REG_CONFIG_DATA 0x8050 | ||
#define GOODIX_GT9X_REG_CONFIG_DATA 0x8047 | ||
#define GOODIX_REG_ID 0x8140 | ||
|
||
#define GOODIX_BUFFER_STATUS_READY (((uint32_t)0x01)<<7)//BIT(7) | ||
#define GOODIX_HAVE_KEY (((uint32_t)0x01)<<4)//BIT(4) | ||
|
||
#define GOODIX_MAX_CONTACTS 5 | ||
#define GOODIX_CONTACT_SIZE 8 | ||
#define GOODIX_STATUS_SIZE 2 | ||
|
||
#define TP_CONTACT_SIZE (GOODIX_MAX_CONTACTS*GOODIX_CONTACT_SIZE) | ||
#define TP_BUF_SIZE (GOODIX_STATUS_SIZE+TP_CONTACT_SIZE) | ||
HAL_StatusTypeDef goodix_i2c_read(uint16_t reg, uint8_t *buf, uint32_t len); | ||
HAL_StatusTypeDef goodix_i2c_write_u8(uint16_t reg, uint8_t value); | ||
void TP_Ver(uint8_t *data); | ||
void TP_Init(I2C_HandleTypeDef *hi2c); | ||
|
||
|
||
// I2C slave | ||
void I2C_Slave_ISR(I2C_HandleTypeDef *hi2c); | ||
void I2C_Slave_Init(I2C_HandleTypeDef *hi2c); | ||
void I2C_Slave_Process(void); | ||
|
||
|
||
#endif // __DEVICE_H__ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
/* USER CODE BEGIN Header */ | ||
/** | ||
****************************************************************************** | ||
* @file : main.h | ||
* @brief : Header for main.c file. | ||
* This file contains the common defines of the application. | ||
****************************************************************************** | ||
* @attention | ||
* | ||
* <h2><center>© Copyright (c) 2021 STMicroelectronics. | ||
* All rights reserved.</center></h2> | ||
* | ||
* This software component is licensed by ST under BSD 3-Clause license, | ||
* the "License"; You may not use this file except in compliance with the | ||
* License. You may obtain a copy of the License at: | ||
* opensource.org/licenses/BSD-3-Clause | ||
* | ||
****************************************************************************** | ||
*/ | ||
/* USER CODE END Header */ | ||
|
||
/* Define to prevent recursive inclusion -------------------------------------*/ | ||
#ifndef __MAIN_H | ||
#define __MAIN_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/* Includes ------------------------------------------------------------------*/ | ||
#include "stm32g0xx_hal.h" | ||
|
||
/* Private includes ----------------------------------------------------------*/ | ||
/* USER CODE BEGIN Includes */ | ||
#include "device.h" | ||
/* USER CODE END Includes */ | ||
|
||
/* Exported types ------------------------------------------------------------*/ | ||
/* USER CODE BEGIN ET */ | ||
|
||
/* USER CODE END ET */ | ||
|
||
/* Exported constants --------------------------------------------------------*/ | ||
/* USER CODE BEGIN EC */ | ||
|
||
/* USER CODE END EC */ | ||
|
||
/* Exported macro ------------------------------------------------------------*/ | ||
/* USER CODE BEGIN EM */ | ||
#define M_VER 0x01 | ||
#define S_VER 0x00 | ||
/* USER CODE END EM */ | ||
|
||
void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim); | ||
|
||
/* Exported functions prototypes ---------------------------------------------*/ | ||
void Error_Handler(void); | ||
|
||
/* USER CODE BEGIN EFP */ | ||
#define ADC_CH_MAX 2 | ||
extern uint16_t AdcVal[]; | ||
/* USER CODE END EFP */ | ||
|
||
/* Private defines -----------------------------------------------------------*/ | ||
#define LCD_VDD_Pin GPIO_PIN_1 | ||
#define LCD_VDD_GPIO_Port GPIOA | ||
#define TP_INT_Pin GPIO_PIN_4 | ||
#define TP_INT_GPIO_Port GPIOA | ||
#define TP_RST_Pin GPIO_PIN_5 | ||
#define TP_RST_GPIO_Port GPIOA | ||
#define LCD_RST_Pin GPIO_PIN_6 | ||
#define LCD_RST_GPIO_Port GPIOA | ||
#define LCD_PWM_Pin GPIO_PIN_7 | ||
#define LCD_PWM_GPIO_Port GPIOA | ||
/* USER CODE BEGIN Private defines */ | ||
|
||
/* USER CODE END Private defines */ | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* __MAIN_H */ | ||
|
||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
Oops, something went wrong.