Bus services: Difference between revisions

No edit summary
No edit summary
(One intermediate revision by the same user not shown)
Line 26: Line 26:
| 9 || [5.0.0+] SetWakeEventActiveFlagSetForDebug2
| 9 || [5.0.0+] SetWakeEventActiveFlagSetForDebug2
|-
|-
| 10 || [6.0.0+]
| 10 || [6.0.0+] [[#SetRetryValues]]
|}
|}


== OpenSessionForDev ==
== OpenSessionForDev ==
Takes a raw [[#GpioPadDescriptor]] and returns an [[#IPadSession]] session for it.
Takes a raw [[#GpioPadDescriptor]] and returns an [[#IPadSession]].


== OpenSession ==
== OpenSession ==
Same as [[#OpenSessionForDev]] except it takes a [[#GpioPadName]] which is then converted to a [[#GpioPadDescriptor]]. Returns an [[#IPadSession]] session.
Same as [[#OpenSessionForDev]] except it takes a [[#GpioPadName]] which is then converted to a [[#GpioPadDescriptor]]. Returns an [[#IPadSession]].


== OpenSessionForTest ==
== OpenSessionForTest ==
Line 49: Line 49:
== IsWakeEventActive2 ==
== IsWakeEventActive2 ==
Same as [[#IsWakeEventActive]] but takes a [[#GpioPadName|DeviceCode]].
Same as [[#IsWakeEventActive]] but takes a [[#GpioPadName|DeviceCode]].
== SetRetryValues ==
Stubbed. Returns 0.


== IPadSession ==
== IPadSession ==
Line 113: Line 116:


== OpenSessionForDev ==
== OpenSessionForDev ==
Takes an u32 '''port''', an u16 '''addr''', an '''AddressingMode''' (1 for 10-bit, 0 otherwise) and a '''SpeedMode''' (400000 or 100000). Returns an [[#II2cSession]] session.
Takes an u32 '''port''', an u16 '''addr''', an '''AddressingMode''' (1 for 10-bit, 0 otherwise) and a '''SpeedMode''' (400000 or 100000). Returns an [[#II2cSession]].


== OpenSession ==
== OpenSession ==
Takes an [[#I2cDevice]] and returns an [[#II2cSession]] session for it.
Takes an [[#I2cDevice]] and returns an [[#II2cSession]].


== HasDevice ==
== HasDevice ==
Line 146: Line 149:
| 12 || [[#ExecuteCommandListAuto]]
| 12 || [[#ExecuteCommandListAuto]]
|-
|-
| 13 || [6.0.0+]
| 13 || [6.0.0+] [[#SetRetryValues]]
|}
|}


== SendAuto ==
== SendAuto ==
Takes bytes to write in either a static buffer or a receive buffer, returns an error code for success
Takes bytes to write in either a static buffer or a receive buffer, returns an error code for success.


== ExecuteCommandListAuto ==
== ExecuteCommandListAuto ==
Line 158: Line 161:
* 0x40 [u8 len] <bytes> - Write bytes to device
* 0x40 [u8 len] <bytes> - Write bytes to device
* 0xC1 [u8 len] - Receive bytes from device
* 0xC1 [u8 len] - Receive bytes from device
== SetRetryValues ==
Takes 2 u32s '''MaxRetries''' and '''RetryDelay'''. Returns 0.


= uart =
= uart =
Line 283: Line 289:
| 1 || OpenSession
| 1 || OpenSession
|-
|-
| 2 || [6.0.0+] OpenSession2
| 2 || [6.0.0+] [[#OpenSession2_3|OpenSession2]]
|}
|}
== OpenSession2 ==
Takes a [[#ChannelName|DeviceCode]] and returns an [[#IChannelSession]].


== IChannelSession ==
== IChannelSession ==
Line 305: Line 314:
| 5 || GetEnabled
| 5 || GetEnabled
|-
|-
| 6 || [6.0.0+]
| 6 || [6.0.0+] SetScale
|-
|-
| 7 || [6.0.0+]
| 7 || [6.0.0+] GetScale
|}
|}


Line 359: Line 368:


== OpenSession ==
== OpenSession ==
Takes an u32 that must be 0 and returns an [[#ISession_2|ISession]].
Takes a [[#SasbusPort]] and returns an [[#ISession_2|ISession]].
 
This opens a session for communicating over SPI4. While code exists to support both SPI1 and SPI4 communication, SPI4 is currently hardcoded as the only available interface.


== ISession ==
== ISession ==
Line 826: Line 833:
|-
|-
| 100 || Uart4Tx, Uart4Rx, Uart4Rts and Uart4Cts
| 100 || Uart4Tx, Uart4Rx, Uart4Rts and Uart4Cts
|}
= SasbusPort =
{| class="wikitable sortable" border="1"
|-
! Name || DeviceCode || Port || Usage
|-
| 0 || 0x3500003D || SPI4 || Joy-Con
|}
|}


[[Category:Services]]
[[Category:Services]]