Prusa MINI Firmware overview
eeprom.h File Reference
#include "variant8.h"

Go to the source code of this file.

Macros

#define EEVAR_VERSION   0x00
 
#define EEVAR_FILAMENT_TYPE   0x01
 
#define EEVAR_FILAMENT_COLOR   0x02
 
#define EEVAR_UNUSED_1   0x03
 
#define EEVAR_UNUSED_2   0x04
 
#define EEVAR_UNUSED_3   0x05
 
#define EEVAR_RUN_SELFTEST   0x06
 
#define EEVAR_RUN_XYZCALIB   0x07
 
#define EEVAR_RUN_FIRSTLAY   0x08
 
#define EEVAR_FSENSOR_ENABLED   0x09
 

Functions

uint8_t eeprom_init (void)
 
void eeprom_defaults (void)
 
variant8_t eeprom_get_var (uint8_t id)
 
void eeprom_set_var (uint8_t id, variant8_t var)
 
void eeprom_clear (void)
 
int8_t eeprom_test_PUT (const unsigned int)
 

Macro Definition Documentation

◆ EEVAR_VERSION

#define EEVAR_VERSION   0x00

◆ EEVAR_FILAMENT_TYPE

#define EEVAR_FILAMENT_TYPE   0x01

◆ EEVAR_FILAMENT_COLOR

#define EEVAR_FILAMENT_COLOR   0x02

◆ EEVAR_UNUSED_1

#define EEVAR_UNUSED_1   0x03

◆ EEVAR_UNUSED_2

#define EEVAR_UNUSED_2   0x04

◆ EEVAR_UNUSED_3

#define EEVAR_UNUSED_3   0x05

◆ EEVAR_RUN_SELFTEST

#define EEVAR_RUN_SELFTEST   0x06

◆ EEVAR_RUN_XYZCALIB

#define EEVAR_RUN_XYZCALIB   0x07

◆ EEVAR_RUN_FIRSTLAY

#define EEVAR_RUN_FIRSTLAY   0x08

◆ EEVAR_FSENSOR_ENABLED

#define EEVAR_FSENSOR_ENABLED   0x09

Function Documentation

◆ eeprom_init()

uint8_t eeprom_init ( void  )
53  {
54  uint8_t ret = 0;
56  //eeprom_clear();
57  //eeprom_dump();
58  uint16_t version = eeprom_get_var(EEVAR_VERSION).ui16;
59  if (version != EE_VERSION) {
61  ret = 1;
62  }
63  //eeprom_print_vars();
64  //eeprom_dump();
65  return ret;
66 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ eeprom_defaults()

void eeprom_defaults ( void  )
69  {
70  uint8_t id;
71  for (id = 0; id < EE_VAR_CNT; id++)
73 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ eeprom_get_var()

variant8_t eeprom_get_var ( uint8_t  id)
75  {
76  uint16_t addr;
77  uint16_t size;
78  variant8_t var = variant8_empty();
79  if (id < EE_VAR_CNT) {
80  var.type = eeprom_map_v1[id];
81  addr = eeprom_var_addr(id);
82  size = eeprom_var_size(id);
83  st25dv64k_user_read_bytes(addr, &(var.ui32), size);
84  }
85  return var;
86 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ eeprom_set_var()

void eeprom_set_var ( uint8_t  id,
variant8_t  var 
)
88  {
89  uint16_t addr;
90  uint16_t size;
91  if (id < EE_VAR_CNT) {
92  if (var.type == eeprom_map_v1[id]) {
93  addr = eeprom_var_addr(id);
94  size = eeprom_var_size(id);
95  st25dv64k_user_write_bytes(addr, &(var.ui32), size);
96  // osDelay(5);
97  }
98  }
99 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ eeprom_clear()

void eeprom_clear ( void  )
201  {
202  uint16_t a;
203  uint32_t data = 0xffffffff;
204  for (a = 0x0000; a < 0x0800; a += 4)
206 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ eeprom_test_PUT()

int8_t eeprom_test_PUT ( const unsigned int  )
208  {
209 
210  unsigned int i;
211  char line[16] = "abcdefghijklmno";
212  char line2[16];
213  uint8_t size = sizeof(line);
214  unsigned int count = bytes / 16;
215 
216  for (i = 0; i < count; i++) {
218  }
219 
220  int8_t res_flag = 1;
221 
222  for (i = 0; i < count; i++) {
224  if (strcmp(line2, line))
225  res_flag = 0;
226  }
227  return res_flag;
228 }
Here is the call graph for this function:
Here is the caller graph for this function:
EE_ADDRESS
#define EE_ADDRESS
Definition: eeprom.c:11
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
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
data
uint8_t data[8]
Definition: masstorage.h:49
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
_variant8_t
Definition: variant8.h:24
EE_VERSION
#define EE_VERSION
Definition: eeprom.c:9
EEVAR_VERSION
#define EEVAR_VERSION
Definition: eeprom.h:8
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
variant8_empty
variant8_t variant8_empty(void)
Definition: variant8.c:10
uint8_t
const uint8_t[]
Definition: 404_html.c:3
EE_VAR_CNT
#define EE_VAR_CNT
Definition: eeprom.c:10
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
eeprom_var_size
uint16_t eeprom_var_size(uint8_t id)
Definition: eeprom.c:103
size
static png_bytep size_t size
Definition: pngwrite.c:2170