添加sht30
This commit is contained in:
parent
d8e312ff0e
commit
092d54210c
@ -16,9 +16,7 @@
|
||||
*/
|
||||
|
||||
#include "bsp_i2c_touch.h"
|
||||
#include "gt9xx.h"
|
||||
|
||||
|
||||
#include "bsp_touch_gtxx.h"
|
||||
|
||||
/* STM32 I2C <20><><EFBFBD><EFBFBD>ģʽ */
|
||||
#define I2C_Speed 400000
|
||||
@ -160,32 +158,23 @@ void I2C_ResetChip(void)
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
|
||||
GTP_INT_GPIO_CLK_ENABLE();
|
||||
GTP_RST_GPIO_CLK_ENABLE();
|
||||
|
||||
/*<2A><><EFBFBD><EFBFBD> INT<4E><54><EFBFBD>ţ<EFBFBD><C5A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC> */
|
||||
GPIO_InitStructure.Pin = GTP_INT_GPIO_PIN;
|
||||
GPIO_InitStructure.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
GPIO_InitStructure.Speed = GPIO_SPEED_HIGH;
|
||||
GPIO_InitStructure.Pull = GPIO_PULLDOWN; //<2F><><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC>
|
||||
HAL_GPIO_Init(GTP_INT_GPIO_PORT, &GPIO_InitStructure);
|
||||
|
||||
/*<2A><>ʼ<EFBFBD><CABC>GT9157,rstΪ<74>ߵ<EFBFBD>ƽ<EFBFBD><C6BD>intΪ<74>͵<EFBFBD>ƽ<EFBFBD><C6BD><EFBFBD><EFBFBD>gt9157<35><37><EFBFBD>豸<EFBFBD><E8B1B8>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ0xBA*/
|
||||
HAL_GPIO_WritePin (GTP_INT_GPIO_PORT,GTP_INT_GPIO_PIN,GPIO_PIN_RESET);
|
||||
|
||||
/*<2A><>λΪ<CEBB>͵<EFBFBD>ƽ<EFBFBD><C6BD>Ϊ<EFBFBD><CEAA>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><D7BC>*/
|
||||
HAL_GPIO_WritePin (GTP_RST_GPIO_PORT,GTP_RST_GPIO_PIN,GPIO_PIN_RESET);
|
||||
Delay(0x0FFFFF);
|
||||
|
||||
Delay(0x9FFFF);
|
||||
/*<2A><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>ʱ<EFBFBD>䣬<EFBFBD><E4A3AC><EFBFBD>г<EFBFBD>ʼ<EFBFBD><CABC>*/
|
||||
HAL_GPIO_WritePin (GTP_RST_GPIO_PORT,GTP_RST_GPIO_PIN,GPIO_PIN_SET);
|
||||
Delay(0x0FFFFF);
|
||||
|
||||
/*<2A><>ʼ<EFBFBD><CABC>GT9157,rstΪ<74>ߵ<EFBFBD>ƽ<EFBFBD><C6BD>intΪ<74>͵<EFBFBD>ƽ<EFBFBD><C6BD><EFBFBD><EFBFBD>gt9157<35><37><EFBFBD>豸<EFBFBD><E8B1B8>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ0xBA*/
|
||||
|
||||
/*<2A><>λΪ<CEBB>͵<EFBFBD>ƽ<EFBFBD><C6BD>Ϊ<EFBFBD><CEAA>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><D7BC>*/
|
||||
HAL_GPIO_WritePin (GTP_RST_GPIO_PORT,GTP_RST_GPIO_PIN,GPIO_PIN_RESET);
|
||||
Delay(0x0FFFFF);
|
||||
|
||||
/*<2A><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>ʱ<EFBFBD>䣬<EFBFBD><E4A3AC><EFBFBD>г<EFBFBD>ʼ<EFBFBD><CABC>*/
|
||||
HAL_GPIO_WritePin (GTP_RST_GPIO_PORT,GTP_RST_GPIO_PIN,GPIO_PIN_SET);
|
||||
Delay(0x0FFFFF);
|
||||
Delay(0x9FFFF);
|
||||
|
||||
/*<2A><>INT<4E><54><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽ<C4A3><CABD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD>մ<EFBFBD><D5B4><EFBFBD><EFBFBD>ж<EFBFBD><D0B6>ź<EFBFBD>*/
|
||||
GPIO_InitStructure.Pin = GTP_INT_GPIO_PIN;
|
||||
@ -200,7 +189,7 @@ void I2C_ResetChip(void)
|
||||
* @param <EFBFBD><EFBFBD>
|
||||
* @retval <EFBFBD><EFBFBD>
|
||||
*/
|
||||
void I2C_Mode_Config(void)
|
||||
static void I2C_Mode_Config(void)
|
||||
{
|
||||
/* I2C <20><><EFBFBD><EFBFBD> */
|
||||
|
||||
@ -304,7 +293,7 @@ static void i2c_Delay(void)
|
||||
ѭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ30ʱ<EFBFBD><EFBFBD>SCLƵ<EFBFBD><EFBFBD> = 533KHz<EFBFBD><EFBFBD>
|
||||
ѭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ20ʱ<EFBFBD><EFBFBD>SCLƵ<EFBFBD><EFBFBD> = 727KHz<EFBFBD><EFBFBD>
|
||||
*/
|
||||
for (i = 0; i < 10*8; i++);
|
||||
for (i = 0; i < 10*6; i++);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -5,10 +5,10 @@
|
||||
|
||||
/*ʹ<><CAB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>IIC<49><43><EFBFBD><EFBFBD>SOFT_IIC<49><43><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ1<CEAA><31>Ӳ<EFBFBD><D3B2>IIC<49><43><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ0
|
||||
!!ʹ<EFBFBD><EFBFBD>Ӳ<EFBFBD><EFBFBD>IICʱ<EFBFBD>dz<EFBFBD><EFBFBD><EFBFBD><EFBFBD>׳<EFBFBD><EFBFBD>ִ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƽ<EFBFBD>*/
|
||||
#define SOFT_IIC 1
|
||||
#define SOFT_IIC 0
|
||||
|
||||
/*<2A>趨ʹ<E8B6A8>õĵ<C3B5><C4B5><EFBFBD><EFBFBD><EFBFBD>IIC<49>豸<EFBFBD><E8B1B8>ַ*/
|
||||
#define GTP_ADDRESS 0xBA
|
||||
#define GTP_ADDRESS 0xBA//0x28//
|
||||
|
||||
#define I2CT_FLAG_TIMEOUT ((uint32_t)0x1000)
|
||||
#define I2CT_LONG_TIMEOUT ((uint32_t)(10 * I2CT_FLAG_TIMEOUT))
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -15,8 +15,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _GOODIX_GT9XX_H
|
||||
#define _GOODIX_GT9XX_H
|
||||
#ifndef _GOODIX_GTXX_H
|
||||
#define _GOODIX_GTXX_H
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@ -26,6 +26,7 @@
|
||||
#define NULL 0
|
||||
#endif
|
||||
|
||||
#define UPDATE_CONFIG 1 // 1 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
/*flags<67>Ŀ<EFBFBD>ȡֵ<C8A1><D6B5>ע<EFBFBD>͵<EFBFBD><CDB5><EFBFBD><EFBFBD>ڱ<EFBFBD><DAB1><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD>õ<EFBFBD>*/
|
||||
//#define I2C_M_TEN 0x0010 /* <20><>ʾ<EFBFBD><CABE><EFBFBD>Ǹ<EFBFBD>10λ<30><CEBB>ַ */
|
||||
@ -51,71 +52,56 @@ struct i2c_msg {
|
||||
uint8_t *buf; /*<2A>洢<EFBFBD><E6B4A2>д<EFBFBD><D0B4><EFBFBD>ݵ<EFBFBD>ָ<EFBFBD><D6B8> */
|
||||
};
|
||||
|
||||
/* ʹ<>õĸ<C3B5><C4B8><EFBFBD><EFBFBD><EFBFBD>Ļ<EFBFBD><C4BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ķֱ<C4B7><D6B1><EFBFBD> */
|
||||
#define LCD_MAX_PIXEL_WIDTH ((uint16_t)800)
|
||||
#define LCD_MAX_PIXEL_HEIGHT ((uint16_t)480)
|
||||
/* LCD Size (Width and Height) */
|
||||
#define LCD_PIXEL_WIDTH LCD_MAX_PIXEL_WIDTH
|
||||
#define LCD_PIXEL_HEIGHT LCD_MAX_PIXEL_HEIGHT
|
||||
/**
|
||||
* @brief <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
/*<2A><><EFBFBD>ݴ<EFBFBD><DDB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
||||
uint16_t max_width; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ,<2C><>
|
||||
uint16_t max_height; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD>
|
||||
|
||||
uint16_t config_reg_addr; //<2F><>ͬ<EFBFBD><CDAC><EFBFBD>͵Ĵ<CDB5><C4B4><EFBFBD>ic<69><63><EFBFBD>üĴ<C3BC><C4B4><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7>ͬ
|
||||
|
||||
}TOUCH_PARAM_TypeDef;
|
||||
|
||||
/**
|
||||
* @brief LCDҺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
INCH_5 = 0x00, /* Ұ<><D2B0>5<EFBFBD><35><EFBFBD><EFBFBD> */
|
||||
INCH_7, /* Ұ<><D2B0>7<EFBFBD><37><EFBFBD><EFBFBD> */
|
||||
INCH_4_3, /* Ұ<><D2B0>4.3<EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
|
||||
LCD_TYPE_NUM /* LCD<43><44><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
||||
}LCD_TypeDef;
|
||||
|
||||
/* <20><>ǰʹ<C7B0>õ<EFBFBD>LCD<43><44>Ĭ<EFBFBD><C4AC>Ϊ5<CEAA><35><EFBFBD><EFBFBD> */
|
||||
extern LCD_TypeDef cur_lcd;
|
||||
/**
|
||||
* @brief <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
GT9157=0,
|
||||
GT911=1,
|
||||
GT5688=2,
|
||||
GT917S=3,
|
||||
}TOUCH_IC;
|
||||
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѹij<D1B8><C4B3><EFBFBD><EFBFBD>飬<EFBFBD><E9A3AC>c<EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>
|
||||
//*************************** PART2:TODO define **********************************
|
||||
|
||||
// TODO: define your own default or for Sensor_ID == 0 config here.
|
||||
// The predefined one is just a sample config, which is not suitable for your tp in most cases.
|
||||
// 5<><35><EFBFBD><EFBFBD>GT9157<35><37><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
//#define CTP_CFG_GT9157 {\
|
||||
//0x00,0x20,0x03,0xE0,0x01,0x05,0x3C,0x00,0x01,0x08,\
|
||||
//0x28,0x0C,0x50,0x32,0x03,0x05,0x00,0x00,0x00,0x00,\
|
||||
//0x00,0x00,0x00,0x17,0x19,0x1E,0x14,0x8B,0x2B,0x0D,\
|
||||
//0x33,0x35,0x0C,0x08,0x00,0x00,0x00,0x9A,0x03,0x11,\
|
||||
//0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x32,0x00,0x00,\
|
||||
//0x00,0x20,0x58,0x94,0xC5,0x02,0x00,0x00,0x00,0x04,\
|
||||
//0xB0,0x23,0x00,0x93,0x2B,0x00,0x7B,0x35,0x00,0x69,\
|
||||
//0x41,0x00,0x5B,0x4F,0x00,0x5B,0x00,0x00,0x00,0x00,\
|
||||
//0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
|
||||
//0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
|
||||
//0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
|
||||
//0x00,0x00,0x02,0x04,0x06,0x08,0x0A,0x0C,0x0E,0x10,\
|
||||
//0x12,0x14,0x16,0x18,0x1A,0xFF,0x00,0x00,0x00,0x00,\
|
||||
//0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
|
||||
//0x00,0x00,0x00,0x02,0x04,0x06,0x08,0x0A,0x0C,0x0F,\
|
||||
//0x10,0x12,0x13,0x16,0x18,0x1C,0x1D,0x1E,0x1F,0x20,\
|
||||
//0x21,0x22,0x24,0x26,0xFF,0xFF,0xFF,0xFF,0x00,0x00,\
|
||||
//0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,\
|
||||
//0xFF,0xFF,0xFF,0xFF,0x48,0x01\
|
||||
//}
|
||||
|
||||
// 7<><37><EFBFBD><EFBFBD>GT911<31><31><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
//#define CTP_CFG_GT911 {\
|
||||
//0x00,0x20,0x03,0xE0,0x01,0x05,0x3D,0x00,0x01,0x48,\
|
||||
//0x28,0x08,0x6E,0x5A,0x03,0x05,0x00,0x00,0x00,0x00,\
|
||||
//0x00,0x00,0x00,0x18,0x1A,0x1E,0x14,0x87,0x28,0x0A,\
|
||||
//0x46,0x48,0x31,0x0D,0x00,0x00,0x02,0x18,0x03,0x1D,\
|
||||
//0x00,0x01,0x00,0x00,0x00,0x03,0x64,0x32,0x00,0x00,\
|
||||
//0x00,0x0F,0x4B,0x94,0x45,0x02,0x07,0x00,0x00,0x04,\
|
||||
//0x9B,0x11,0x00,0x72,0x18,0x00,0x57,0x21,0x00,0x43,\
|
||||
//0x2E,0x00,0x36,0x40,0x00,0x36,0x00,0x00,0x00,0x00,\
|
||||
//0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
|
||||
//0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
|
||||
//0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
|
||||
//0x00,0x00,0x14,0x12,0x10,0x0E,0x0C,0x0A,0x08,0x06,\
|
||||
//0x04,0x02,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,\
|
||||
//0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
|
||||
//0x00,0x00,0x26,0x24,0x22,0x21,0x20,0x1F,0x1E,0x1D,\
|
||||
//0x0C,0x0A,0x08,0x06,0x04,0x02,0x00,0xFF,0xFF,0xFF,\
|
||||
//0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,\
|
||||
//0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
|
||||
//0x00,0x00,0x00,0x00,0xCD,0x01 \
|
||||
//}
|
||||
|
||||
|
||||
|
||||
extern TOUCH_IC touchIC;
|
||||
extern const TOUCH_PARAM_TypeDef touch_param[];
|
||||
|
||||
// STEP_3(optional): Specify your special config info if needed
|
||||
#define GTP_MAX_HEIGHT 480
|
||||
#define GTP_MAX_WIDTH 800
|
||||
#define GTP_MAX_HEIGHT touch_param[touchIC].max_height
|
||||
#define GTP_MAX_WIDTH touch_param[touchIC].max_width
|
||||
#define GTP_INT_TRIGGER 0
|
||||
#define GTP_MAX_TOUCH 1
|
||||
|
||||
@ -127,7 +113,7 @@ typedef enum
|
||||
#define GTP_POLL_TIME 10
|
||||
#define GTP_ADDR_LENGTH 2
|
||||
#define GTP_CONFIG_MIN_LENGTH 186
|
||||
#define GTP_CONFIG_MAX_LENGTH 240
|
||||
#define GTP_CONFIG_MAX_LENGTH 256
|
||||
#define FAIL 0
|
||||
#define SUCCESS 1
|
||||
#define SWITCH_OFF 0
|
||||
@ -178,19 +164,20 @@ typedef enum
|
||||
#define GTP_READ_COOR_ADDR 0x814E
|
||||
#define GTP_REG_SLEEP 0x8040
|
||||
#define GTP_REG_SENSOR_ID 0x814A
|
||||
#define GTP_REG_CONFIG_DATA 0x8047
|
||||
#define GTP_REG_CONFIG_DATA touch_param[touchIC].config_reg_addr
|
||||
#define GTP_REG_VERSION 0x8140
|
||||
|
||||
#define RESOLUTION_LOC 3
|
||||
#define TRIGGER_LOC 8
|
||||
#define X2Y_LOC (1<<3)
|
||||
|
||||
#define CFG_GROUP_LEN(p_cfg_grp) (sizeof(p_cfg_grp) / sizeof(p_cfg_grp[0]))
|
||||
|
||||
|
||||
//***************************PART1:ON/OFF define*******************************
|
||||
|
||||
#define GTP_DEBUG_ON 0
|
||||
#define GTP_DEBUG_ARRAY_ON 0
|
||||
#define GTP_DEBUG_ON 1
|
||||
#define GTP_DEBUG_ARRAY_ON 1
|
||||
#define GTP_DEBUG_FUNC_ON 0
|
||||
// Log define
|
||||
#define GTP_INFO(fmt,arg...) printf("<<-GTP-INFO->> "fmt"\n",##arg)
|
||||
@ -238,6 +225,8 @@ void GTP_IRQ_Disable(void);
|
||||
void GTP_IRQ_Enable(void);
|
||||
int32_t GTP_Init_Panel(void);
|
||||
int8_t GTP_Send_Command(uint8_t command);
|
||||
int GTP_Execu( int *x,int *y);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
File diff suppressed because one or more lines are too long
@ -150,7 +150,7 @@
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>ST-LINKIII-KEIL_SWO</Key>
|
||||
<Name>-U54FF75066578555551530367 -O2254 -SF10000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP (ARM Core") -D00(5BA02477) -L00(0) -TO131090 -TC10000000 -TT10000000 -TP21 -TDS8000 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO11 -FD20000000 -FC8000 -FN2 -FF0STM32F7x_1024.FLM -FS08000000 -FL0100000 -FP0($$Device:STM32F767IGTx$CMSIS\Flash\STM32F7x_1024.FLM) -FF1STM32F767_W25QXX -FS190000000 -FL11000000</Name>
|
||||
<Name>-U49FF6F067577525037062381 -O2254 -SF10000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP (ARM Core") -D00(5BA02477) -L00(0) -TO131090 -TC10000000 -TT10000000 -TP21 -TDS8000 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO11 -FD20000000 -FC8000 -FN2 -FF0STM32F7x_1024.FLM -FS08000000 -FL0100000 -FP0($$Device:STM32F767IGTx$CMSIS\Flash\STM32F7x_1024.FLM) -FF1STM32F767_W25QXX -FS190000000 -FL11000000</Name>
|
||||
</SetRegEntry>
|
||||
</TargetDriverDllRegistry>
|
||||
<Breakpoint>
|
||||
@ -953,7 +953,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>gui</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
@ -1305,7 +1305,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>Lib</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
@ -1345,11 +1345,11 @@
|
||||
<GroupNumber>9</GroupNumber>
|
||||
<FileNumber>85</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\Drivers\Touch_Driver\gt9xx.c</PathWithFileName>
|
||||
<FilenameWithoutPath>gt9xx.c</FilenameWithoutPath>
|
||||
<PathWithFileName>..\Drivers\Touch_Driver\bsp_touch_gtxx.c</PathWithFileName>
|
||||
<FilenameWithoutPath>bsp_touch_gtxx.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
|
@ -843,9 +843,9 @@
|
||||
<FilePath>..\Drivers\Touch_Driver\bsp_i2c_touch.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>gt9xx.c</FileName>
|
||||
<FileName>bsp_touch_gtxx.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\Drivers\Touch_Driver\gt9xx.c</FilePath>
|
||||
<FilePath>..\Drivers\Touch_Driver\bsp_touch_gtxx.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -18,7 +18,7 @@
|
||||
/* USER CODE BEGIN STM32TouchController */
|
||||
|
||||
#include <STM32TouchController.hpp>
|
||||
#include "gt9xx.h"
|
||||
#include "bsp_touch_gtxx.h"
|
||||
extern "C"
|
||||
{
|
||||
int32_t GTP_Init_Panel(void);
|
||||
|
@ -1,7 +1,7 @@
|
||||
[PreviousGenFiles]
|
||||
HeaderPath=D:/Project/hellotouchGFX/2_Start_game/Inc
|
||||
HeaderPath=F:/PROJECT/SOR/hellotouchGFX/demo/3_STM32F767_RTThread_TouchGFX/2_freertos_Start_game/Inc
|
||||
HeaderFiles=FreeRTOSConfig.h;app_touchgfx.h;TouchGFXGeneratedHAL.hpp;TouchGFXHAL.hpp;STM32TouchController.hpp;STM32DMA.hpp;stm32f7xx_it.h;stm32f7xx_hal_conf.h;main.h;
|
||||
SourcePath=D:/Project/hellotouchGFX/2_Start_game/Src
|
||||
SourcePath=F:/PROJECT/SOR/hellotouchGFX/demo/3_STM32F767_RTThread_TouchGFX/2_freertos_Start_game/Src
|
||||
SourceFiles=freertos.c;TouchGFXConfiguration.cpp;TouchGFXGeneratedHAL.cpp;TouchGFXHAL.cpp;STM32TouchController.cpp;STM32DMA.cpp;OSWrappers.cpp;TouchGFXGPIO.cpp;app_touchgfx.c;stm32f7xx_it.c;stm32f7xx_hal_msp.c;stm32f7xx_hal_timebase_tim.c;main.c;
|
||||
|
||||
[PreviousLibFiles]
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,233 @@
|
||||
/* drivers/input/touchscreen/gt9xx.h
|
||||
*
|
||||
* 2010 - 2013 Goodix Technology.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be a reference
|
||||
* to you, when you are integrating the GOODiX's CTP IC into your system,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _GOODIX_GTXX_H
|
||||
#define _GOODIX_GTXX_H
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#include "stm32f7xx.h"
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL 0
|
||||
#endif
|
||||
|
||||
#define UPDATE_CONFIG 1 // 1 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
/*flags<67>Ŀ<EFBFBD>ȡֵ<C8A1><D6B5>ע<EFBFBD>͵<EFBFBD><CDB5><EFBFBD><EFBFBD>ڱ<EFBFBD><DAB1><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD>õ<EFBFBD>*/
|
||||
//#define I2C_M_TEN 0x0010 /* <20><>ʾ<EFBFBD><CABE><EFBFBD>Ǹ<EFBFBD>10λ<30><CEBB>ַ */
|
||||
//#define I2C_M_NOSTART 0x4000 /* if I2C_FUNC_PROTOCOL_MANGLING */
|
||||
//#define I2C_M_REV_DIR_ADDR 0x2000 /* if I2C_FUNC_PROTOCOL_MANGLING */
|
||||
//#define I2C_M_IGNORE_NAK 0x1000 /* if I2C_FUNC_PROTOCOL_MANGLING */
|
||||
//#define I2C_M_NO_RD_ACK 0x0800 /* if I2C_FUNC_PROTOCOL_MANGLING */
|
||||
//#define I2C_M_RECV_LEN 0x0400 /* length will be first received byte */
|
||||
|
||||
/* <20><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
#define I2C_M_RD 0x0001
|
||||
/*
|
||||
* <EFBFBD>洢I2CͨѶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
||||
* @addr<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>豸<EFBFBD><EFBFBD>I2C<EFBFBD>豸<EFBFBD><EFBFBD>ַ
|
||||
* @flags: <EFBFBD><EFBFBD><EFBFBD>Ʊ<EFBFBD>־
|
||||
* @len<EFBFBD><EFBFBD> <EFBFBD><EFBFBD>д<EFBFBD><EFBFBD><EFBFBD>ݵij<EFBFBD><EFBFBD><EFBFBD>
|
||||
* @buf<EFBFBD><EFBFBD> <EFBFBD>洢<EFBFBD><EFBFBD>д<EFBFBD><EFBFBD><EFBFBD>ݵ<EFBFBD>ָ<EFBFBD><EFBFBD>
|
||||
**/
|
||||
struct i2c_msg {
|
||||
uint8_t addr; /*<2A><><EFBFBD>豸<EFBFBD><E8B1B8>I2C<32>豸<EFBFBD><E8B1B8>ַ */
|
||||
uint16_t flags; /*<2A><><EFBFBD>Ʊ<EFBFBD>־*/
|
||||
uint16_t len; /*<2A><>д<EFBFBD><D0B4><EFBFBD>ݵij<DDB5><C4B3><EFBFBD> */
|
||||
uint8_t *buf; /*<2A>洢<EFBFBD><E6B4A2>д<EFBFBD><D0B4><EFBFBD>ݵ<EFBFBD>ָ<EFBFBD><D6B8> */
|
||||
};
|
||||
|
||||
/* ʹ<>õĸ<C3B5><C4B8><EFBFBD><EFBFBD><EFBFBD>Ļ<EFBFBD><C4BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ķֱ<C4B7><D6B1><EFBFBD> */
|
||||
#define LCD_MAX_PIXEL_WIDTH ((uint16_t)800)
|
||||
#define LCD_MAX_PIXEL_HEIGHT ((uint16_t)480)
|
||||
/* LCD Size (Width and Height) */
|
||||
#define LCD_PIXEL_WIDTH LCD_MAX_PIXEL_WIDTH
|
||||
#define LCD_PIXEL_HEIGHT LCD_MAX_PIXEL_HEIGHT
|
||||
/**
|
||||
* @brief <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
/*<2A><><EFBFBD>ݴ<EFBFBD><DDB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
||||
uint16_t max_width; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ,<2C><>
|
||||
uint16_t max_height; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD>
|
||||
|
||||
uint16_t config_reg_addr; //<2F><>ͬ<EFBFBD><CDAC><EFBFBD>͵Ĵ<CDB5><C4B4><EFBFBD>ic<69><63><EFBFBD>üĴ<C3BC><C4B4><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7>ͬ
|
||||
|
||||
}TOUCH_PARAM_TypeDef;
|
||||
|
||||
/**
|
||||
* @brief LCDҺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
INCH_5 = 0x00, /* Ұ<><D2B0>5<EFBFBD><35><EFBFBD><EFBFBD> */
|
||||
INCH_7, /* Ұ<><D2B0>7<EFBFBD><37><EFBFBD><EFBFBD> */
|
||||
INCH_4_3, /* Ұ<><D2B0>4.3<EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
|
||||
LCD_TYPE_NUM /* LCD<43><44><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
||||
}LCD_TypeDef;
|
||||
|
||||
/* <20><>ǰʹ<C7B0>õ<EFBFBD>LCD<43><44>Ĭ<EFBFBD><C4AC>Ϊ5<CEAA><35><EFBFBD><EFBFBD> */
|
||||
extern LCD_TypeDef cur_lcd;
|
||||
/**
|
||||
* @brief <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
GT9157=0,
|
||||
GT911=1,
|
||||
GT5688=2,
|
||||
GT917S=3,
|
||||
}TOUCH_IC;
|
||||
|
||||
extern TOUCH_IC touchIC;
|
||||
extern const TOUCH_PARAM_TypeDef touch_param[];
|
||||
|
||||
// STEP_3(optional): Specify your special config info if needed
|
||||
#define GTP_MAX_HEIGHT touch_param[touchIC].max_height
|
||||
#define GTP_MAX_WIDTH touch_param[touchIC].max_width
|
||||
#define GTP_INT_TRIGGER 0
|
||||
#define GTP_MAX_TOUCH 1
|
||||
|
||||
|
||||
//***************************PART3:OTHER define*********************************
|
||||
#define GTP_DRIVER_VERSION "V2.2<2014/01/14>"
|
||||
#define GTP_I2C_NAME "Goodix-TS"
|
||||
#define GT91XX_CONFIG_PROC_FILE "gt9xx_config"
|
||||
#define GTP_POLL_TIME 10
|
||||
#define GTP_ADDR_LENGTH 2
|
||||
#define GTP_CONFIG_MIN_LENGTH 186
|
||||
#define GTP_CONFIG_MAX_LENGTH 256
|
||||
#define FAIL 0
|
||||
#define SUCCESS 1
|
||||
#define SWITCH_OFF 0
|
||||
#define SWITCH_ON 1
|
||||
|
||||
//******************** For GT9XXF Start **********************//
|
||||
#define GTP_REG_BAK_REF 0x99D0
|
||||
#define GTP_REG_MAIN_CLK 0x8020
|
||||
#define GTP_REG_CHIP_TYPE 0x8000
|
||||
#define GTP_REG_HAVE_KEY 0x804E
|
||||
#define GTP_REG_MATRIX_DRVNUM 0x8069
|
||||
#define GTP_REG_MATRIX_SENNUM 0x806A
|
||||
#define GTP_REG_COMMAND 0x8040
|
||||
|
||||
#define GTP_COMMAND_READSTATUS 0
|
||||
#define GTP_COMMAND_DIFFERENCE 1
|
||||
#define GTP_COMMAND_SOFTRESET 2
|
||||
#define GTP_COMMAND_UPDATE 3
|
||||
#define GTP_COMMAND_CALCULATE 4
|
||||
#define GTP_COMMAND_TURNOFF 5
|
||||
|
||||
|
||||
|
||||
|
||||
#define GTP_FL_FW_BURN 0x00
|
||||
#define GTP_FL_ESD_RECOVERY 0x01
|
||||
#define GTP_FL_READ_REPAIR 0x02
|
||||
|
||||
#define GTP_BAK_REF_SEND 0
|
||||
#define GTP_BAK_REF_STORE 1
|
||||
#define CFG_LOC_DRVA_NUM 29
|
||||
#define CFG_LOC_DRVB_NUM 30
|
||||
#define CFG_LOC_SENS_NUM 31
|
||||
|
||||
#define GTP_CHK_FW_MAX 40
|
||||
#define GTP_CHK_FS_MNT_MAX 300
|
||||
#define GTP_BAK_REF_PATH "/data/gtp_ref.bin"
|
||||
#define GTP_MAIN_CLK_PATH "/data/gtp_clk.bin"
|
||||
#define GTP_RQST_CONFIG 0x01
|
||||
#define GTP_RQST_BAK_REF 0x02
|
||||
#define GTP_RQST_RESET 0x03
|
||||
#define GTP_RQST_MAIN_CLOCK 0x04
|
||||
#define GTP_RQST_RESPONDED 0x00
|
||||
#define GTP_RQST_IDLE 0xFF
|
||||
|
||||
//******************** For GT9XXF End **********************//
|
||||
// Registers define
|
||||
#define GTP_READ_COOR_ADDR 0x814E
|
||||
#define GTP_REG_SLEEP 0x8040
|
||||
#define GTP_REG_SENSOR_ID 0x814A
|
||||
#define GTP_REG_CONFIG_DATA touch_param[touchIC].config_reg_addr
|
||||
#define GTP_REG_VERSION 0x8140
|
||||
|
||||
#define RESOLUTION_LOC 3
|
||||
#define TRIGGER_LOC 8
|
||||
#define X2Y_LOC (1<<3)
|
||||
|
||||
#define CFG_GROUP_LEN(p_cfg_grp) (sizeof(p_cfg_grp) / sizeof(p_cfg_grp[0]))
|
||||
|
||||
|
||||
//***************************PART1:ON/OFF define*******************************
|
||||
|
||||
#define GTP_DEBUG_ON 1
|
||||
#define GTP_DEBUG_ARRAY_ON 1
|
||||
#define GTP_DEBUG_FUNC_ON 0
|
||||
// Log define
|
||||
#define GTP_INFO(fmt,arg...) printf("<<-GTP-INFO->> "fmt"\n",##arg)
|
||||
#define GTP_ERROR(fmt,arg...) printf("<<-GTP-ERROR->> "fmt"\n",##arg)
|
||||
#define GTP_DEBUG(fmt,arg...) do{\
|
||||
if(GTP_DEBUG_ON)\
|
||||
printf("<<-GTP-DEBUG->> [%d]"fmt"\n",__LINE__, ##arg);\
|
||||
}while(0)
|
||||
|
||||
#define GTP_DEBUG_ARRAY(array, num) do{\
|
||||
int32_t i;\
|
||||
uint8_t* a = array;\
|
||||
if(GTP_DEBUG_ARRAY_ON)\
|
||||
{\
|
||||
printf("<<-GTP-DEBUG-ARRAY->>\n");\
|
||||
for (i = 0; i < (num); i++)\
|
||||
{\
|
||||
printf("%02x ", (a)[i]);\
|
||||
if ((i + 1 ) %10 == 0)\
|
||||
{\
|
||||
printf("\n");\
|
||||
}\
|
||||
}\
|
||||
printf("\n");\
|
||||
}\
|
||||
}while(0)
|
||||
|
||||
#define GTP_DEBUG_FUNC() do{\
|
||||
if(GTP_DEBUG_FUNC_ON)\
|
||||
printf("<<-GTP-FUNC->> Func:%s@Line:%d\n",__func__,__LINE__);\
|
||||
}while(0)
|
||||
|
||||
|
||||
|
||||
#define GTP_SWAP(x, y) do{\
|
||||
typeof(x) z = x;\
|
||||
x = y;\
|
||||
y = z;\
|
||||
}while (0)
|
||||
|
||||
//*****************************End of Part III********************************
|
||||
int8_t GTP_Reset_Guitar(void);
|
||||
int32_t GTP_Read_Version(void);
|
||||
void GTP_IRQ_Disable(void);
|
||||
void GTP_IRQ_Enable(void);
|
||||
int32_t GTP_Init_Panel(void);
|
||||
int8_t GTP_Send_Command(uint8_t command);
|
||||
int GTP_Execu( int *x,int *y);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* _GOODIX_GT9XX_H_ */
|
File diff suppressed because one or more lines are too long
@ -202,6 +202,22 @@
|
||||
<ExecCommand></ExecCommand>
|
||||
<Expression></Expression>
|
||||
</Bp>
|
||||
<Bp>
|
||||
<Number>3</Number>
|
||||
<Type>0</Type>
|
||||
<LineNumber>50</LineNumber>
|
||||
<EnabledFlag>0</EnabledFlag>
|
||||
<Address>0</Address>
|
||||
<ByteObject>0</ByteObject>
|
||||
<HtxType>0</HtxType>
|
||||
<ManyObjects>0</ManyObjects>
|
||||
<SizeOfObject>0</SizeOfObject>
|
||||
<BreakByAccess>0</BreakByAccess>
|
||||
<BreakIfRCount>0</BreakIfRCount>
|
||||
<Filename>../Src/STM32TouchController.cpp</Filename>
|
||||
<ExecCommand></ExecCommand>
|
||||
<Expression></Expression>
|
||||
</Bp>
|
||||
</Breakpoint>
|
||||
<MemoryWindow1>
|
||||
<Mm>
|
||||
@ -953,7 +969,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>gui</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
@ -4936,8 +4952,8 @@
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\Drivers\Touch_Driver\gt9xx.c</PathWithFileName>
|
||||
<FilenameWithoutPath>gt9xx.c</FilenameWithoutPath>
|
||||
<PathWithFileName>..\Drivers\Touch_Driver\bsp_touch_gtxx.c</PathWithFileName>
|
||||
<FilenameWithoutPath>bsp_touch_gtxx.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
|
@ -2338,9 +2338,9 @@
|
||||
<FilePath>..\Drivers\Touch_Driver\bsp_i2c_touch.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>gt9xx.c</FileName>
|
||||
<FileName>bsp_touch_gtxx.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\Drivers\Touch_Driver\gt9xx.c</FilePath>
|
||||
<FilePath>..\Drivers\Touch_Driver\bsp_touch_gtxx.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -18,7 +18,8 @@
|
||||
/* USER CODE BEGIN STM32TouchController */
|
||||
|
||||
#include <STM32TouchController.hpp>
|
||||
#include "gt9xx.h"
|
||||
#include "bsp_touch_gtxx.h"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
int32_t GTP_Init_Panel(void);
|
||||
|
@ -312,8 +312,8 @@ CONFIG_PKG_AT_DEVICE_PATH="/packages/iot/at_device"
|
||||
CONFIG_AT_DEVICE_USING_ESP8266=y
|
||||
CONFIG_AT_DEVICE_ESP8266_INIT_ASYN=y
|
||||
CONFIG_AT_DEVICE_ESP8266_SAMPLE=y
|
||||
CONFIG_ESP8266_SAMPLE_WIFI_SSID="xgld1"
|
||||
CONFIG_ESP8266_SAMPLE_WIFI_PASSWORD="xgld64627816"
|
||||
CONFIG_ESP8266_SAMPLE_WIFI_SSID="ChinaNet-ssssss"
|
||||
CONFIG_ESP8266_SAMPLE_WIFI_PASSWORD="SQHWLK9394"
|
||||
CONFIG_ESP8266_SAMPLE_CLIENT_NAME="uart3"
|
||||
CONFIG_ESP8266_SAMPLE_RECV_BUFF_LEN=512
|
||||
# CONFIG_AT_DEVICE_USING_RW007 is not set
|
||||
@ -325,6 +325,7 @@ CONFIG_ESP8266_SAMPLE_RECV_BUFF_LEN=512
|
||||
# CONFIG_AT_DEVICE_USING_BC26 is not set
|
||||
# CONFIG_AT_DEVICE_USING_AIR720 is not set
|
||||
# CONFIG_AT_DEVICE_USING_ME3616 is not set
|
||||
# CONFIG_AT_DEVICE_USING_M6315 is not set
|
||||
# CONFIG_PKG_USING_AT_DEVICE_V202 is not set
|
||||
# CONFIG_PKG_USING_AT_DEVICE_V201 is not set
|
||||
# CONFIG_PKG_USING_AT_DEVICE_V200 is not set
|
||||
@ -344,6 +345,7 @@ CONFIG_PKG_AT_DEVICE_VER_NUM=0x99999
|
||||
# CONFIG_PKG_USING_TENCENT_IOTHUB is not set
|
||||
# CONFIG_PKG_USING_JIOT-C-SDK is not set
|
||||
# CONFIG_PKG_USING_UCLOUD_IOT_SDK is not set
|
||||
# CONFIG_PKG_USING_JOYLINK is not set
|
||||
# CONFIG_PKG_USING_NIMBLE is not set
|
||||
# CONFIG_PKG_USING_OTA_DOWNLOADER is not set
|
||||
# CONFIG_PKG_USING_IPMSG is not set
|
||||
@ -544,8 +546,8 @@ CONFIG_BSP_USING_I2C1=y
|
||||
#
|
||||
# Notice: PB6 --> 22; PB7 --> 23
|
||||
#
|
||||
CONFIG_BSP_I2C1_SCL_PIN=53
|
||||
CONFIG_BSP_I2C1_SDA_PIN=54
|
||||
CONFIG_BSP_I2C1_SCL_PIN=60
|
||||
CONFIG_BSP_I2C1_SDA_PIN=61
|
||||
CONFIG_BSP_USING_ONCHIP_RTC=y
|
||||
CONFIG_BSP_RTC_USING_LSE=y
|
||||
# CONFIG_BSP_RTC_USING_LSI is not set
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include <arpa/inet.h>
|
||||
#include <netdev.h>
|
||||
#include <ntp.h>
|
||||
|
||||
/* defined the LED0 pin: PH10 */
|
||||
#define LED0_PIN GET_PIN(H, 10)
|
||||
|
||||
@ -48,9 +49,9 @@ int main(void)
|
||||
while (count++)
|
||||
{
|
||||
rt_pin_write(LED0_PIN, PIN_HIGH);
|
||||
rt_thread_mdelay(500);
|
||||
rt_thread_mdelay(1000);
|
||||
rt_pin_write(LED0_PIN, PIN_LOW);
|
||||
rt_thread_mdelay(500);
|
||||
rt_thread_mdelay(1000);
|
||||
}
|
||||
|
||||
return RT_EOK;
|
||||
|
@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2019, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2020-02-20 Mculover666 the first version
|
||||
*/
|
||||
|
||||
#include <rtthread.h>
|
||||
#include <board.h>
|
||||
#include <sht3x.h>
|
||||
|
||||
#define THREAD_PRIORITY 9
|
||||
#define THREAD_STACK_SIZE 1024
|
||||
#define THREAD_TIMESLICE 5
|
||||
|
||||
static rt_thread_t tid1 = RT_NULL;
|
||||
|
||||
/* 入口函数 */
|
||||
static void sht30_collect_thread_entry(void *parameter)
|
||||
{
|
||||
sht3x_device_t sht3x_device;
|
||||
|
||||
sht3x_device = sht3x_init("i2c1", 0x44);
|
||||
|
||||
//此处需要短暂的延时,否则会出现连续读取失败的问题,感谢网友的提醒
|
||||
rt_thread_mdelay(150);
|
||||
|
||||
while (1)
|
||||
{
|
||||
if(RT_EOK == sht3x_read_singleshot(sht3x_device))
|
||||
{
|
||||
rt_kprintf("sht30 humidity : %d.%d ", (int)sht3x_device->humidity, (int)(sht3x_device->humidity * 10) % 10);
|
||||
rt_kprintf("temperature: %d.%d\n", (int)sht3x_device->temperature, (int)(sht3x_device->temperature * 10) % 10);
|
||||
}
|
||||
else
|
||||
{
|
||||
rt_kprintf("read sht3x fail.\r\n");
|
||||
break;
|
||||
}
|
||||
rt_thread_mdelay(2000);
|
||||
}
|
||||
}
|
||||
|
||||
/* 创建线程 */
|
||||
int sht30_collect(void)
|
||||
{
|
||||
/* 创建线程*/
|
||||
tid1 = rt_thread_create("sht30",
|
||||
sht30_collect_thread_entry, RT_NULL,
|
||||
THREAD_STACK_SIZE,
|
||||
THREAD_PRIORITY, THREAD_TIMESLICE);
|
||||
|
||||
/* 如果获得线程控制块,启动这个线程 */
|
||||
if (tid1 != RT_NULL)
|
||||
rt_thread_startup(tid1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
INIT_APP_EXPORT(sht30_collect);
|
@ -634,7 +634,6 @@ Output:
|
||||
|
||||
GTP_DEBUG_FUNC();
|
||||
|
||||
|
||||
I2C_Touch_Init();
|
||||
|
||||
ret = GTP_I2C_Test();
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
#ifdef RT_USING_I2C
|
||||
|
||||
#define DRV_DEBUG
|
||||
//#define DRV_DEBUG
|
||||
#define LOG_TAG "drv.i2c"
|
||||
#include <drv_log.h>
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -462,6 +462,11 @@
|
||||
<FileType>1</FileType>
|
||||
<FilePath>applications\main.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>sht30_ccollect.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>.\applications\sht30_ccollect.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
|
@ -180,8 +180,8 @@
|
||||
#define AT_DEVICE_USING_ESP8266
|
||||
#define AT_DEVICE_ESP8266_INIT_ASYN
|
||||
#define AT_DEVICE_ESP8266_SAMPLE
|
||||
#define ESP8266_SAMPLE_WIFI_SSID "xgld1"
|
||||
#define ESP8266_SAMPLE_WIFI_PASSWORD "xgld64627816"
|
||||
#define ESP8266_SAMPLE_WIFI_SSID "ChinaNet-ssssss"
|
||||
#define ESP8266_SAMPLE_WIFI_PASSWORD "SQHWLK9394"
|
||||
#define ESP8266_SAMPLE_CLIENT_NAME "uart3"
|
||||
#define ESP8266_SAMPLE_RECV_BUFF_LEN 512
|
||||
#define PKG_USING_AT_DEVICE_LATEST_VERSION
|
||||
@ -239,8 +239,8 @@
|
||||
|
||||
/* Notice: PB6 --> 22; PB7 --> 23 */
|
||||
|
||||
#define BSP_I2C1_SCL_PIN 53
|
||||
#define BSP_I2C1_SDA_PIN 54
|
||||
#define BSP_I2C1_SCL_PIN 60
|
||||
#define BSP_I2C1_SDA_PIN 61
|
||||
#define BSP_USING_ONCHIP_RTC
|
||||
#define BSP_RTC_USING_LSE
|
||||
#define BSP_USING_FMC
|
||||
|
Loading…
x
Reference in New Issue
Block a user