picofuse-objc

NXAnalogInput.h
Go to the documentation of this file.
1 
5 #pragma once
6 #include "NXEventSource.h"
8 
24 @private
25  uint8_t _channel;
26  BOOL _temperature;
27  NXDuration _interval;
28  id _target;
29  SEL _selector;
30  void *_device;
31  uintptr_t _attachment;
32 }
33 
44 + (NXAnalogInput *)inputWithChannel:(uint8_t)channel
46  target:(id)target
47  selector:(SEL)selector;
48 
53 + (NXAnalogInput *)temperatureWithInterval:(NXDuration)interval
54  target:(id)target
55  selector:(SEL)selector;
56 
60 - (uint8_t)channel;
61 
66 
71 
75 - (BOOL)isAttached;
76 
81 - (float)floatValue;
82 
83 @end
int64_t NXDuration
A length of time, in nanoseconds, which may be negative.
Definition: NXDuration.h:17
Foundation framework header.
Something which produces events, such as a timer, while it's attached to the application with -[NXApp...
Definition: NXEventSource.h:17
BOOL isAttached()
Returns YES if it's attached, so it can be read and sends its message.
Defines the NXEventSource protocol, for what produces events for an application.
float floatValue()
Reads it now: volts for an ADC channel, or degrees Celsius for the temperature sensor, or 0 if it isn't attached.
bool BOOL
A Boolean value.
Definition: runtime.h:60
BOOL isTemperature()
Returns YES if it's the internal temperature sensor.
The base class for objects in the Foundation framework.
Definition: NXObject.h:28
const struct objc_selector * SEL
A pointer to a method selector.
Definition: runtime.h:23
struct objc_object * id
A pointer to an instance of a class.
Definition: runtime.h:18
NXDuration interval()
Returns how often it's read.
An ADC channel, or the internal temperature sensor, which is read at an interval, and which sends a m...
Definition: NXAnalogInput.h:23
uint8_t channel()
Returns the ADC channel, which is 0 for the temperature sensor.