korad-kaxxxxp: Add KA3305P support, handle multiple outputs - #307
Open
minuteman3 wants to merge 1 commit into
Open
minuteman3 wants to merge 1 commit into
minuteman3 wants to merge 1 commit into
Conversation
Add the Korad KA3305P and its RND 320-KA3305P rebadge, a two output
variant of the KA3005P family, and teach the driver to handle more than
one output.
Model support:
- Recognise "KORAD KA3305P" natively, no force_detect workaround.
- Ranges from the manual: 0-30V / 0-5A with 10mV / 1mA resolution,
which matches the existing volts_30 and amps_5 tables.
Multiple outputs:
- dev_context keeps its values per output, and the VSET/ISET/VOUT/IOUT
commands are built with the output number instead of being hardcoded
to output 1.
- Models with more than one output get Vn/In analog channels and one
channel group per output, so per output config can be addressed with
e.g. "sigrok-cli -g CH2". Single output models keep the historical
"V"/"I" channels and the previous behaviour.
- The acquisition cycle walks all outputs before reading the shared
status byte, and each datafeed packet now references the channel it
actually belongs to. The previous channel list juggling also leaked
the removed list link, that is gone too.
- Output enable remains a device level option. On this family the
"OUT<boolean>" command has no channel number, so the outputs cannot
be switched individually.
Status bit quirks:
- Measurement shows the KA3305P family reports the OVP enable state on
STATUS bit 4, not bit 7. The documented bit map lists bit 4 as unused
and the driver decoded it as the beeper state, so
SR_CONF_OVER_VOLTAGE_PROTECTION_ENABLED read bit 7 and therefore
reported "true" whenever the output was enabled, and could never
report "false" while the output was on.
- The beeper has no status bit at all on this family: toggling it
changes no bit whatsoever, so its state is left untouched rather than
being derived from the OVP bit.
- All of this is gated behind KORAD_QUIRK_STATUS_OVP_BIT4, so the other
models keep the previous bit 7 decoding. OCP on bit 5, the output
state on bit 6, and the per output CC/CV bits are unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds support for the Korad KA3305P and its RND 320-KA3305P rebadge — a dual-output variant of the KA3005P family — and teaches the driver to handle more than one output.
Model support
KORAD KA3305P V7.1), noforce_detectworkaround.Multiple outputs
dev_context;VSET/ISET/VOUT/IOUTnow carry the output number instead of being hardcoded to output 1.V1/I1/V2/I2plus one channel group per output, so per-output config can be addressed with e.g.sigrok-cli -g CH2.V/I, previous behaviour).OUT<boolean>takes no channel on this family, so the outputs cannot be switched individually.STATUS bit quirk
Measurements on real hardware contradict the documented
STATUS?map, so this family reads OVP from bit 4 (gated behindKORAD_QUIRK_STATUS_OVP_BIT4):beep_enabledocp_enabledovp_enabledAs a result
SR_CONF_OVER_VOLTAGE_PROTECTION_ENABLEDreportedtruewhenever the output was enabled and could never reportfalse. The beeper has no status bit at all (toggling it changes no bit), so it is no longer derived from the OVP bit. Other models keep the previous bit 7 decoding.Verification
Tested on a KA3305P (firmware V7.1) with a Brymen BM257s on CH2 as an independent witness:
Korad KA3305P [S/N: 00018549] with 4 channels: V1 I1 V2 I2-g CH2emitsVSET2:…/ISET2:…,-g CH1emitsVSET1:…ocp_enabledandovp_enablednow round-trip correctly (set false → get false); the latter was previously impossible while the output was onOCP0/1,OVP0/1,BEEP0/1,TRACK0/1/2sweepsmake checkpasses; builds clean under-Wall -Wextra -Wmissing-prototypesCaveats
OVPSTEis write-only (no readback query) and is absent from the official manual, and no functional OVP trip was reproducible.RND 320-KA3305Pentry is inferred from documentation, not verified against hardware.