|
local lib = starlit.mod.lib
local E = {}
starlit.mod.electronics = E
---------------------
-- item registries --
---------------------
-- a dynamo is any item that produces power and can be slotted into a power
-- source slot. this includes batteries, but also things like radiothermal
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
local lib = starlit.mod.lib
local E = {}
starlit.mod.electronics = E
--------------------------------
-- software context interface --
-------------------------------- ---------------------------------------
-- any time a program is run() or bgProc()eeded, a context argument MUST
-- be passed to the entry point. this argument must have at least the
-- following fields and functions:
-- string context ('suit', 'device', etc)
-- names the context in which the program is being run
-- swCap program
-- a structure as returned from usableSoftware(), providing the
-- program with access to and information about its substrate
-- function verify() --> bool
-- return true if the chip the program was loaded from is still
-- accessible
-- function drawCurrent(power, time, whatFor, [min]) --> J
-- attempt to draw current from the power source of whatever core
-- the program is running on
-- function pullConf() --> ()
-- updates the conf structure provided to the program as part of
-- its initial context
-- function saveConf([conf]) --> ()
-- saves any changes made to the conf structure
-- function availableChips() --> inventory list
-- returns the list of chips that are available in the execution
-- context. needed to retrieve system files
-- currently, this interface is implemented by
-- - starlit/interfaces.lua
-- - starlit/suit.lua
---------------------
-- item registries --
---------------------
-- a dynamo is any item that produces power and can be slotted into a power
-- source slot. this includes batteries, but also things like radiothermal
|