I2C:ReadRegisters16: Difference between revisions

From 3dbrew
Jump to navigation Jump to search
TimmSkiller (talk | contribs)
Created page with "=Request= {{IPC/Request}} {{IPC/RequestHeader|0x0010|3|0}} {{IPC/RequestEntry|u8, device ID}} {{IPC/RequestEntry|u16, starting register}} {{IPC/RequestEntry|u32, count}} {{IPC/RequestEnd}} =Request Static Buffers= {{IPC/RequestStaticBuffers}} {{#vardefine:ipc_offset|0}} {{IPC/TranslateStaticBuffer|Output buffer pointer|0}} {{IPC/RequestEnd}} =Response= {{IPC/Request}} {{#vardefine:ipc_offset|0}} {{IPC/RequestHeader|0x0010|1|2}} {{IPC/RequestEntry|Result code}} {{IPC..."
 
TimmSkiller (talk | contribs)
No edit summary
 
Line 26: Line 26:
=Description=
=Description=
Reads a range of 16-bit I2C registers of the specified device sequentially to the given buffer.
Reads a range of 16-bit I2C registers of the specified device sequentially to the given buffer.
The maximum output buffer size is 0x200 for the New3DS i2c-sysmodule, and 0x20 for the Old3DS version.


This is similar to [[I2C:ReadRegisters8]], except this reads from 16-bit registers.
This is similar to [[I2C:ReadRegisters8]], except this reads from 16-bit registers.

Latest revision as of 16:42, 28 May 2026

Request

Index Word Description
0
Header 0x001000C0 Cmd 0x0010 Param 3 Xlat 0
1 u8, device ID
2 u16, starting register
3 u32, count

Request Static Buffers

The handler for this IPC command expects the following 0x100-bytes after the beginning of the above command buffer:

Index Word Description
0 Descriptor for static buffer (id 0)
1 Output buffer pointer

Response

Index Word Description
0
Header 0x00100042 Cmd 0x0010 Param 1 Xlat 2
1 Result code
2 Descriptor for static buffer (id 0)
3 Output buffer pointer

Description

Reads a range of 16-bit I2C registers of the specified device sequentially to the given buffer.

The maximum output buffer size is 0x200 for the New3DS i2c-sysmodule, and 0x20 for the Old3DS version.

This is similar to I2C:ReadRegisters8, except this reads from 16-bit registers.

For example, assuming:

    reg[5] = 0xAAAA, reg[6] = 0xBBBB, reg[7] = 0xCCCC, reg[8] = 0xDDDD

Then reading with count 4 and starting register 5 would result in:

    outbuf[0] = 0xAAAA
    outbuf[1] = 0xBBBB
    outbuf[2] = 0xCCCC
    outbuf[3] = 0xDDDD