Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
STMPE1600.cpp
00001 #include "STMPE1600.h" 00002 #include "common_define.h" 00003 00004 00005 00006 STMPE1600::STMPE1600 (I2C *i2c, uint8_t DevAddr) : _dev_i2c(i2c) , address(DevAddr) 00007 { 00008 write_sys_ctrl (SOFT_RESET); 00009 _gpdro_15 = (uint16_t)0; // gpio dir all IN 00010 write_16_bit_reg (GPDR_0_7, &_gpdro_15); 00011 _gpsro_15 = (uint16_t)0x0ffff; // gpio status all 1 00012 write_16_bit_reg (GPSR_0_7, &_gpsro_15); 00013 } 00014 00015 00016 void STMPE1600::read(uint8_t* pBuffer, uint8_t RegisterAddr, uint16_t NumByteToRead) 00017 { 00018 i2cRead(_dev_i2c,address,pBuffer,RegisterAddr,NumByteToRead); 00019 } 00020 00021 void STMPE1600::write(uint8_t* pBuffer, uint8_t RegisterAddr, uint16_t NumByteToWrite) 00022 { 00023 i2cWrite(_dev_i2c,address,pBuffer,RegisterAddr,NumByteToWrite); 00024 } 00025 00026 uint8_t STMPE1600::readID() 00027 { 00028 uint8_t device_id; 00029 read(&device_id,VersionId,1); 00030 return device_id; 00031 } 00032 00033
Generated on Tue Jul 12 2022 21:49:23 by
