Prusa MINI Firmware overview
eeprom.h
Go to the documentation of this file.
1 // eeprom.h
2 
3 #ifndef _EEPROM_H
4 #define _EEPROM_H
5 
6 #include "variant8.h"
7 
8 #define EEVAR_VERSION 0x00
9 #define EEVAR_FILAMENT_TYPE 0x01
10 #define EEVAR_FILAMENT_COLOR 0x02
11 #define EEVAR_UNUSED_1 0x03
12 #define EEVAR_UNUSED_2 0x04
13 #define EEVAR_UNUSED_3 0x05
14 #define EEVAR_RUN_SELFTEST 0x06
15 #define EEVAR_RUN_XYZCALIB 0x07
16 #define EEVAR_RUN_FIRSTLAY 0x08
17 #define EEVAR_FSENSOR_ENABLED 0x09
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif //__cplusplus
22 
23 // initialize eeprom
24 extern uint8_t eeprom_init(void);
25 
26 // write default values to all variables
27 extern void eeprom_defaults(void);
28 
29 // get variable value as variant8
31 
32 // set variable value as variant8
33 extern void eeprom_set_var(uint8_t id, variant8_t var);
34 
35 // fill range 0x0000..0x0800 with 0xff
36 extern void eeprom_clear(void);
37 
38 int8_t eeprom_test_PUT(const unsigned int);
39 
40 #ifdef __cplusplus
41 }
42 #endif //__cplusplus
43 
44 #endif //_EEPROM_H
eeprom_test_PUT
int8_t eeprom_test_PUT(const unsigned int)
Definition: eeprom.c:208
VARIANT8_UI8
#define VARIANT8_UI8
Definition: variant8.h:10
eeprom_set_var
void eeprom_set_var(uint8_t id, variant8_t var)
Definition: eeprom.c:88
EEVAR_UNUSED_1
#define EEVAR_UNUSED_1
Definition: eeprom.h:11
EE_ADDRESS
#define EE_ADDRESS
Definition: eeprom.c:11
eeprom_test_PUT
int8_t eeprom_test_PUT(const unsigned int bytes)
Definition: eeprom.c:208
variant8_ui8
variant8_t variant8_ui8(uint8_t ui8)
Definition: variant8.c:18
eeprom_var_name
const char * eeprom_var_name[]
Definition: eeprom.c:26
EEVAR_FSENSOR_ENABLED
#define EEVAR_FSENSOR_ENABLED
Definition: eeprom.h:17
st25dv64k_user_read_bytes
void st25dv64k_user_read_bytes(uint16_t address, void *pdata, uint8_t size)
Definition: st25dv64k.c:111
eeprom_var_default
variant8_t eeprom_var_default(uint8_t id)
Definition: eeprom.c:127
eeprom_map_v1
const uint8_t eeprom_map_v1[]
Definition: eeprom.c:13
_variant8_t::ui16
uint16_t ui16
Definition: variant8.h:34
eeprom.h
VARIANT8_I16
#define VARIANT8_I16
Definition: variant8.h:11
st25dv64k_init
void st25dv64k_init(void)
Definition: st25dv64k.c:73
eeprom_get_var
variant8_t eeprom_get_var(uint8_t id)
Definition: eeprom.c:75
_variant8_t::ui8
uint8_t ui8
Definition: variant8.h:36
VARIANT8_I8
#define VARIANT8_I8
Definition: variant8.h:9
data
uint8_t data[8]
Definition: masstorage.h:49
EEVAR_RUN_FIRSTLAY
#define EEVAR_RUN_FIRSTLAY
Definition: eeprom.h:16
i
uint8_t i
Definition: screen_test_graph.c:72
_variant8_t::type
uint8_t type
Definition: variant8.h:25
eeprom_set_var
void eeprom_set_var(uint8_t id, variant8_t var)
Definition: eeprom.c:88
eeprom_clear
void eeprom_clear(void)
Definition: eeprom.c:201
eeprom_crc_index
uint8_t eeprom_crc_index
Definition: eeprom.c:40
dbg.h
eeprom_init
uint8_t eeprom_init(void)
Definition: eeprom.c:53
variant8_ui16
variant8_t variant8_ui16(uint16_t ui16)
Definition: variant8.c:30
_variant8_t
Definition: variant8.h:24
EE_VERSION
#define EE_VERSION
Definition: eeprom.c:9
EEVAR_RUN_XYZCALIB
#define EEVAR_RUN_XYZCALIB
Definition: eeprom.h:15
_variant8_t::flt
float flt
Definition: variant8.h:31
EEVAR_VERSION
#define EEVAR_VERSION
Definition: eeprom.h:8
variant8.h
EEVAR_RUN_SELFTEST
#define EEVAR_RUN_SELFTEST
Definition: eeprom.h:14
eeprom_crc_value
uint16_t eeprom_crc_value
Definition: eeprom.c:39
st25dv64k_user_write_bytes
void st25dv64k_user_write_bytes(uint16_t address, void *pdata, uint8_t size)
Definition: st25dv64k.c:119
eeprom_defaults
void eeprom_defaults(void)
Definition: eeprom.c:69
createSpeedLookupTable.a
list a
Definition: createSpeedLookupTable.py:29
eeprom_dump
void eeprom_dump(void)
Definition: eeprom.c:153
EEVAR_FILAMENT_COLOR
#define EEVAR_FILAMENT_COLOR
Definition: eeprom.h:10
variant8_empty
variant8_t variant8_empty(void)
Definition: variant8.c:10
uint8_t
const uint8_t[]
Definition: 404_html.c:3
EEVAR_UNUSED_2
#define EEVAR_UNUSED_2
Definition: eeprom.h:12
_dbg
#define _dbg(...)
Definition: dbg.h:50
eeprom_clear
void eeprom_clear(void)
Definition: eeprom.c:201
EE_VAR_CNT
#define EE_VAR_CNT
Definition: eeprom.c:10
eeprom_init
uint8_t eeprom_init(void)
Definition: eeprom.c:53
variant8_ui32
variant8_t variant8_ui32(uint32_t ui32)
Definition: variant8.c:42
VARIANT8_UI16
#define VARIANT8_UI16
Definition: variant8.h:12
VARIANT8_FLT
#define VARIANT8_FLT
Definition: variant8.h:15
eeprom_print_vars
void eeprom_print_vars(void)
Definition: eeprom.c:192
eeprom_defaults
void eeprom_defaults(void)
Definition: eeprom.c:69
eeprom_get_var
variant8_t eeprom_get_var(uint8_t id)
Definition: eeprom.c:75
eeprom_var_sprintf
int eeprom_var_sprintf(char *str, uint8_t id, variant8_t var)
Definition: eeprom.c:169
VARIANT8_UI32
#define VARIANT8_UI32
Definition: variant8.h:14
eeprom_var_addr
uint16_t eeprom_var_addr(uint8_t id)
Definition: eeprom.c:120
_variant8_t::ui32
uint32_t ui32
Definition: variant8.h:32
st25dv64k_user_read
uint8_t st25dv64k_user_read(uint16_t address)
Definition: st25dv64k.c:93
VARIANT8_I32
#define VARIANT8_I32
Definition: variant8.h:13
eeprom_var_size
uint16_t eeprom_var_size(uint8_t id)
Definition: eeprom.c:103
variant8_flt
variant8_t variant8_flt(float flt)
Definition: variant8.c:48
st25dv64k.h
createSpeedLookupTable.b
list b
Definition: createSpeedLookupTable.py:30
EEVAR_UNUSED_3
#define EEVAR_UNUSED_3
Definition: eeprom.h:13
EEVAR_FILAMENT_TYPE
#define EEVAR_FILAMENT_TYPE
Definition: eeprom.h:9
size
static png_bytep size_t size
Definition: pngwrite.c:2170