forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pi-spi.d.ts
46 lines (32 loc) · 1.07 KB
/
pi-spi.d.ts
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
43
44
45
46
// Type definitions for pi-spi
// Project: https://github.com/natevw/pi-spi
// Definitions by: Marcel Ernst <https://github.com/marcel-ernst>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
declare namespace __PI_SPI {
enum mode {
CPHA = 0x01,
CPOL = 0x02
}
enum order {
MSB_FIRST = 0,
LSB_FIRST = 1
}
function initialize(device:string):__PI_SPI.SPI;
class SPI {
clockSpeed():number;
clockSpeed(speed:number):void;
dataMode():number;
dataMode(mode:mode):void;
bitOrder():number;
bitOrder(order:order):void;
write(writebuf:Buffer, cb:(error:Error,data:Buffer) => void):void;
read(readcount:number, cb:(error:Error,data:Buffer) => void):void;
transfer(writebuf:Buffer, cb:(error:Error,data:Buffer) => void ):void;
transfer(writebuf:Buffer, readcount:number, cb:(error:Error,data:Buffer) => void ):void;
close():void;
}
}
declare module "pi-spi" {
export = __PI_SPI;
}