picofuse-objc

Classes | Enumerations | Functions
Application Framework

An application, and the run loop which dispatches its events on one or more cores. More...

Collaboration diagram for Application Framework:

Classes

class  NXAnalogInput
 An ADC channel, or the internal temperature sensor, which is read at an interval, and which sends a message to a target when its reading changes, as an event source of the application. More...
 
protocol  <NXApplicationDelegate>
 What an application tells its delegate. More...
 
protocol  <NXEvent>
 Something a run loop dispatches, on one of its workers. More...
 
protocol  <NXEventSource>
 Something which produces events, such as a timer, while it's attached to the application with -[NXApplication attachEventSource:]. More...
 
class  NXInputEvent
 What an input sends its target, which is an NXKeyEvent, an NXMoveEvent or an NXSensorEvent: one method can take any of them, and check which it is with -kind. More...
 
class  NXKeyEvent
 A key pressed, held so it repeats, or released. More...
 
class  NXMoveEvent
 A mouse button or a finger pressed, moved while it's pressed, or released, or a mouse's pointer moved with nothing pressed, which a touchscreen doesn't send. More...
 
class  NXSensorEvent
 A sensor's reading of one quantity, such as a temperature, which it sends each time it's read. More...
 
class  NXLight
 An LED, or a chain of NeoPixels, which is turned on and off, dimmed, colored, or blinked. More...
 
class  NXPin
 A pin of picofuse's GPIO: one of a bank's pins, and its level. More...
 
class  NXDigitalOutput
 A pin which is driven high or low. More...
 
class  NXDigitalInput
 A pin which is read, and which sends a message to a target when its level changes, as an event source of the application. More...
 
protocol  <NXRunLoopDelegate>
 What a run loop tells its delegate. More...
 
class  NXRunLoop
 Dispatches events which are posted to it, on one or more workers, until it's shut down. More...
 
class  NXSerialPort
 A UART, as a stream: a Pico's pins, or a host's serial device. More...
 
class  NXStreamSource
 Sends a message to a target when a stream has something to read, or room to write, as an event source of the application. More...
 
class  NXTimer
 Sends a message to a target after an interval, once or repeatedly, on the application's run loop. More...
 

Enumerations

enum  NXApplicationFeatures {
  NXApplicationFeatureNone = 0, NXApplicationFeatureMulticore = (1 << 0), NXApplicationFeatureWatchdog = (1 << 1), NXApplicationFeatureSignals = (1 << 2),
  NXApplicationFeatureStdioRTT = (1 << 3), NXApplicationFeatureStdioUSB = (1 << 4), NXApplicationFeatureDevices = (1 << 5)
}
 The features NXApplicationMain starts, which can be combined. More...
 
enum  NXKeyModifiers {
  NXKeyModifierNone = 0, NXKeyModifierShift = (1 << 0), NXKeyModifierControl = (1 << 1), NXKeyModifierAlt = (1 << 2),
  NXKeyModifierMeta = (1 << 3), NXKeyModifierCapsLock = (1 << 4)
}
 The modifier keys held, and Caps Lock, of a key event, which can be combined. More...
 
enum  NXMovePhase { NXMovePhaseBegan = 0, NXMovePhaseMoved, NXMovePhaseEnded, NXMovePhaseHover }
 How a move went: a mouse button or a finger pressed, moved while it's pressed, or released, or a mouse's pointer moved with nothing pressed. More...
 
enum  NXInputEventKind { NXInputEventKindKey = 0, NXInputEventKindMove, NXInputEventKindSensor }
 What kind an input event is, and so which class. More...
 
enum  NXPinPull { NXPinPullNone = 0, NXPinPullUp, NXPinPullDown }
 Whether an input is pulled up or down when nothing drives it. More...
 

Functions

int NXApplicationMain (int argc, char **argv, NXApplicationFeatures features, Class delegateClass)
 Starts the system, parses the command line, and runs the shared application with a delegate, until it's terminated. More...
 

Detailed Description

An application, and the run loop which dispatches its events on one or more cores.

Enumeration Type Documentation

◆ NXApplicationFeatures

The features NXApplicationMain starts, which can be combined.

Enumerator
NXApplicationFeatureNone 

None.

NXApplicationFeatureMulticore 

A worker on every core, rather than one.

NXApplicationFeatureWatchdog 

The watchdog, where there's one, which the run loop feeds as it runs.

NXApplicationFeatureSignals 

TERM, INT and QUIT terminate it, with 128 + the signal's number.

NXApplicationFeatureStdioRTT 

Standard input and output over SEGGER RTT.

NXApplicationFeatureStdioUSB 

Standard input and output over USB.

NXApplicationFeatureDevices 

The Devices framework's NXDeviceManager, as -[NXApplication deviceManager], with the devices it's built for, from JSON, such as its display, made before the delegate.

Definition at line 175 of file NXApplication.h.

175  {
181  NXApplicationFeatureWatchdog = (1 << 1),
183  NXApplicationFeatureSignals = (1 << 2),
185  NXApplicationFeatureStdioRTT = (1 << 3),
187  NXApplicationFeatureStdioUSB = (1 << 4),
190  NXApplicationFeatureDevices = (1 << 5),
Standard input and output over USB.
The watchdog, where there&#39;s one, which the run loop feeds as it runs.
NXApplicationFeatures
The features NXApplicationMain starts, which can be combined.
A worker on every core, rather than one.
TERM, INT and QUIT terminate it, with 128 + the signal&#39;s number.
Standard input and output over SEGGER RTT.
The Devices framework&#39;s NXDeviceManager, as -[NXApplication deviceManager], with the devices it&#39;s bui...

◆ NXInputEventKind

What kind an input event is, and so which class.

Enumerator
NXInputEventKindKey 

An NXKeyEvent.

NXInputEventKindMove 

An NXMoveEvent.

NXInputEventKindSensor 

An NXSensorEvent.

Definition at line 39 of file NXInputEvent.h.

39  {
An NXSensorEvent.
Definition: NXInputEvent.h:42
An NXMoveEvent.
Definition: NXInputEvent.h:41
An NXKeyEvent.
Definition: NXInputEvent.h:40
NXInputEventKind
What kind an input event is, and so which class.
Definition: NXInputEvent.h:39

◆ NXKeyModifiers

The modifier keys held, and Caps Lock, of a key event, which can be combined.

Enumerator
NXKeyModifierNone 

None.

NXKeyModifierShift 

Either Shift.

NXKeyModifierControl 

Either Control.

NXKeyModifierAlt 

Either Alt, or Option on a Mac.

NXKeyModifierMeta 

Either Meta, Command on a Mac, or Windows.

NXKeyModifierCapsLock 

Caps Lock is on.

Definition at line 14 of file NXInputEvent.h.

14  {
15  NXKeyModifierNone = 0,
16  NXKeyModifierShift = (1 << 0),
17  NXKeyModifierControl = (1 << 1),
18  NXKeyModifierAlt = (1 << 2),
19  NXKeyModifierMeta = (1 << 3),
20  NXKeyModifierCapsLock = (1 << 4),
NXKeyModifiers
The modifier keys held, and Caps Lock, of a key event, which can be combined.
Definition: NXInputEvent.h:14
Either Shift.
Definition: NXInputEvent.h:16
Either Meta, Command on a Mac, or Windows.
Definition: NXInputEvent.h:19
Either Alt, or Option on a Mac.
Definition: NXInputEvent.h:18
Either Control.
Definition: NXInputEvent.h:17
Caps Lock is on.
Definition: NXInputEvent.h:20

◆ NXMovePhase

How a move went: a mouse button or a finger pressed, moved while it's pressed, or released, or a mouse's pointer moved with nothing pressed.

Enumerator
NXMovePhaseBegan 

Pressed, at its point.

NXMovePhaseMoved 

Moved, while it's pressed.

NXMovePhaseEnded 

Released, at its point.

NXMovePhaseHover 

A pointer moved, with nothing pressed.

Definition at line 28 of file NXInputEvent.h.

28  {
29  NXMovePhaseBegan = 0,
33 } NXMovePhase;
Pressed, at its point.
Definition: NXInputEvent.h:29
Moved, while it&#39;s pressed.
Definition: NXInputEvent.h:30
Released, at its point.
Definition: NXInputEvent.h:31
NXMovePhase
How a move went: a mouse button or a finger pressed, moved while it&#39;s pressed, or released...
Definition: NXInputEvent.h:28
A pointer moved, with nothing pressed.
Definition: NXInputEvent.h:32

◆ NXPinPull

enum NXPinPull

Whether an input is pulled up or down when nothing drives it.

Enumerator
NXPinPullNone 

Neither, so it floats when nothing drives it.

NXPinPullUp 

Pulled up, so it's high when nothing drives it.

NXPinPullDown 

Pulled down, so it's low when nothing drives it.

Definition at line 13 of file NXPin.h.

13  {
14  NXPinPullNone = 0,
15  NXPinPullUp,
17 } NXPinPull;
NXPinPull
Whether an input is pulled up or down when nothing drives it.
Definition: NXPin.h:13
Pulled down, so it&#39;s low when nothing drives it.
Definition: NXPin.h:16
Neither, so it floats when nothing drives it.
Definition: NXPin.h:14
Pulled up, so it&#39;s high when nothing drives it.
Definition: NXPin.h:15

Function Documentation

◆ NXApplicationMain()

int NXApplicationMain ( int  argc,
char **  argv,
NXApplicationFeatures  features,
Class  delegateClass 
)

Starts the system, parses the command line, and runs the shared application with a delegate, until it's terminated.

Call it from main() and return what it returns.

Parameters
argcThe number of arguments, from main(), which is ignored on a Pico.
argvThe arguments, from main(), which are ignored on a Pico.
featuresThe features to start.
delegateClassThe class of the delegate, which conforms to NXApplicationDelegate, and is made with alloc and init. Its flags are from +commandLineFlags, to which –help, -h is added, which writes usage: –help unless a flag has that name already, and -h unless a flag has that.
Returns
The status it was terminated with, 0 after –help, 2 if the command line doesn't parse, or 1 if the delegate can't be made. The system is still running, so standard output can be written to, and returning from main() ends the program.
@implementation Controller
+ (NXArray *)commandLineFlags {
return [NXArray arrayWithObjects:[NXArgument argumentWithName:@"verbose" short:@"v"], nil];
}
@end
int main(int argc, char *argv[]) {
return NXApplicationMain(argc, argv,
}