Prusa MINI Firmware overview
screen_lan_settings.h
Go to the documentation of this file.
1 /*
2  * screen_lan_settings.h
3  *
4  * Created on: Dec 11, 2019
5  * Author: Migi
6  */
7 
8 #ifndef SRC_GUI_SCREEN_LAN_SETTINGS_H_
9 #define SRC_GUI_SCREEN_LAN_SETTINGS_H_
10 
11 #include "gui.h"
12 #include "config.h"
13 #include "screen_menu.h"
14 #include "lwip/netif.h"
15 
16 #define plsd ((screen_lan_settings_data_t *)screen->pdata)
17 #define MAC_ADDR_STR_SIZE 18
18 
19 typedef struct {
24 
26  char mac_addr_str[MAC_ADDR_STR_SIZE];
28 
29 typedef struct {
30  ip4_addr_t lan_ip4_addr;
31  ip4_addr_t lan_ip4_msk;
32  ip4_addr_t lan_ip4_gw;
34 
36 extern screen_t *const pscreen_lan_settings;
37 
38 #endif /* SRC_GUI_SCREEN_LAN_SETTINGS_H_ */
window_set_alignment
void window_set_alignment(int16_t id, uint8_t alignment)
Definition: window.c:561
IDR_PNG_status_logo_prusa_prn
#define IDR_PNG_status_logo_prusa_prn
Definition: resource.h:18
PRINT_PREVIEW_ACTION_PRINT
Definition: screen_print_preview.h:10
_window_text_t
Definition: window_text.h:15
FIL
Definition: ff.h:155
screen_home_data_t::footer
status_footer_t footer
Definition: screen_home.cpp:68
screen_home
screen_t screen_home
Definition: screen_home.cpp:267
pscreen_lan_settings
screen_t *const pscreen_lan_settings
Definition: screen_lan_settings.c:294
_menu_item_t
Definition: screen_menu.h:19
IDR_PNG_menu_icon_settings
#define IDR_PNG_menu_icon_settings
Definition: resource.h:33
labels
const char * labels[7]
Definition: screen_home.cpp:45
gui_free
void gui_free(void *ptr)
Definition: gui.c:39
window_set_padding
void window_set_padding(int16_t id, padding_ui8_t padding)
Definition: window.c:549
IDR_PNG_menu_icon_spool
#define IDR_PNG_menu_icon_spool
Definition: resource.h:30
_get_ip4_addrs
static uint8_t _get_ip4_addrs(void)
Definition: screen_lan_settings.c:55
marlin_client.h
f_write
FRESULT f_write(FIL *fp, const void *buff, UINT btw, UINT *bw)
Definition: ff.c:3599
screen_home_data_t::is_starting
uint8_t is_starting
Definition: screen_home.cpp:70
AM_HID
#define AM_HID
Definition: ff.h:352
_window_frame_t
Definition: window_frame.h:18
print_begin
void print_begin(const char *filename)
Definition: print_utils.cpp:6
ini_parse_string
int ini_parse_string(const char *string, ini_handler handler, void *user)
Definition: ini.c:277
IDR_PNG_status_icon_home
#define IDR_PNG_status_icon_home
Definition: resource.h:25
plsd
#define plsd
Definition: screen_lan_settings.h:16
MARLIN_EVT_MediaError
#define MARLIN_EVT_MediaError
Definition: marlin_events.h:12
window_set_color_back
void window_set_color_back(int16_t id, color_t clr)
Definition: window.c:431
usb_host.h
: Header for usb_host.c file.
FA_WRITE
#define FA_WRITE
Definition: ff.h:327
IDR_PNG_filescreen_icon_folder
#define IDR_PNG_filescreen_icon_folder
Definition: resource.h:41
window_header_events
#define window_header_events(window)
Definition: window_header.h:72
networkconfig_t::lan_ip4_gw
ip4_addr_t lan_ip4_gw
Definition: screen_lan_settings.h:32
FILINFO::fattrib
BYTE fattrib
Definition: ff.h:201
netifapi.h
window_file_list_load
void window_file_list_load(window_file_list_t *window, const char **filters, size_t filters_cnt, WF_Sort_t sort)
Definition: window_file_list.c:63
screen_filebrowser_data_t
Definition: screen_filebrowser.cpp:31
pd
#define pd
Definition: screen_filebrowser.cpp:39
screen_lan_settings_event
static int screen_lan_settings_event(screen_t *screen, window_t *window, uint8_t event, void *param)
Definition: screen_lan_settings.c:213
screen_filebrowser_init
static void screen_filebrowser_init(screen_t *screen)
Definition: screen_filebrowser.cpp:47
screen_printing_file_path
char screen_printing_file_path[_MAX_LFN+2]
Definition: screen_printing.cpp:165
f_open
FRESULT f_open(FIL *fp, const TCHAR *path, BYTE mode)
Definition: ff.c:3296
screen_lan_settings_data_t::root
window_frame_t root
Definition: screen_lan_settings.h:20
ALIGN_CENTER
#define ALIGN_CENTER
Definition: guitypes.h:19
rect_ui16
static rect_ui16_t rect_ui16(uint16_t x, uint16_t y, uint16_t w, uint16_t h)
Definition: guitypes.h:159
on_print_preview_action
static void on_print_preview_action(print_preview_action_t action)
Definition: screen_home.cpp:143
WORD
unsigned short WORD
Definition: onboard_sd.h:14
gui_malloc
void * gui_malloc(unsigned int size)
Definition: gui.c:35
FILINFO::fdate
WORD fdate
Definition: ff.h:199
screen_lan_settings_done
static void screen_lan_settings_done(screen_t *screen)
Definition: screen_lan_settings.c:276
data
uint8_t data[8]
Definition: masstorage.h:49
screen_print_preview_get_gcode_filepath
const char * screen_print_preview_get_gcode_filepath()
Definition: screen_print_preview.c:85
window_destroy
void window_destroy(int16_t id)
Definition: window.c:132
_window_file_list_t::altpath
char altpath[F_MAXPATHNAMELENGTH - 12]
Definition: window_file_list.h:73
padding_ui8
static padding_ui8_t padding_ui8(uint8_t l, uint8_t t, uint8_t r, uint8_t b)
Definition: guitypes.h:164
i
uint8_t i
Definition: screen_test_graph.c:72
screen_filebrowser_draw
static void screen_filebrowser_draw(screen_t *screen)
Definition: screen_filebrowser.cpp:76
WF_SORT_BY_TIME
Definition: window_file_list.h:81
screen_printing_file_name
char screen_printing_file_name[_MAX_LFN+1]
Definition: screen_printing.cpp:164
screen_home_data_t
Definition: screen_home.cpp:58
media_is_inserted
bool media_is_inserted()
Definition: Marlin_CardReader.cpp:17
networkconfig_t
Definition: screen_lan_settings.h:29
IDR_FNT_SPECIAL
#define IDR_FNT_SPECIAL
Definition: resource.h:13
window_file_list.h
window_set_icon_id
void window_set_icon_id(int16_t id, uint16_t id_res)
Definition: window.c:659
SCREEN_MENU_NO_SCREEN
#define SCREEN_MENU_NO_SCREEN
Definition: screen_menu.h:39
screen_print_preview_set_gcode_filename
void screen_print_preview_set_gcode_filename(const char *fname)
Definition: screen_print_preview.c:89
IDR_PNG_menu_icon_preheat
#define IDR_PNG_menu_icon_preheat
Definition: resource.h:29
_menu_lan_items
const menu_item_t _menu_lan_items[]
Definition: screen_lan_settings.c:42
_window_icon_t
Definition: window_icon.h:11
BUTTON_SETTINGS
#define BUTTON_SETTINGS
Definition: screen_home.cpp:33
f_unlink
FRESULT f_unlink(const TCHAR *path)
Definition: ff.c:4584
screen_open
void screen_open(int16_t screen_id)
Definition: screen.c:62
dbg.h
screen_home_event
int screen_home_event(screen_t *screen, window_t *window, uint8_t event, void *param)
Definition: screen_home.cpp:153
screen_home_data_t::header
window_header_t header
Definition: screen_home.cpp:62
MARLIN_EVT_MediaInserted
#define MARLIN_EVT_MediaInserted
Definition: marlin_events.h:11
window_header.h
NULL
#define NULL
Definition: usbd_def.h:53
screen_filebrowser_data_t::header
window_header_t header
Definition: screen_filebrowser.cpp:35
MSGBOX_ICO_INFO
#define MSGBOX_ICO_INFO
Definition: window_msgbox.h:36
IDR_PNG_menu_icon_calibration
#define IDR_PNG_menu_icon_calibration
Definition: resource.h:32
screen_filebrowser_data_t::w_filelist
window_file_list_t w_filelist
Definition: screen_filebrowser.cpp:36
on_print_preview_action
static void on_print_preview_action(print_preview_action_t action)
Definition: screen_filebrowser.cpp:78
screen_menu.h
MSGBOX_BTN_OK
#define MSGBOX_BTN_OK
Definition: window_msgbox.h:20
screen_home_disable_print_button
void screen_home_disable_print_button(screen_t *screen)
Definition: screen_home.cpp:256
HAL_GetTick
uint32_t HAL_GetTick(void)
Provides a tick value in millisecond.
Definition: stm32f4xx_hal.c:339
screen_close
void screen_close(void)
Definition: screen.c:80
pw
#define pw
Definition: screen_home.cpp:76
BUTTON_INFO
#define BUTTON_INFO
Definition: screen_home.cpp:34
find_latest_gcode
static bool find_latest_gcode(char *fpath, int fpath_len, char *fname, int fname_len)
Definition: screen_home.cpp:220
PRINT_PREVIEW_ACTION_BACK
Definition: screen_print_preview.h:9
COLOR_GRAY
#define COLOR_GRAY
Definition: guitypes.h:50
netif.h
pscreen_menu_calibration
screen_t * pscreen_menu_calibration
Definition: screen_menu_calibration.c:101
window_disable
void window_disable(int16_t id)
Definition: window.c:523
screen_lan_settings
screen_t screen_lan_settings
Definition: screen_lan_settings.c:283
window_set_text
void window_set_text(int16_t id, const char *text)
Definition: window.c:340
MATCH
Definition: inflate.h:45
screen_lan_settings_data_t
Definition: screen_lan_settings.h:19
screen_filebrowser_done
static void screen_filebrowser_done(_screen_t *screen)
Definition: screen_filebrowser.cpp:72
pscreen_printing
screen_t * pscreen_printing
Definition: screen_printing.cpp:161
IDR_PNG_menu_icon_info
#define IDR_PNG_menu_icon_info
Definition: resource.h:34
FA_READ
#define FA_READ
Definition: ff.h:326
_window_t
Definition: window.h:76
ini.h
_window_header_t
Definition: window_header.h:36
screen_lan_settings_data_t::menu
window_menu_t menu
Definition: screen_lan_settings.h:22
pscreen_filebrowser
const screen_t * pscreen_filebrowser
Definition: screen_filebrowser.cpp:177
MI_RETURN
Definition: screen_lan_settings.c:28
BUTTON_CALIBRATION
#define BUTTON_CALIBRATION
Definition: screen_home.cpp:32
WINDOW_CLS_FRAME
#define WINDOW_CLS_FRAME
Definition: window.h:9
pscreen_lan_settings
screen_t *const pscreen_lan_settings
Definition: screen_lan_settings.c:294
MAC_ADDR_SIZE
#define MAC_ADDR_SIZE
Definition: screen_lan_settings.c:23
FILINFO::ftime
WORD ftime
Definition: ff.h:200
f_opendir
FRESULT f_opendir(DIR *dp, const TCHAR *path)
Definition: ff.c:4221
BUTTON_FILAMENT
#define BUTTON_FILAMENT
Definition: screen_home.cpp:31
MI_t
MI_t
Definition: screen_lan_settings.c:27
WINDOW_CLS_MENU
#define WINDOW_CLS_MENU
Definition: window.h:18
screen_filebrowser_event
static int screen_filebrowser_event(screen_t *screen, window_t *window, uint8_t event, void *param)
Definition: screen_filebrowser.cpp:89
window_set_focus
void window_set_focus(int16_t id)
Definition: window.c:480
BUTTON_PREHEAT
#define BUTTON_PREHEAT
Definition: screen_home.cpp:30
filt_cnt
static const size_t filt_cnt
Definition: screen_filebrowser.cpp:45
window_set_capture
void window_set_capture(int16_t id)
Definition: window.c:500
lwip.h
screen_print_preview_set_gcode_filepath
void screen_print_preview_set_gcode_filepath(const char *fpath)
Definition: screen_print_preview.c:81
MAX_INI_SIZE
#define MAX_INI_SIZE
Definition: screen_lan_settings.c:24
ff.h
plan_str
static char * plan_str
Definition: screen_lan_settings.c:35
MAC_ADDR_START
#define MAC_ADDR_START
Definition: screen_lan_settings.c:22
window_is_focused
int window_is_focused(int16_t id)
Definition: window.c:267
window_set_tag
void window_set_tag(int16_t id, uint8_t tag)
Definition: window.c:329
BUTTON_PRINT
#define BUTTON_PRINT
Definition: screen_home.cpp:29
_window_file_list_t::file_items
FILINFO file_items[SDSORT_LIMIT]
Definition: window_file_list.h:74
screen_lan_settings_draw
static void screen_lan_settings_draw(screen_t *screen)
Definition: screen_lan_settings.c:273
screen_filebrowser
static screen_t screen_filebrowser
Definition: screen_filebrowser.cpp:166
_rect_ui16_t
Definition: guitypes.h:69
WI_LABEL
Definition: window_menu.h:14
_window_menu_item_t
Definition: window_menu.h:58
screen_lan_settings_data_t::header
window_header_t header
Definition: screen_lan_settings.h:21
screen_home_data_t::root
window_frame_t root
Definition: screen_home.cpp:60
dhcp.h
uint8_t
const uint8_t[]
Definition: 404_html.c:3
print_preview_action_t
print_preview_action_t
Definition: screen_print_preview.h:8
pscreen_menu_preheat
screen_t * pscreen_menu_preheat
Definition: screen_menu_preheat.cpp:93
FILINFO::fname
TCHAR fname[13]
Definition: ff.h:206
AM_SYS
#define AM_SYS
Definition: ff.h:353
_screen_t
Definition: screen.h:18
_screen_lan_settings_item
static void _screen_lan_settings_item(window_menu_t *pwindow_menu, uint16_t index, window_menu_item_t **ppitem, void *data)
Definition: screen_lan_settings.c:49
screen_print_preview_set_on_action
void screen_print_preview_set_on_action(print_preview_action_handler_t handler)
Definition: screen_print_preview.c:93
MSGBOX_RES_OK
#define MSGBOX_RES_OK
Definition: window_msgbox.h:46
WINDOW_CLS_ICON
#define WINDOW_CLS_ICON
Definition: window.h:12
menu_item_return
const menu_item_t menu_item_return
Definition: screen_menu.c:14
WF_Sort_t
WF_Sort_t
Definition: window_file_list.h:80
_parse_MAC_addr
static void _parse_MAC_addr(char *mac_addr_str)
Definition: screen_lan_settings.c:83
WINDOW_CLS_TEXT
#define WINDOW_CLS_TEXT
Definition: window.h:10
screen_lan_settings_data_t::text
window_text_t text
Definition: screen_lan_settings.h:25
pscreen_menu_settings
screen_t * pscreen_menu_settings
Definition: screen_menu_settings.c:133
FRESULT
FRESULT
Definition: ff.h:214
screen_lan_settings_init
static void screen_lan_settings_init(screen_t *screen)
Definition: screen_lan_settings.c:91
AM_DIR
#define AM_DIR
Definition: ff.h:354
networkconfig_t::lan_ip4_addr
ip4_addr_t lan_ip4_addr
Definition: screen_lan_settings.h:30
screen_filebrowser_sort
static WF_Sort_t screen_filebrowser_sort
Definition: screen_filebrowser.cpp:42
f_findnext
FRESULT f_findnext(DIR *dp, FILINFO *fno)
resource_font
font_t * resource_font(uint16_t id)
Definition: guitypes.c:186
pscreen_menu_filament
screen_t * pscreen_menu_filament
Definition: screen_menu_filament.c:124
WINDOW_EVENT_CLICK
#define WINDOW_EVENT_CLICK
Definition: window.h:46
pscreen_menu_info
screen_t * pscreen_menu_info
Definition: screen_menu_info.c:66
WINDOW_CLS_FILE_LIST
int16_t WINDOW_CLS_FILE_LIST
Definition: window_file_list.c:24
screen_home_done
void screen_home_done(screen_t *screen)
Definition: screen_home.cpp:136
screen_print_preview.h
FR_OK
Definition: ff.h:215
MAXPATHNAMELENGTH
#define MAXPATHNAMELENGTH
Definition: screen_filebrowser.cpp:26
window_create_ptr
int16_t window_create_ptr(int16_t cls_id, int16_t id_parent, rect_ui16_t rect, void *ptr)
Definition: window.c:102
screen_printing.h
window_enable
void window_enable(int16_t id)
Definition: window.c:517
IDR_FNT_SMALL
#define IDR_FNT_SMALL
Definition: resource.h:9
screen_filebrowser_data_t::root
window_frame_t root
Definition: screen_filebrowser.cpp:33
networkconfig_t::lan_ip4_msk
ip4_addr_t lan_ip4_msk
Definition: screen_lan_settings.h:31
_screen_t::id
int16_t id
Definition: screen.h:19
screen_home_data_t::time
uint32_t time
Definition: screen_home.cpp:71
DIR
Definition: ff.h:178
print_utils.h
pscreen_filebrowser
screen_t * pscreen_filebrowser
Definition: screen_filebrowser.cpp:177
IP4_ADDR_STR_SIZE
#define IP4_ADDR_STR_SIZE
Definition: screen_lan_settings.c:25
screen_home_init
void screen_home_init(screen_t *screen)
Definition: screen_home.cpp:81
screen_home_data_t::logo
window_icon_t logo
Definition: screen_home.cpp:63
window_file_set_item_index
void window_file_set_item_index(window_file_list_t *window, int index)
Definition: window_file_list.c:118
MSGBOX_ICO_ERROR
#define MSGBOX_ICO_ERROR
Definition: window_msgbox.h:33
config_s
Definition: deflate.c:120
IDR_PNG_menu_icon_print
#define IDR_PNG_menu_icon_print
Definition: resource.h:28
config.h
_window_menu_t
Definition: window_menu.h:83
WINDOW_CLS_HEADER
int16_t WINDOW_CLS_HEADER
Definition: window_header.c:24
screen_lan_settings_data_t::items
menu_item_t * items
Definition: screen_lan_settings.h:23
_addrs_to_str
static void _addrs_to_str(char *param_str, uint8_t flg)
Definition: screen_lan_settings.c:70
config
static networkconfig_t config
Definition: screen_lan_settings.c:36
eth0
struct netif eth0
Definition: lwip.c:72
gui.h
MARLIN_EVT_MediaRemoved
#define MARLIN_EVT_MediaRemoved
Definition: marlin_events.h:13
filters
static const char * filters[]
Definition: screen_filebrowser.cpp:44
LOG_ERROR
#define LOG_ERROR(...)
Definition: screen_filebrowser.cpp:29
screen_lan_settings
screen_t screen_lan_settings
Definition: screen_lan_settings.c:283
f_closedir
FRESULT f_closedir(DIR *dp)
Definition: ff.c:4291
MAC_ADDR_STR_SIZE
#define MAC_ADDR_STR_SIZE
Definition: screen_lan_settings.h:17
p_window_header_event_clr
int p_window_header_event_clr(window_header_t *window, uint8_t evt_id)
Definition: window_header.c:157
_window_file_list_t
Definition: window_file_list.h:62
icons
const uint16_t icons[6]
Definition: screen_home.cpp:36
f_findfirst
FRESULT f_findfirst(DIR *dp, FILINFO *fno, const TCHAR *path, const TCHAR *pattern)
pscreen_home
const screen_t * pscreen_home
Definition: screen_home.cpp:278
cmsis_os.h
Header of cmsis_os.c A new set of APIs are added in addition to existing ones, these APIs are specifi...
p_window_header_set_icon
void p_window_header_set_icon(window_header_t *window, uint16_t id_res)
Definition: window_header.c:121
pscreen_print_preview
screen_t *const pscreen_print_preview
Definition: screen_print_preview.c:77
MI_LOAD
Definition: screen_menu_filament.c:22
FILINFO
Definition: ff.h:197
screen_lan_settings.h
UINT
unsigned int UINT
Definition: onboard_sd.h:16
WINDOW_FLG_INVALID
#define WINDOW_FLG_INVALID
Definition: window.h:26
f_read
FRESULT f_read(FIL *fp, void *buff, UINT btr, UINT *br)
Definition: ff.c:3499
f_close
FRESULT f_close(FIL *fp)
Definition: ff.c:3801
screen_home_draw
void screen_home_draw(screen_t *screen)
Definition: screen_home.cpp:140
menu_preheat_type
uint8_t menu_preheat_type
Definition: screen_menu_preheat.cpp:14
p_window_header_set_text
void p_window_header_set_text(window_header_t *window, const char *text)
Definition: window_header.c:152
FA_CREATE_NEW
#define FA_CREATE_NEW
Definition: ff.h:329
marlin_event_clr
int marlin_event_clr(uint8_t evt_id)
Definition: marlin_client.c:252
netif_is_up
#define netif_is_up(netif)
Definition: netif.h:401