MCPcopy Create free account

hub / github.com/cranksters/pd-usb / functions

Functions72 in github.com/cranksters/pd-usb

↓ 34 callersFunctionassert
(condition: boolean, errMsg = 'Assert failed')
src/utils/assert.ts:19
↓ 8 callersMethodemit
* Emit an event
src/PlaydateDevice.ts:135
↓ 4 callersMethodassertNotBusy
()
src/PlaydateDevice.ts:475
↓ 4 callersMethodsendCommand
* Send a custom USB command to the device * Some commands are potentially dangerous and could harm your Playdate. *Please* don't execute any comman
src/PlaydateDevice.ts:425
↓ 4 callersFunctionstringToBytes
(str: string)
src/utils/bytes.ts:16
↓ 4 callersMethodwriteAscii
* Send an ascii string to the serial device
src/Serial.ts:76
↓ 3 callersMethodparseButtonFlags
(flags: number)
src/PlaydateDevice.ts:503
↓ 3 callersMethodreadLinesUntilTimeout
* Read lines until a timeout happens, indicating there's no more lines to read for now
src/Serial.ts:170
↓ 3 callersMethodwrite
* Sends an Uint8Array to the serial device
src/Serial.ts:66
↓ 2 callersMethoddoReadWithTimeout
* Do one of the above read functions, but make it timeout after a given number of milliseconds * This is used to read everything until the device h
src/Serial.ts:137
↓ 2 callersFunctionerror
(msg: string)
src/utils/assert.ts:11
↓ 2 callersFunctionmergeByteChunks
(chunks: Uint8Array[])
src/utils/bytes.ts:41
↓ 2 callersMethodsetMode
(mode: PDSerialMode)
src/SerialTransformer.ts:29
↓ 1 callersFunctionassertUsbSupported
()
src/index.ts:21
↓ 1 callersFunctionbytesPos
(haystack: Uint8Array, needle: Uint8Array, ptr = 0)
src/utils/bytes.ts:23
↓ 1 callersMethodclearOut
()
src/SerialTransformer.ts:45
↓ 1 callersMethodclearRead
* Clear the current reader.read() call that's being awaited, to prevent it from blocking further reads...
src/Serial.ts:106
↓ 1 callersMethodflushBytes
(controller: PDStreamController<Uint8Array>)
src/SerialTransformer.ts:102
↓ 1 callersMethodflushLines
(controller: PDStreamController<string>)
src/SerialTransformer.ts:97
↓ 1 callersMethodgetScreen
* Capture a screenshot from the Playdate, and get the raw framebuffer * This will return the 1-bit framebuffer data as an Uint8Array of bytes, wher
src/PlaydateDevice.ts:217
↓ 1 callersMethodonData
(callbackFn: (data: Uint8Array) => void)
src/Serial.ts:34
↓ 1 callersMethodonError
(callbackFn: (error: Error) => void)
src/Serial.ts:38
↓ 1 callersMethodparseControlState
(state: string)
src/PlaydateDevice.ts:479
↓ 1 callersFunctionparseKeyVal
(str: string)
src/utils/fmt.ts:6
↓ 1 callersMethodpollControlsLoop
* Continually read lines while control polling is active * Probably don't want to call this with await so that it doesn't lock everything
src/PlaydateDevice.ts:454
↓ 1 callersMethodreadBytes
* Reads an Uint8Array from the serial device * If numBytes is 0, it will resolve as soon as some bytes are received * If numBytes is more than 0
src/Serial.ts:86
↓ 1 callersMethodreadLine
* Reads a single line of ascii text from the serial device * Newline characters are not included, some lines may be empty
src/Serial.ts:117
↓ 1 callersMethodrequestDevice
()
src/PlaydateDevice.ts:83
↓ 1 callersMethodsendBitmap
* Send a 1-bit bitmap buffer to display on the Playdate's screen * The input bitmap must be an Uint8Array of bytes, where each bit in the byte will
src/PlaydateDevice.ts:256
↓ 1 callersMethodstopPollingControls
* Stop polling for control updates, after startPollingControls() has been called * After this has completed, you'll be able to communicate with the
src/PlaydateDevice.ts:363
↓ 1 callersMethodtransformBytes
(chunk: Uint8Array, controller: PDStreamController<Uint8Array>)
src/SerialTransformer.ts:82
↓ 1 callersMethodtransformLines
(chunk: Uint8Array, controller: PDStreamController<string>)
src/SerialTransformer.ts:75
FunctionassertBrowserEnv
()
src/utils/env.ts:36
FunctionassertExists
(value: S, name='')
src/utils/assert.ts:27
FunctionassertNodeEnv
()
src/utils/env.ts:52
FunctionassertWebWorkerEnv
()
src/utils/env.ts:70
MethodbuttonIsPressed
* Equivalent to Playdate SDK's playdate.buttonIsPressed(button)
src/PlaydateDevice.ts:316
MethodbuttonJustPressed
* Equivalent to Playdate SDK's playdate.buttonJustPressed(button)
src/PlaydateDevice.ts:326
MethodbuttonJustReleased
* Equivalent to Playdate SDK's playdate.buttonJustReleased(button)
src/PlaydateDevice.ts:336
FunctionbytesToString
(bytes: Uint8Array)
src/utils/bytes.ts:5
Methodclose
* Close a device for communication
src/PlaydateDevice.ts:160
Methodclose
* Closes the serial device, stopping communication
src/Serial.ts:57
Methodconstructor
(port: SerialPort)
src/PlaydateDevice.ts:74
Methodconstructor
(port: SerialPort, options: PDSerialOptions)
src/Serial.ts:28
FunctiondynamicRequire
(nodeModule: NodeModule, p: string)
src/utils/env.ts:12
MethodevalLuaPayload
* Eval a pre-compiled lua function payload (has to be compiled with pdc) on the device
src/PlaydateDevice.ts:385
Methodflush
(controller: PDStreamController)
src/SerialTransformer.ts:67
MethodgetControls
* Get the current controls state, after startPollingControls() has been called
src/PlaydateDevice.ts:308
MethodgetCrankPosition
* Equivalent to Playdate SDK's playdate.getCrankPosition()
src/PlaydateDevice.ts:354
MethodgetDevices
()
src/PlaydateDevice.ts:88
MethodgetScreenIndexed
* Capture a screenshot from the Playdate, and get the unpacked framebuffer * This will return an 8-bit indexed framebuffer as an Uint8Array of pixe
src/PlaydateDevice.ts:235
MethodgetSerial
* Get the Playdate's serial number
src/PlaydateDevice.ts:207
MethodgetVersion
* Get version information about the Playdate; its OS build info, SDK version, serial number, etc
src/PlaydateDevice.ts:173
MethodisBusy
* Indicates when the Playdate is busy and not able to handle other commands
src/PlaydateDevice.ts:108
MethodisCrankDocked
* Equivalent to Playdate SDK's playdate.isCrankDocked()
src/PlaydateDevice.ts:346
MethodisOpen
* Indicates whether the Playdate is open or close to reading/writing
src/PlaydateDevice.ts:101
FunctionisUsbSupported
()
src/index.ts:13
Methodoff
* Remove an event callback
src/PlaydateDevice.ts:126
Methodon
(eventType: PlaydateDeviceEvent, callback: PlaydateDeviceEventCallback)
src/PlaydateDevice.ts:119
MethodonData
(callbackFn: (data: Uint8Array) => void)
src/SerialTransformer.ts:25
Methodopen
* Open a device for communication
src/PlaydateDevice.ts:143
Methodopen
* Open the serial device to start communication
src/Serial.ts:45
MethodreadBytesUntilTimeout
* Read bytes until a timeout happens, indicating there's no more bytes to read for now
src/Serial.ts:189
FunctionrequestConnectPlaydate
()
src/index.ts:29
Methodrun
* Launch a .PDX rom at a given path, e.g. '/System/Crayons.pdx'
src/PlaydateDevice.ts:376
MethodsendBitmapIndexed
* Send a indexed bitmap to display on the Playdate's screen * The input bitmap must be an Uint8Array of bytes, each byte in the array will represen
src/PlaydateDevice.ts:272
Functionsleep
(ms: number)
src/utils/promise.ts:4
FunctionsplitLines
(str: string)
src/utils/fmt.ts:17
Methodstart
(controller: PDStreamController)
src/SerialTransformer.ts:53
MethodstartPollingControls
* Begin polling for control updates. Can be stopped with `stopPollingControls()` * While this is active, you won't be able to communicate with the
src/PlaydateDevice.ts:296
Methodtransform
(chunk: Uint8Array, controller: PDStreamController)
src/SerialTransformer.ts:57
Functionwarn
(msg: string)
src/utils/assert.ts:4