code to access the AT30TSE75x temperature and E-prom device
Dependents: AT30TSE752TST AT30TSE752TST2
Diff: AT30TSE75x.h
- Revision:
- 1:c0db18a0c56b
- Parent:
- 0:7cb648bc5c2a
- Child:
- 2:91836ad02096
--- a/AT30TSE75x.h Fri Jan 13 12:11:55 2017 +0000 +++ b/AT30TSE75x.h Tue Jan 17 13:43:08 2017 +0000 @@ -9,7 +9,7 @@ #include "I2CInterface.h" -#define VERSION_AT30TSE75x_HDR "0.80" +#define VERSION_AT30TSE75x_HDR "0.86" /** AT30TSE75x class. * Used for interfacing with a AT30TSE75x temperature sensor and ee-prom @@ -21,8 +21,10 @@ * ee-prom set / read not tested / implemented. * version 0.8 : read of temperature 12 bits, fixed configuration * read /write ee-prom + * version 0.86 : added ee-prom write protect mode tested ( un-protect not tested) * this code is only tested with the AT30TSE752 version ( 2 KBit version) - * processor for the testing : FRDM-KL25Z + * + * processor board for the testing : FRDM-KL25Z * * (C) Wim Beaumont Universiteit Antwerpen 2016, 2017 * @@ -48,7 +50,12 @@ // read a single byte from ee prom int read_eeprombyte(char &data, uint8_t word_addr, uint8_t page); int write_eeprombyte(char data, uint8_t word_addr, uint8_t page); - + // set ee-prom in read only mode special voltage on A0 is needed and A1 and A2 shoud be low. + int protect_eeprom(void); + // set ee-prom in read only mode special voltage on A0 and A1 should be high , A2 should be low + int unprotect_eeprom(void); + // returns I2C err ( NACK) in case protected , else ACK ( no error =0) + int get_eeprom_protec(void); };