Bus services: Difference between revisions
No edit summary  | 
				|||
| Line 200: | Line 200: | ||
| 8 || [[#IsSupportedPortEventForDev]]  | | 8 || [[#IsSupportedPortEventForDev]]  | ||
|-  | |-  | ||
| 9 || [7.0.0+] [[#  | | 9 || [7.0.0+] [[#IsSupportedDeviceVariation]]  | ||
|-  | |-  | ||
| 10 || [7.0.0+] [[#  | | 10 || [7.0.0+] [[#IsSupportedDeviceVariationForDev]]  | ||
|}  | |}  | ||
== HasPort ==  | == HasPort ==  | ||
Takes an [[#UartPort]]. Returns   | Takes an input [[#UartPort]]. Returns an output boolean success value.  | ||
== HasPortForDev ==  | == HasPortForDev ==  | ||
Takes an [[#UartPortForDev]]. Returns   | Takes an input [[#UartPortForDev]]. Returns an output boolean success value.  | ||
== IsSupportedBaudRate ==  | == IsSupportedBaudRate ==  | ||
Takes an [[#UartPort]] and an u32 '''BaudRate'''. Returns   | Takes an input [[#UartPort]] and an input u32 '''BaudRate'''. Returns an output boolean success value.  | ||
Supported baud rates are 57600, 115200, 1000000 and 3000000.  | Supported baud rates are 57600, 115200, 1000000 and 3000000.  | ||
== IsSupportedBaudRateForDev ==  | == IsSupportedBaudRateForDev ==  | ||
Takes an [[#UartPortForDev]] and an u32 '''BaudRate'''. Returns   | Takes an input [[#UartPortForDev]] and an input u32 '''BaudRate'''. Returns an output boolean success value.  | ||
Supported baud rates are 57600, 115200, 1000000 and 3000000.  | Supported baud rates are 57600, 115200, 1000000 and 3000000.  | ||
== IsSupportedFlowControlMode ==  | == IsSupportedFlowControlMode ==  | ||
Takes an [[#UartPort]] and an u32 '''FlowControlMode'''. Returns   | Takes an input [[#UartPort]] and an input u32 '''FlowControlMode'''. Returns an output boolean success value.  | ||
Supported modes are 0 (RTS) and 1 (CTS).  | Supported modes are 0 (RTS) and 1 (CTS).  | ||
== IsSupportedFlowControlModeForDev ==  | == IsSupportedFlowControlModeForDev ==  | ||
Takes an [[#UartPortForDev]] and an u32 '''FlowControlMode'''. Returns   | Takes an input [[#UartPortForDev]] and an input u32 '''FlowControlMode'''. Returns an output boolean success value.  | ||
Supported modes are 0 (RTS) and 1 (CTS).  | Supported modes are 0 (RTS) and 1 (CTS).  | ||
== CreatePortSession ==  | == CreatePortSession ==  | ||
No input. Returns an [[#IPortSession]].  | No input. Returns an output [[#IPortSession]].  | ||
== IsSupportedPortEvent ==  | == IsSupportedPortEvent ==  | ||
Takes an [[#UartPort]] and an u32 '''PortEvent'''. Returns   | Takes an input [[#UartPort]] and an input u32 '''PortEvent'''. Returns an output boolean success value.  | ||
Supported events are 0 (data), 1 (break), 2 (unknown) and 3 (unknown).  | Supported events are 0 (data), 1 (break), 2 (unknown) and 3 (unknown).  | ||
== IsSupportedPortEventForDev ==  | == IsSupportedPortEventForDev ==  | ||
Takes an [[#UartPortForDev]] and an u32 '''PortEvent'''. Returns   | Takes an input [[#UartPortForDev]] and an input u32 '''PortEvent'''. Returns an output boolean success value.  | ||
Supported events are 0 (data), 1 (break), 2 (unknown) and 3 (unknown).  | Supported events are 0 (data), 1 (break), 2 (unknown) and 3 (unknown).  | ||
==   | == IsSupportedDeviceVariation ==  | ||
Takes an [[#UartPort]] and an u32 '''  | Takes an input [[#UartPort]] and an input u32 '''DeviceVariation'''. Returns an output boolean success value.  | ||
Supported   | Supported device variations are 0 (Bluetooth) for UART-D, 0 (Joy-Con(R)) for UART-B, 0 (Joy-Con(L)) and 1 (MCU) for UART-C.  | ||
==   | == IsSupportedDeviceVariationForDev ==  | ||
Takes an [[#UartPortForDev]] and an u32 '''  | Takes an input [[#UartPortForDev]] and an input u32 '''DeviceVariation'''. Returns an output boolean success value.  | ||
Supported   | Supported device variations are 0 (Bluetooth) for UART-D, 0 (Joy-Con(R)) for UART-B, 0 (Joy-Con(L)) and 1 (MCU) for UART-C.  | ||
== IPortSession ==  | == IPortSession ==  | ||
| Line 279: | Line 279: | ||
=== OpenPort ===  | === OpenPort ===  | ||
Takes an [[#UartPort]],   | Takes an input [[#UartPort]], 2 input u32s '''BaudRate''' and '''FlowControlMode''', 2 input u64s '''SendBufferLength''' and '''ReceiveBufferLength''' and 2 input TransferMemory handles '''SendHandle''' and '''ReceiveHandle'''. Returns an output boolean success value.  | ||
[7.0.0+]   | [6.0.0+] Takes 4 input u8s (padded as u32) '''IsInvertTx''', '''IsInvertRx''', '''IsInvertRts''' and '''IsInvertCts''', an input [[#UartPort]], 2 input u32s '''BaudRate''' and '''FlowControlMode''', 2 input u64s '''SendBufferLength''' and '''ReceiveBufferLength''' and 2 input TransferMemory handles '''SendHandle''' and '''ReceiveHandle'''. Returns an output boolean success value.  | ||
[7.0.0+] Takes 4 input u8s (padded as u32) '''IsInvertTx''', '''IsInvertRx''', '''IsInvertRts''' and '''IsInvertCts''', an input [[#UartPort]], 3 input u32s '''BaudRate''', '''FlowControlMode''' and '''DeviceVariation''', 2 input u64s '''SendBufferLength''' and '''ReceiveBufferLength''' and 2 input TransferMemory handles '''SendHandle''' and '''ReceiveHandle'''. Returns an output boolean success value.  | |||
=== OpenPortForDev ===  | === OpenPortForDev ===  | ||
Same as [[#OpenPort]], but takes an input [[#UartPortForDev]] instead.  | |||
[  | |||
=== GetWritableLength ===  | === GetWritableLength ===  | ||
No input  | No input. Returns an output u64 '''WritableLength'''.  | ||
=== Send ===  | === Send ===  | ||
Takes a type-0x21 input buffer  | Takes a type-0x21 input buffer '''DataBytes'''. Returns an output u64 size.  | ||
=== GetReadableLength ===  | === GetReadableLength ===  | ||
No input  | No input. Returns an output u64 '''ReadableLength'''.  | ||
=== Receive ===  | === Receive ===  | ||
Takes a type-0x22 output buffer  | Takes a type-0x22 output buffer '''DataBytes'''. Returns an output u64 size.  | ||
=== BindPortEvent ===  | === BindPortEvent ===  | ||
Takes an input u32 and u64  | Takes an input u32 '''PortEvent''' and an input u64. Returns an output boolean success value and an Event handle with EventClearMode=0.  | ||
=== UnbindPortEvent ===  | === UnbindPortEvent ===  | ||
Takes an input u32  | Takes an input u32 '''PortEvent'''. Returns an output boolean success value.  | ||
= pwm =  | = pwm =  | ||