►
From YouTube: .NET Design Reviews: GPIO
Description
We took a look at an API proposal for general purpose IO (GPIO). Notes are here:
https://github.com/dotnet/apireviews/pull/66
A
All
ready,
so,
let's
start
about
this
booklet
Isis.
We
started
with
like
Raspberry
Pi
humming
born
in
Odroid,
but
the
idea
is
to
make
it
extensible
enough
so
that
we
can
add
IOT
devices
later.
We
also
wanted
to
make
it
multi-platform.
So
we
wanted
to
work
on
on
Linux
and
windows
OSS
running
on
the
on
the
devices.
A
We
also
wanted
to
make
general
enough
so
that
the
client
liked
the
same
code
can
run
on
different
devices,
just
by
switching
that
the
type
of
driver
that
you
use,
which
we'll
talk
about
in
a
sec,
and
we
wanted
to
be
performant
so
basically
there's
two
main
classes
that
the
user
will
interact
with,
and
we
have
some
code
samples
in
the
proposal
that
we're
gonna
we're
gonna
share.
So
can
you
scroll
a
bit?
You
know.
A
Found
your
mouse
yeah,
so
yeah,
so
there's
two
basic
classes,
so
it's
the
GPIO
controller
class
and
the
GPIO
pin
class
the
GPIO
controller
class.
You
can
think
of
it
as
an
object
factory
class,
which
has
several
open
methods
that
take
different
parameters
and
and
this
class
will
just
basically
give
you
whatever
the
controller,
is
in
that
device
and
it
will
use
a
driver
in
order
to
perform
operations
within
those
pins.
A
If
you
just
call
the
default
open
method,
if
we
will
basically
try
to
check
with
runtime
information,
we'll
check
which
platform
you're
running
on
which
OS
and
with
that
we're
gonna,
give
you
like
the
default
driver
that
will
do
the
operations
with
the
pins
or,
if
you
specify
like,
if
you
know,
for
example,
I'm
running
on
a
Raspberry
Pi
3,
then
we
will
provide
you.
Another
factory
method
where
you
can
specify.
A
Oh
I
want
to
use
that
driver
because
in
general
that's
gonna
be
more
performant,
so
so
we're
gonna
give
you
that
extensibility
plus
you
will
be
able
to
just
write
your
own
drivers
in
the
future.
In
case
you
want
to
be
supported
in
a
different
device,
and
so
you
can
use
this
factory
methods
and
pass
in
your
own
driver
so
that
you
can
run
somewhere
else
and
then
the
other
class
is
the
GPIO
pin
class.
B
Pin
operations
like
weed
right,
setting
modes
registering
for
events
and
then
also
some
more
advanced
scenarios
like
analog
reads:
analog
writes
if
you
support
PWM
and
stuff
like
that,
so
I
have
a
few
code
snippets
in
there
like.
Well,
you
can
see
like
blinking
LED,
so
while
the
the
controller
class
has
a
dispos
that
will
basically
do
as
well
is
this
possible.
That
was
just
basically
like
free
up
all
of
the
memory
and
resources
that
were
used
by
the
controller.
B
We
also
pass
in
the
pin
number
in
the
board,
and
then
we
set
the
mode
where
that
pin
so
for
that
specific
pin,
we're
sending
it
to
output
so
that
we
can
write
a
value
and
then
in
a
cycle
we're
just
like
turning
it
on
and
off
I'm
serious
when
you
create,
when
you
create
pins,
presumably
they're,
always
associated
with
a
particular
controller.
What
drives
the
design
of
using
a
constructor
rather
than
like
controller
dot,
get
pin
or
something
like
that
we
were
going
to
so
we
thought
of
that.
B
The
the
reason
why
we
decided
to
go
this
way
is
because
GPIO
pin
class
is
extendable,
so
in
the
future
like
that
that
it
implements
an
abstract
class
that
in
the
future,
like
let's
say
that
you
don't
want
to
look
at
it
at
the
pin
level.
You
want
to
look
at
more
as
a
kind
of
like
a
sensor.
Instead
that
takes
several
pins.
B
Does
that
make
sense,
yeah
so
yeah,
because
actually
originally
in
the
interns
design,
it
was
controller,
dot,
get
pin
at
location,
but
we
just
decided
that
this
might
be
a
little
bit
more
extensible
you
provide
a
new
driver
to
you
is
a
extensibility
of
the
controllers.
It's
something
that
the
controller
takes
in
the
controller
that
open
method
it
takes
it.
We
have
some
examples
and
later
on
so
yeah.
B
The
second
example
is
just
like
another:
it's
a
hello
world,
but
this
one
we're
setting
another
pin
as
well
as
input
and
then
we're
just
like
weaning
the
value
and
then
writing
it
on
the
roundel
edge.
So
when
the
button
is
pressed,
we
will
turn
on
the
LED
when,
when
the
button
is
released,
we
will
turn
off
the
lid,
so
there's
no
eventing,
you
basically
are
curing.
In
this
example.
There's
not
we
have
if
we
have
more
examples.
B
So
if
you
scroll
a
little
bit
more,
we
also
have
some
functionality
in
the
LED
to
basically
wait
kind
of
like
synchronously
wait
for
an
event
to
be
raised
so
for
this
you
basically
have
to
set
whatever
pin
you
have
to
set
well
specify
that
you
do
want
to
enable
racing
events
for
the
specific
pin.
Then
you
in
the
notify
filter.
You
basically
said
which
type
of
events
you
want
to
get
so
you
could
be
for
now.
We
just
support
like
either
falling
or
rising.
So
a
button
well,
like
I,
mean
going
from
0.
B
A
ball
which
will
tell
you
basically
if
the
event
was
received
or
not,
so
that's
that
top
example.
If
the
event
occurred
anywhere
before
the
dot
wait
for
event,
you
would
walk
indefinitely.
Well,
you
would
log
in
for
those
10
yeah
for
10
seconds
in
this.
Yes,
yes,
as
long
as
you
don't
like,
you
have
to
configure
I
mean
call
the
weight
before
like
before
the
event
happens,
and
then
we
also
support
registering
for
callbacks.
So
that's
the
next
example.
So
you
can.
We
have
an
event
handler.
B
B
And
the
thinking
of
this
is
that
Python
actually
supports
the
same
thing,
which
is,
you
could
basically
know
like
use
the
notify
filter
to
register
for
a
few
events.
But
then,
if
you
want
to
basically
say
so,
I
want
to
pass
basically
receiving
events
for
a
few
a
few
moments.
Then
what
you
could
do
is
just
like
set
enable
racing
events
to
false.
You
won't
get
events,
and
then
you
can
set
it
back
to
true
whenever
you
want
to
you're
interested
in
getting
events
again.
B
B
Windows,
it's
like
it's
enabled
as
long
as
soon
as
you
and
they
subscribe
to
the
event
right
yeah,
because
certainly
my
first
thought
on
that
was,
if
the
only
property,
the
only
value
that
you
change
is
the
notify
filter
then
notify
filters.
Equal
none
would
be
don't
raise
events
and
otherwise
raise
it,
but
we
could.
C
B
You
actually
want
the
notified
filter
to
be
set
before
you
says,
enable
raising
events.
The
truth,
yes
to
do
they
kind
of
blow
that
that
I
always
find
it
is
because,
if
you,
if
you'd
like
in
written
forms,
there's
no
enable
raising
events
right
your
subscription
when
you
get
an
event
when
it
happens
right
and
like
it's
just
they
give,
you
don't
see
the
line.
The
code
looks
fine
right
and
it's
like.
Why
is
my
event
not
coming
it's
like
well,
because
you
didn't
ask
for
it.
Well,
I
subscribe
to
the
event.
B
It
is
that
not
enough,
like
I
mean
much
more,
you
want
for
me.
It's
not.
It's
not
straightforward.
I!
Think
the
only
baby
that
this
has
is
like
you
have
a
pre-configured
object
where
you
have
the
modified
photo
set
of
your
the
event
handler
setup
in
yours
when
I
turning
on
and
off
right.
But
how
often
do
you
want
that
I
I?
Don't.
B
C
B
B
Python
kind
of
like
they
have
this
functionality.
So,
like
that's,
why
we
said?
Okay,
maybe
we
want
to
enable
that
it
yeah.
Don't
get
me
wrong
with
this.
Oh
they're
different
scenario
make
sense.
It's
just
that
just
it
feels
like
usability
trap
right
yeah,
if
I,
just
look
at
the
API
I
would
I
would
just
think.
Okay,
maybe
I
just
need
to
add
a
notify,
filter
and
then
set
my
callback,
and
it
should
just
work
right.
So
yeah
I
agree
that
that's
that
might
be.
B
E
B
H
B
H
H
A
The
explosion
know
and
the
exposed
to
API
we
used
to
so
yesterday.
We
did
a
first
revision
of
it
and
it
did
have
all
of
those
different
like
same
falling
as
chasing
falling
edge
and
all
those
yeah
are
you
actually
using
yeah.
Turning
to
because
I
think,
a
lot
of
people
ended
on
that
world
might
expect
instead.
B
An
unlimited
number
of
things
happening
here
and
so
then
kind
of
make
sense
for
that,
and
it's
the
kind
of
thing
that
Rx
is
good
for
in
getting
a
sequence
or
something
like
channels.
And
you
know
you
push
all
the
things
into
the
channel
and
then
you
pull
from
it,
because
you
need
something
to
do
buffering.
But
with
the
wait
for
event,
I
would.
B
H
The
only
time
you're
getting
get
it
and
then
is
while
you're
in
that
call
and
the
moment
it
returns
it.
The
other
thing
happens:
you're
not
going
to
get
that
event
and
there's
a
race
condition.
If
you
try
to
write
a
loop,
that
was
wait
for
then
just
do
something
weaker
then
do
something
right
make
sense,
yeah
and
about
the
other
thing
that
you
mentioned
Steve
like
having
the
notify
filter
preset
and
then
also
have
enable
raising
events
preset
to
to
the
the.
B
H
H
Interrupts
into
into
the
actual
execution
every
time
that
you
hit
one
of
these
events,
so
that's
why
we
thought
that.
Maybe
this
is
something
that
the
user
and
and
that's
also,
why
I
think
in
Python.
You
you
have
to
manually,
set
this
to
true,
because
if
you
clear
that
performance,
you
don't
that
makes
sense
except
it
does.
I
E
I
B
You
changed
or
when
they
call
wait
for
events
like
we
could
set
the
three
properties
under
the
under
the
hood
of
when
the
easiest,
that's
one
when
I
see
short
code,
yeah
I
mean
my
other
questions
like
go
for
beta
for
wins,
I,
guess
away
the
vendee
it's
kind
of
clear,
but
if
I
use
normal
normal
events,
what
does
my
main
look
like?
What
is
your?
What
what
does
my.
J
C
Today
works:
is
we
spin
off
whenever
you
set
up
and
add
a
value
change
callback?
We
spin
up
a
different
thread
that
will
basically
be
oh,
it's
a
while
true
that
will
be
just
while
you
still
have
some
callbacks
and
while
not
if
I
filter
is
not
empty,
we
will
basically
look
for
events
on
all
of
the
pins,
so
it
could
literally
do
this
go
snippety
and
then
my
last
line
in
maine
is
just
console,
dot
read
line,
and
then
this
is
place
you're
blocking
again
your
events
get
still.
B
The
actual
notification
for
events
is
an
actual
register
that
you
flip
on,
and
you
say:
okay,
I
wanna
like
these
type
of
events.
I
want
to
get
a
notification
for,
and
so
basically
what
we
do
is
what
the
hardware
does
is
whenever
you
register
for
that,
it
will
basically
start
listening
for
that
specific
pin
for
those
type
of
events,
and
whenever
you
get
one
it
will
go
in
and
flip
another
register
and
say
hey.
You
have
an
event
like
it
happens.
So
then
our
internal
implementation
is
basically
going
check.
B
I
Jeremy,
I
can,
I
can
give
you
a
little
bit
more
data,
so
this
is
actually
a
lossy
callback
mechanism
to
so
so,
let's
just
said
it
sets
these
bits
in
a
register
to
one
saying:
hey,
an
event
has
happened
and
there's
a
different
register
with
the
value
yeah.
Then
joe's
code
then
has
to
go
in
in,
like
I
think
yesterday,
like
a
ones
complement
or
he
has
to
do.
A
B
Into
a
queue
for
somebody
else
to
deal
with
later
so
we
you
get
a
little
bit
out
of
the
polling,
and
then
we
could
use
our
existing
wait
handles
to
wake
up
somebody
else,
instead
of
sitting
in
a
busy
loop
like
really
it's
it's
long,
it's
okay!
If
we
go
better
than
our
Handler
and
it's
CPU
intensive,
if
you're
something
I'd
love
to
see,
is
the
value
change.
C
A
A
B
The
Joe
I
think
I
may
have
I'm
not
sure
if
I
heard
you
correctly
heard
miss
her
to
earlier
so
wait
for
event.
Yes,
so
let's
say
I
turn
on
the
naval.
Raising
events
I've
got
to
notify,
filter
and
then
such
an
event
happens
and
it
sounds
like
that's
gonna
end
up
setting
some
register
somewhere
to
one.
Yes,
if
I
then
call
wait
for
event,
do
I
observe
that
event
that
just
happened
or
not
you
would.
Yes,
you
would
see.
B
B
I
H
One
very
important
thing
it
for
that
this
factory
method
and
the
implementation
would
be
that
we
would
have
to
actually
have
some
sort
of
check
to
see
and
make
sure
that
you
are
not
picking
raspberry
pi
3
in
a
in
a
different
device,
because
what
this
driver
will
do
is
it
will
actually
go
in
and
flip
registers.
So
in
your
memory
and
it
and
for
most
of
this
I
guess-
I
didn't
mention
this.
J
M
B
A
B
A
B
To
be
shared,
we
have
actually
like
kind
of
like
a
base
class,
GPIO
driver
class,
and
so
this
this,
this
abstract
class,
will
basically
has
like
the
shell
that
everything
every
single
driver
will
have
to
implement.
Because
that's
what
the
controller
is
going
to
be
calling
in
order
to
perform
operations
and
same
for
the
pin.
But
are
there
things
that
you
can
configure
on
that
driver
that
you
might
want
to
have
access
to.
B
We
discussed
that
yesterday.
So
basically
we
discussed
the
possibility
of
like
what,
if
we
want
to
support
Raspberry
Pi
for
with
the
Raspberry
Pi
three
drivers,
so
all
you
only
takes
is
basically
changing
the
the
register
addresses
so
passing
in
like
a
DTS
file
or
something
I,
don't
know,
I,
don't
I,
don't
see
a
bunch
of
like
I,
guess,
I,
don't
I,
don't
see
a
big
benefit
and
doing
that.
I
think
that
it's
gonna
be
more
complicated
than
like
just
doing
the
parsing
for
all
of
that
file
and
and
because.
N
N
D
N
D
N
J
C
C
B
Be
like
you
either
use
the
default
or
you
use
the
enum
and
the
driver
is
like
for,
like
the
you
know,
very
detail
of
the
scenarios,
then
I
would
just
do
the
enum,
because
it
adds
enough
value
and
will
be
basically
very
usable
API
for
majority
of
customers.
Yeah.
Is
there
any
cases
where
you
know
you
would
have
to
live
without
using
a
Raspberry
Pi
we're
gonna
be
able
to
detect
it
correctly
right?
We
should
be
able
to
detect
it
I'm.
B
And
so
we
haven't
used
this
in
happy
mystics
in
our
library,
so
right
now,
most
people
would
actually
want
to
write
that
very
first
line
as
the
project
is
implemented
today.
What
you're
passing
in
the
enum
but
you'd
want
to
use
the
last
line
right.
You
want
it
to
be
just
GPI
controller
dot
open,
and
it
just
knows
what
to
do
yes,
but
then
like.
If
we
do
that
like
we
could,
we
could
totally
do
like
this
hacks
that
josh
is
mentioning,
but
it
also.
B
It
would
also
be
that
now,
GPIO
controller
open
method
will
be
like
a
whole
bunch
of
like
it
will
be
super
complex
and
it
will
be
checking
a
bunch
of
processor
information.
Yes,
so
actually
we
should
we've
had
some
discussions
about
this.
You
know
reliability
of
the
default
open
like
if
it's
really
not
reliable.
We
should
actually
consider
not
having
it,
because
we
don't
want
to
slip
an
API
that
you
know
it's
just
for
shooting
yourself
in
the
food.
It
is
reliable
if
we
just
used
it
to
full
controller.
B
D
N
Review,
but
so
would
we
ever
want
people
to
you
really
need
to
say
I'm
on
Raspberry
Pi
3
right?
What
do
we
ever
want
anybody
to
use
the
default
open?
It's
for
people
like
if
you
want
to
just
flip
an
LED
or
if
you're,
on
a
board.
We
don't
support.
That's
the
backup
if
you
want
to
do
basic
operations
as
well
like
just
reading
and
writing
a.
I
I
Predict
best
driver
and
it
either
returns
back
an
object
or
returns
back
an
enum
that
says
I,
don't
know
in
the
I,
don't
know
case
or
or
whatever.
Then
you
decouple
the
open
code
from
the
predict
code
and
if
somebody
knows
what
they
want
to
do,
they
call
that
one
and
then
you
always
make
them
pass
a
thing.
The
default.
B
V-Twin
won't
be
allowed
I,
don't
think
any
of
this
matters
I
think
anyone
who's
knows
that
they
need
to
open,
pin.
17
knows
they're
working
on
the
Raspberry
Pi
I'm
gonna
set
that
one
honestly
and
they
probably
want
to
actually,
if
anything,
maybe
we
should
delete
the
default,
open,
0,
pram
method
and
make.
N
B
For
Raspberry
Pi,
well,
that's
thing
is
it?
Is
it
disposable
and
then
the
next
question
was
gonna
be?
Is
it?
Is
it
thread
safe?
Because
then
it's
do.
We
have
a
singleton
pattern
or
do
we
have
a
factory
pattern
and
if
it's
disposable
and
not
thread
safe,
then
it's
annoying
because
now
the
enum
look-alike
is
occurring
a
bunch
of
stuff
with
the
garbage
collector
I,
guess
that
depends
on
whether
or
not
it's
fine,
illogical,
disposables,
fine,
fine,
Eliza
balloons,
it's
a
very
expensive
property.
I
I
B
H
I
H
H
C
B
A
A
I
B
N
N
B
Syntactically
anymore,
because
you'd
still
have
to
specify
the
driveway.
Yes,
yes,
but
that's
what
I
was
asking
these
methods
would
be
gone.
We
won't
have
those
right
in
the
second
box.
Well,
yes,
yes,
we
won't
have
them,
but
we
will
have
the
ones
on
the
top
and
that
well
two
of
the
first
two
of
the
programs
on
the
top
and
then
both
of
them
take
an
extra
second
optional
parameter,
which
is
the
number
in
width
so
on.
B
Both
of
them
were
like
in
all
three
options
above
we're
just
defaulting
to
logical,
but
you
could
optionally,
you
specify
a
new,
so
I
understand,
I,
understand
I'm,
looking
at
the
chip
schematics-
and
it
says
this
is:
pin
11
and
I,
see
that's
what
I
soldered
my
wire
to
yeah,
so
I'm
going
to
pass
the
number
11
yeah
that
logical
or
board
that's
board.
Okay,
so
you
saw
that
pin
out
like.
D
B
B
B
B
B
B
B
H
E
B
I
It
is
that
translation,
consistent
across
drivers
I
know
it's
different.
It's
different
yeah,
it's
every
driver
has
their
own.
So
you
this.
Why
isn't
this
a
property
on
the
driver,
though
I'm
still
not
on
that
controller,
because
the
good
like
the
actual
implementation
of
the
like,
for
example,
translation
of
these
numbering
is
the
controller
calling
on
its
driver
and
say
translate
this.
I
R
B
J
G
B
B
D
A
H
C
I
The
board
layout,
if
we
want
to
support
it
at
all,
should
be
a
property
on
the
driver,
and
it
should
not
be
a
default.
You
should
have
to
go
out
of
your
way
to
get
into
it
and
which
means
we're,
probably
just
starting
to
care,
and
mr.
this
morning,
yeah
the
more
I
look
at
it.
The
more
I
think
we
shouldn't.
J
We
should
have
should
just
use
logical,
should
always
decide.
I
disagree,
so
I.
Let's
say
we
do
want
to
support
board
because
all
the
like
Adafruit
samples
and
all
the
Python
code,
samples
out
there
are
all
in
board,
pin
numbers
well,
so
I
think
there's
two
different
ways:
code
over
from
Python
the
c-sharp
and
that
translates
three
threes
to
17s
and
have
their
code
work.
I.
Think.
J
Agree
we
need
both
also
I,
think
that
some
of
our
customers
will
be
in
complete
control
of
the
hardware
that
they
care
and
they
probably
may
want
to
refer
to
basically
hardware
board
specific.
They
don't
care
about
the
abstraction
like
I'm
running
on
some
devices.
I
actually
don't
know
what
they
exactly
are
they're
like.
We
know
what
we
have
there
I
want
to
refer
to,
pin
5,
don't
ever
like
map
it
to
anything
else
again.
B
I
J
I
B
I
B
The
consumer
will
probably
want
logical
yeah,
and
so
you
need
both
and
you
need
to
deal
with
be
able
to
deal
with
both,
but
your
drove,
the
the
the
consumer
isn't
going
to
want
to
see
or
deal
with
board.
Most
of
the
time
don't
want
to
deal
with
logical,
because
that's
what
they're,
following
along
in
their
book
or
right
now,
tutorial.
H
I
did
on
the
pic
I
feel
that
when
it's
supported
Clampett
said
GPIO,
one
two
and
five
support
Quinn
now
granted
you're
like
I,
don't
know
by
one
two
and
five,
then
you
look
like,
oh
because
it's
these
three
guys
right
here,
yeah
but
like
you
called
them
one,
two
and
five,
for
whatever
reason
you
did
and
that's
like
the
documentation
where
you're
reading
what
you
can
do
with
this
chip.
Never
talks
about
like
pin
out
eight
it
talks
about.
It
uses
the
logical
name.
G
I
I
C
I
N
Driver
right
state
yeah,
it's
not
the
question
that
I
think
we
don't
yet
decided
is,
but
is
it
passed
through
from
a
controller,
open
method,
I
think
it's
I
think
the
driver
would
need
to
be
pre-configured
before
it's
passed
to
the
controller
and
all
the
controllers,
gonna
say:
they're.
The
right
onion
wherever
that
comes
from
is
gonna.
Take
a
number
it's
going
to
pass
it
to
the
driver
and
the
driver
knows
what
it's
supposed
to
do
it
sure,
but
you
imagine
we
could
have
an
open
method
that
takes
both.
I
J
The
driver
to
set
the
properly
because
it
won't
be,
it
won't,
be
a
state
on
the
controller.
It
would
still
be
a
state
on
the
driver,
but
then
you
don't
have
to
pre
initialize
again
that
that
does
depend
on
if
we
are
using
any
number
we're
using
static
accelerator
properties,
because
if
you're
getting
back
and
shared
objects,
you
don't
want
to
change
state
on
this
object
when
invoking
it
in
a
different
memo.
J
It
is
there
an
example
of
how
logical
and
board
differ
for
how
a
user
will
call
that
because
know
what
what
I
would
expect
is
that
you
know
if
I
were
providing
the
driver.
I
would
either
provide
explicit
like
right.
Gpio,
three
pin
methods
or
I
would
provide
an
enum
that
map's
concretely
with
no
translation
required
friendly
names,
too
logical,
pin
numbers
and
then
there's
no
overhead
roll.
It
just
you
say
right.
10,.
H
Like
what
we,
which,
whenever
you
call
a
function
like,
for
example,
repin
18,
we
would
know
which
numbering
scheme
you're
using,
and
so
we
do
the
overhead
of
translating
that
to
the
logical
and
that
what
we
passed
into
the
driver,
but
for
for
logical
like
so
what
I'm
not
getting
is
if,
if
I
say,
I
want
logical
mode,
then
how
how
do
I
say,
read
GPIO
3?
What
would
what
would
the
actual.
J
H
M
N
H
N
H
J
B
J
B
J
Right
you
need
like
four
pins
or
three
pins
there
for
a
connection.
It's
not
a
food!
If
that
one
connection
is
consuming
three
deaths
right.
It's
telling
you
that
it's
consuming
these
particular
things
right.
It's
it's!
It's
a
dictionary
of
like
pins
in
different
modes.
Basically
so
I
would
say
in
general,
you
can
always
add.
J
B
You
can
go
connection
with
ya
all
right,
it
always
inserted
based
on.
Is
there
a
real
need
for
a
numerating
connections?
No
not
today,
so
today,
the
only
class
that
we
have
is
GPIO
pin,
of
course,
but
like
we
thought,
a
bit
more
of
kind
of
like
an
extensibility
point
for
the
future.
If
we
wanted
to
support
new
sensors
but
again,
why
would
you
in
what
scenario
would
you
want
to
read
so
I'm,
not
all
of
the
time
friend
like
the
basically
I'm
talking
about
GPI
controller,
there's
the
property?
What
are
the
open
connections
yeah?
G
B
And
imagine
so
like
the
idea
behind
it
was
especially
for
like
that
this
pose
or
close
old
pins.
We
have.
We
have
to
kind
of
keep
a
state
of
what
do
we
have
to
clean?
What
are
the
things
that
we
have
to
on
exports
and
stuff
like
that?
So
that's
why
we
had
the
the
open
connections
and,
above
all,
in
there
also
like
in
the.
B
F
N
B
B
This
information
I'm
asking
why
I
just
want
to
do
the
any
great
yeah
I'm
curious
with
these
scenario,
is
of
a
numerating
I
am
the
only
program
running
on
this
job?
Who
else
has
stolen
to
be
is,
if
you
would
remember
the
pin,
you
remember
the
pin
right,
yeah
store
it
somewhere
and
then,
even
if
it
internally
maintains
a
collection
for
clothes
all
like.
Why
is
that
being
exposed?
B
A
B
H
H
B
And
available
no,
yes,
it
should
be
yeah
because
you
didn't
open
it
without
asking
for
open
connections
on
the
second
one
returns
to
the
empty
enumerator.
Yes,
okay,
knows
controllers,
it
knows
the
objects.
You
can't
not
allow
it.
Yes,
I'm
saying
why
do
we
want
to
unless
it's,
let's
make
it
a
factory,
only
created
method
and
yeah
yeah,
you
passing
a
particular
driver
and
there's
always
only
one
driver,
there's
always
only
one
controller
per
driver
yeah.
So
again,
it's
just
the
understanding.
H
Then
they
are
basically
just
wrappers
over
the
short
state,
and
maybe
they
have
some
individual
things
like
you
know
the
logical
to
physical
mapping
and
whatnot,
because
that
one
is
kind
of
probably
not
so
they
need
to
identify
what
would
happen
and
what
should
happen.
Yeah
you
make
two
controllers,
let's
even
say.
N
B
B
That
would
be
a
function
of
the
controller,
not
a
I,
create
a
func,
reiated
controller
and
then
in
order
to
create
this
other
pin
object.
I
need
to
know
what
a
controller
yes
like.
So
this
is
about.
Like
writing.
The
linear
flow
of
your
code
instead
of
the
one
one
example
of
why
we
thought
of
this.
For
example,
it's
it's
not
represented
in
this
part
of
the
proposal,
but
we
thought
about
splitting
right
now.
Gpio
pin
has.
H
B
H
L
N
H
Begins,
that's,
and
maybe
things
like
quim
get
a
little
different
and
get
a
little
more
complicated,
but
the
I
want
to
read
and
write
directly
to
a
pin
feels
like
a
primitive
unroll.
But,
okay,
we
could
solve
this.
I
agree
with
you
about
the
problems
that
their
current
design
maker
but
I
think
we
can
solve
it
in
different
ways,
not
necessarily
throw
away
the
idea
of
having
multiple
in
terms
because.
H
H
B
Concerned,
if
that
depends
disposable,
but
that's
the
one
you
want
to
work
with,
but
that
needs
a
disposable
context
with
controller
which
possibly
needs
a
disposable
context
for
the
driver
when,
like
so,
you
read
a
bunch
of
using
to
get
to
the
code
you
like,
and
we
are,
they
need
to
start
inverting,
a
bunch
of
that
flow
or
or
they
need
to
understand.
Why
they're
coming
one
line
after
the
true,
but
why
their
scope
is
open,
because,
even
if
you
have
open
pin
that
gives
you
back
a
new
instance
of
GPIO
pin
right.
B
If
that
is
disposable,
expose
away.
Yes,
but
you
didn't
have
the
temptation
to
write
I,
don't
think
you
have
the
temptation
either,
though
cuz
there's,
no
there's
no
constructor
and
GPIO
controller
right.
We're
not
gonna
expose
that
the
only
way
of
getting
a
new
controller
is
by
calling
open
and
then
that's
all
I
would
also
that
you
know
there
is
a
constructor
right.
Anybody
who
has
ever
written
any
managed
code,
it's
pretty
normal,
that
you
instantiate
an
object.
It
wants
another
object
in
the
constructor
and
you
know
you're
not
always
doing
them
up
in
life.
H
Object
one
you're
passing
on
the
existing
is
you're.
Not
you
know,
Julian
up
again
right
especially
I
mean
I,
would
say,
controller
and
thin.
It
is
possible,
it's
like
una,
cocaÃna,
Monica
I.
Don't
do
that.
All
I'm
saying
is
I,
don't
think
it's
it's
a
completely.
You
know
new
pattern
that
you
haven't
seen
before.
Is
it's
the
typical
normal
yep.
H
P
H
H
N
Saying
we
must
do
it,
but
let's
assume
we
want
different
types
of
things.
Maybe
I
use
the
exact
same
thing.
We
did
with
Dream
Eater
right,
so
it's
so
we
have
streamreader,
you
can
either
pass
in
the
stream
or
you
pass
in
the
pond.
I
mean
it
could
start
to
screen
for
you
right.
It's
the
same.
You
could
imagine
that
they
have
a
GPIO
pin
open
from
controller
one-liner
right.
It
just
gives
you
back.
N
Like
both
makes
sense,
you
didn't
get
the
base
case
that
most
people
gonna
be
doing,
which
is
just
open.
A
GPIO
pin
should
have
a
special
case
for
it,
so
they
say
GPI
controller,
on
open,
pin
where
hey
the
pwm
pin
or
something.
Then
they
can
do
yeah
how's
it.
Yes,
that's
what
I
think
that's
reasonable
that
that,
if
what
they
want,
is
just
the
read
write
on
a
pen
and
they
want
the
simple
like
via
1
or
0
yep,
no
analog
mode,
no
quim,
no
SPI!
Oh!
H
We're
not
open
him
back
when
that
new
new
pin,
5
well
I
mean
the
pin,
needs
a
controller,
neutral
controller,
comma,
5,
comma
mode,
and
because
we
worried
about
the
lifetime
of
the
controller
instead.
I
think
that
nothing
in
the
I
think
that
there's
some
trying
to
help
people
understand
the
lifetime
better.
A
A
H
N
New
object
has
a
new
lifetime
of
the
thing
and
you
can
dispose
your
controller.
Does
it
doesn't
go
away?
You
might
be
in
the
second
phase.
Yeah
I
can
still
create
two
controllers
think
that
they
are
independent
and
I
close
all
pins
on
one
and
I'm
screwed.
That
I
would
also
say,
like
this
highly
depends.
N
A
H
H
N
H
C
N
B
F
B
To
talk
about
a
GPIO
pin
for
as
long
as
they
want
to
talk
about
the
pin,
can
we
make
them
where
they
shouldn't
talk
about
the
controller,
but
we're
not
sending
something
to
the
finalizer
so
understanding
lifetime
semantics?
Maybe
changing
things
to
address
release
route
like
just
trying
to
understand
what.
H
A
I
think
that
if
we,
if
we
have
a
constructor
on
GPIO
controller,
it's
definitely
gonna
cause
the
scenario
that
you
first
point:
it
I
think
having
it
a
factory
method.
It
helps
a
little
with
people
not
wanting
to
just
do
Bart,
pinnacles,
new
pin
and
then
in
parentheses,
new
controller,
so
like
I,
think
it
kind
of
helps
in
that.
So
I
think.
The
consistency
argument
is
very
good
point,
but
I
have
to
tell
you
that
open
screams,
you
should
close
it.
B
N
B
B
N
H
H
Cuz
new
controller
is
not
a
thing
like
no.
No.
No,
if
you
say
you
GPIO
pin
controller
five,
and
you
did
that
twice
so
today.
It
doesn't
well,
though,
the
way
the
API
implementation
is
today
it
won't
like
it
won't
do
anything
would
just
return
you
a
pin.
So
then,
when
you
dispose
the
second
one,
it
killed
the
first
one
which
seems
like
yes,
you've
got
to
separate
for
references
and
control.
The
same
instance
I,
don't
I,
don't
think
that
the
implementation
is
far.
H
Like
it
was
just
a
lot
of
ownership
semantics,
especially
because,
at
the
end
of
the
day,
you're
talking
about
owning
a
taken
ownership
of
this
piece
of
hardware
yeah,
since
the
actual
hardware
is
like
shared,
it
seems
like
having
controller
dot
open,
in
which
case
you
can
logically
return.
The
same
underlying
instance.
B
Of
the
pin,
but
this
way
I'm
saying
whether
it's
a
factory
method
or
a
constructor,
we
can
implement
the
same
semantics.
I
think
you
just
have
an
idea.
Yes,
I
agree:
the
implementation
would
have
to
be
different,
but
I
don't
think
we
should.
If
we
feel
that
one
of
the
api's
is
better
I
think
we
can.
D
N
Up
in
the
same
pin
and
they
created
different
controllers
or
different
drivers,
or
at
what
level
do
we
understand?
We've
done
a
thing
at
what
level
have
we
impacted
some
other
library
that
you
that
you
loaded
that
didn't
understand
that
the
two
libraries
are
competing
instead
of
working
collaboratively?
N
N
N
B
H
B
S
J
H
J
N
N
H
Also
thought
that,
on
the
controller
class,
you
had
that
tracking
all
of
the
pins,
yes,
which
makes
a
lifetime
even
more
confusing,
because
I
open
the
pin
and
the
controller
still
is
tracking
it
and
then
I
dispose
the
pain.
But
the
controller
is
still
tracking
it
and
it
might
think
it's
open
unless
it
itself
subscribe
to
the
close
event
right
yep,
which
is
why
we
did
really
well
I.
Think
you've
got
that
problem,
whether
you
do
open
or
create
or
anything.
H
J
B
P
B
It's
a
lightweight
object.
You
can
create
thousands
of
those,
you
can
associate
them
with
the
same
thing.
If
you
call
you
know
on
and
on
and
off
on
the
other
one.
A
second
later
it's
gonna
be
off
yeah.
The
problem
is
what,
if
you
set
one
is
input
and
then
try
to
do
the
other.
One
is
output.
It
only
supports
one.
A
B
H
A
J
Rich
kids,
what
I
would
be
in
favor
of
you?
Can
you
knew
it
up?
You
get
a
new
instance
or
you
get
an
exception.
It's
like
how
you
open
a
file
right.
If
you
open
a
file
twice
yep,
sorry!
So
then
again,
but
then
you're
busted
I,
don't
have
a
problem.
I
mean.
If
you
have.
You
need
an
exclusive
read
on
a
file.
The.
J
N
N
But
isn't
the
problem?
Because
if
you
don't
do
that,
then
you
have
a
shared
resource
for
that
right,
but
you
wouldn't
the
library,
be
working
with
pins,
not
controllers.
So
that
way,
your
program
curtain
provides
the
pins
the
the
library
works
on
the
pins.
But
let's
say
that
the
library
is
called
Maya
robot
yeah.
O
N
D
N
N
B
N
A
G
B
N
G
N
There
is
light
and
it
uses
pins,
8
and
7,
and
you
can
turn
on
lights
and
turn
off
lights.
Now
you
don't
want
to
the
surface
API
of
these
2
types
or
2
library.
You
just
have
to
do
anything
to
do
with
page.
It's
just
the
robots
and
lights,
and
you
know
and
speaker
or
something
technically,
you
still
have
to
know.
Well,
you
still
have
to
pass
in
pins
because
you're
plugging
the.
A
J
A
J
J
Which
eventually
gets
down
to
the
VGA
driver,
which
says
write
these
bits
to
for
it,
3
C,
3,
co,
+
and
the
normal
user
will
never
interact
with
the
pins.
That's
the
responsibility
of
the
driver,
which
talks
the
controller
and
the
sensors
and
everything
else
to
get
it
done,
and
so
it's
like
completely
different
layers
of
the
library
author
will
have
to
deal
with
the
ports
and
the
drivers
and
the
controllers,
but
the
end
user
won't
unless
they
explicitly
want
to
its
back
doors
to
get
today.
G
N
A
J
J
It
arts
what
they'd
say
if
you
open,
if
you
open
the
fire
exclusively
we're
sharing
for
reading
anybody,
can
read
the
file.
Nobody
can
open
the
file
for
ride
no
problem
right.
So
if
anybody
just
opens
pins
for
reading
like
detecting
button
presses,
yeah
for
libraries,
just
seems
fine
right,
I
think
there's
also
a
little
bit
of
a
difference
in
layering
because,
like
file
IO
stuff,
it
support
shared
reading
and
writing
right
because
it
sits
on
top
of
the
file
IO
driver,
which
is
sits
on
top
of
the
disk
driver,
which
you.
N
N
J
J
I'm
not
sure
I
would
buy
them.
Leather,
though,
because
with
Chris
example
right,
if
you
have
to
look
like
a
robot
live
in
lights
library,
you
don't
see
the
control
that
I
keep
in
the
bowels
of
these
guys.
One
guy
needs
it
up.
One
other
guys
needs
it
up
and
I'm,
just
a
guy
in
Maine
composing,
two
components
like
imagine
that
she's
not
even
composing
using
either
this
one
or
that
one
it
would
just
work.
J
It's
just
no,
but
to
this
point
like
what
we're
not
workers
have
used
both
of
these
yeah
there's
no
way
for
me
to
know
this
right,
you
can
to
divide
two
sensors
can
share
the
same
controller
as
long
as
they're,
not
sharing
the
pins,
and
if
they
are
sharing
pins,
they
have
to
have
another
controller
that
separates
the
which
which
place
the
pins
go
to.
So
you,
like
you,.
N
Can
have
any
nesting
of
microcontroller
sitting
on
top
of
each
other,
directing
pin
X
2
pin
Y
depending
on
what
higher
state
you've
passed
it
so,
but
but
at
the
end
of
the
day,
you
always
have
one
controller
that
that
two
devices
can't
simultaneously
try
and
do
the
same
pin
at
the
same
time
too.
And
if
you
do,
then
things
break
so
for
now
for
going
back
to
how
we
design
it,
I
would
suggest
that
we
try
to
get
as
close
as
possible
to
reality
without.
A
Getting
too
haki
like,
if
we
just
cannot
do
something
can
happen
for
some
like
let's
say
we
don't
even
happen,
I,
don't
know
whether
we
can
delete
the
information.
Is
that
mean
open
or
not?
Well,
we
cannot
implement
in
IP
is
something
that
is
completely
corresponds
to
you
know
they
just
open
your
pants
and
then
maybe
it
fails
at
some
point,
but.
J
If
we
have
the
information,
we
should
design
itself
that
they
cannot
basically
do
things
that
don't
correspond
to
the
physical
world.
May
change
so
like
if
we
can
make
the
controller
be.
Given
that
you
know
in
reality,
there
is
one
device.
If
you
can
make
it,
the
controller
would
be
such
that
you
can
only
have
one
and
it's
perfect,
but
if
we
cannot,
then
you
could
pull.
A
Them
all
out
at
the
driver,
livery
or
add
the
controller
level
we
can
only
like
when
you
called
this
post
on
a
controller.
It
would
only
close
whatever
it
opened.
So
that
way,
if
you
have,
if
you
have
two
different
libraries
that
are
controlling
two
different
sensors
plugged
into
the
same
pi,
when
you
call
this
pose
on
each
one
of
them,
but
they
will
only
close
whatever
they
open
for
you
with
the
rest
go
well,
no,
but
you
just
think
a
bit
of
like
so.
Obviously
you
won't
be
able
to
do.
J
A
N
N
N
Top
of
that
an
inch
physical
device
would
only
control
whatever
that
thing.
Oh
well,
you
know
whatever
that
thing
has
done
right
and
so
the
one
that's
in
charge
of
hey
you
can't
you
can't
use
this
pin
would
be
like
the
actual
physical
one
that
will
tell
you
like
hey.
This
pin
is
used
for
something
else
which,
as
a
matter
of
fact,
I,
don't
even
know
if
that's
possible,
like
at
least
in
the
Raspberry
Pi
level.
I,
don't
think,
there's
a
way
of
saying
is
somebody
using
this
this.
N
So
you
know
there's
itself
because
you'd
like
you,
can
you
kick
in
principle?
You
could
say
that
the
physical
control
and
your
work
could
be
the
to
the
GPIO
driver
instance
right,
but
you
just
remember
which
pins
you
have
opened
the
second
guy
that
asked
for
that
you're
like
nope,
sorry
that
things
were
taken
with
somebody
else
it's
stored
in
this
as
of
us,
and
if
am
the
very
least
in
the
export
list,
it
does.
If
you
use
system,
yes,
but
it
doesn't.
If
you
do
register
money,
please.
B
B
A
B
J
J
B
B
J
J
M
D
B
L
N
N
In
fact,
you
can
just
initialize
a
pin
without
setting
a
mode,
and
then
you
can
set
those
they
don't
have
separate
types
for
different
kinds
of
things,
right
right,
all
right,
so
we're
everything.
We
gave
you
enough
things
that
you
probably
should
do
another
pass
of
the
architecture,
because
I
think
is
gonna,
be.
B
J
A
B
B
B
It
would
seem
to
me
weird
if
I'm
listening
to
it,
I've
been
expecting
the
value
to
change
change
and
it
doesn't
change,
may
make
sense,
although,
like
rising,
does
kind
of
tell
you
like
unless
the
value
I'm
getting
from
the
pen
is
actual
full
value
or
some
sort
think
I
can
actually
see
it.
Different
values
and
I
wouldn't
have
the
right
thing
you
know
I
would
just
have
to
changed.