Update SDK documentation for SMX_SetLights2.
This commit is contained in:
parent
12794762a8
commit
67a1789ea2
@ -16,7 +16,7 @@ You can either build the solution and link the resulting SMX.dll to your applica
|
|||||||
or import the source project and add it to your Visual Studio solution. The SDK
|
or import the source project and add it to your Visual Studio solution. The SDK
|
||||||
interface is <code>SMX.h</code>.
|
interface is <code>SMX.h</code>.
|
||||||
<p>
|
<p>
|
||||||
See <code>sample</code> for a sample application.
|
See <code>SMXSample</code> for a sample application.
|
||||||
<p>
|
<p>
|
||||||
Up to two controllers are supported. <code>SMX_GetInfo</code> can be used to check which
|
Up to two controllers are supported. <code>SMX_GetInfo</code> can be used to check which
|
||||||
controllers are connected. Each <code>pad</code> argument to API calls can be 0 for the
|
controllers are connected. Each <code>pad</code> argument to API calls can be 0 for the
|
||||||
@ -35,7 +35,13 @@ HID interface, and instead use <code>SMX_GetInputState</code> to retrieve the in
|
|||||||
The platform can have up to nine panels. Each panel has a grid of 4x4 RGB LEDs, which can
|
The platform can have up to nine panels. Each panel has a grid of 4x4 RGB LEDs, which can
|
||||||
be individually controlled at up to 30 FPS.
|
be individually controlled at up to 30 FPS.
|
||||||
<p>
|
<p>
|
||||||
See <code>SMX_SetLights</code>.
|
See <code>SMX_SetLights2</code>.
|
||||||
|
|
||||||
|
<h2>Update notes</h2>
|
||||||
|
|
||||||
|
2019-07-18-01: Added SMX_SetLights2. This is the same as SMX_SetLights, with an added
|
||||||
|
parameter to specify the size of the buffer. This must be used to control the Gen4
|
||||||
|
pads which have additional LEDs.
|
||||||
|
|
||||||
<h2>Platform configuration</h2>
|
<h2>Platform configuration</h2>
|
||||||
|
|
||||||
@ -92,8 +98,31 @@ Get info about a pad. Use this to detect which pads are currently connected.
|
|||||||
Get a mask of the currently pressed panels.
|
Get a mask of the currently pressed panels.
|
||||||
|
|
||||||
<h3 class=ref>void SMX_SetLights(const char lightsData[864]);</h3>
|
<h3 class=ref>void SMX_SetLights(const char lightsData[864]);</h3>
|
||||||
|
|
||||||
|
(deprecated)
|
||||||
|
<p>
|
||||||
|
Equivalent to SMX_SetLights2(lightsData, 864). SMX_SetLights2 should be used instead.
|
||||||
|
|
||||||
|
<h3 class=ref>void SMX_SetLights2(const char *lightsData, int lightDataSize);</h3>
|
||||||
Update the lights. Both pads are always updated together. lightsData is a list of 8-bit RGB
|
Update the lights. Both pads are always updated together. lightsData is a list of 8-bit RGB
|
||||||
colors, one for each LED. Each panel has lights in the following order:
|
colors, one for each LED.
|
||||||
|
<p>
|
||||||
|
lightDataSize is the number of bytes in lightsData. This should be 1350 (2 pads * 9 panels *
|
||||||
|
25 lights * 3 RGB colors). For backwards-compatibility, this can also be 864.
|
||||||
|
<p>
|
||||||
|
Each panel has lights in the following order:
|
||||||
|
<p>
|
||||||
|
<pre>
|
||||||
|
00 01 02 03
|
||||||
|
16 17 18
|
||||||
|
04 05 06 07
|
||||||
|
19 20 21
|
||||||
|
08 09 10 11
|
||||||
|
22 23 24
|
||||||
|
12 13 14 15
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
Each panel has lights in the following order:
|
||||||
<p>
|
<p>
|
||||||
<pre>
|
<pre>
|
||||||
0123
|
0123
|
||||||
@ -110,13 +139,14 @@ Panels are in the following order:
|
|||||||
678 F01
|
678 F01
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
With 18 panels, 16 LEDs per panel and 3 bytes per LED, each light update has 864 bytes of data.
|
|
||||||
<p>
|
|
||||||
Lights will update at up to 30 FPS. If lights data is sent more quickly, a best effort will be
|
Lights will update at up to 30 FPS. If lights data is sent more quickly, a best effort will be
|
||||||
made to send the most recent lights data available, but the panels won't update more quickly.
|
made to send the most recent lights data available, but the panels won't update more quickly.
|
||||||
<p>
|
<p>
|
||||||
The panels will return to automatic lighting if no lights are received for a while, so applications
|
The panels will return to automatic lighting if no lights are received for a while, so applications
|
||||||
controlling lights should send light updates continually, even if the lights aren't changing.
|
controlling lights should send light updates continually, even if the lights aren't changing.
|
||||||
|
<p>
|
||||||
|
For backwards compatibility, if lightDataSize is 864, the old 4x4-only order is used,
|
||||||
|
which simply omits lights 16-24.
|
||||||
|
|
||||||
<h3 class=ref>void SMX_ReenableAutoLights();</h3>
|
<h3 class=ref>void SMX_ReenableAutoLights();</h3>
|
||||||
|
|
||||||
|
31
sdk/SMX.h
31
sdk/SMX.h
@ -47,13 +47,24 @@ SMX_API void SMX_GetInfo(int pad, SMXInfo *info);
|
|||||||
// Get a mask of the currently pressed panels.
|
// Get a mask of the currently pressed panels.
|
||||||
SMX_API uint16_t SMX_GetInputState(int pad);
|
SMX_API uint16_t SMX_GetInputState(int pad);
|
||||||
|
|
||||||
|
// (deprecated) Equivalent to SMX_SetLights2(lightsData, 864).
|
||||||
|
SMX_API void SMX_SetLights(const char lightData[864]);
|
||||||
|
|
||||||
// Update the lights. Both pads are always updated together. lightData is a list of 8-bit RGB
|
// Update the lights. Both pads are always updated together. lightData is a list of 8-bit RGB
|
||||||
// colors, one for each LED. Each panel has lights in the following order:
|
// colors, one for each LED.
|
||||||
//
|
//
|
||||||
// 0123
|
// lightDataSize is the number of bytes in lightsData. This should be 1350 (2 pads * 9 panels *
|
||||||
// 4567
|
// 25 lights * 3 RGB colors). For backwards-compatibility, this can also be 864.
|
||||||
// 89AB
|
//
|
||||||
// CDEF
|
// Each panel has lights in the following order:
|
||||||
|
//
|
||||||
|
// 00 01 02 03
|
||||||
|
// 16 17 18
|
||||||
|
// 04 05 06 07
|
||||||
|
// 19 20 21
|
||||||
|
// 08 09 10 11
|
||||||
|
// 22 23 24
|
||||||
|
// 12 13 14 15
|
||||||
//
|
//
|
||||||
// Panels are in the following order:
|
// Panels are in the following order:
|
||||||
//
|
//
|
||||||
@ -61,18 +72,16 @@ SMX_API uint16_t SMX_GetInputState(int pad);
|
|||||||
// 345 CDE
|
// 345 CDE
|
||||||
// 678 F01
|
// 678 F01
|
||||||
//
|
//
|
||||||
// With 18 panels, 16 LEDs per panel and 3 bytes per LED, each light update has 864 bytes of data.
|
// With 18 panels, 25 LEDs per panel and 3 bytes per LED, each light update has 1350 bytes of data.
|
||||||
//
|
//
|
||||||
// Lights will update at up to 30 FPS. If lights data is sent more quickly, a best effort will be
|
// Lights will update at up to 30 FPS. If lights data is sent more quickly, a best effort will be
|
||||||
// made to send the most recent lights data available, but the panels won't update more quickly.
|
// made to send the most recent lights data available, but the panels won't update more quickly.
|
||||||
//
|
//
|
||||||
// The panels will return to automatic lighting if no lights are received for a while, so applications
|
// The panels will return to automatic lighting if no lights are received for a while, so applications
|
||||||
// controlling lights should send light updates continually, even if the lights aren't changing.
|
// controlling lights should send light updates continually, even if the lights aren't changing.
|
||||||
SMX_API void SMX_SetLights(const char lightData[864]);
|
//
|
||||||
|
// For backwards compatibility, if lightDataSize is 864, the old 4x4-only order is used,
|
||||||
// This is the same as SMX_SetLights, but specifies the size of the buffer. The
|
// which simply omits lights 16-24.
|
||||||
// buffer size must be either 864 bytes (2 pads * 9 panels * 16 lights * 3) or
|
|
||||||
// 1350 bytes (2 pads * 9 panels * 25 lights * 3).
|
|
||||||
SMX_API void SMX_SetLights2(const char *lightData, int lightDataSize);
|
SMX_API void SMX_SetLights2(const char *lightData, int lightDataSize);
|
||||||
|
|
||||||
// By default, the panels light automatically when stepped on. If a lights command is sent by
|
// By default, the panels light automatically when stepped on. If a lights command is sent by
|
||||||
|
Loading…
x
Reference in New Issue
Block a user