Difference between revisions of "EEPROM"
Line 10: | Line 10: | ||
{{#Widget:LibTable}} | {{#Widget:LibTable}} | ||
|- | |- | ||
− | |Defination || | + | |Defination || void EEPROM_WriteByte(uint16_t v_eepromAddress_u16, uint8_t v_eepromData_u8) |
|- | |- | ||
− | | Input Arguments || | + | | Input Arguments || uint16_t: eeprom_address at which eeprom_data is to be written.<br />uint8_t: byte of data to be to be written in eeprom. |
|- | |- | ||
| Return Value|| none | | Return Value|| none | ||
Line 18: | Line 18: | ||
| Description || This function is used to write the data at specified EEPROM_address.. | | Description || This function is used to write the data at specified EEPROM_address.. | ||
|- | |- | ||
− | | Usage || | + | | Usage ||EEPROM_WriteByte(1234,25); Writes 25 in the eeprom at 1234(address) |
|} | |} | ||
+ | |||
+ | |||
+ | |||
==EEPROM_WriteNBytes== | ==EEPROM_WriteNBytes== | ||
Line 25: | Line 28: | ||
{{#Widget:LibTable}} | {{#Widget:LibTable}} | ||
|- | |- | ||
− | |Defination || | + | |Defination || void EEPROM_WriteNBytes(uint16_t EepromAddr, uint8_t *RamAddr, uint16_t NoOfBytes)''' |
|- | |- | ||
− | | Input Arguments || | + | | Input Arguments || uint16_t,: eeprom_address from where the N-bytes are to be written.<br /> |
− | + | uint8_t*: Pointer to the N-bytes of data to be written.<br /> | |
− | + | uint16_t : Number of bytes to be written | |
|- | |- | ||
| Return Value|| none | | Return Value|| none | ||
Line 35: | Line 38: | ||
| Description || This function is used to write N-bytes of data at specified EEPROM_address. | | Description || This function is used to write N-bytes of data at specified EEPROM_address. | ||
|- | |- | ||
− | | Usage || | + | | Usage ||uint8_t A_RamBuffer_U8[5]={10,20,30,40,50}; // Buffer containing the data to be written in Eeprom data<br /> |
+ | EEPROM_WriteNBytes(100,A_RamBuffer_U8,5); //Copies 5bytes data from A_RamBuffer_U8 into eeprm location 100. | ||
|} | |} | ||
+ | |||
+ | |||
+ | |||
==EEPROM_WriteString== | ==EEPROM_WriteString== | ||
Line 42: | Line 49: | ||
{{#Widget:LibTable}} | {{#Widget:LibTable}} | ||
|- | |- | ||
− | |Defination || | + | |Defination || void EEPROM_WriteString(uint16_t v_eepromAddress_u16, char *p_stringPointer_u8) |
|- | |- | ||
− | | Input Arguments || | + | | Input Arguments || uint16_t: eeprom_address where the String is to be written.<br /> |
− | + | char*: Pointer to String which has to be written. | |
|- | |- | ||
| Return Value|| none | | Return Value|| none | ||
Line 51: | Line 58: | ||
| Description || This function is used to Write a String at specified EEPROM_address.NOTE: Null char is also written into the eeprom. | | Description || This function is used to Write a String at specified EEPROM_address.NOTE: Null char is also written into the eeprom. | ||
|- | |- | ||
− | | Usage || | + | | Usage ||uint8_t A_StringBuffer_U8[20]="Hello, World"; // String to be written in eeprom<br /> |
+ | EEPROM_WriteString(50,A_StringBuffer_U8); //Copies a string "Hello, World" along with NULL character from A_StringBuffer_U8 into eeprom location 50. | ||
|} | |} | ||
+ | |||
+ | |||
+ | |||
==EEPROM_Erase== | ==EEPROM_Erase== | ||
Line 58: | Line 69: | ||
{{#Widget:LibTable}} | {{#Widget:LibTable}} | ||
|- | |- | ||
− | |Defination || | + | |Defination || void EEPROM_Erase()''' |
|- | |- | ||
| Input Arguments || none | | Input Arguments || none | ||
Line 64: | Line 75: | ||
| Return Value|| none | | Return Value|| none | ||
|- | |- | ||
− | | Description || | + | | Description || This function is used to erase the entire Eeprom memory.<br /> |
+ | Complete Eeprom(C_MaxEepromSize_U16) is filled with 0xFF to accomplish the Eeprom Erase. | ||
|- | |- | ||
− | | Usage || | + | | Usage ||EEPROM_Erase(); //Erases the complete(C_MaxEepromSize_U16 bytes) eeprom. |
|} | |} | ||
+ | |||
+ | |||
+ | |||
==EEPROM_ReadByte== | ==EEPROM_ReadByte== | ||
Line 74: | Line 89: | ||
{{#Widget:LibTable}} | {{#Widget:LibTable}} | ||
|- | |- | ||
− | |Defination || | + | |Defination || uint8_t EEPROM_ReadByte(uint16_t v_eepromAddress_u16) |
|- | |- | ||
− | | Input Arguments || | + | | Input Arguments || uint16_t: eeprom_address from where eeprom_data is to be read. |
|- | |- | ||
− | | Return Value|| | + | | Return Value|| uint8_t: data read from Eeprom. |
|- | |- | ||
| Description ||This function is used to read the data from specified EEPROM_address. | | Description ||This function is used to read the data from specified EEPROM_address. | ||
|- | |- | ||
− | | Usage || | + | | Usage || eeprom_data = EEPROM_ReadByte(100); returns the data from eeprom location 100 which is copied to eeprom_data |
|} | |} | ||
+ | |||
+ | |||
+ | |||
==EEPROM_ReadNBytes== | ==EEPROM_ReadNBytes== | ||
Line 89: | Line 107: | ||
{{#Widget:LibTable}} | {{#Widget:LibTable}} | ||
|- | |- | ||
− | |Defination || | + | |Defination || void EEPROM_ReadNBytes(uint16_t v_eepromAddress_16, uint8_t *p_ramAddress_u8, uint16_t v_numOfBytes_u16) |
|- | |- | ||
− | | Input Arguments || | + | | Input Arguments || uint16_t,: eeprom_address from where the N-bytes is to be read.<br /> |
− | + | uint8_t*: Pointer into which the N-bytes of data is to be read.<br /> | |
− | + | uint16_t : Number of bytes to be Read | |
− | + | ||
− | + | ||
|- | |- | ||
| Return Value|| none | | Return Value|| none | ||
|- | |- | ||
− | | Description || This function is used to Read N-bytes of data from specified EEPROM_address. The data read from the eeprom will be copied into the RamAddress | + | | Description || This function is used to Read N-bytes of data from specified EEPROM_address. The data read from the eeprom will be copied into the specified RamAddress .<br />Note:Care should be taken to allocate enough buffer to read the data. |
|- | |- | ||
− | | Usage || | + | | Usage ||uint8_t A_RamBuffer_U8[20]; // Buffer to read the Eeprom data<br /> |
+ | EEPROM_ReadNBytes(1000,A_RamBuffer_U8,20); //Copies 20bytes of eeprom data(address 1000) into A_RamBuffer_U8 | ||
|} | |} | ||
+ | |||
+ | |||
==EEPROM_ReadString== | ==EEPROM_ReadString== | ||
Line 110: | Line 129: | ||
{{#Widget:LibTable}} | {{#Widget:LibTable}} | ||
|- | |- | ||
− | |Defination || | + | |Defination || void EEPROM_ReadString(uint16_t v_eepromAddress_u16, char *p_destStringAddress_u8) |
|- | |- | ||
− | | Input Arguments || | + | | Input Arguments || uint16_t: eeprom_address from where the String is to be read.<br /> |
− | + | char*: Pointer into which the String is to be read. | |
|- | |- | ||
| Return Value||none | | Return Value||none | ||
|- | |- | ||
− | | Description ||This function is used to Read a String from specified EEPROM_address.The string read from eeprom will be copied to specified buffer | + | | Description ||This function is used to Read a String from specified EEPROM_address.The string read from eeprom will be copied to specified buffer along with NULL character. |
|- | |- | ||
− | | Usage || | + | | Usage ||uint8_t A_StringBuffer_U8[20]; // Buffer to read the Eeprom data<br /> |
+ | EEPROM_ReadString(200,A_StringBuffer_U8); //Copies a string from eeprom(address 200) along with NULL caharacter into A_StringBuffer_U8 | ||
|} | |} |
Revision as of 18:41, 25 December 2014
Contents
EEPROM
EEPROM_WriteByte
Defination | void EEPROM_WriteByte(uint16_t v_eepromAddress_u16, uint8_t v_eepromData_u8) |
Input Arguments | uint16_t: eeprom_address at which eeprom_data is to be written. uint8_t: byte of data to be to be written in eeprom. |
Return Value | none |
Description | This function is used to write the data at specified EEPROM_address.. |
Usage | EEPROM_WriteByte(1234,25); Writes 25 in the eeprom at 1234(address) |
EEPROM_WriteNBytes
Defination | void EEPROM_WriteNBytes(uint16_t EepromAddr, uint8_t *RamAddr, uint16_t NoOfBytes) |
Input Arguments | uint16_t,: eeprom_address from where the N-bytes are to be written. uint8_t*: Pointer to the N-bytes of data to be written. |
Return Value | none |
Description | This function is used to write N-bytes of data at specified EEPROM_address. |
Usage | uint8_t A_RamBuffer_U8[5]={10,20,30,40,50}; // Buffer containing the data to be written in Eeprom data EEPROM_WriteNBytes(100,A_RamBuffer_U8,5); //Copies 5bytes data from A_RamBuffer_U8 into eeprm location 100. |
EEPROM_WriteString
Defination | void EEPROM_WriteString(uint16_t v_eepromAddress_u16, char *p_stringPointer_u8) |
Input Arguments | uint16_t: eeprom_address where the String is to be written. char*: Pointer to String which has to be written. |
Return Value | none |
Description | This function is used to Write a String at specified EEPROM_address.NOTE: Null char is also written into the eeprom. |
Usage | uint8_t A_StringBuffer_U8[20]="Hello, World"; // String to be written in eeprom EEPROM_WriteString(50,A_StringBuffer_U8); //Copies a string "Hello, World" along with NULL character from A_StringBuffer_U8 into eeprom location 50. |
EEPROM_Erase
Defination | void EEPROM_Erase() |
Input Arguments | none |
Return Value | none |
Description | This function is used to erase the entire Eeprom memory. Complete Eeprom(C_MaxEepromSize_U16) is filled with 0xFF to accomplish the Eeprom Erase. |
Usage | EEPROM_Erase(); //Erases the complete(C_MaxEepromSize_U16 bytes) eeprom. |
EEPROM_ReadByte
Defination | uint8_t EEPROM_ReadByte(uint16_t v_eepromAddress_u16) |
Input Arguments | uint16_t: eeprom_address from where eeprom_data is to be read. |
Return Value | uint8_t: data read from Eeprom. |
Description | This function is used to read the data from specified EEPROM_address. |
Usage | eeprom_data = EEPROM_ReadByte(100); returns the data from eeprom location 100 which is copied to eeprom_data |
EEPROM_ReadNBytes
Defination | void EEPROM_ReadNBytes(uint16_t v_eepromAddress_16, uint8_t *p_ramAddress_u8, uint16_t v_numOfBytes_u16) |
Input Arguments | uint16_t,: eeprom_address from where the N-bytes is to be read. uint8_t*: Pointer into which the N-bytes of data is to be read. |
Return Value | none |
Description | This function is used to Read N-bytes of data from specified EEPROM_address. The data read from the eeprom will be copied into the specified RamAddress . Note:Care should be taken to allocate enough buffer to read the data. |
Usage | uint8_t A_RamBuffer_U8[20]; // Buffer to read the Eeprom data EEPROM_ReadNBytes(1000,A_RamBuffer_U8,20); //Copies 20bytes of eeprom data(address 1000) into A_RamBuffer_U8 |
EEPROM_ReadString
Defination | void EEPROM_ReadString(uint16_t v_eepromAddress_u16, char *p_destStringAddress_u8) |
Input Arguments | uint16_t: eeprom_address from where the String is to be read. char*: Pointer into which the String is to be read. |
Return Value | none |
Description | This function is used to Read a String from specified EEPROM_address.The string read from eeprom will be copied to specified buffer along with NULL character. |
Usage | uint8_t A_StringBuffer_U8[20]; // Buffer to read the Eeprom data EEPROM_ReadString(200,A_StringBuffer_U8); //Copies a string from eeprom(address 200) along with NULL caharacter into A_StringBuffer_U8 |