sig
type 'a result = [ `Error of [ `Msg of string ] | `Ok of 'a ]
module Mem :
sig
type addr = nativeint
val ( + ) : Rpi.Mem.addr -> Rpi.Mem.addr -> Rpi.Mem.addr
val ( - ) : Rpi.Mem.addr -> Rpi.Mem.addr -> Rpi.Mem.addr
val offset : Rpi.Mem.addr -> int -> Rpi.Mem.addr
val of_int32 : int32 -> Rpi.Mem.addr
val pp_addr : Format.formatter -> Rpi.Mem.addr -> unit
val wait : int -> unit
val dsb : unit -> unit
val dmb : unit -> unit
val isb : unit -> unit
val get : Rpi.Mem.addr -> int
val get_int : Rpi.Mem.addr -> int
val get_int32 : Rpi.Mem.addr -> int32
val get_int64 : Rpi.Mem.addr -> int64
val set : Rpi.Mem.addr -> int -> unit
val set_int : Rpi.Mem.addr -> int -> unit
val set_int32 : Rpi.Mem.addr -> int32 -> unit
val set_int64 : Rpi.Mem.addr -> int64 -> unit
val set_bits : Rpi.Mem.addr -> bits:int -> int -> unit
val set_int_bits : Rpi.Mem.addr -> bits:int -> int -> unit
val set_int32_bits : Rpi.Mem.addr -> bits:int32 -> int32 -> unit
val set_int64_bits : Rpi.Mem.addr -> bits:int64 -> int64 -> unit
module Map :
sig
type ('a, 'b) t = ('a, 'b, Bigarray.c_layout) Bigarray.Array1.t
type bytes = (int, Bigarray.int8_unsigned_elt) Rpi.Mem.Map.t
type int32s = (int32, Bigarray.int32_elt) Rpi.Mem.Map.t
type int64s = (int64, Bigarray.int64_elt) Rpi.Mem.Map.t
val length : ('a, 'b) Rpi.Mem.Map.t -> int
val byte_length : ('a, 'b) Rpi.Mem.Map.t -> int
val base : ('a, 'b) Rpi.Mem.Map.t -> Rpi.Mem.addr
val bytes : Rpi.Mem.addr -> len:int -> Rpi.Mem.Map.bytes
val int32s : Rpi.Mem.addr -> len:int -> Rpi.Mem.Map.int32s
val int64s : Rpi.Mem.addr -> len:int -> Rpi.Mem.Map.int64s
end
end
module Mmio : sig val base : Rpi.Mem.addr end
module Gpio :
sig
type pin =
P00
| P01
| P02
| P03
| P04
| P05
| P06
| P07
| P08
| P09
| P10
| P11
| P12
| P13
| P14
| P15
| P16
| P17
| P18
| P19
| P20
| P21
| P22
| P23
| P24
| P25
| P26
| P27
| P28
| P29
| P30
| P31
| P32
| P33
| P34
| P35
| P36
| P37
| P38
| P39
| P40
| P41
| P42
| P43
| P44
| P45
| P46
| P47
| P48
| P49
| P50
| P51
| P52
| P53
type func =
F_IN
| F_OUT
| F_ALT5
| F_ALT4
| F_ALT0
| F_ALT1
| F_ALT2
| F_ALT3
val set_func : Rpi.Gpio.pin -> Rpi.Gpio.func -> unit
type pull_state = PULL_OFF | PULL_DOWN | PULL_UP
val set_pull_state : Rpi.Gpio.pin -> Rpi.Gpio.pull_state -> unit
val get : Rpi.Gpio.pin -> bool
val set : Rpi.Gpio.pin -> bool -> unit
end
module Mbox :
sig
module Prop :
sig
type 'a t =
Unit : unit Rpi.Mbox.Prop.t
| Bytes : int *
(Rpi.Mem.Map.bytes -> 'a Rpi.result) -> 'a Rpi.Mbox.Prop.t
| Int32 : int *
(Rpi.Mem.Map.int32s -> 'a Rpi.result) -> 'a Rpi.Mbox.Prop.t
| Int64 : int *
(Rpi.Mem.Map.int64s -> 'a Rpi.result) -> 'a Rpi.Mbox.Prop.t
val unit : unit Rpi.Mbox.Prop.t
val string : max:int -> string Rpi.Mbox.Prop.t
val int : int Rpi.Mbox.Prop.t
val int32 : int32 Rpi.Mbox.Prop.t
val int64 : int64 Rpi.Mbox.Prop.t
val int_pair : (int * int) Rpi.Mbox.Prop.t
val int32_pair : (int32 * int32) Rpi.Mbox.Prop.t
val int64_pair : (int64 * int64) Rpi.Mbox.Prop.t
type args = int32 list
type 'a req
type ereq
val req :
?args:Rpi.Mbox.Prop.args ->
int32 -> resp:'a Rpi.Mbox.Prop.t -> 'a Rpi.Mbox.Prop.req
val r : 'a Rpi.Mbox.Prop.req -> Rpi.Mbox.Prop.ereq
type resp
val send : Rpi.Mbox.Prop.ereq list -> Rpi.Mbox.Prop.resp Rpi.result
val find :
Rpi.Mbox.Prop.resp ->
'a Rpi.Mbox.Prop.req -> 'a option Rpi.result
end
type channel =
Power_management
| Framebuffer
| Virtual_UART
| VCHIQ
| LEDs
| Buttons
| Touchscreen
| Unused
| Tags_ARM_to_VC
| Tags_VC_to_ARM
val read : Rpi.Mbox.channel -> Rpi.Mem.addr
val write : Rpi.Mbox.channel -> Rpi.Mem.addr -> unit
end
module Mtime :
sig
type span_us = int64
val elapsed_us : unit -> Rpi.Mtime.span_us
val sleep_us : Rpi.Mtime.span_us -> unit
type counter
val counter : unit -> Rpi.Mtime.counter
val counter_value_us : Rpi.Mtime.counter -> Rpi.Mtime.span_us
val s_to_us : int64
val ms_to_us : int64
end
module Serial :
sig
val init : unit -> unit
val read_byte : unit -> int
val try_read_byte : unit -> int option
val write_byte : int -> unit
val write : string -> unit
val writef : ('a, Format.formatter, unit) Pervasives.format -> 'a
end
end