From d0215be860ca9ac5368ed21f5f3961d099428ec5 Mon Sep 17 00:00:00 2001 From: mechmerlin Date: Mon, 29 Jul 2019 22:05:12 -0700 Subject: [PATCH 01/11] provide means to turn on RTP mode and set the amplitude --- drivers/haptic/DRV2605L.c | 12 ++++++++++++ drivers/haptic/DRV2605L.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/drivers/haptic/DRV2605L.c b/drivers/haptic/DRV2605L.c index 215e6be3e7cb..aa274c293c43 100644 --- a/drivers/haptic/DRV2605L.c +++ b/drivers/haptic/DRV2605L.c @@ -121,6 +121,18 @@ void DRV_init(void) DRV_write(DRV_GO, 0x01); } + +void DRV_rtp_init(void) +{ + DRV_write(DRV_RTP_INPUT, 0x05); // arbitrary amplitude + DRV_write(DRV_MODE, 0x05); +} + +void DRV_amplitude(uint8_t amplitude) +{ + DRV_write(DRV_RTP_INPUT, amplitude); +} + void DRV_pulse(uint8_t sequence) { DRV_write(DRV_GO, 0x00); diff --git a/drivers/haptic/DRV2605L.h b/drivers/haptic/DRV2605L.h index 836e9cbcd281..bb877fb33653 100644 --- a/drivers/haptic/DRV2605L.h +++ b/drivers/haptic/DRV2605L.h @@ -171,6 +171,8 @@ void DRV_init(void); void DRV_write(const uint8_t drv_register, const uint8_t settings); uint8_t DRV_read(const uint8_t regaddress); void DRV_pulse(const uint8_t sequence); +void DRV_rtp_init(void); +void DRV_amplitude(const uint8_t amplitude); typedef enum DRV_EFFECT{ clear_sequence = 0, From b77441027f40a639b2731340f69dce5ebf617ab6 Mon Sep 17 00:00:00 2001 From: mechmerlin Date: Mon, 29 Jul 2019 22:52:27 -0700 Subject: [PATCH 02/11] new keycode HPT_CONT to turn RTP off/on --- drivers/haptic/DRV2605L.c | 4 +++- drivers/haptic/haptic.c | 24 +++++++++++++++++++ drivers/haptic/haptic.h | 3 ++- .../hadron/ver3/keymaps/default/keymap.c | 2 +- quantum/quantum_keycodes.h | 1 + 5 files changed, 31 insertions(+), 3 deletions(-) diff --git a/drivers/haptic/DRV2605L.c b/drivers/haptic/DRV2605L.c index aa274c293c43..3b2a57143a35 100644 --- a/drivers/haptic/DRV2605L.c +++ b/drivers/haptic/DRV2605L.c @@ -124,8 +124,10 @@ void DRV_init(void) void DRV_rtp_init(void) { - DRV_write(DRV_RTP_INPUT, 0x05); // arbitrary amplitude + DRV_write(DRV_GO, 0x00); + DRV_write(DRV_RTP_INPUT, 0x75); // arbitrary amplitude DRV_write(DRV_MODE, 0x05); + DRV_write(DRV_GO, 0x01); } void DRV_amplitude(uint8_t amplitude) diff --git a/drivers/haptic/haptic.c b/drivers/haptic/haptic.c index a94f05565c22..5f305a18a154 100644 --- a/drivers/haptic/haptic.c +++ b/drivers/haptic/haptic.c @@ -202,6 +202,29 @@ uint8_t haptic_get_dwell(void) { return haptic_config.dwell; } +void haptic_enable_continuous(void) { + haptic_config.cont = 1; + xprintf("haptic_config.cont = %u\n", haptic_config.cont); + eeconfig_update_haptic(haptic_config.raw); + DRV_rtp_init(); +} + +void haptic_disable_continuous(void) { + haptic_config.cont = 0; + xprintf("haptic_config.cont = %u\n", haptic_config.cont); + eeconfig_update_haptic(haptic_config.raw); + DRV_write(DRV_MODE,0x00); +} + +void haptic_toggle_continuous(void) { +if (haptic_config.cont) { + haptic_disable_continuous(); + } else { + haptic_enable_continuous(); + } + eeconfig_update_haptic(haptic_config.raw); +} + void haptic_play(void) { #ifdef DRV2605L uint8_t play_eff = 0; @@ -224,6 +247,7 @@ bool process_haptic(uint16_t keycode, keyrecord_t *record) { if (keycode == HPT_MODD && record->event.pressed) { haptic_mode_decrease(); } if (keycode == HPT_DWLI && record->event.pressed) { haptic_dwell_increase(); } if (keycode == HPT_DWLD && record->event.pressed) { haptic_dwell_decrease(); } + if (keycode == HPT_CONT && record->event.pressed) { haptic_toggle_continuous(); } if (haptic_config.enable) { if ( record->event.pressed ) { // keypress diff --git a/drivers/haptic/haptic.h b/drivers/haptic/haptic.h index d39dc5c3b9d6..d7a68369f413 100644 --- a/drivers/haptic/haptic.h +++ b/drivers/haptic/haptic.h @@ -40,7 +40,8 @@ typedef union { uint8_t mode :7; bool buzz :1; uint8_t dwell :7; - uint16_t reserved :16; + bool cont :1; + uint16_t reserved :15; }; } haptic_config_t; diff --git a/keyboards/hadron/ver3/keymaps/default/keymap.c b/keyboards/hadron/ver3/keymaps/default/keymap.c index 749c385c85e6..39ab7eae3945 100644 --- a/keyboards/hadron/ver3/keymaps/default/keymap.c +++ b/keyboards/hadron/ver3/keymaps/default/keymap.c @@ -183,7 +183,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_ADJUST] = LAYOUT( RESET, HPT_TOG, HPT_FBK, HPT_MODI, HPT_MODD, HPT_RST , _______, _______, _______, _______, _______, EEP_RST, \ - _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, KC_DEL, \ + HPT_CONT, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, KC_DEL, \ _______, _______, _______, AU_ON, AU_OFF, AG_NORM, _______, _______, _______, AG_SWAP, QWERTY, COLEMAK, _______, _______, _______, \ _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, BL_DEC, BL_INC, BL_STEP, BL_TOGG, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, CK_RST, CK_DOWN, CK_UP, CK_TOGG\ diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h index 207e0a8261b7..54de57d52e9f 100644 --- a/quantum/quantum_keycodes.h +++ b/quantum/quantum_keycodes.h @@ -474,6 +474,7 @@ enum quantum_keycodes { HPT_BUZ, HPT_MODI, HPT_MODD, + HPT_CONT, HPT_DWLI, HPT_DWLD, From 9c598f7ee25597299b5e66b4a598efcc254beef2 Mon Sep 17 00:00:00 2001 From: mechmerlin Date: Wed, 31 Jul 2019 21:39:24 -0700 Subject: [PATCH 03/11] introduce new keycodes HPT_CONI, and HPT_COND for Haptic Continuous Increase and Decrease --- quantum/quantum_keycodes.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h index 54de57d52e9f..69e70e1ee903 100644 --- a/quantum/quantum_keycodes.h +++ b/quantum/quantum_keycodes.h @@ -475,6 +475,8 @@ enum quantum_keycodes { HPT_MODI, HPT_MODD, HPT_CONT, + HPT_CONI, + HPT_COND, HPT_DWLI, HPT_DWLD, From e938e3469e25e69479625febf7d8fe03d346061b Mon Sep 17 00:00:00 2001 From: mechmerlin Date: Wed, 31 Jul 2019 21:39:51 -0700 Subject: [PATCH 04/11] support for continuous mode amplitude increase and decrease --- drivers/haptic/DRV2605L.c | 2 +- drivers/haptic/DRV2605L.h | 10 ++++++++++ drivers/haptic/haptic.c | 32 ++++++++++++++++++++++++++++++++ drivers/haptic/haptic.h | 3 ++- 4 files changed, 45 insertions(+), 2 deletions(-) diff --git a/drivers/haptic/DRV2605L.c b/drivers/haptic/DRV2605L.c index 3b2a57143a35..db01b97f8adf 100644 --- a/drivers/haptic/DRV2605L.c +++ b/drivers/haptic/DRV2605L.c @@ -125,7 +125,7 @@ void DRV_init(void) void DRV_rtp_init(void) { DRV_write(DRV_GO, 0x00); - DRV_write(DRV_RTP_INPUT, 0x75); // arbitrary amplitude + DRV_write(DRV_RTP_INPUT, 20); // arbitrary amplitude DRV_write(DRV_MODE, 0x05); DRV_write(DRV_GO, 0x01); } diff --git a/drivers/haptic/DRV2605L.h b/drivers/haptic/DRV2605L.h index bb877fb33653..72f703dd303c 100644 --- a/drivers/haptic/DRV2605L.h +++ b/drivers/haptic/DRV2605L.h @@ -167,6 +167,16 @@ #define DRV_VBAT_VOLT_MONITOR 0x21 #define DRV_LRA_RESONANCE_PERIOD 0x22 +/* RTP Amplitude Values */ +typedef enum DRV_RTP_AMP{ + gentle = 15, + slow = 30, + medium = 70, + fast = 100, + drv_rtp_amp_max = 100, +}DRV_RTP_AMP; + + void DRV_init(void); void DRV_write(const uint8_t drv_register, const uint8_t settings); uint8_t DRV_read(const uint8_t regaddress); diff --git a/drivers/haptic/haptic.c b/drivers/haptic/haptic.c index 5f305a18a154..9a0e0056976d 100644 --- a/drivers/haptic/haptic.c +++ b/drivers/haptic/haptic.c @@ -169,6 +169,13 @@ void haptic_set_mode(uint8_t mode) { xprintf("haptic_config.mode = %u\n", haptic_config.mode); } +void haptic_set_amplitude(uint8_t amp) { + haptic_config.amplitude = amp; + eeconfig_update_haptic(haptic_config.raw); + xprintf("haptic_config.amplitude = %u\n", haptic_config.amplitude); + DRV_amplitude(amp); +} + void haptic_set_buzz(uint8_t buzz) { haptic_config.buzz = buzz; eeconfig_update_haptic(haptic_config.raw); @@ -225,6 +232,28 @@ if (haptic_config.cont) { eeconfig_update_haptic(haptic_config.raw); } + +void haptic_cont_increase(void) { + uint8_t amp = haptic_config.amplitude + 10; + #ifdef DRV2605L + if (haptic_config.amplitude >= 120) { + amp = 120; + } + #endif + haptic_set_amplitude(amp); +} + +void haptic_cont_decrease(void) { + uint8_t amp = haptic_config.amplitude - 10; + #ifdef DRV2605L + if (haptic_config.amplitude < 20) { + amp = 20; + } + #endif + haptic_set_amplitude(amp); +} + + void haptic_play(void) { #ifdef DRV2605L uint8_t play_eff = 0; @@ -248,6 +277,9 @@ bool process_haptic(uint16_t keycode, keyrecord_t *record) { if (keycode == HPT_DWLI && record->event.pressed) { haptic_dwell_increase(); } if (keycode == HPT_DWLD && record->event.pressed) { haptic_dwell_decrease(); } if (keycode == HPT_CONT && record->event.pressed) { haptic_toggle_continuous(); } + if (keycode == HPT_CONI && record->event.pressed) { haptic_cont_increase(); } + if (keycode == HPT_COND && record->event.pressed) { haptic_cont_decrease(); } + if (haptic_config.enable) { if ( record->event.pressed ) { // keypress diff --git a/drivers/haptic/haptic.h b/drivers/haptic/haptic.h index d7a68369f413..e29a1c48c2bb 100644 --- a/drivers/haptic/haptic.h +++ b/drivers/haptic/haptic.h @@ -41,7 +41,8 @@ typedef union { bool buzz :1; uint8_t dwell :7; bool cont :1; - uint16_t reserved :15; + uint8_t amplitude :8; + uint16_t reserved :7; }; } haptic_config_t; From 78e64454b939dc3877a3a8cd5b8cc7a32f738aff Mon Sep 17 00:00:00 2001 From: mechmerlin Date: Wed, 31 Jul 2019 21:46:11 -0700 Subject: [PATCH 05/11] code cleanup --- drivers/haptic/DRV2605L.c | 3 +-- drivers/haptic/DRV2605L.h | 10 ---------- drivers/haptic/haptic.c | 4 +++- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/drivers/haptic/DRV2605L.c b/drivers/haptic/DRV2605L.c index db01b97f8adf..9aeffea4b720 100644 --- a/drivers/haptic/DRV2605L.c +++ b/drivers/haptic/DRV2605L.c @@ -121,11 +121,10 @@ void DRV_init(void) DRV_write(DRV_GO, 0x01); } - void DRV_rtp_init(void) { DRV_write(DRV_GO, 0x00); - DRV_write(DRV_RTP_INPUT, 20); // arbitrary amplitude + DRV_write(DRV_RTP_INPUT, 20); //20 is the lowest value I've found where haptics can still be felt. DRV_write(DRV_MODE, 0x05); DRV_write(DRV_GO, 0x01); } diff --git a/drivers/haptic/DRV2605L.h b/drivers/haptic/DRV2605L.h index 72f703dd303c..bb877fb33653 100644 --- a/drivers/haptic/DRV2605L.h +++ b/drivers/haptic/DRV2605L.h @@ -167,16 +167,6 @@ #define DRV_VBAT_VOLT_MONITOR 0x21 #define DRV_LRA_RESONANCE_PERIOD 0x22 -/* RTP Amplitude Values */ -typedef enum DRV_RTP_AMP{ - gentle = 15, - slow = 30, - medium = 70, - fast = 100, - drv_rtp_amp_max = 100, -}DRV_RTP_AMP; - - void DRV_init(void); void DRV_write(const uint8_t drv_register, const uint8_t settings); uint8_t DRV_read(const uint8_t regaddress); diff --git a/drivers/haptic/haptic.c b/drivers/haptic/haptic.c index 9a0e0056976d..2e9e70013f75 100644 --- a/drivers/haptic/haptic.c +++ b/drivers/haptic/haptic.c @@ -224,12 +224,14 @@ void haptic_disable_continuous(void) { } void haptic_toggle_continuous(void) { +#ifdef DRV2605L if (haptic_config.cont) { haptic_disable_continuous(); } else { - haptic_enable_continuous(); + haptic_enable_continuous(); } eeconfig_update_haptic(haptic_config.raw); +#endif } From 867960b6d72a853b292e62b7869055f5a51c6738 Mon Sep 17 00:00:00 2001 From: mechmerlin Date: Wed, 31 Jul 2019 21:53:01 -0700 Subject: [PATCH 06/11] update docs to reference new keycodes and functionality --- docs/feature_haptic_feedback.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/feature_haptic_feedback.md b/docs/feature_haptic_feedback.md index 85fd4396402a..acd156a27aa0 100644 --- a/docs/feature_haptic_feedback.md +++ b/docs/feature_haptic_feedback.md @@ -29,6 +29,9 @@ Not all keycodes below will work depending on which haptic mechanism you have ch |`HPT_BUZ` | Toggle solenoid buzz on/off | |`HPT_MODI` | Go to next DRV2605L waveform | |`HPT_MODD` | Go to previous DRV2605L waveform | +|`HPT_CONT` | Toggle continuous haptic mode on/off | +|`HPT_CONI` | Increase DRV2605L continous haptic strength | +|`HPT_COND` | Decrease DRV2605L continous haptic strength | |`HPT_DWLI` | Increase Solenoid dwell time | |`HPT_DWLD` | Decrease Solenoid dwell time | @@ -145,3 +148,7 @@ If haptic feedback is enabled, the keyboard will vibrate to a specific sqeuence #define DRV_MODE_DEFAULT *sequence name or number* ``` This will set what sequence HPT_RST will set as the active mode. If not defined, mode will be set to 1 when HPT_RST is pressed. + +### DRV2605L Continuous Haptic Mode + +This mode sets continuous haptic feedback with the option to increase or decrease strength. \ No newline at end of file From 0b4ad2f3fac36f9a77a3190ab18a782bb2b1fd36 Mon Sep 17 00:00:00 2001 From: mechmerlin Date: Wed, 31 Jul 2019 21:59:56 -0700 Subject: [PATCH 07/11] don't touch the keymaps --- keyboards/hadron/ver3/keymaps/default/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/hadron/ver3/keymaps/default/keymap.c b/keyboards/hadron/ver3/keymaps/default/keymap.c index 39ab7eae3945..749c385c85e6 100644 --- a/keyboards/hadron/ver3/keymaps/default/keymap.c +++ b/keyboards/hadron/ver3/keymaps/default/keymap.c @@ -183,7 +183,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_ADJUST] = LAYOUT( RESET, HPT_TOG, HPT_FBK, HPT_MODI, HPT_MODD, HPT_RST , _______, _______, _______, _______, _______, EEP_RST, \ - HPT_CONT, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, KC_DEL, \ + _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, KC_DEL, \ _______, _______, _______, AU_ON, AU_OFF, AG_NORM, _______, _______, _______, AG_SWAP, QWERTY, COLEMAK, _______, _______, _______, \ _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, BL_DEC, BL_INC, BL_STEP, BL_TOGG, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, CK_RST, CK_DOWN, CK_UP, CK_TOGG\ From 03856de1be4851cc48ea7a589a2aa3af62c60927 Mon Sep 17 00:00:00 2001 From: mechmerlin Date: Wed, 31 Jul 2019 23:27:44 -0700 Subject: [PATCH 08/11] add function prototypes --- drivers/haptic/haptic.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/haptic/haptic.h b/drivers/haptic/haptic.h index e29a1c48c2bb..3ef296c53c2f 100644 --- a/drivers/haptic/haptic.h +++ b/drivers/haptic/haptic.h @@ -67,6 +67,7 @@ void haptic_mode(uint8_t mode); void haptic_reset(void); void haptic_set_feedback(uint8_t feedback); void haptic_set_mode(uint8_t mode); +void haptic_set_amplitude(uint8_t amp); void haptic_set_dwell(uint8_t dwell); void haptic_set_buzz(uint8_t buzz); void haptic_buzz_toggle(void); @@ -74,6 +75,11 @@ uint8_t haptic_get_mode(void); uint8_t haptic_get_feedback(void); void haptic_dwell_increase(void); void haptic_dwell_decrease(void); +void haptic_toggle_continuous(void); +void haptic_cont_increase(void); +void haptic_cont_decrease(void); + + void haptic_play(void); void haptic_shutdown(void); From da3dfeabf540ae627a695a0b2d6ac2583ae8eeb0 Mon Sep 17 00:00:00 2001 From: mechmerlin Date: Thu, 1 Aug 2019 06:16:50 -0700 Subject: [PATCH 09/11] add proper guards --- drivers/haptic/haptic.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/haptic/haptic.c b/drivers/haptic/haptic.c index 2e9e70013f75..4142455e943e 100644 --- a/drivers/haptic/haptic.c +++ b/drivers/haptic/haptic.c @@ -170,10 +170,12 @@ void haptic_set_mode(uint8_t mode) { } void haptic_set_amplitude(uint8_t amp) { + #ifdef DRV2605L haptic_config.amplitude = amp; eeconfig_update_haptic(haptic_config.raw); xprintf("haptic_config.amplitude = %u\n", haptic_config.amplitude); DRV_amplitude(amp); + #endif } void haptic_set_buzz(uint8_t buzz) { @@ -241,8 +243,9 @@ void haptic_cont_increase(void) { if (haptic_config.amplitude >= 120) { amp = 120; } + + haptic_set_amplitude(amp); #endif - haptic_set_amplitude(amp); } void haptic_cont_decrease(void) { @@ -251,8 +254,8 @@ void haptic_cont_decrease(void) { if (haptic_config.amplitude < 20) { amp = 20; } - #endif haptic_set_amplitude(amp); + #endif } From d6dd362c650c4096e8058b706565fd11fc8bce76 Mon Sep 17 00:00:00 2001 From: mechmerlin Date: Thu, 1 Aug 2019 08:01:50 -0700 Subject: [PATCH 10/11] cleanup guards --- drivers/haptic/haptic.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/haptic/haptic.c b/drivers/haptic/haptic.c index 4142455e943e..6a3e9bc0b3e6 100644 --- a/drivers/haptic/haptic.c +++ b/drivers/haptic/haptic.c @@ -170,10 +170,10 @@ void haptic_set_mode(uint8_t mode) { } void haptic_set_amplitude(uint8_t amp) { - #ifdef DRV2605L haptic_config.amplitude = amp; eeconfig_update_haptic(haptic_config.raw); xprintf("haptic_config.amplitude = %u\n", haptic_config.amplitude); + #ifdef DRV2605L DRV_amplitude(amp); #endif } @@ -215,14 +215,18 @@ void haptic_enable_continuous(void) { haptic_config.cont = 1; xprintf("haptic_config.cont = %u\n", haptic_config.cont); eeconfig_update_haptic(haptic_config.raw); + #ifdef DRV2605L DRV_rtp_init(); + #endif } void haptic_disable_continuous(void) { haptic_config.cont = 0; xprintf("haptic_config.cont = %u\n", haptic_config.cont); eeconfig_update_haptic(haptic_config.raw); + #ifdef DRV2605L DRV_write(DRV_MODE,0x00); + #endif } void haptic_toggle_continuous(void) { @@ -239,23 +243,18 @@ if (haptic_config.cont) { void haptic_cont_increase(void) { uint8_t amp = haptic_config.amplitude + 10; - #ifdef DRV2605L if (haptic_config.amplitude >= 120) { amp = 120; } - haptic_set_amplitude(amp); - #endif } void haptic_cont_decrease(void) { uint8_t amp = haptic_config.amplitude - 10; - #ifdef DRV2605L if (haptic_config.amplitude < 20) { amp = 20; } haptic_set_amplitude(amp); - #endif } From 008058973de6b8e0913d0645cb6a15cedb3966ec Mon Sep 17 00:00:00 2001 From: mechmerlin Date: Wed, 18 Sep 2019 15:06:50 -0700 Subject: [PATCH 11/11] remove extra reserved --- drivers/haptic/haptic.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/haptic/haptic.h b/drivers/haptic/haptic.h index 00fb045ebe50..2f6eb31fc2da 100644 --- a/drivers/haptic/haptic.h +++ b/drivers/haptic/haptic.h @@ -34,12 +34,11 @@ typedef union { uint32_t raw; struct { - bool enable : 1; - uint8_t feedback : 2; - uint8_t mode : 7; - bool buzz : 1; - uint8_t dwell : 7; - uint16_t reserved : 16; + bool enable :1; + uint8_t feedback :2; + uint8_t mode :7; + bool buzz :1; + uint8_t dwell :7; bool cont :1; uint8_t amplitude :8; uint16_t reserved :7;