KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches
General Purpose Output

JVS general purpose output (lamps, solenoids) More...

Macros

#define MIE_JVS_OUTPUT_MASK(index)
 Bit mask for JVS output index index (output 0 = bit 31).
 
#define MIE_JVS_OUTPUT_ALL   GENMASK(31, 32 - MIE_JVS_OUTPUT_COUNT)
 All MIE_JVS_OUTPUT_COUNT outputs enabled.
 
#define MIE_JVS_OUTPUT_MASK_COUNT(count)
 Bitmask for the first count JVS outputs (output 0 = bit 31).
 

Functions

uint8_t mie_jvs_driver_outputs (void)
 Number of JVS outputs reported by the I/O board.
 
bool mie_jvs_set_outputs (uint32_t outputs, bool block)
 Set all JVS general purpose outputs at once.
 
bool mie_jvs_set_output (uint8_t index, bool on, bool block)
 Set a single JVS general purpose output.
 
uint32_t mie_jvs_get_outputs (void)
 Get the cached JVS general purpose output state.
 

Detailed Description

JVS general purpose output (lamps, solenoids)

The JVS I/O board exposes up to MIE_JVS_OUTPUT_COUNT general purpose output lines, driven with the JVS general-purpose output command (0x32). They are used for cabinet lamps, start button lights, solenoids, and similar actuators.

Output state is a uint32_t bitmask in JVS wire order: output n is bit (31 - n). The driver keeps a cached copy so individual lines can be toggled with mie_jvs_set_output() without affecting the others.

Macro Definition Documentation

◆ MIE_JVS_OUTPUT_ALL

#define MIE_JVS_OUTPUT_ALL   GENMASK(31, 32 - MIE_JVS_OUTPUT_COUNT)

All MIE_JVS_OUTPUT_COUNT outputs enabled.

◆ MIE_JVS_OUTPUT_MASK

#define MIE_JVS_OUTPUT_MASK ( index)
Value:
BIT(31 - (index))
#define BIT(bit)
Create a 32-bit mask with a bit set.
Definition regfield.h:27

Bit mask for JVS output index index (output 0 = bit 31).

Referenced by outputs_blink().

◆ MIE_JVS_OUTPUT_MASK_COUNT

#define MIE_JVS_OUTPUT_MASK_COUNT ( count)
Value:
GENMASK(31, 32 - (count))
#define GENMASK(h, l)
Create a mask with a range of bits set.
Definition regfield.h:42

Bitmask for the first count JVS outputs (output 0 = bit 31).

Function Documentation

◆ mie_jvs_driver_outputs()

uint8_t mie_jvs_driver_outputs ( void )

Number of JVS outputs reported by the I/O board.

Returns
Output count from the last function check (0x14), or MIE_JVS_OUTPUT_COUNT if unknown.
See also
mie_jvs_set_outputs

◆ mie_jvs_get_outputs()

uint32_t mie_jvs_get_outputs ( void )

Get the cached JVS general purpose output state.

Returns
Last applied output bitmask in JVS wire order.
See also
mie_jvs_set_outputs

Referenced by ui_build().

◆ mie_jvs_set_output()

bool mie_jvs_set_output ( uint8_t index,
bool on,
bool block )

Set a single JVS general purpose output.

Parameters
indexOutput index (0 to MIE_JVS_OUTPUT_COUNT - 1).
ontrue to turn the output on; false to turn it off.
blocktrue to wait for completion; false to queue only.
Return values
trueCommand completed or queued successfully.
falseInvalid index, JVS not initialized, busy, or I/O failed.
See also
mie_jvs_set_outputs, mie_jvs_get_outputs

◆ mie_jvs_set_outputs()

bool mie_jvs_set_outputs ( uint32_t outputs,
bool block )

Set all JVS general purpose outputs at once.

Parameters
outputsOutput bitmask in JVS wire order.
blocktrue to wait for completion; false to queue only.
Return values
trueCommand completed or queued successfully.
falseJVS not initialized, busy, or I/O failed.
See also
mie_jvs_set_output, mie_jvs_get_outputs

Referenced by outputs_blink().