Changes

Jump to navigation Jump to search
no edit summary
== OpenSessionForDev ==
Takes an input u32 '''portBusIdx''', an input u16 '''addrSlaveAddress''', an '''and 2 input u32s [[#AddressingMode''' (1 for 10-bit, 0 otherwise) ]] and a '''[[#SpeedMode''' (400000 or 100000)]]. Returns an [[#II2cSession]].
== OpenSession ==
Takes an input u32 [[#I2cDevice]] and returns . Returns an output [[#II2cSession]].
== HasDevice ==
Takes an input u32 [[#I2cDevice]] and returns true if the device exists or false otherwise. Returns an output boolean success value.
== HasDeviceForDev ==
Takes an input u32 '''portBusIdx''', an input u16 '''addrSlaveAddress''', an '''and 2 input u32s [[#AddressingMode''' (1 for 10-bit, 0 otherwise) ]] and a '''[[#SpeedMode''' (400000 or 100000)]]. Returns true if the device exists or false otherwisean output boolean success value.
== OpenSession2 ==
Same as [[#OpenSession_2|OpenSession]] but takes a an input u32 [[#I2cDevice|DeviceCode]].
== II2cSession ==
! Cmd || Name
|-
| 0 || [1.0.0-5.1.0] SendSendOld
|-
| 1 || [1.0.0-5.1.0] ReceiveReceiveOld
|-
| 2 || [1.0.0-5.1.0] ExecuteCommandListExecuteCommandListOld
|-
| 10 || [[#SendAutoSend]]
|-
| 11 || ReceiveAuto[[#Receive]]
|-
| 12 || [[#ExecuteCommandListAutoExecuteCommandList]]
|-
| 13 || [6.0.0+] [[#SetRetryValues]]
|}
== SendAuto Send ==Takes bytes to write in either a static type-0x21 input buffer or a receive buffer, returns '''InData''' and an error code for successinput u32 [[#TransactionOption]]. No output.
== ExecuteCommandListAuto Receive ==Takes a command list from either a static type-0x22 output buffer or '''OutData''' and an input u32 [[#TransactionOption]]. No output. == ExecuteCommandList ==Takes a receive type-0x22 output buffer, returns data in either '''ReceiveBuffer''' and a static (or recieve?) type-0x9 input buffer'''CommandList'''. No output.
=== Commands ===
The commands use the following bitsThis is "nn::i2c::I2cCommand". 
{| class=wikitable
! Bit Bits || Name
|-
| 0 -5 || Receive[[#CommandId]]
|-
| 6 || I2cTransactionOption_Start|-| 7 || I2cTransactionOption_Sop[[#TransactionOption]]
|}
* If bit 0 is not set, the A send command will write bytes to the device and follows this using the format: [u8 cmdcmd_send] [u8 len] <bytes>* If bit 0 is set, the A receive command will receive read bytes from the device and follows this using the format: [u8 cmdcmd_receive] [u8 len] An extension sleep command will stall the device using the format: [u8 cmd_extension] [u8 ms]
== SetRetryValues ==
Takes 2 input u32s '''MaxRetries''' and '''RetryDelay'''. Returns 0No output.
= uart =
== IsSupportedBaudRate ==
Takes an 2 input u32s [[#UartPort]] and an input u32 '''BaudRate'''. Returns an output boolean success value.
Supported baud rates are 57600, 115200, 1000000 and 3000000.
== IsSupportedBaudRateForDev ==
Takes an 2 input u32s [[#UartPortForDev]] and an input u32 '''BaudRate'''. Returns an output boolean success value.
Supported baud rates are 57600, 115200, 1000000 and 3000000.
== IsSupportedFlowControlMode ==
Takes an 2 input u32s [[#UartPort]] and an input u32 '''[[#FlowControlMode''']]. Returns an output boolean success value. Supported modes are 0 (RTS) and 1 (CTS).
== IsSupportedFlowControlModeForDev ==
Takes an 2 input u32s [[#UartPortForDev]] and an input u32 '''[[#FlowControlMode''']]. Returns an output boolean success value. Supported modes are 0 (RTS) and 1 (CTS).
== CreatePortSession ==
== IsSupportedPortEvent ==
Takes an 2 input u32s [[#UartPort]] and an input u32 '''PortEvent'''[[#PortEventType]]. Returns an output boolean success value. Supported events are 0 (data), 1 (break), 2 (unknown) and 3 (unknown).
== IsSupportedPortEventForDev ==
Takes an 2 input u32s [[#UartPortForDev]] and an input u32 '''PortEvent'''[[#PortEventType]]. Returns an output boolean success value. Supported events are 0 (data), 1 (break), 2 (unknown) and 3 (unknown).
== IsSupportedDeviceVariation ==
Takes an 2 input u32s [[#UartPort]] and an input u32 '''DeviceVariation'''. Returns an output boolean success value.
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 2 input u32s [[#UartPortForDev]] and an input u32 '''DeviceVariation'''. Returns an output boolean success value.
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.
=== OpenPort ===
Takes an 3 input u32s [[#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.
[6.0.0+] Takes 4 input u8s (padded as u32) '''IsInvertTx''', '''IsInvertRx''', '''IsInvertRts''' and '''IsInvertCts''', an 3 input u32s [[#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 4 input u32s [[#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 ===
=== Send ===
Takes a type-0x21 input buffer '''DataBytesInData'''. Returns an output u64 size.
=== GetReadableLength ===
=== Receive ===
Takes a type-0x22 output buffer '''DataBytesOutData'''. Returns an output u64 size.
=== BindPortEvent ===
Takes an input u32 '''PortEvent''' [[#PortEventType]] and an input s64 '''Threshold'''. Returns an output boolean success value and an Event handle with EventClearMode=0.
=== UnbindPortEvent ===
Takes an input u32 '''PortEvent'''[[#PortEventType]]. Returns an output boolean success value.
= pwm =
|-
| [8.0.0+] 31 || || 0x36000001 || 1:08 || N || 400000 || 3 || 5000000 || NFC IC || [[NFC services]] || Hoag
|}
 
= AddressingMode =
This is "nn::i2c::AddressingMode".
 
{| class="wikitable sortable" border="1"
|-
! Value || Name
|-
| 0 || BitWidth7
|-
| 1 || BitWidth10
|}
 
= TransactionOption =
This is "nn::i2c::TransactionOption".
 
{| class="wikitable sortable" border="1"
|-
! Value || Name
|-
| 1 || StartCondition
|-
| 2 || StopCondition
|}
 
= SpeedMode =
This is "nn::i2c::SpeedMode".
 
{| class="wikitable sortable" border="1"
|-
! Value || Name
|-
| 0x186A0 || Standard
|-
| 0x61A80 || Fast
|-
| 0xF4240 || FastPlus
|-
| 0x33E140 || HighSpeed
|}
 
= CommandId =
This is "nn::i2c::detail::CommandId".
 
{| class="wikitable sortable" border="1"
|-
! Value || Name
|-
| 0 || Send
|-
| 1 || Receive
|-
| 2 || Extension
|}
 
= SubCommandId =
This is "nn::i2c::detail::SubCommandId".
 
{| class="wikitable sortable" border="1"
|-
! Value || Name
|-
| 0 || Sleep
|}
= UartPort =
This is "nn::uart::UartPort".
 
{| class="wikitable sortable" border="1"
|-
! Value || Name || DeviceCode (internal) || DeviceCode (mapped) || Port || UsageDescription
|-
| 0 || 0x03000001 UART-A || 0x03000001 || UART-A || Invalid
|-
| 1 || UART-D || 0x03000004 || 0x37000001 || UART-D || Bluetooth
|-
| 2 || UART-B || 0x03000002 || 0x35000405 || UART-B || Joy-Con(R)
|-
| 3 || UART-C || 0x03000003 || 0x3500040F || UART-C || Joy-Con(L)
|-
| 4 || UART-C || 0x03000003 || 0x35000419 || UART-C || MCU
|}
= UartPortForDev =
This is "nn::uart::UartPortForDev".
 
{| class="wikitable sortable" border="1"
|-
! Value || Name || DeviceCode (internal) || DeviceCode (mapped) || Description
|-
| 0 || UART-A || 0x03000001 || || Invalid
|-
| 1 || UART-B || 0x03000002 || 0x35000405 || Joy-Con(R)
|-
| 2 || UART-C || 0x03000003 || 0x3500040F || Joy-Con(L)
|-
| 3 || UART-D || 0x03000004 || 0x37000001 || Bluetooth
|}
 
= FlowControlMode =
This is "nn::uart::FlowControlMode".
 
{| class="wikitable sortable" border="1"
|-
! Value || Name
|-
| 0 || None
|-
| 1 || Hardware
|}
 
= PortEventType =
This is "nn::uart::PortEventType".
 
{| class="wikitable sortable" border="1"
|-
! Name Value || DeviceCode (internal) || DeviceCode (mapped) || Port || UsageName
|-
| 0 || 0x03000001 || || UART-A || InvalidSendBufferEmpty
|-
| 1 || 0x03000002 || 0x35000405 || UART-B || Joy-Con(R)SendBufferReady
|-
| 2 || 0x03000003 || 0x3500040F || UART-C || Joy-Con(L)ReceiveBufferReady
|-
| 3 || 0x03000004 || 0x37000001 || UART-D || BluetoothReceiveEnd
|}

Navigation menu