Prusa MINI Firmware overview
|
#include "eeprom.h"
#include <stdio.h>
#include "st25dv64k.h"
#include "dbg.h"
#include <string.h>
◆ EE_VERSION
#define EE_VERSION 0x0002 |
◆ EE_VAR_CNT
◆ EE_ADDRESS
#define EE_ADDRESS 0x0500 |
◆ eeprom_var_size()
uint16_t eeprom_var_size |
( |
uint8_t |
id | ) |
|
◆ eeprom_var_addr()
uint16_t eeprom_var_addr |
( |
uint8_t |
id | ) |
|
◆ eeprom_var_default()
◆ eeprom_dump()
158 for (
i = 0;
i < 128;
i++)
160 sprintf(line,
"%04x",
i * 16);
161 for (j = 0; j < 16; j++) {
163 sprintf(line + 4 + j * 3,
" %02x",
b);
◆ eeprom_print_vars()
◆ eeprom_clear()
203 uint32_t
data = 0xffffffff;
204 for (
a = 0x0000;
a < 0x0800;
a += 4)
◆ eeprom_init()
◆ eeprom_defaults()
◆ eeprom_get_var()
◆ eeprom_set_var()
◆ eeprom_var_sprintf()
172 return sprintf(str,
"%u", (
unsigned int)var.
ui16);
174 return sprintf(str,
"%u", (
unsigned int)var.
ui8);
176 return sprintf(str,
"0x%08lx", (
unsigned long)var.
ui32);
178 return sprintf(str,
"%.4f", (
double)var.
flt);
180 return sprintf(str,
"%.1f", (
double)var.
flt);
182 return sprintf(str,
"%.1f", (
double)var.
flt);
187 return sprintf(str,
"%u", (
unsigned int)var.
ui8);
◆ eeprom_test_PUT()
int8_t eeprom_test_PUT |
( |
const unsigned int |
bytes | ) |
|
211 char line[16] =
"abcdefghijklmno";
214 unsigned int count = bytes / 16;
216 for (
i = 0;
i < count;
i++) {
222 for (
i = 0;
i < count;
i++) {
224 if (strcmp(line2, line))
◆ eeprom_map_v1
◆ eeprom_var_name
const char* eeprom_var_name[] |
Initial value:= {
"VERSION",
"FILAMENT_TYPE",
"FILAMENT_COLOR",
"UNUSED_1",
"UNUSED_2",
"UNUSED_3",
"RUN_SELFTEST",
"RUN_XYZCALIB",
"RUN_FIRSTLAY",
"FSENSOR_ENABLED",
}
◆ eeprom_crc_value
uint16_t eeprom_crc_value = 0 |
◆ eeprom_crc_index
#define VARIANT8_UI8
Definition: variant8.h:10
#define EEVAR_UNUSED_1
Definition: eeprom.h:11
#define EE_ADDRESS
Definition: eeprom.c:11
variant8_t variant8_ui8(uint8_t ui8)
Definition: variant8.c:18
const char * eeprom_var_name[]
Definition: eeprom.c:26
#define EEVAR_FSENSOR_ENABLED
Definition: eeprom.h:17
void st25dv64k_user_read_bytes(uint16_t address, void *pdata, uint8_t size)
Definition: st25dv64k.c:111
variant8_t eeprom_var_default(uint8_t id)
Definition: eeprom.c:127
const uint8_t eeprom_map_v1[]
Definition: eeprom.c:13
uint16_t ui16
Definition: variant8.h:34
#define VARIANT8_I16
Definition: variant8.h:11
void st25dv64k_init(void)
Definition: st25dv64k.c:73
variant8_t eeprom_get_var(uint8_t id)
Definition: eeprom.c:75
uint8_t ui8
Definition: variant8.h:36
#define VARIANT8_I8
Definition: variant8.h:9
uint8_t data[8]
Definition: masstorage.h:49
#define EEVAR_RUN_FIRSTLAY
Definition: eeprom.h:16
uint8_t i
Definition: screen_test_graph.c:72
uint8_t type
Definition: variant8.h:25
void eeprom_set_var(uint8_t id, variant8_t var)
Definition: eeprom.c:88
variant8_t variant8_ui16(uint16_t ui16)
Definition: variant8.c:30
Definition: variant8.h:24
#define EE_VERSION
Definition: eeprom.c:9
#define EEVAR_RUN_XYZCALIB
Definition: eeprom.h:15
float flt
Definition: variant8.h:31
#define EEVAR_VERSION
Definition: eeprom.h:8
#define EEVAR_RUN_SELFTEST
Definition: eeprom.h:14
void st25dv64k_user_write_bytes(uint16_t address, void *pdata, uint8_t size)
Definition: st25dv64k.c:119
void eeprom_defaults(void)
Definition: eeprom.c:69
list a
Definition: createSpeedLookupTable.py:29
#define EEVAR_FILAMENT_COLOR
Definition: eeprom.h:10
variant8_t variant8_empty(void)
Definition: variant8.c:10
const uint8_t[]
Definition: 404_html.c:3
#define EEVAR_UNUSED_2
Definition: eeprom.h:12
#define _dbg(...)
Definition: dbg.h:50
#define EE_VAR_CNT
Definition: eeprom.c:10
variant8_t variant8_ui32(uint32_t ui32)
Definition: variant8.c:42
#define VARIANT8_UI16
Definition: variant8.h:12
#define VARIANT8_FLT
Definition: variant8.h:15
int eeprom_var_sprintf(char *str, uint8_t id, variant8_t var)
Definition: eeprom.c:169
#define VARIANT8_UI32
Definition: variant8.h:14
uint16_t eeprom_var_addr(uint8_t id)
Definition: eeprom.c:120
uint32_t ui32
Definition: variant8.h:32
uint8_t st25dv64k_user_read(uint16_t address)
Definition: st25dv64k.c:93
#define VARIANT8_I32
Definition: variant8.h:13
uint16_t eeprom_var_size(uint8_t id)
Definition: eeprom.c:103
variant8_t variant8_flt(float flt)
Definition: variant8.c:48
list b
Definition: createSpeedLookupTable.py:30
#define EEVAR_UNUSED_3
Definition: eeprom.h:13
#define EEVAR_FILAMENT_TYPE
Definition: eeprom.h:9
static png_bytep size_t size
Definition: pngwrite.c:2170