whiskers 0.4.5
RP2350 BadUSB Tool
Loading...
Searching...
No Matches
wlua.h
Go to the documentation of this file.
1/* Copyright (c) 2026 Zane A. Maples
2 Licensed under the MIT license. See LICENSE in the main repository for more information. */
3
13
14#ifndef W_LUA_H
15#define W_LUA_H
16
17#include "../../hal/file.h"
18#include "../../hal/flash.h"
19#include "../../hal/standard.h"
20#include "../../lua/lua.h"
21#include "../../lua/lualib.h"
22#include "../../lua/lauxlib.h"
23#include "wlua_fops.h"
24#include "wlua_usb.h"
25#include "../usb/wusb.h"
26#include <string.h>
27#include <stdio.h>
28
29#define WLUA_MAX_INPUT_SIZE (1024 * 32) - 1
36
41#define WLUA_MAX_FLASH_SIZE 1024 * 1024
42
47#define WLUA_FLASH_SECTORS (uint32_t)(WLUA_MAX_FLASH_SIZE/FLASH_SECTOR_SIZE)
48
53void start_lua(lua_State **lua);
61bool run_lua_from_file(const char *path, lua_State *lua);
66void stop_lua(lua_State *lua);
67
76bool run_lua_from_flash(lua_State *lua);
77
89bool save_lua_to_flash();
90
91#endif
HAL file functions.
HAL flash functions.
Miscellaneous/Utility HAL functions.
High-level code for setting up the USB stack.