useless
Dependents: Final_Homework1 ee202Homework1 EE202A_Homework1 PRVIZ_LV8
Fork of TSI by
Revision 5:a192baf6250c, committed 2014-02-08
- Comitter:
- bmdlh
- Date:
- Sat Feb 08 22:20:24 2014 +0000
- Parent:
- 4:4dc2f5a3a731
- Commit message:
- cai cai wo shi shui
Changed in this revision
TSISensor.cpp | Show annotated file Show diff for this revision Revisions of this file |
TSISensor.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r 4dc2f5a3a731 -r a192baf6250c TSISensor.cpp --- a/TSISensor.cpp Fri Jun 28 13:59:29 2013 +0000 +++ b/TSISensor.cpp Sat Feb 08 22:20:24 2014 +0000 @@ -252,3 +252,25 @@ TSI0->GENCS |= TSI_GENCS_EOSF_MASK; // Clear End of Scan Flag changeElectrode(); } + +void TSISensor::Overwrite_ps_nscn(int ps,int nscn) +{ + + TSI0->GENCS |= (TSI_GENCS_ESOR_MASK + | TSI_GENCS_MODE(0) + | TSI_GENCS_REFCHRG(4) + | TSI_GENCS_DVOLT(0) + | TSI_GENCS_EXTCHRG(7) + | TSI_GENCS_PS(ps) + | TSI_GENCS_NSCN(nscn) + | TSI_GENCS_TSIIEN_MASK + | TSI_GENCS_STPE_MASK + ); + + TSI0->GENCS |= TSI_GENCS_TSIEN_MASK; + + //NVIC_SetVector(TSI0_IRQn, (uint32_t)&tsi_irq); + //NVIC_EnableIRQ(TSI0_IRQn); + + selfCalibration(); +} \ No newline at end of file
diff -r 4dc2f5a3a731 -r a192baf6250c TSISensor.h --- a/TSISensor.h Fri Jun 28 13:59:29 2013 +0000 +++ b/TSISensor.h Sat Feb 08 22:20:24 2014 +0000 @@ -64,7 +64,8 @@ uint8_t readDistance(); uint16_t readValue(uint8_t); void TSISensor_reset(void); - + void Overwrite_ps_nscn(int ps,int nscn); + private: void sliderRead(void); void selfCalibration(void);