STC15W408AS library 0.13.0
Loading...
Searching...
No Matches
Macros | Enumerations
eeprom.h File Reference
#include <stdint.h>
#include <sys.h>
#include <bits.h>
#include <power_management.h>
Include dependency graph for eeprom.h:

Go to the source code of this file.

Macros

#define OP_TRIGGER_SEQ_FIRST_BYTE   0x5A
 Read operation trigger sequence first byte.
 
#define OP_TRIGGER_SEQ_SECOND_BYTE   0xA5
 Read operation trigger sequence second byte.
 
#define CMD_FAIL_BIT   4
 Command fail error code.
 
#define ERROR_VALUE   0xFF
 Error value.
 
#define eeprom_disable_iap()
 Disables IAP.
 
#define get_eeprom_last_operation_result()   (get_bit(IAP_CONTR, CMD_FAIL_BIT) ? CMD_FAIL_ERROR : CMD_SUCCESS)
 get last operation result
 
#define eeprom_read_byte(addr_high, addr_low, value_ptr, error_ptr)
 Reads single byte from the EEPROM at the given address.
 
#define eeprom_erase_page(sector_start_addr, error_ptr)
 Erases a sector in the EEPROM starting from a specified address.
 
#define eeprom_write_byte(addr_high, addr_low, value, error_ptr)
 Writes a single byte to the EEPROM at the specified address.
 

Enumerations

enum  eeprom_operation_t { READ_OP = 0x01 , WRITE_OP = 0x02 , ERASE_OP = 0x03 }
 EEPROM operation types. More...
 
enum  eeprom_operation_status_t { CMD_SUCCESS = 0 , CMD_FAIL_ERROR = 1 , LOW_VOLTAGE_ERROR = 2 }
 EEPROM operation status. More...