ERIS CORE
AppWren Class Reference

Wren is a scripting language. This class is a proxy which mirrors the AppBaseClass into wren and hosts a VM.


The use case for this class is to allow scripting of apps
With this interface, applications can be dynamically loaded and executed
Beware: The available heap defines the upper boundary of VM size

From https://wren.io/:
"Wren is a small, fast, class-based concurrent scripting language.
Think Smalltalk in a Lua-sized package with a dash of Erlang and wrapped up in a familiar, modern syntax.
Wren is small. The VM implementation is under 4,000 semicolons"
. More...

#include "AppWren.h"

+ Inheritance diagram for AppWren:
+ Collaboration diagram for AppWren:

Public Member Functions

 AppWren ()
 
 ~AppWren ()
 
void bltFrameBuffer2FrameBuffer (int16_t from_x, int16_t from_y, int16_t width, int16_t height, int16_t to_x, int16_t to_y, bltMode blt_mode)
 
void bltFrameBuffer2Surface (int16_t from_x, int16_t from_y, int16_t width, int16_t height, int16_t to_x, int16_t to_y, bltMode blt_mode)
 
void bltRAMDrive2FrameBuffer (const char *path, const char *filename, int16_t x, int16_t y, bltMode blt_mode)
 block tramsfer from ram drive file to the frame buffer More...
 
void bltRAMDrive2Surface (const char *path, const char *filename, int16_t x, int16_t y, bltMode blt_mode)
 block tramsfer from ram drive file to surface More...
 
void bltSD2Surface (const char *path, const char *filename, int16_t x, int16_t y, bltMode blt_mode)
 block tramsfer from SD to surface More...
 
void bltSurface2FrameBuffer (int16_t from_x, int16_t from_y, int16_t width, int16_t height, int16_t to_x, int16_t to_y, bltMode blt_mode)
 
void bltSurface2Surface (int16_t from_x, int16_t from_y, int16_t width, int16_t height, int16_t to_x, int16_t to_y, bltMode blt_mode)
 
void disablePixelOP ()
 wren callback interface to disable pixel operations
forwards the call to ILI9341_t3_ERIS which has a matching interface More...
 
void drawFill (int16_t r, int16_t g, int16_t b)
 fills the render target (either a surface or the framebuffer depending on ) More...
 
void drawLine (int16_t start_x, int16_t start_y, int16_t end_x, int16_t end_y, int16_t r, int16_t g, int16_t b)
 draws a line on the render target More...
 
void enablePixelOP (uint16_t param, pixelOPMode operation)
 wren callback interface to enable pixel operations
forwards the call to ILI9341_t3_ERIS which has a matching interface More...
 
void freeModuleSource ()
 receiver for the wren c callback function loadModuleComplete indicating it's now ok to release the module_load_buffer More...
 
AudioDirectorgetAudioDirector ()
 provides an interface for wren c call backfunctions to get the AudioDirector object More...
 
ILI9341_t3_ERISgetDraw ()
 provides an interface for wren c call backfunctions to get the ILI9341_t3_ERIS draw object. More...
 
void getFocus ()
 Get the Focus object. More...
 
uint16_t getID ()
 Get the ID object. More...
 
uint16_t getPixel (int16_t x, int16_t y)
 get a pixel from the render target More...
 
void haltCallForwarding ()
 halts forwarding of the AppBase class method calls/n this allows scripts to run without utilizing the App interface within wren
More...
 
bool isName (const char *name_string)
 Compares the name_string to the app class instance name (string) More...
 
const char * loadModuleSource (const char *name)
 receiver for the wren c callback function getSourceForModule More...
 
bool FASTRUN loadScript (const char *script)
 runs the script in the VM More...
 
void messageHandler (AppBaseClass *sender, const char *message)
 handles messages from other sw components More...
 
void FLASHMEM rebootRequest (const char *script_name)
 c callback support to allow wren scripts to request a VM reboot & script load
More...
 
void registerApp (AppBaseClass *app)
 registers the app instance with the AppManager More...
 
void releasePopUp ()
 
void requestPopUp (bool exclusive=false)
 
void FLASHMEM restartVM ()
 shutsdown then starts the VM More...
 
void returnFocus ()
 
void FLASHMEM setDimension (int16_t new_width, int16_t new_height)
 Set the Dimension object
receiver for the wren c callback function setDimensionCallback. More...
 
void setName (const char *name_string)
 Set the app class instance name (string) More...
 
void FLASHMEM setParent (AppBaseClass *parent)
 Set the Parent object. More...
 
void setPixel (int16_t x, int16_t y, int16_t r, int16_t g, int16_t b)
 set a pixel on the render target More...
 
void FLASHMEM setPosition (int16_t newOriginX, int16_t newOriginY)
 Set the Position object/n receiver for the wren c callback function setPositionCallback. More...
 
void setUpdatePriority (uint16_t level)
 
void setWidgetDimension (int16_t new_width, int16_t new_height)
 Set the Widget Dimension object
receiver for the wren c callback function setWidgetDimensionCallback. More...
 
void setWidgetPosition (int16_t newOriginX, int16_t newOriginY)
 Set the Widget Position object
receiver for the wren c callback function setWidgetPositionCallback. More...
 
void FLASHMEM shutdownVM ()
 shutdown the VM More...
 
void FLASHMEM startVM ()
 start the VM More...
 
void vmConstructor (const char *initial_script)
 start, load and configure the handles of the VM More...
 

Public Attributes

int16_t h
 
int16_t height
 
char name [MAX_NAME_LENGTH]
 
int16_t origin_x
 
int16_t origin_y
 
bool useNativeFS
 
int16_t w
 
int16_t widget_height
 
int16_t widget_origin_x
 
int16_t widget_origin_y
 
int16_t widget_width
 
int16_t width
 
File wren_file
 
LittleFS_RAM wren_file_system
 
int16_t x
 
int16_t y
 

Protected Member Functions

void _updatePosition ()
 
bool dynamicSurfaceManager ()
 responsible for managing the surface buffer memory allocation More...
 
void getWrenHandles ()
 VM post module load support function creates/updates the Wren embedded call handles. More...
 
bool isWrenResultOK (WrenInterpretResult res)
 
void onAnalog1 (uint16_t uval, float fval) override
 class specific onAnalog1 implementation More...
 
void onAnalog2 (uint16_t uval, float fval) override
 class specific onAnalog2 implementation More...
 
void onAnalog3 (uint16_t uval, float fval) override
 class specific onAnalog3 implementation More...
 
void onAnalog4 (uint16_t uval, float fval) override
 class specific onAnalog4 implementation More...
 
void onFocus () override
 class specific OnFocus implementation More...
 
void onFocusLost () override
 class specific onFocusLost implementation More...
 
void onTouch (uint16_t t_x, uint16_t t_y) override
 class specific onTouch implementation More...
 
void onTouchDrag (uint16_t t_x, uint16_t t_y) override
 class specific onTouchDrag implementation More...
 
void onTouchRelease (uint16_t t_x, uint16_t t_y) override
 class specific onTouchRelease implementation More...
 
void releaseWrenHandles ()
 release any/all Wren embedded call handles More...
 
void render () override
 class specific update implementation More...
 
void selfRegister ()
 self register the instance with the AppManager More...
 
void update () override
 class specific update implementation More...
 

Protected Attributes

AudioDirectorad
 
AppManageram
 
bool compile_only
 
uint16_t cycle_time
 
uint16_t cycle_time_max
 
ILI9341_t3_ERISdraw
 
bool enable_call_forwarding
 
elapsedMicros et_render_period
 
elapsedMicros et_update_period
 
bool has_focus
 
bool has_pop
 
uint16_t id
 
bool image_loaded
 
char img_filename [MAX_TEXT_LENGTH]
 
char img_path [MAX_TEXT_LENGTH]
 
bool is_pressed
 
char * module_load_buffer
 
AppBaseClassnext_app_node
 
AppBaseClassparent_node
 
AppBaseClassprevious_app_node
 
bool reboot_request
 
uint16_t render_cpu_time
 
uint16_t render_cpu_time_max
 
uint16_t render_period_max
 
bool save_module
 
SvcSerialCommandInterfacesci
 
SdFs * sd
 
bool show_active
 
Surfacesurface_cache
 
uint16_t * surface_mempool
 
elapsedMillis time_active
 
bool touch_state
 
uint16_t update_cpu_time
 
uint16_t update_cpu_time_max
 
uint16_t update_period_max
 
uint16_t update_priority
 
uint16_t update_priority_counter
 
bool using_image
 
char wren_module_name [MAX_TEXT_LENGTH]
 

Private Attributes

WrenHandle * h_messageHandler
 
WrenHandle * h_onAnalog1
 
WrenHandle * h_onAnalog2
 
WrenHandle * h_onAnalog3
 
WrenHandle * h_onAnalog4
 
WrenHandle * h_onFocus
 
WrenHandle * h_onFocusLost
 
WrenHandle * h_onTouch
 
WrenHandle * h_onTouchDrag
 
WrenHandle * h_onTouchRelease
 
WrenHandle * h_render
 
WrenHandle * h_slot0
 
WrenHandle * h_update
 
WrenVM * vm
 

Detailed Description

Wren is a scripting language. This class is a proxy which mirrors the AppBaseClass into wren and hosts a VM.


The use case for this class is to allow scripting of apps
With this interface, applications can be dynamically loaded and executed
Beware: The available heap defines the upper boundary of VM size

From https://wren.io/:
"Wren is a small, fast, class-based concurrent scripting language.
Think Smalltalk in a Lua-sized package with a dash of Erlang and wrapped up in a familiar, modern syntax.
Wren is small. The VM implementation is under 4,000 semicolons"
.

Definition at line 31 of file AppWren.h.


The documentation for this class was generated from the following files: