From 51a018b0cffa948689548b9b8bd5b232a36bcd04 Mon Sep 17 00:00:00 2001 From: 96021c6f149619c2abfb151ec48670b44f896293 <96021c6f149619c2abfb151ec48670b44f896293@redacted> Date: Fri, 20 May 2022 03:49:29 +0000 Subject: [PATCH] Add sdvx generator lights to sdvxio-bio2. --- src/main/acio/kfca.h | 3 +-- src/main/bemanitools/sdvxio.h | 1 + src/main/sdvxio-bio2/sdvxio.c | 10 ++++++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main/acio/kfca.h b/src/main/acio/kfca.h index 13fbe4b..3af14c1 100644 --- a/src/main/acio/kfca.h +++ b/src/main/acio/kfca.h @@ -41,8 +41,7 @@ struct ac_io_kfca_poll_in { struct ac_io_kfca_poll_out { uint32_t gpio; - uint8_t pwm[18]; - uint8_t unk[2]; + uint8_t pwm[20]; }; #pragma pack(pop) diff --git a/src/main/bemanitools/sdvxio.h b/src/main/bemanitools/sdvxio.h index 274f898..534fd71 100644 --- a/src/main/bemanitools/sdvxio.h +++ b/src/main/bemanitools/sdvxio.h @@ -33,6 +33,7 @@ enum sdvx_io_out_gpio_bit { SDVX_IO_OUT_GPIO_D = 0, SDVX_IO_OUT_GPIO_FX_L = 1, SDVX_IO_OUT_GPIO_FX_R = 2, + SDVX_IO_OUT_GPIO_GENERATOR_B = 3, SDVX_IO_OUT_GPIO_START = 12, SDVX_IO_OUT_GPIO_A = 13, SDVX_IO_OUT_GPIO_B = 14, diff --git a/src/main/sdvxio-bio2/sdvxio.c b/src/main/sdvxio-bio2/sdvxio.c index 5d3de59..7680dbd 100644 --- a/src/main/sdvxio-bio2/sdvxio.c +++ b/src/main/sdvxio-bio2/sdvxio.c @@ -172,6 +172,9 @@ static uint8_t assign_light(uint32_t gpio_lights, uint32_t shift) return 0; } +/* Blue generator lights are gpio, while the red and green are pwm on the KFCA. + Tested this on a gen 1 sdvx pcb, and indeed the blue lights are only on/off, + while the red & green can fade. */ void sdvx_io_set_gpio_lights(uint32_t gpio_lights) { pout_staging.gpio[0] = assign_light(gpio_lights, SDVX_IO_OUT_GPIO_START); @@ -181,6 +184,7 @@ void sdvx_io_set_gpio_lights(uint32_t gpio_lights) pout_staging.gpio[4] = assign_light(gpio_lights, SDVX_IO_OUT_GPIO_D); pout_staging.gpio[5] = assign_light(gpio_lights, SDVX_IO_OUT_GPIO_FX_L); pout_staging.gpio[6] = assign_light(gpio_lights, SDVX_IO_OUT_GPIO_FX_R); + pout_staging.generator[2] = assign_light(gpio_lights, SDVX_IO_OUT_GPIO_GENERATOR_B); } void sdvx_io_set_pwm_light(uint8_t light_no, uint8_t intensity) @@ -207,6 +211,12 @@ void sdvx_io_set_pwm_light(uint8_t light_no, uint8_t intensity) case 17: pout_staging.controller[2] = intensity; break; + case 18: + pout_staging.generator[0] = intensity; + break; + case 19: + pout_staging.generator[1] = intensity; + break; default: break; }