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.
EEPROM4UID.h
00001 #include "mbed.h" 00002 #ifndef EEPROM4UID_H 00003 typedef union{ // creamos una estructura por facilidad 00004 uint8_t uidn_hl[2]; 00005 uint16_t uidn; 00006 }NUID; // nombre de la estructura 00007 00008 00009 typedef union{ 00010 uint8_t bytes[4]; 00011 uint32_t key; 00012 00013 }UID; 00014 00015 // se hace como una clase 00016 class EEPROM4UID{ 00017 public: 00018 EEPROM4UID (PinName SDA, PinName SCL, uint16_t epraddr); // constructor 00019 int8_t writeStr_EEPROM(uint16_t mem_addr, uint8_t* str); 00020 int8_t readByte_EEPROM(uint16_t mem_addr, uint8_t* byte); 00021 uint16_t wrt_newUID(UID &newUID);// 00022 void updt_uidn(NUID &num); // actualizar el numero de IDs 00023 // le entra la nueva cantidad de UIDs 00024 uint16_t read_uidn(); // función para leer los UIDS 00025 void read_database(UID* dtbse); 00026 private: 00027 I2C eeprom; 00028 NUID n; 00029 uint16_t EPR_ADDR; 00030 }; 00031 00032 #endif
Generated on Tue Jul 19 2022 12:43:27 by
