From 209fbe34d34e5e65a64a40910adf850352eca7fc Mon Sep 17 00:00:00 2001 From: glopesdev Date: Wed, 11 Mar 2026 22:22:11 +0000 Subject: [PATCH 1/7] Add missing mask type to device metadata --- .../Harp.Behavior/AsyncDevice.Generated.cs | 6 ++-- Interface/Harp.Behavior/Device.Generated.cs | 33 ++++++++++++------- device.yml | 5 +++ 3 files changed, 30 insertions(+), 14 deletions(-) diff --git a/Interface/Harp.Behavior/AsyncDevice.Generated.cs b/Interface/Harp.Behavior/AsyncDevice.Generated.cs index 0b5ee7c..8765dfd 100644 --- a/Interface/Harp.Behavior/AsyncDevice.Generated.cs +++ b/Interface/Harp.Behavior/AsyncDevice.Generated.cs @@ -2748,7 +2748,7 @@ public async Task WriteEncoderResetAsync(EncoderInputs value, CancellationToken /// A task that represents the asynchronous read operation. The /// property contains the register payload. /// - public async Task ReadEnableSerialTimestampAsync(CancellationToken cancellationToken = default) + public async Task ReadEnableSerialTimestampAsync(CancellationToken cancellationToken = default) { var reply = await CommandAsync(HarpCommand.ReadByte(EnableSerialTimestamp.Address), cancellationToken); return EnableSerialTimestamp.GetPayload(reply); @@ -2764,7 +2764,7 @@ public async Task ReadEnableSerialTimestampAsync(CancellationToken cancell /// A task that represents the asynchronous read operation. The /// property contains the timestamped register payload. /// - public async Task> ReadTimestampedEnableSerialTimestampAsync(CancellationToken cancellationToken = default) + public async Task> ReadTimestampedEnableSerialTimestampAsync(CancellationToken cancellationToken = default) { var reply = await CommandAsync(HarpCommand.ReadByte(EnableSerialTimestamp.Address), cancellationToken); return EnableSerialTimestamp.GetTimestampedPayload(reply); @@ -2778,7 +2778,7 @@ public async Task> ReadTimestampedEnableSerialTimestampAsync(C /// A which can be used to cancel the operation. /// /// The task object representing the asynchronous write operation. - public async Task WriteEnableSerialTimestampAsync(byte value, CancellationToken cancellationToken = default) + public async Task WriteEnableSerialTimestampAsync(SerialTimestampPorts value, CancellationToken cancellationToken = default) { var request = EnableSerialTimestamp.FromPayload(MessageType.Write, value); await CommandAsync(request, cancellationToken); diff --git a/Interface/Harp.Behavior/Device.Generated.cs b/Interface/Harp.Behavior/Device.Generated.cs index 1ac5554..9e2674c 100644 --- a/Interface/Harp.Behavior/Device.Generated.cs +++ b/Interface/Harp.Behavior/Device.Generated.cs @@ -7162,9 +7162,9 @@ public partial class EnableSerialTimestamp /// /// A object representing the register message. /// A value representing the message payload. - public static byte GetPayload(HarpMessage message) + public static SerialTimestampPorts GetPayload(HarpMessage message) { - return message.GetPayloadByte(); + return (SerialTimestampPorts)message.GetPayloadByte(); } /// @@ -7172,9 +7172,10 @@ public static byte GetPayload(HarpMessage message) /// /// A object representing the register message. /// A value representing the timestamped message payload. - public static Timestamped GetTimestampedPayload(HarpMessage message) + public static Timestamped GetTimestampedPayload(HarpMessage message) { - return message.GetTimestampedPayloadByte(); + var payload = message.GetTimestampedPayloadByte(); + return Timestamped.Create((SerialTimestampPorts)payload.Value, payload.Seconds); } /// @@ -7186,9 +7187,9 @@ public static Timestamped GetTimestampedPayload(HarpMessage message) /// A object for the register /// with the specified message type and payload. /// - public static HarpMessage FromPayload(MessageType messageType, byte value) + public static HarpMessage FromPayload(MessageType messageType, SerialTimestampPorts value) { - return HarpMessage.FromByte(Address, messageType, value); + return HarpMessage.FromByte(Address, messageType, (byte)value); } /// @@ -7202,9 +7203,9 @@ public static HarpMessage FromPayload(MessageType messageType, byte value) /// A object for the register /// with the specified message type, timestamp, and payload. /// - public static HarpMessage FromPayload(double timestamp, MessageType messageType, byte value) + public static HarpMessage FromPayload(double timestamp, MessageType messageType, SerialTimestampPorts value) { - return HarpMessage.FromByte(Address, timestamp, messageType, value); + return HarpMessage.FromByte(Address, timestamp, messageType, (byte)value); } } @@ -7226,7 +7227,7 @@ public partial class TimestampedEnableSerialTimestamp /// /// A object representing the register message. /// A value representing the timestamped message payload. - public static Timestamped GetPayload(HarpMessage message) + public static Timestamped GetPayload(HarpMessage message) { return EnableSerialTimestamp.GetTimestampedPayload(message); } @@ -11643,13 +11644,13 @@ public partial class CreateEnableSerialTimestampPayload /// Gets or sets the value that enables the timestamp for serial TX. /// [Description("The value that enables the timestamp for serial TX.")] - public byte EnableSerialTimestamp { get; set; } + public SerialTimestampPorts EnableSerialTimestamp { get; set; } /// /// Creates a message payload for the EnableSerialTimestamp register. /// /// The created message payload value. - public byte GetPayload() + public SerialTimestampPorts GetPayload() { return EnableSerialTimestamp; } @@ -12369,6 +12370,16 @@ public enum FrameAcquired : byte FrameAcquired = 0x1 } + /// + /// Specifies available timestamp TX ports. + /// + [Flags] + public enum SerialTimestampPorts : byte + { + None = 0x0, + TimestampPort2 = 0x4 + } + /// /// Specifies the target IO on which to mimic the specified register. /// diff --git a/device.yml b/device.yml index 3790aff..2d81051 100644 --- a/device.yml +++ b/device.yml @@ -386,6 +386,7 @@ registers: address: 110 type: U8 access: Write + maskType: SerialTimestampPorts description: Enables the timestamp for serial TX. MimicPort0IR: &mimic address: 111 @@ -497,6 +498,10 @@ bitMasks: description: Specifies that camera frame was acquired. bits: FrameAcquired: 0x1 + SerialTimestampPorts: + description: Specifies available timestamp TX ports. + bits: + TimestampPort2: 0x4 groupMasks: MimicOutput: description: Specifies the target IO on which to mimic the specified register. From f2151c7e091174f7e05a25a49a2ed776b2782861 Mon Sep 17 00:00:00 2001 From: glopesdev Date: Thu, 12 Mar 2026 14:10:34 +0000 Subject: [PATCH 2/7] Align firmware and interface naming conventions Firmware header files are regenerated taking into account the device interface. Digital IO configuration is now made explicit in the ios.yml file and used for header and implementation code generation. --- Firmware/Behavior/app.c | 130 ++--- Firmware/Behavior/app.h | 2 +- Firmware/Behavior/app_funcs.c | 793 +++++++++++++-------------- Firmware/Behavior/app_funcs.h | 173 +++--- Firmware/Behavior/app_ios_and_regs.c | 109 ++-- Firmware/Behavior/app_ios_and_regs.h | 415 +++++++------- Firmware/Behavior/interrupts.c | 122 ++--- Firmware/Behavior/ios.yml | 134 +++++ device.yml | 2 +- 9 files changed, 1001 insertions(+), 879 deletions(-) create mode 100644 Firmware/Behavior/ios.yml diff --git a/Firmware/Behavior/app.c b/Firmware/Behavior/app.c index 2166ed0..b5f8094 100644 --- a/Firmware/Behavior/app.c +++ b/Firmware/Behavior/app.c @@ -159,29 +159,29 @@ void core_callback_reset_registers(void) //app_regs.REG_PORTS_IN = 0; //app_regs.REG_POKE_DIG_IN = 0; - app_regs.REG_OUTPUTS_SET = 0; - app_regs.REG_OUTPUTS_CLEAR = 0; - app_regs.REG_OUTPUTS_TOGGLE = 0; - app_regs.REG_OUTPUTS_OUT = 0; + app_regs.REG_OUTPUT_SET = 0; + app_regs.REG_OUTPUT_CLEAR = 0; + app_regs.REG_OUTPUT_TOGGLE = 0; + app_regs.REG_OUTPUT_STATE = 0; - app_regs.REG_PORT_DIOS_SET = 0; - app_regs.REG_PORT_DIOS_CLEAR = 0; - app_regs.REG_PORT_DIOS_TOGGLE = 0; - app_regs.REG_PORT_DIOS_OUT = 0; - app_regs.REG_PORT_DIOS_CONF = 0; // All as inputs - //app_regs.REG_PORT_DIOS_IN = 0; + app_regs.REG_PORT_DIO_SET = 0; + app_regs.REG_PORT_DIO_CLEAR = 0; + app_regs.REG_PORT_DIO_TOGGLE = 0; + app_regs.REG_PORT_DIO_STATE = 0; + app_regs.REG_PORT_DIO_DIRECTION = 0; // All as inputs + //app_regs.REG_PORT_DIO_STATE_EVENT = 0; - //app_regs.REG_DATA[0] = 0; - app_regs.REG_DATA[1] = 0; + //app_regs.REG_ANALOG_DATA[0] = 0; + app_regs.REG_ANALOG_DATA[1] = 0; - app_regs.REG_OUTPUT_PULSE_EN = B_PORT0_12V | B_PORT1_12V | B_PORT2_12V; - - app_regs.REG_PULSE_PORT0_DO = 500; - app_regs.REG_PULSE_PORT1_DO = 500; - app_regs.REG_PULSE_PORT2_DO = 500; - app_regs.REG_PULSE_PORT0_12V = 15; - app_regs.REG_PULSE_PORT1_12V = 15; - app_regs.REG_PULSE_PORT2_12V = 15; + app_regs.REG_OUTPUT_PULSE_ENABLE = B_SUPPLY_PORT0 | B_SUPPLY_PORT1 | B_SUPPLY_PORT2; + + app_regs.REG_PULSE_DO_PORT0 = 500; + app_regs.REG_PULSE_DO_PORT1 = 500; + app_regs.REG_PULSE_DO_PORT2 = 500; + app_regs.REG_PULSE_SUPPLY_PORT0 = 15; + app_regs.REG_PULSE_SUPPLY_PORT1 = 15; + app_regs.REG_PULSE_SUPPLY_PORT2 = 15; app_regs.REG_PULSE_LED0 = 500; app_regs.REG_PULSE_LED1 = 500; app_regs.REG_PULSE_RGB0 = 500; @@ -191,25 +191,25 @@ void core_callback_reset_registers(void) app_regs.REG_PULSE_DO2 = 250; app_regs.REG_PULSE_DO3 = 250; - app_regs.REG_FREQ_DO0 = 1000; - app_regs.REG_FREQ_DO1 = 2000; - app_regs.REG_FREQ_DO2 = 3000; - app_regs.REG_FREQ_DO3 = 4000; + app_regs.REG_PWM_FREQUENCY_DO0 = 1000; + app_regs.REG_PWM_FREQUENCY_DO1 = 2000; + app_regs.REG_PWM_FREQUENCY_DO2 = 3000; + app_regs.REG_PWM_FREQUENCY_DO3 = 4000; - app_regs.REG_DCYCLE_DO0 = 50; - app_regs.REG_DCYCLE_DO1 = 50; - app_regs.REG_DCYCLE_DO2 = 50; - app_regs.REG_DCYCLE_DO3 = 50; + app_regs.REG_PWM_DUTY_CYCLE_DO0 = 50; + app_regs.REG_PWM_DUTY_CYCLE_DO1 = 50; + app_regs.REG_PWM_DUTY_CYCLE_DO2 = 50; + app_regs.REG_PWM_DUTY_CYCLE_DO3 = 50; app_regs.REG_PWM_START = 0; app_regs.REG_PWM_STOP = 0; - app_regs.REG_RGBS[0] = 255; // Green - app_regs.REG_RGBS[1] = 0; // Red - app_regs.REG_RGBS[2] = 0; // Blue - app_regs.REG_RGBS[3] = 0; // Green - app_regs.REG_RGBS[4] = 0; // Red - app_regs.REG_RGBS[5] = 255; // Blue + app_regs.REG_RGB_ALL[0] = 255; // Green + app_regs.REG_RGB_ALL[1] = 0; // Red + app_regs.REG_RGB_ALL[2] = 0; // Blue + app_regs.REG_RGB_ALL[3] = 0; // Green + app_regs.REG_RGB_ALL[4] = 0; // Red + app_regs.REG_RGB_ALL[5] = 255; // Blue app_regs.REG_RGB0[0] = 255; // Green app_regs.REG_RGB0[1] = 0; // Red @@ -224,23 +224,23 @@ void core_callback_reset_registers(void) app_regs.REG_LED0_MAX_CURRENT = 30; app_regs.REG_LED1_MAX_CURRENT = 30; - app_regs.REG_EVNT_ENABLE = B_EVT_PORT_DIS | B_EVT_PORT_DIOS_IN | B_EVT_DATA | B_EVT_CAM0 | B_EVT_CAM1; + app_regs.REG_EVENT_ENABLE = B_PORT_DI | B_PORT_DIO | B_ANALOG_DATA | B_CAMERA0 | B_CAMERA1; app_regs.REG_START_CAMERAS = 0; app_regs.REG_STOP_CAMERAS = 0; - app_regs.REG_EN_SERVOS = 0; - app_regs.REG_DIS_SERVOS = 0; - app_regs.REG_EN_ENCODERS = 0; + app_regs.REG_ENABLE_SERVOS = 0; + app_regs.REG_DISABLE_SERVOS = 0; + app_regs.REG_ENABLE_ENCODERS = 0; - app_regs.REG_CAM_OUT0_FREQ = 30; - app_regs.REG_CAM_OUT1_FREQ = 30; + app_regs.REG_CAMERA0_FREQUENCY = 30; + app_regs.REG_CAMERA1_FREQUENCY = 30; - app_regs.REG_MOTOR_OUT2_PERIOD = 20000; - app_regs.REG_MOTOR_OUT2_PULSE = 1500; - app_regs.REG_MOTOR_OUT3_PERIOD = 20000; - app_regs.REG_MOTOR_OUT3_PULSE = 1500; + app_regs.REG_SERVO_MOTOR2_PERIOD = 20000; + app_regs.REG_SERVO_MOTOR2_PULSE = 1500; + app_regs.REG_SERVO_MOTOR3_PERIOD = 20000; + app_regs.REG_SERVO_MOTOR3_PULSE = 1500; - app_regs.REG_POKE_INPUT_FILTER_MS = 1; + app_regs.REG_POKE_INPUT_FILTER = 1; } extern ports_state_t _states_; @@ -266,28 +266,28 @@ void core_callback_registers_were_reinitialized(void) _states_.quad_counter.port1 = false; _states_.quad_counter.port2 = false; - aux16b = app_regs.REG_OUTPUTS_OUT; - app_write_REG_OUTPUTS_OUT(&aux16b); + aux16b = app_regs.REG_OUTPUT_STATE; + app_write_REG_OUTPUT_STATE(&aux16b); aux8b = app_regs.REG_LED0_CURRENT; app_write_REG_LED0_CURRENT(&aux8b); aux8b = app_regs.REG_LED1_CURRENT; app_write_REG_LED1_CURRENT(&aux8b); - aux16b = app_regs.REG_FREQ_DO0; - app_write_REG_FREQ_DO0(&aux16b); - aux16b = app_regs.REG_FREQ_DO1; - app_write_REG_FREQ_DO1(&aux16b); - aux16b = app_regs.REG_FREQ_DO2; - app_write_REG_FREQ_DO2(&aux16b); - aux16b = app_regs.REG_FREQ_DO3; - app_write_REG_FREQ_DO3(&aux16b); + aux16b = app_regs.REG_PWM_FREQUENCY_DO0; + app_write_REG_PWM_FREQUENCY_DO0(&aux16b); + aux16b = app_regs.REG_PWM_FREQUENCY_DO1; + app_write_REG_PWM_FREQUENCY_DO1(&aux16b); + aux16b = app_regs.REG_PWM_FREQUENCY_DO2; + app_write_REG_PWM_FREQUENCY_DO2(&aux16b); + aux16b = app_regs.REG_PWM_FREQUENCY_DO3; + app_write_REG_PWM_FREQUENCY_DO3(&aux16b); aux8b = app_regs.REG_PWM_START; app_write_REG_PWM_START(&aux8b); - aux8b = app_regs.REG_EN_ENCODERS; - app_write_REG_EN_ENCODERS(&aux8b); + aux8b = app_regs.REG_ENABLE_ENCODERS; + app_write_REG_ENABLE_ENCODERS(&aux8b); aux8b = app_regs.REG_MIMIC_PORT0_IR; app_write_REG_MIMIC_PORT0_IR(&aux8b); @@ -303,7 +303,7 @@ void core_callback_registers_were_reinitialized(void) aux8b = app_regs.REG_MIMIC_PORT2_VALVE; app_write_REG_MIMIC_PORT2_VALVE(&aux8b); - app_regs.REG_POKE_INPUT_FILTER_MS = 1; + app_regs.REG_POKE_INPUT_FILTER = 1; } /************************************************************************/ @@ -313,7 +313,7 @@ void core_callback_visualen_to_on(void) {} void core_callback_visualen_to_off(void) {} /************************************************************************/ -/* Callbacks: Change on the operation mode */ +/* Callbacks: Change to the operation mode */ /************************************************************************/ extern bool stop_camera_do0; extern bool stop_camera_do1; @@ -370,24 +370,24 @@ void core_callback_t_before_exec(void) ADCA_CH0_CTRL |= ADC_CH_START_bm; /* Read encoder on Port 2 */ - if (app_regs.REG_EN_ENCODERS & B_EN_ENCODER_PORT2) + if (app_regs.REG_ENABLE_ENCODERS & B_ENCODER_PORT2) { int16_t timer_cnt = TCD1_CNT; - if (app_regs.REG_CONF_ENCODERS == GM_POSITION) + if (app_regs.REG_ENCODER_MODE == GM_ENCODER_MODE_CONFIG_POSITION) { if (timer_cnt > 32768) { - app_regs.REG_DATA[1] = 0xFFFF - timer_cnt; + app_regs.REG_ANALOG_DATA[1] = 0xFFFF - timer_cnt; } else { - app_regs.REG_DATA[1] = (32768 - timer_cnt) * -1; + app_regs.REG_ANALOG_DATA[1] = (32768 - timer_cnt) * -1; } } else { - app_regs.REG_DATA[1] = previous_encoder_poke2 - timer_cnt; + app_regs.REG_ANALOG_DATA[1] = previous_encoder_poke2 - timer_cnt; previous_encoder_poke2 = timer_cnt; } @@ -512,7 +512,7 @@ void core_callback_t_1ms(void) } /************************************************************************/ -/* Callbacks: cloc control */ +/* Callbacks: clock control */ /************************************************************************/ void core_callback_clock_to_repeater(void) {} void core_callback_clock_to_generator(void) {} diff --git a/Firmware/Behavior/app.h b/Firmware/Behavior/app.h index 0254ba9..ef4e569 100644 --- a/Firmware/Behavior/app.h +++ b/Firmware/Behavior/app.h @@ -26,7 +26,7 @@ #define MAJOR_FW_VERSION 3 #endif #ifndef MINOR_FW_VERSION -#define MINOR_FW_VERSION 3 +#define MINOR_FW_VERSION 4 #endif #ifndef PATCH_FW_VERSION #define PATCH_FW_VERSION 0 diff --git a/Firmware/Behavior/app_funcs.c b/Firmware/Behavior/app_funcs.c index 00cd2bf..a23ee9e 100644 --- a/Firmware/Behavior/app_funcs.c +++ b/Firmware/Behavior/app_funcs.c @@ -21,26 +21,26 @@ ports_state_t _states_; extern AppRegs app_regs; void (*app_func_rd_pointer[])(void) = { - &app_read_REG_PORT_DIS, + &app_read_REG_DIGITAL_INPUT_STATE, &app_read_REG_RESERVED0, - &app_read_REG_OUTPUTS_SET, - &app_read_REG_OUTPUTS_CLEAR, - &app_read_REG_OUTPUTS_TOGGLE, - &app_read_REG_OUTPUTS_OUT, - &app_read_REG_PORT_DIOS_SET, - &app_read_REG_PORT_DIOS_CLEAR, - &app_read_REG_PORT_DIOS_TOGGLE, - &app_read_REG_PORT_DIOS_OUT, - &app_read_REG_PORT_DIOS_CONF, - &app_read_REG_PORT_DIOS_IN, - &app_read_REG_DATA, - &app_read_REG_OUTPUT_PULSE_EN, - &app_read_REG_PULSE_PORT0_DO, - &app_read_REG_PULSE_PORT1_DO, - &app_read_REG_PULSE_PORT2_DO, - &app_read_REG_PULSE_PORT0_12V, - &app_read_REG_PULSE_PORT1_12V, - &app_read_REG_PULSE_PORT2_12V, + &app_read_REG_OUTPUT_SET, + &app_read_REG_OUTPUT_CLEAR, + &app_read_REG_OUTPUT_TOGGLE, + &app_read_REG_OUTPUT_STATE, + &app_read_REG_PORT_DIO_SET, + &app_read_REG_PORT_DIO_CLEAR, + &app_read_REG_PORT_DIO_TOGGLE, + &app_read_REG_PORT_DIO_STATE, + &app_read_REG_PORT_DIO_DIRECTION, + &app_read_REG_PORT_DIO_STATE_EVENT, + &app_read_REG_ANALOG_DATA, + &app_read_REG_OUTPUT_PULSE_ENABLE, + &app_read_REG_PULSE_DO_PORT0, + &app_read_REG_PULSE_DO_PORT1, + &app_read_REG_PULSE_DO_PORT2, + &app_read_REG_PULSE_SUPPLY_PORT0, + &app_read_REG_PULSE_SUPPLY_PORT1, + &app_read_REG_PULSE_SUPPLY_PORT2, &app_read_REG_PULSE_LED0, &app_read_REG_PULSE_LED1, &app_read_REG_PULSE_RGB0, @@ -49,30 +49,30 @@ void (*app_func_rd_pointer[])(void) = { &app_read_REG_PULSE_DO1, &app_read_REG_PULSE_DO2, &app_read_REG_PULSE_DO3, - &app_read_REG_FREQ_DO0, - &app_read_REG_FREQ_DO1, - &app_read_REG_FREQ_DO2, - &app_read_REG_FREQ_DO3, - &app_read_REG_DCYCLE_DO0, - &app_read_REG_DCYCLE_DO1, - &app_read_REG_DCYCLE_DO2, - &app_read_REG_DCYCLE_DO3, + &app_read_REG_PWM_FREQUENCY_DO0, + &app_read_REG_PWM_FREQUENCY_DO1, + &app_read_REG_PWM_FREQUENCY_DO2, + &app_read_REG_PWM_FREQUENCY_DO3, + &app_read_REG_PWM_DUTY_CYCLE_DO0, + &app_read_REG_PWM_DUTY_CYCLE_DO1, + &app_read_REG_PWM_DUTY_CYCLE_DO2, + &app_read_REG_PWM_DUTY_CYCLE_DO3, &app_read_REG_PWM_START, &app_read_REG_PWM_STOP, - &app_read_REG_RGBS, + &app_read_REG_RGB_ALL, &app_read_REG_RGB0, &app_read_REG_RGB1, &app_read_REG_LED0_CURRENT, &app_read_REG_LED1_CURRENT, &app_read_REG_LED0_MAX_CURRENT, &app_read_REG_LED1_MAX_CURRENT, - &app_read_REG_EVNT_ENABLE, + &app_read_REG_EVENT_ENABLE, &app_read_REG_START_CAMERAS, &app_read_REG_STOP_CAMERAS, - &app_read_REG_EN_SERVOS, - &app_read_REG_DIS_SERVOS, - &app_read_REG_EN_ENCODERS, - &app_read_REG_CONF_ENCODERS, + &app_read_REG_ENABLE_SERVOS, + &app_read_REG_DISABLE_SERVOS, + &app_read_REG_ENABLE_ENCODERS, + &app_read_REG_ENCODER_MODE, &app_read_REG_RESERVED2, &app_read_REG_RESERVED3, &app_read_REG_RESERVED4, @@ -81,23 +81,23 @@ void (*app_func_rd_pointer[])(void) = { &app_read_REG_RESERVED7, &app_read_REG_RESERVED8, &app_read_REG_RESERVED9, - &app_read_REG_CAM_OUT0_FRAME_ACQUIRED, - &app_read_REG_CAM_OUT0_FREQ, - &app_read_REG_CAM_OUT1_FRAME_ACQUIRED, - &app_read_REG_CAM_OUT1_FREQ, + &app_read_REG_CAMERA0_FRAME, + &app_read_REG_CAMERA0_FREQUENCY, + &app_read_REG_CAMERA1_FRAME, + &app_read_REG_CAMERA1_FREQUENCY, &app_read_REG_RESERVED10, &app_read_REG_RESERVED11, &app_read_REG_RESERVED12, &app_read_REG_RESERVED13, - &app_read_REG_MOTOR_OUT2_PERIOD, - &app_read_REG_MOTOR_OUT2_PULSE, - &app_read_REG_MOTOR_OUT3_PERIOD, - &app_read_REG_MOTOR_OUT3_PULSE, + &app_read_REG_SERVO_MOTOR2_PERIOD, + &app_read_REG_SERVO_MOTOR2_PULSE, + &app_read_REG_SERVO_MOTOR3_PERIOD, + &app_read_REG_SERVO_MOTOR3_PULSE, &app_read_REG_RESERVED14, &app_read_REG_RESERVED15, &app_read_REG_RESERVED16, &app_read_REG_RESERVED17, - &app_read_REG_ENCODERS_RESET, + &app_read_REG_ENCODER_RESET, &app_read_REG_RESERVED18, &app_read_REG_ENABLE_SERIAL_TIMESTAMP, &app_read_REG_MIMIC_PORT0_IR, @@ -111,30 +111,30 @@ void (*app_func_rd_pointer[])(void) = { &app_read_REG_MIMIC_PORT2_VALVE, &app_read_REG_RESERVED23, &app_read_REG_RESERVED24, - &app_read_REG_POKE_INPUT_FILTER_MS + &app_read_REG_POKE_INPUT_FILTER }; bool (*app_func_wr_pointer[])(void*) = { - &app_write_REG_PORT_DIS, + &app_write_REG_DIGITAL_INPUT_STATE, &app_write_REG_RESERVED0, - &app_write_REG_OUTPUTS_SET, - &app_write_REG_OUTPUTS_CLEAR, - &app_write_REG_OUTPUTS_TOGGLE, - &app_write_REG_OUTPUTS_OUT, - &app_write_REG_PORT_DIOS_SET, - &app_write_REG_PORT_DIOS_CLEAR, - &app_write_REG_PORT_DIOS_TOGGLE, - &app_write_REG_PORT_DIOS_OUT, - &app_write_REG_PORT_DIOS_CONF, - &app_write_REG_PORT_DIOS_IN, - &app_write_REG_DATA, - &app_write_REG_OUTPUT_PULSE_EN, - &app_write_REG_PULSE_PORT0_DO, - &app_write_REG_PULSE_PORT1_DO, - &app_write_REG_PULSE_PORT2_DO, - &app_write_REG_PULSE_PORT0_12V, - &app_write_REG_PULSE_PORT1_12V, - &app_write_REG_PULSE_PORT2_12V, + &app_write_REG_OUTPUT_SET, + &app_write_REG_OUTPUT_CLEAR, + &app_write_REG_OUTPUT_TOGGLE, + &app_write_REG_OUTPUT_STATE, + &app_write_REG_PORT_DIO_SET, + &app_write_REG_PORT_DIO_CLEAR, + &app_write_REG_PORT_DIO_TOGGLE, + &app_write_REG_PORT_DIO_STATE, + &app_write_REG_PORT_DIO_DIRECTION, + &app_write_REG_PORT_DIO_STATE_EVENT, + &app_write_REG_ANALOG_DATA, + &app_write_REG_OUTPUT_PULSE_ENABLE, + &app_write_REG_PULSE_DO_PORT0, + &app_write_REG_PULSE_DO_PORT1, + &app_write_REG_PULSE_DO_PORT2, + &app_write_REG_PULSE_SUPPLY_PORT0, + &app_write_REG_PULSE_SUPPLY_PORT1, + &app_write_REG_PULSE_SUPPLY_PORT2, &app_write_REG_PULSE_LED0, &app_write_REG_PULSE_LED1, &app_write_REG_PULSE_RGB0, @@ -143,30 +143,30 @@ bool (*app_func_wr_pointer[])(void*) = { &app_write_REG_PULSE_DO1, &app_write_REG_PULSE_DO2, &app_write_REG_PULSE_DO3, - &app_write_REG_FREQ_DO0, - &app_write_REG_FREQ_DO1, - &app_write_REG_FREQ_DO2, - &app_write_REG_FREQ_DO3, - &app_write_REG_DCYCLE_DO0, - &app_write_REG_DCYCLE_DO1, - &app_write_REG_DCYCLE_DO2, - &app_write_REG_DCYCLE_DO3, + &app_write_REG_PWM_FREQUENCY_DO0, + &app_write_REG_PWM_FREQUENCY_DO1, + &app_write_REG_PWM_FREQUENCY_DO2, + &app_write_REG_PWM_FREQUENCY_DO3, + &app_write_REG_PWM_DUTY_CYCLE_DO0, + &app_write_REG_PWM_DUTY_CYCLE_DO1, + &app_write_REG_PWM_DUTY_CYCLE_DO2, + &app_write_REG_PWM_DUTY_CYCLE_DO3, &app_write_REG_PWM_START, &app_write_REG_PWM_STOP, - &app_write_REG_RGBS, + &app_write_REG_RGB_ALL, &app_write_REG_RGB0, &app_write_REG_RGB1, &app_write_REG_LED0_CURRENT, &app_write_REG_LED1_CURRENT, &app_write_REG_LED0_MAX_CURRENT, &app_write_REG_LED1_MAX_CURRENT, - &app_write_REG_EVNT_ENABLE, + &app_write_REG_EVENT_ENABLE, &app_write_REG_START_CAMERAS, &app_write_REG_STOP_CAMERAS, - &app_write_REG_EN_SERVOS, - &app_write_REG_DIS_SERVOS, - &app_write_REG_EN_ENCODERS, - &app_write_REG_CONF_ENCODERS, + &app_write_REG_ENABLE_SERVOS, + &app_write_REG_DISABLE_SERVOS, + &app_write_REG_ENABLE_ENCODERS, + &app_write_REG_ENCODER_MODE, &app_write_REG_RESERVED2, &app_write_REG_RESERVED3, &app_write_REG_RESERVED4, @@ -175,23 +175,23 @@ bool (*app_func_wr_pointer[])(void*) = { &app_write_REG_RESERVED7, &app_write_REG_RESERVED8, &app_write_REG_RESERVED9, - &app_write_REG_CAM_OUT0_FRAME_ACQUIRED, - &app_write_REG_CAM_OUT0_FREQ, - &app_write_REG_CAM_OUT1_FRAME_ACQUIRED, - &app_write_REG_CAM_OUT1_FREQ, + &app_write_REG_CAMERA0_FRAME, + &app_write_REG_CAMERA0_FREQUENCY, + &app_write_REG_CAMERA1_FRAME, + &app_write_REG_CAMERA1_FREQUENCY, &app_write_REG_RESERVED10, &app_write_REG_RESERVED11, &app_write_REG_RESERVED12, &app_write_REG_RESERVED13, - &app_write_REG_MOTOR_OUT2_PERIOD, - &app_write_REG_MOTOR_OUT2_PULSE, - &app_write_REG_MOTOR_OUT3_PERIOD, - &app_write_REG_MOTOR_OUT3_PULSE, + &app_write_REG_SERVO_MOTOR2_PERIOD, + &app_write_REG_SERVO_MOTOR2_PULSE, + &app_write_REG_SERVO_MOTOR3_PERIOD, + &app_write_REG_SERVO_MOTOR3_PULSE, &app_write_REG_RESERVED14, &app_write_REG_RESERVED15, &app_write_REG_RESERVED16, &app_write_REG_RESERVED17, - &app_write_REG_ENCODERS_RESET, + &app_write_REG_ENCODER_RESET, &app_write_REG_RESERVED18, &app_write_REG_ENABLE_SERIAL_TIMESTAMP, &app_write_REG_MIMIC_PORT0_IR, @@ -205,22 +205,20 @@ bool (*app_func_wr_pointer[])(void*) = { &app_write_REG_MIMIC_PORT2_VALVE, &app_write_REG_RESERVED23, &app_write_REG_RESERVED24, - &app_write_REG_POKE_INPUT_FILTER_MS + &app_write_REG_POKE_INPUT_FILTER }; - /************************************************************************/ -/* REG_PORTS_IN */ +/* REG_DIGITAL_INPUT_STATE */ /************************************************************************/ -void app_read_REG_PORT_DIS(void) +void app_read_REG_DIGITAL_INPUT_STATE(void) { - app_regs.REG_PORT_DIS = (read_POKE0_IR) ? B_DI0 : 0; - app_regs.REG_PORT_DIS |= (read_POKE1_IR) ? B_DI1 : 0; - app_regs.REG_PORT_DIS |= (read_POKE2_IR) ? B_DI2 : 0; - app_regs.REG_PORT_DIS |= (read_DI3) ? B_DI3 : 0; + app_regs.REG_DIGITAL_INPUT_STATE = (read_POKE0_IR) ? B_DIPORT0 : 0; + app_regs.REG_DIGITAL_INPUT_STATE |= (read_POKE1_IR) ? B_DIPORT1 : 0; + app_regs.REG_DIGITAL_INPUT_STATE |= (read_POKE2_IR) ? B_DIPORT2 : 0; + app_regs.REG_DIGITAL_INPUT_STATE |= (read_DI3) ? B_DI3 : 0; } -bool app_write_REG_PORT_DIS(void *a) { return false; } - +bool app_write_REG_DIGITAL_INPUT_STATE(void *a) { return false; } /************************************************************************/ /* REG_RESERVED0 */ @@ -235,29 +233,29 @@ bool app_write_REG_RESERVED0(void *a) /************************************************************************/ -/* REG_OUTPUTS_SET */ +/* REG_OUTPUT_SET */ /************************************************************************/ bool rgb0_on = false; bool rgb1_on = false; -#define start_POKE0_LED do {set_POKE0_LED; if (app_regs.REG_OUTPUT_PULSE_EN & B_PORT0_DO) pulse_countdown.poke0_led = app_regs.REG_PULSE_PORT0_DO + 1; } while(0) -#define start_POKE1_LED do {set_POKE1_LED; if (app_regs.REG_OUTPUT_PULSE_EN & B_PORT1_DO) pulse_countdown.poke1_led = app_regs.REG_PULSE_PORT1_DO + 1; } while(0) -#define start_POKE2_LED do {set_POKE2_LED; if (app_regs.REG_OUTPUT_PULSE_EN & B_PORT2_DO) pulse_countdown.poke2_led = app_regs.REG_PULSE_PORT2_DO + 1; } while(0) +#define start_POKE0_LED do {set_POKE0_LED; if (app_regs.REG_OUTPUT_PULSE_ENABLE & B_DOPORT0) pulse_countdown.poke0_led = app_regs.REG_PULSE_DO_PORT0 + 1; } while(0) +#define start_POKE1_LED do {set_POKE1_LED; if (app_regs.REG_OUTPUT_PULSE_ENABLE & B_DOPORT1) pulse_countdown.poke1_led = app_regs.REG_PULSE_DO_PORT1 + 1; } while(0) +#define start_POKE2_LED do {set_POKE2_LED; if (app_regs.REG_OUTPUT_PULSE_ENABLE & B_DOPORT2) pulse_countdown.poke2_led = app_regs.REG_PULSE_DO_PORT2 + 1; } while(0) -#define start_POKE0_VALVE do {set_POKE0_VALVE; if (app_regs.REG_OUTPUT_PULSE_EN & B_PORT0_12V) pulse_countdown.poke0_valve = app_regs.REG_PULSE_PORT0_12V + 1; } while(0) -#define start_POKE1_VALVE do {set_POKE1_VALVE; if (app_regs.REG_OUTPUT_PULSE_EN & B_PORT1_12V) pulse_countdown.poke1_valve = app_regs.REG_PULSE_PORT1_12V + 1; } while(0) -#define start_POKE2_VALVE do {set_POKE2_VALVE; if (app_regs.REG_OUTPUT_PULSE_EN & B_PORT2_12V) pulse_countdown.poke2_valve = app_regs.REG_PULSE_PORT2_12V + 1; } while(0) +#define start_POKE0_VALVE do {set_POKE0_VALVE; if (app_regs.REG_OUTPUT_PULSE_ENABLE & B_SUPPLY_PORT0) pulse_countdown.poke0_valve = app_regs.REG_PULSE_SUPPLY_PORT0 + 1; } while(0) +#define start_POKE1_VALVE do {set_POKE1_VALVE; if (app_regs.REG_OUTPUT_PULSE_ENABLE & B_SUPPLY_PORT1) pulse_countdown.poke1_valve = app_regs.REG_PULSE_SUPPLY_PORT1 + 1; } while(0) +#define start_POKE2_VALVE do {set_POKE2_VALVE; if (app_regs.REG_OUTPUT_PULSE_ENABLE & B_SUPPLY_PORT2) pulse_countdown.poke2_valve = app_regs.REG_PULSE_SUPPLY_PORT2 + 1; } while(0) -#define start_LED0 do {set_LED0; if (app_regs.REG_OUTPUT_PULSE_EN & B_LED0) pulse_countdown.led0 = app_regs.REG_PULSE_LED0 + 1; } while(0) -#define start_LED1 do {set_LED1; if (app_regs.REG_OUTPUT_PULSE_EN & B_LED1) pulse_countdown.led1 = app_regs.REG_PULSE_LED1 + 1; } while(0) +#define start_LED0 do {set_LED0; if (app_regs.REG_OUTPUT_PULSE_ENABLE & B_LED0) pulse_countdown.led0 = app_regs.REG_PULSE_LED0 + 1; } while(0) +#define start_LED1 do {set_LED1; if (app_regs.REG_OUTPUT_PULSE_ENABLE & B_LED1) pulse_countdown.led1 = app_regs.REG_PULSE_LED1 + 1; } while(0) -#define start_RGB0 do {rgb0_on = true; if (app_regs.REG_OUTPUT_PULSE_EN & B_RGB0) pulse_countdown.rgb0 = app_regs.REG_PULSE_RGB0 + 1; } while(0) -#define start_RGB1 do {rgb1_on = true; if (app_regs.REG_OUTPUT_PULSE_EN & B_RGB1) pulse_countdown.rgb1 = app_regs.REG_PULSE_RGB1 + 1; } while(0) +#define start_RGB0 do {rgb0_on = true; if (app_regs.REG_OUTPUT_PULSE_ENABLE & B_RGB0) pulse_countdown.rgb0 = app_regs.REG_PULSE_RGB0 + 1; } while(0) +#define start_RGB1 do {rgb1_on = true; if (app_regs.REG_OUTPUT_PULSE_ENABLE & B_RGB1) pulse_countdown.rgb1 = app_regs.REG_PULSE_RGB1 + 1; } while(0) -#define start_DO0 do {set_DO0; if (app_regs.REG_OUTPUT_PULSE_EN & B_DO0) pulse_countdown.do0 = app_regs.REG_PULSE_DO0 + 1; } while(0) -#define start_DO1 do {set_DO1; if (app_regs.REG_OUTPUT_PULSE_EN & B_DO1) pulse_countdown.do1 = app_regs.REG_PULSE_DO1 + 1; } while(0) -#define start_DO2 do {set_DO2; if (app_regs.REG_OUTPUT_PULSE_EN & B_DO2) pulse_countdown.do2 = app_regs.REG_PULSE_DO2 + 1; } while(0) -#define start_DO3 do {set_DO3; if (app_regs.REG_OUTPUT_PULSE_EN & B_DO3) pulse_countdown.do3 = app_regs.REG_PULSE_DO3 + 1; } while(0) +#define start_DO0 do {set_DO0; if (app_regs.REG_OUTPUT_PULSE_ENABLE & B_DO0) pulse_countdown.do0 = app_regs.REG_PULSE_DO0 + 1; } while(0) +#define start_DO1 do {set_DO1; if (app_regs.REG_OUTPUT_PULSE_ENABLE & B_DO1) pulse_countdown.do1 = app_regs.REG_PULSE_DO1 + 1; } while(0) +#define start_DO2 do {set_DO2; if (app_regs.REG_OUTPUT_PULSE_ENABLE & B_DO2) pulse_countdown.do2 = app_regs.REG_PULSE_DO2 + 1; } while(0) +#define start_DO3 do {set_DO3; if (app_regs.REG_OUTPUT_PULSE_ENABLE & B_DO3) pulse_countdown.do3 = app_regs.REG_PULSE_DO3 + 1; } while(0) void handle_Rgbs(bool use_rgb0, bool use_rgb1) { @@ -295,18 +293,18 @@ void handle_Rgbs(bool use_rgb0, bool use_rgb1) PMIC_CTRL = PMIC_RREN_bm | PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm; } -void app_read_REG_OUTPUTS_SET(void) {} -bool app_write_REG_OUTPUTS_SET(void *a) +void app_read_REG_OUTPUT_SET(void) {} +bool app_write_REG_OUTPUT_SET(void *a) { uint16_t reg = *((uint16_t*)a); - if (reg & B_PORT0_DO) start_POKE0_LED; - if (reg & B_PORT1_DO) start_POKE1_LED; - if (reg & B_PORT2_DO) start_POKE2_LED; + if (reg & B_DOPORT0) start_POKE0_LED; + if (reg & B_DOPORT1) start_POKE1_LED; + if (reg & B_DOPORT2) start_POKE2_LED; - if (reg & B_PORT0_12V) start_POKE0_VALVE; - if (reg & B_PORT1_12V) start_POKE1_VALVE; - if (reg & B_PORT2_12V) start_POKE2_VALVE; + if (reg & B_SUPPLY_PORT0) start_POKE0_VALVE; + if (reg & B_SUPPLY_PORT1) start_POKE1_VALVE; + if (reg & B_SUPPLY_PORT2) start_POKE2_VALVE; if (reg & B_LED0) start_LED0; if (reg & B_LED1) start_LED1; @@ -323,28 +321,28 @@ bool app_write_REG_OUTPUTS_SET(void *a) if (reg & B_DO2) start_DO2; if (reg & B_DO3) start_DO3; - app_regs.REG_OUTPUTS_OUT |= reg; - app_regs.REG_OUTPUTS_SET = reg; + app_regs.REG_OUTPUT_STATE |= reg; + app_regs.REG_OUTPUT_SET = reg; return true; } /************************************************************************/ -/* REG_OUTPUTS_CLEAR */ +/* REG_OUTPUT_CLEAR */ /************************************************************************/ -void app_read_REG_OUTPUTS_CLEAR(void) {} -bool app_write_REG_OUTPUTS_CLEAR(void *a) +void app_read_REG_OUTPUT_CLEAR(void) {} +bool app_write_REG_OUTPUT_CLEAR(void *a) { uint16_t reg = *((uint16_t*)a); - if (reg & B_PORT0_DO) clr_POKE0_LED; - if (reg & B_PORT1_DO) clr_POKE1_LED; - if (reg & B_PORT2_DO) clr_POKE2_LED; + if (reg & B_DOPORT0) clr_POKE0_LED; + if (reg & B_DOPORT1) clr_POKE1_LED; + if (reg & B_DOPORT2) clr_POKE2_LED; - if (reg & B_PORT0_12V) clr_POKE0_VALVE; - if (reg & B_PORT1_12V) clr_POKE1_VALVE; - if (reg & B_PORT2_12V) clr_POKE2_VALVE; + if (reg & B_SUPPLY_PORT0) clr_POKE0_VALVE; + if (reg & B_SUPPLY_PORT1) clr_POKE1_VALVE; + if (reg & B_SUPPLY_PORT2) clr_POKE2_VALVE; if (reg & B_LED0) clr_LED0; if (reg & B_LED1) clr_LED1; @@ -361,28 +359,28 @@ bool app_write_REG_OUTPUTS_CLEAR(void *a) if (reg & B_DO2) clr_DO2; if (reg & B_DO3) clr_DO3; - app_regs.REG_OUTPUTS_OUT &= ~reg; - app_regs.REG_OUTPUTS_CLEAR = reg; + app_regs.REG_OUTPUT_STATE &= ~reg; + app_regs.REG_OUTPUT_CLEAR = reg; return true; } /************************************************************************/ -/* REG_OUTPUTS_TOGGLE */ +/* REG_OUTPUT_TOGGLE */ /************************************************************************/ -void app_read_REG_OUTPUTS_TOGGLE(void) {} -bool app_write_REG_OUTPUTS_TOGGLE(void *a) +void app_read_REG_OUTPUT_TOGGLE(void) {} +bool app_write_REG_OUTPUT_TOGGLE(void *a) { uint16_t reg = *((uint16_t*)a); - if (reg & B_PORT0_DO) { if (read_POKE0_LED) tgl_POKE0_LED; else start_POKE0_LED;} - if (reg & B_PORT1_DO) { if (read_POKE1_LED) tgl_POKE1_LED; else start_POKE1_LED;} - if (reg & B_PORT2_DO) { if (read_POKE2_LED) tgl_POKE2_LED; else start_POKE2_LED;} + if (reg & B_DOPORT0) { if (read_POKE0_LED) tgl_POKE0_LED; else start_POKE0_LED;} + if (reg & B_DOPORT1) { if (read_POKE1_LED) tgl_POKE1_LED; else start_POKE1_LED;} + if (reg & B_DOPORT2) { if (read_POKE2_LED) tgl_POKE2_LED; else start_POKE2_LED;} - if (reg & B_PORT0_12V) { if (read_POKE0_VALVE) tgl_POKE0_VALVE; else start_POKE0_VALVE;} - if (reg & B_PORT1_12V) { if (read_POKE1_VALVE) tgl_POKE1_VALVE; else start_POKE1_VALVE;} - if (reg & B_PORT2_12V) { if (read_POKE2_VALVE) tgl_POKE2_VALVE; else start_POKE2_VALVE;} + if (reg & B_SUPPLY_PORT0) { if (read_POKE0_VALVE) tgl_POKE0_VALVE; else start_POKE0_VALVE;} + if (reg & B_SUPPLY_PORT1) { if (read_POKE1_VALVE) tgl_POKE1_VALVE; else start_POKE1_VALVE;} + if (reg & B_SUPPLY_PORT2) { if (read_POKE2_VALVE) tgl_POKE2_VALVE; else start_POKE2_VALVE;} if (reg & B_LED0) { if (!read_LED0) tgl_LED0; else start_LED0;} @@ -412,39 +410,39 @@ bool app_write_REG_OUTPUTS_TOGGLE(void *a) if (reg & B_DO2) { if (read_DO2) tgl_DO2; else start_DO2;} if (reg & B_DO3) { if (read_DO3) tgl_DO3; else start_DO3;} - app_regs.REG_OUTPUTS_OUT ^= reg; - app_regs.REG_OUTPUTS_TOGGLE = reg; + app_regs.REG_OUTPUT_STATE ^= reg; + app_regs.REG_OUTPUT_TOGGLE = reg; return true; } /************************************************************************/ -/* REG_OUTPUTS_OUT */ +/* REG_OUTPUT_STATE */ /************************************************************************/ -void app_read_REG_OUTPUTS_OUT(void) +void app_read_REG_OUTPUT_STATE(void) { - app_regs.REG_OUTPUTS_OUT = (read_POKE0_LED) ? B_PORT0_DO : 0; - app_regs.REG_OUTPUTS_OUT |= (read_POKE1_LED) ? B_PORT1_DO : 0; - app_regs.REG_OUTPUTS_OUT |= (read_POKE2_LED) ? B_PORT2_DO : 0; + app_regs.REG_OUTPUT_STATE = (read_POKE0_LED) ? B_DOPORT0 : 0; + app_regs.REG_OUTPUT_STATE |= (read_POKE1_LED) ? B_DOPORT1 : 0; + app_regs.REG_OUTPUT_STATE |= (read_POKE2_LED) ? B_DOPORT2 : 0; - app_regs.REG_OUTPUTS_OUT |= (read_POKE0_VALVE) ? B_PORT0_12V: 0; - app_regs.REG_OUTPUTS_OUT |= (read_POKE1_VALVE) ? B_PORT1_12V: 0; - app_regs.REG_OUTPUTS_OUT |= (read_POKE2_VALVE) ? B_PORT2_12V: 0; + app_regs.REG_OUTPUT_STATE |= (read_POKE0_VALVE) ? B_SUPPLY_PORT0: 0; + app_regs.REG_OUTPUT_STATE |= (read_POKE1_VALVE) ? B_SUPPLY_PORT1: 0; + app_regs.REG_OUTPUT_STATE |= (read_POKE2_VALVE) ? B_SUPPLY_PORT2: 0; - app_regs.REG_OUTPUTS_OUT |= (read_LED0) ? 0 : B_LED0; - app_regs.REG_OUTPUTS_OUT |= (read_LED1) ? 0 : B_LED1; + app_regs.REG_OUTPUT_STATE |= (read_LED0) ? 0 : B_LED0; + app_regs.REG_OUTPUT_STATE |= (read_LED1) ? 0 : B_LED1; - app_regs.REG_OUTPUTS_OUT |= (rgb0_on) ? B_RGB0 : 0; - app_regs.REG_OUTPUTS_OUT |= (rgb1_on) ? B_RGB1 : 0; + app_regs.REG_OUTPUT_STATE |= (rgb0_on) ? B_RGB0 : 0; + app_regs.REG_OUTPUT_STATE |= (rgb1_on) ? B_RGB1 : 0; - app_regs.REG_OUTPUTS_OUT |= (read_DO0) ? B_DO0 : 0; - app_regs.REG_OUTPUTS_OUT |= (read_DO1) ? B_DO1 : 0; - app_regs.REG_OUTPUTS_OUT |= (read_DO2) ? B_DO2 : 0; - app_regs.REG_OUTPUTS_OUT |= (read_DO3) ? B_DO3 : 0; + app_regs.REG_OUTPUT_STATE |= (read_DO0) ? B_DO0 : 0; + app_regs.REG_OUTPUT_STATE |= (read_DO1) ? B_DO1 : 0; + app_regs.REG_OUTPUT_STATE |= (read_DO2) ? B_DO2 : 0; + app_regs.REG_OUTPUT_STATE |= (read_DO3) ? B_DO3 : 0; } -bool app_write_REG_OUTPUTS_OUT(void *a) +bool app_write_REG_OUTPUT_STATE(void *a) { uint16_t reg = *((uint16_t*)a); @@ -452,13 +450,13 @@ bool app_write_REG_OUTPUTS_OUT(void *a) prev_rgb0_on = rgb0_on; prev_rgb1_on = rgb1_on; - if (reg & B_PORT0_DO) start_POKE0_LED; else clr_POKE0_LED; - if (reg & B_PORT1_DO) start_POKE1_LED; else clr_POKE1_LED; - if (reg & B_PORT2_DO) start_POKE2_LED; else clr_POKE2_LED; + if (reg & B_DOPORT0) start_POKE0_LED; else clr_POKE0_LED; + if (reg & B_DOPORT1) start_POKE1_LED; else clr_POKE1_LED; + if (reg & B_DOPORT2) start_POKE2_LED; else clr_POKE2_LED; - if (reg & B_PORT0_12V) start_POKE0_VALVE; else clr_POKE0_VALVE; - if (reg & B_PORT1_12V) start_POKE1_VALVE; else clr_POKE1_VALVE; - if (reg & B_PORT2_12V) start_POKE2_VALVE; else clr_POKE2_VALVE; + if (reg & B_SUPPLY_PORT0) start_POKE0_VALVE; else clr_POKE0_VALVE; + if (reg & B_SUPPLY_PORT1) start_POKE1_VALVE; else clr_POKE1_VALVE; + if (reg & B_SUPPLY_PORT2) start_POKE2_VALVE; else clr_POKE2_VALVE; if (reg & B_LED0) start_LED0; else clr_LED0; if (reg & B_LED1) start_LED1; else clr_LED1; @@ -476,134 +474,122 @@ bool app_write_REG_OUTPUTS_OUT(void *a) if (reg & B_DO2) start_DO2; else clr_DO2; if (reg & B_DO3) start_DO3; else clr_DO3; - app_regs.REG_OUTPUTS_OUT = reg; + app_regs.REG_OUTPUT_STATE = reg; return true; } /************************************************************************/ -/* REG_PORT_DIOS_SET */ +/* REG_PORT_DIO_SET */ /************************************************************************/ -void app_read_REG_PORT_DIOS_SET(void) +void app_read_REG_PORT_DIO_SET(void) { - //app_regs.REG_PORT_DIOS_SET = 0; + //app_regs.REG_PORT_DIO_SET = 0; } -bool app_write_REG_PORT_DIOS_SET(void *a) +bool app_write_REG_PORT_DIO_SET(void *a) { uint8_t reg = *((uint8_t*)a); - app_regs.REG_PORT_DIOS_SET = reg; + app_regs.REG_PORT_DIO_SET = reg; return true; } - /************************************************************************/ -/* REG_PORT_DIOS_CLEAR */ +/* REG_PORT_DIO_CLEAR */ /************************************************************************/ -void app_read_REG_PORT_DIOS_CLEAR(void) +void app_read_REG_PORT_DIO_CLEAR(void) { - //app_regs.REG_PORT_DIOS_CLEAR = 0; + //app_regs.REG_PORT_DIO_CLEAR = 0; } -bool app_write_REG_PORT_DIOS_CLEAR(void *a) +bool app_write_REG_PORT_DIO_CLEAR(void *a) { uint8_t reg = *((uint8_t*)a); - app_regs.REG_PORT_DIOS_CLEAR = reg; + app_regs.REG_PORT_DIO_CLEAR = reg; return true; } - /************************************************************************/ -/* REG_PORT_DIOS_TOGGLE */ +/* REG_PORT_DIO_TOGGLE */ /************************************************************************/ -void app_read_REG_PORT_DIOS_TOGGLE(void) +void app_read_REG_PORT_DIO_TOGGLE(void) { - //app_regs.REG_PORT_DIOS_TOGGLE = 0; + //app_regs.REG_PORT_DIO_TOGGLE = 0; } -bool app_write_REG_PORT_DIOS_TOGGLE(void *a) +bool app_write_REG_PORT_DIO_TOGGLE(void *a) { uint8_t reg = *((uint8_t*)a); - app_regs.REG_PORT_DIOS_TOGGLE = reg; + app_regs.REG_PORT_DIO_TOGGLE = reg; return true; } - /************************************************************************/ -/* REG_PORT_DIOS_OUT */ +/* REG_PORT_DIO_STATE */ /************************************************************************/ -void app_read_REG_PORT_DIOS_OUT(void) +void app_read_REG_PORT_DIO_STATE(void) { - //app_regs.REG_PORT_DIOS_OUT = 0; + //app_regs.REG_PORT_DIO_STATE = 0; } -bool app_write_REG_PORT_DIOS_OUT(void *a) +bool app_write_REG_PORT_DIO_STATE(void *a) { uint8_t reg = *((uint8_t*)a); - app_regs.REG_PORT_DIOS_OUT = reg; + app_regs.REG_PORT_DIO_STATE = reg; return true; } - /************************************************************************/ -/* REG_PORT_DIOS_CONF */ +/* REG_PORT_DIO_DIRECTION */ /************************************************************************/ -void app_read_REG_PORT_DIOS_CONF(void) +void app_read_REG_PORT_DIO_DIRECTION(void) { - //app_regs.REG_PORT_DIOS_CONF = 0; + //app_regs.REG_PORT_DIO_DIRECTION = 0; } -bool app_write_REG_PORT_DIOS_CONF(void *a) +bool app_write_REG_PORT_DIO_DIRECTION(void *a) { uint8_t reg = *((uint8_t*)a); - app_regs.REG_PORT_DIOS_CONF = reg; + app_regs.REG_PORT_DIO_DIRECTION = reg; return true; } - /************************************************************************/ -/* REG_PORT_DIOS_IN */ +/* REG_PORT_DIO_STATE_EVENT */ /************************************************************************/ -void app_read_REG_PORT_DIOS_IN(void) +void app_read_REG_PORT_DIO_STATE_EVENT(void) { - //app_regs.REG_PORT_DIOS_IN = 0; + //app_regs.REG_PORT_DIO_STATE_EVENT = 0; - app_regs.REG_PORT_DIOS_IN = (read_POKE0_IO) ? B_DIO0 : 0; - app_regs.REG_PORT_DIOS_IN |= (read_POKE1_IO) ? B_DIO1 : 0; - app_regs.REG_PORT_DIOS_IN |= (read_POKE2_IO) ? B_DIO2 : 0; + app_regs.REG_PORT_DIO_STATE_EVENT = (read_POKE0_IO) ? B_DIO0 : 0; + app_regs.REG_PORT_DIO_STATE_EVENT |= (read_POKE1_IO) ? B_DIO1 : 0; + app_regs.REG_PORT_DIO_STATE_EVENT |= (read_POKE2_IO) ? B_DIO2 : 0; } -bool app_write_REG_PORT_DIOS_IN(void *a) -{ - uint8_t reg = *((uint8_t*)a); - - app_regs.REG_PORT_DIOS_IN = reg; - return true; -} - +bool app_write_REG_PORT_DIO_STATE_EVENT(void *a) { return false; } /************************************************************************/ -/* REG_DATA */ +/* REG_ANALOG_DATA */ /************************************************************************/ -// This register is an array with 2 positions -void app_read_REG_DATA(void) {} // The register is always updated -bool app_write_REG_DATA(void *a) +// This register is an array with 3 positions +void app_read_REG_ANALOG_DATA(void) {} // The register is always updated +bool app_write_REG_ANALOG_DATA(void *a) { uint16_t *reg = ((uint16_t*)a); - app_regs.REG_DATA[1] = reg[1]; // Write only to encoder counter + app_regs.REG_ANALOG_DATA[1] = reg[1]; // Write only to encoder counter if (_states_.quad_counter.port2) { @@ -615,98 +601,98 @@ bool app_write_REG_DATA(void *a) /************************************************************************/ -/* REG_MODE_POKE0_LED */ +/* REG_OUTPUT_PULSE_ENABLE */ /************************************************************************/ -void app_read_REG_OUTPUT_PULSE_EN(void) {} -bool app_write_REG_OUTPUT_PULSE_EN(void *a) +void app_read_REG_OUTPUT_PULSE_ENABLE(void) {} +bool app_write_REG_OUTPUT_PULSE_ENABLE(void *a) { uint16_t reg = *((uint16_t*)a); - app_regs.REG_OUTPUT_PULSE_EN = reg; + app_regs.REG_OUTPUT_PULSE_ENABLE = reg; return true; } /************************************************************************/ -/* REG_PULSE_PORT0_DO */ +/* REG_PULSE_DO_PORT0 */ /************************************************************************/ -void app_read_REG_PULSE_PORT0_DO(void) {} -bool app_write_REG_PULSE_PORT0_DO(void *a) +void app_read_REG_PULSE_DO_PORT0(void) {} +bool app_write_REG_PULSE_DO_PORT0(void *a) { if (*((uint16_t*)a) < 1) return false; - app_regs.REG_PULSE_PORT0_DO = *((uint16_t*)a); + app_regs.REG_PULSE_DO_PORT0 = *((uint16_t*)a); return true; } /************************************************************************/ -/* REG_PULSE_PORT1_DO */ +/* REG_PULSE_DO_PORT1 */ /************************************************************************/ -void app_read_REG_PULSE_PORT1_DO(void) {} -bool app_write_REG_PULSE_PORT1_DO(void *a) +void app_read_REG_PULSE_DO_PORT1(void) {} +bool app_write_REG_PULSE_DO_PORT1(void *a) { if (*((uint16_t*)a) < 1) return false; - app_regs.REG_PULSE_PORT1_DO = *((uint16_t*)a); + app_regs.REG_PULSE_DO_PORT1 = *((uint16_t*)a); return true; } /************************************************************************/ -/* REG_PULSE_PORT2_DO */ +/* REG_PULSE_DO_PORT2 */ /************************************************************************/ -void app_read_REG_PULSE_PORT2_DO(void) {} -bool app_write_REG_PULSE_PORT2_DO(void *a) +void app_read_REG_PULSE_DO_PORT2(void) {} +bool app_write_REG_PULSE_DO_PORT2(void *a) { if (*((uint16_t*)a) < 1) return false; - app_regs.REG_PULSE_PORT2_DO = *((uint16_t*)a); + app_regs.REG_PULSE_DO_PORT2 = *((uint16_t*)a); return true; } /************************************************************************/ -/* REG_PULSE_PORT0_12V */ +/* REG_PULSE_SUPPLY_PORT0 */ /************************************************************************/ -void app_read_REG_PULSE_PORT0_12V(void) {} -bool app_write_REG_PULSE_PORT0_12V(void *a) +void app_read_REG_PULSE_SUPPLY_PORT0(void) {} +bool app_write_REG_PULSE_SUPPLY_PORT0(void *a) { if (*((uint16_t*)a) < 1) return false; - app_regs.REG_PULSE_PORT0_12V = *((uint16_t*)a); + app_regs.REG_PULSE_SUPPLY_PORT0 = *((uint16_t*)a); return true; } /************************************************************************/ -/* REG_PULSE_PORT1_12V */ +/* REG_PULSE_SUPPLY_PORT1 */ /************************************************************************/ -void app_read_REG_PULSE_PORT1_12V(void) {} -bool app_write_REG_PULSE_PORT1_12V(void *a) +void app_read_REG_PULSE_SUPPLY_PORT1(void) {} +bool app_write_REG_PULSE_SUPPLY_PORT1(void *a) { if (*((uint16_t*)a) < 1) return false; - app_regs.REG_PULSE_PORT1_12V = *((uint16_t*)a); + app_regs.REG_PULSE_SUPPLY_PORT1 = *((uint16_t*)a); return true; } /************************************************************************/ -/* REG_PULSE_PORT2_12V */ +/* REG_PULSE_SUPPLY_PORT2 */ /************************************************************************/ -void app_read_REG_PULSE_PORT2_12V(void) {} -bool app_write_REG_PULSE_PORT2_12V(void *a) +void app_read_REG_PULSE_SUPPLY_PORT2(void) {} +bool app_write_REG_PULSE_SUPPLY_PORT2(void *a) { if (*((uint16_t*)a) < 1) return false; - app_regs.REG_PULSE_PORT2_12V = *((uint16_t*)a); + app_regs.REG_PULSE_SUPPLY_PORT2 = *((uint16_t*)a); return true; } @@ -824,10 +810,10 @@ bool app_write_REG_PULSE_DO3(void *a) /************************************************************************/ -/* REG_FREQ_DO0 */ +/* REG_PWM_FREQUENCY_DO0 */ /************************************************************************/ -void app_read_REG_FREQ_DO0(void) {} -bool app_write_REG_FREQ_DO0(void *a) +void app_read_REG_PWM_FREQUENCY_DO0(void) {} +bool app_write_REG_PWM_FREQUENCY_DO0(void *a) { uint16_t reg = *((uint16_t*)a); @@ -835,19 +821,19 @@ bool app_write_REG_FREQ_DO0(void *a) return false; calculate_timer_16bits(32000000, reg, &timer_conf.prescaler_do0, &timer_conf.target_do0); - timer_conf.dcycle_do0 = app_regs.REG_DCYCLE_DO0/100.0 * timer_conf.target_do0 + 0.5; + timer_conf.dcycle_do0 = app_regs.REG_PWM_DUTY_CYCLE_DO0/100.0 * timer_conf.target_do0 + 0.5; is_new_timer_conf.pwm_do0 = true; - app_regs.REG_FREQ_DO0 = reg; + app_regs.REG_PWM_FREQUENCY_DO0 = reg; return true; } /************************************************************************/ -/* REG_FREQ_DO1 */ +/* REG_PWM_FREQUENCY_DO1 */ /************************************************************************/ -void app_read_REG_FREQ_DO1(void) {} -bool app_write_REG_FREQ_DO1(void *a) +void app_read_REG_PWM_FREQUENCY_DO1(void) {} +bool app_write_REG_PWM_FREQUENCY_DO1(void *a) { uint16_t reg = *((uint16_t*)a); @@ -855,24 +841,24 @@ bool app_write_REG_FREQ_DO1(void *a) return false; calculate_timer_16bits(32000000, reg, &timer_conf.prescaler_do1, &timer_conf.target_do1); - timer_conf.dcycle_do1 = app_regs.REG_DCYCLE_DO1/100.0 * timer_conf.target_do1 + 0.5; + timer_conf.dcycle_do1 = app_regs.REG_PWM_DUTY_CYCLE_DO1/100.0 * timer_conf.target_do1 + 0.5; is_new_timer_conf.pwm_do1 = true; - app_regs.REG_FREQ_DO1 = reg; + app_regs.REG_PWM_FREQUENCY_DO1 = reg; return true; } /************************************************************************/ -/* REG_FREQ_DO2 */ +/* REG_PWM_FREQUENCY_DO2 */ /************************************************************************/ -void app_read_REG_FREQ_DO2(void) +void app_read_REG_PWM_FREQUENCY_DO2(void) { - //app_regs.REG_FREQ_DO2 = 0; + //app_regs.REG_PWM_FREQUENCY_DO2 = 0; } -bool app_write_REG_FREQ_DO2(void *a) +bool app_write_REG_PWM_FREQUENCY_DO2(void *a) { uint16_t reg = *((uint16_t*)a); @@ -880,24 +866,24 @@ bool app_write_REG_FREQ_DO2(void *a) return false; calculate_timer_16bits(32000000, reg, &timer_conf.prescaler_do2, &timer_conf.target_do2); - timer_conf.dcycle_do2 = app_regs.REG_DCYCLE_DO2/100.0 * timer_conf.target_do2 + 0.5; + timer_conf.dcycle_do2 = app_regs.REG_PWM_DUTY_CYCLE_DO2/100.0 * timer_conf.target_do2 + 0.5; is_new_timer_conf.pwm_do2 = true; - app_regs.REG_FREQ_DO2 = reg; + app_regs.REG_PWM_FREQUENCY_DO2 = reg; return true; } /************************************************************************/ -/* REG_FREQ_DO3 */ +/* REG_PWM_FREQUENCY_DO3 */ /************************************************************************/ -void app_read_REG_FREQ_DO3(void) +void app_read_REG_PWM_FREQUENCY_DO3(void) { - //app_regs.REG_FREQ_DO3 = 0; + //app_regs.REG_PWM_FREQUENCY_DO3 = 0; } -bool app_write_REG_FREQ_DO3(void *a) +bool app_write_REG_PWM_FREQUENCY_DO3(void *a) { uint16_t reg = *((uint16_t*)a); @@ -905,105 +891,105 @@ bool app_write_REG_FREQ_DO3(void *a) return false; calculate_timer_16bits(32000000, reg, &timer_conf.prescaler_do3, &timer_conf.target_do3); - timer_conf.dcycle_do3 = app_regs.REG_DCYCLE_DO3/100.0 * timer_conf.target_do3 + 0.5; + timer_conf.dcycle_do3 = app_regs.REG_PWM_DUTY_CYCLE_DO3/100.0 * timer_conf.target_do3 + 0.5; is_new_timer_conf.pwm_do3 = true; - app_regs.REG_FREQ_DO3 = reg; + app_regs.REG_PWM_FREQUENCY_DO3 = reg; return true; } /************************************************************************/ -/* REG_DCYCLE_DO0 */ +/* REG_PWM_DUTY_CYCLE_DO0 */ /************************************************************************/ -void app_read_REG_DCYCLE_DO0(void) {} -bool app_write_REG_DCYCLE_DO0(void *a) +void app_read_REG_PWM_DUTY_CYCLE_DO0(void) {} +bool app_write_REG_PWM_DUTY_CYCLE_DO0(void *a) { uint8_t reg = *((uint8_t*)a); if (reg < 1 || reg > 99) return false; - //calculate_timer_16bits(32000000, app_regs.REG_FREQ_DO0, &timer_conf.prescaler_do0, &timer_conf.target_do0); + //calculate_timer_16bits(32000000, app_regs.REG_PWM_FREQUENCY_DO0, &timer_conf.prescaler_do0, &timer_conf.target_do0); timer_conf.dcycle_do0 = reg/100.0 * timer_conf.target_do0 + 0.5; is_new_timer_conf.pwm_do0 = true; - app_regs.REG_DCYCLE_DO0 = reg; + app_regs.REG_PWM_DUTY_CYCLE_DO0 = reg; return true; } /************************************************************************/ -/* REG_DCYCLE_DO1 */ +/* REG_PWM_DUTY_CYCLE_DO1 */ /************************************************************************/ -void app_read_REG_DCYCLE_DO1(void) +void app_read_REG_PWM_DUTY_CYCLE_DO1(void) { - //app_regs.REG_DCYCLE_DO1 = 0; + //app_regs.REG_PWM_DUTY_CYCLE_DO1 = 0; } -bool app_write_REG_DCYCLE_DO1(void *a) +bool app_write_REG_PWM_DUTY_CYCLE_DO1(void *a) { uint8_t reg = *((uint8_t*)a); if (reg < 1 || reg > 99) return false; - //calculate_timer_16bits(32000000, app_regs.REG_FREQ_DO0, &timer_conf.prescaler_do0, &timer_conf.target_do0); + //calculate_timer_16bits(32000000, app_regs.REG_PWM_FREQUENCY_DO0, &timer_conf.prescaler_do0, &timer_conf.target_do0); timer_conf.dcycle_do1 = reg/100.0 * timer_conf.target_do1 + 0.5; is_new_timer_conf.pwm_do1 = true; - app_regs.REG_DCYCLE_DO1 = reg; + app_regs.REG_PWM_DUTY_CYCLE_DO1 = reg; return true; } /************************************************************************/ -/* REG_DCYCLE_DO2 */ +/* REG_PWM_DUTY_CYCLE_DO2 */ /************************************************************************/ -void app_read_REG_DCYCLE_DO2(void) +void app_read_REG_PWM_DUTY_CYCLE_DO2(void) { - //app_regs.REG_DCYCLE_DO2 = 0; + //app_regs.REG_PWM_DUTY_CYCLE_DO2 = 0; } -bool app_write_REG_DCYCLE_DO2(void *a) +bool app_write_REG_PWM_DUTY_CYCLE_DO2(void *a) { uint8_t reg = *((uint8_t*)a); if (reg < 1 || reg > 99) return false; - //calculate_timer_16bits(32000000, app_regs.REG_FREQ_DO0, &timer_conf.prescaler_do0, &timer_conf.target_do0); + //calculate_timer_16bits(32000000, app_regs.REG_PWM_FREQUENCY_DO0, &timer_conf.prescaler_do0, &timer_conf.target_do0); timer_conf.dcycle_do2 = reg/100.0 * timer_conf.target_do2 + 0.5; is_new_timer_conf.pwm_do2 = true; - app_regs.REG_DCYCLE_DO2 = reg; + app_regs.REG_PWM_DUTY_CYCLE_DO2 = reg; return true; } /************************************************************************/ -/* REG_DCYCLE_DO3 */ +/* REG_PWM_DUTY_CYCLE_DO3 */ /************************************************************************/ -void app_read_REG_DCYCLE_DO3(void) +void app_read_REG_PWM_DUTY_CYCLE_DO3(void) { - //app_regs.REG_DCYCLE_DO3 = 0; + //app_regs.REG_PWM_DUTY_CYCLE_DO3 = 0; } -bool app_write_REG_DCYCLE_DO3(void *a) +bool app_write_REG_PWM_DUTY_CYCLE_DO3(void *a) { uint8_t reg = *((uint8_t*)a); if (reg < 1 || reg > 99) return false; - //calculate_timer_16bits(32000000, app_regs.REG_FREQ_DO0, &timer_conf.prescaler_do0, &timer_conf.target_do0); + //calculate_timer_16bits(32000000, app_regs.REG_PWM_FREQUENCY_DO0, &timer_conf.prescaler_do0, &timer_conf.target_do0); timer_conf.dcycle_do3 = reg/100.0 * timer_conf.target_do3 + 0.5; is_new_timer_conf.pwm_do3 = true; - app_regs.REG_DCYCLE_DO3 = reg; + app_regs.REG_PWM_DUTY_CYCLE_DO3 = reg; return true; } @@ -1121,28 +1107,28 @@ bool app_write_REG_PWM_STOP(void *a) /************************************************************************/ -/* REG_RGBS */ +/* REG_RGB_ALL */ /************************************************************************/ // This register is an array with 6 positions -void app_read_REG_RGBS(void) {} -bool app_write_REG_RGBS(void *a) +void app_read_REG_RGB_ALL(void) {} +bool app_write_REG_RGB_ALL(void *a) { uint8_t *reg = ((uint8_t*)a); - app_regs.REG_RGBS[0] = reg[1]; - app_regs.REG_RGBS[1] = reg[0]; - app_regs.REG_RGBS[2] = reg[2]; - app_regs.REG_RGBS[3] = reg[4]; - app_regs.REG_RGBS[4] = reg[3]; - app_regs.REG_RGBS[5] = reg[5]; - - app_regs.REG_RGB0[0] = reg[1]; - app_regs.REG_RGB0[1] = reg[0]; - app_regs.REG_RGB0[2] = reg[2]; + app_regs.REG_RGB_ALL[0] = reg[1]; + app_regs.REG_RGB_ALL[1] = reg[0]; + app_regs.REG_RGB_ALL[2] = reg[2]; + app_regs.REG_RGB_ALL[3] = reg[4]; + app_regs.REG_RGB_ALL[4] = reg[3]; + app_regs.REG_RGB_ALL[5] = reg[5]; + + app_regs.REG_RGB_ALL[0] = reg[1]; + app_regs.REG_RGB_ALL[1] = reg[0]; + app_regs.REG_RGB_ALL[2] = reg[2]; - app_regs.REG_RGB1[0] = reg[4]; - app_regs.REG_RGB1[1] = reg[3]; - app_regs.REG_RGB1[2] = reg[5]; + app_regs.REG_RGB_ALL[0] = reg[4]; + app_regs.REG_RGB_ALL[1] = reg[3]; + app_regs.REG_RGB_ALL[2] = reg[5]; handle_Rgbs(rgb0_on, rgb1_on); @@ -1159,13 +1145,13 @@ bool app_write_REG_RGB0(void *a) { uint8_t *reg = ((uint8_t*)a); - app_regs.REG_RGBS[0] = reg[1]; - app_regs.REG_RGBS[1] = reg[0]; - app_regs.REG_RGBS[2] = reg[2]; + app_regs.REG_RGB_ALL[0] = reg[1]; + app_regs.REG_RGB_ALL[1] = reg[0]; + app_regs.REG_RGB_ALL[2] = reg[2]; - app_regs.REG_RGB0[0] = reg[1]; - app_regs.REG_RGB0[1] = reg[0]; - app_regs.REG_RGB0[2] = reg[2]; + app_regs.REG_RGB_ALL[0] = reg[1]; + app_regs.REG_RGB_ALL[1] = reg[0]; + app_regs.REG_RGB_ALL[2] = reg[2]; handle_Rgbs(rgb0_on, rgb1_on); @@ -1182,13 +1168,13 @@ bool app_write_REG_RGB1(void *a) { uint8_t *reg = ((uint8_t*)a); - app_regs.REG_RGBS[3] = reg[1]; - app_regs.REG_RGBS[4] = reg[0]; - app_regs.REG_RGBS[5] = reg[2]; + app_regs.REG_RGB_ALL[3] = reg[1]; + app_regs.REG_RGB_ALL[4] = reg[0]; + app_regs.REG_RGB_ALL[5] = reg[2]; - app_regs.REG_RGB1[0] = reg[1]; - app_regs.REG_RGB1[1] = reg[0]; - app_regs.REG_RGB1[2] = reg[2]; + app_regs.REG_RGB_ALL[0] = reg[1]; + app_regs.REG_RGB_ALL[1] = reg[0]; + app_regs.REG_RGB_ALL[2] = reg[2]; handle_Rgbs(rgb0_on, rgb1_on); @@ -1293,14 +1279,14 @@ bool app_write_REG_LED1_MAX_CURRENT(void *a) /************************************************************************/ -/* REG_EVNT_ENABLE */ +/* REG_EVENT_ENABLE */ /************************************************************************/ -void app_read_REG_EVNT_ENABLE(void) {} -bool app_write_REG_EVNT_ENABLE(void *a) +void app_read_REG_EVENT_ENABLE(void) {} +bool app_write_REG_EVENT_ENABLE(void *a) { uint8_t reg = *((uint8_t*)a); - app_regs.REG_EVNT_ENABLE = reg; + app_regs.REG_EVENT_ENABLE = reg; return true; } @@ -1338,37 +1324,37 @@ void app_read_REG_START_CAMERAS(void) if(_states_.camera.do0) { - app_regs.REG_START_CAMERAS |= B_EN_CAM_OUT0; + app_regs.REG_START_CAMERAS |= B_CAMERA_OUTPUT0; } if(_states_.camera.do1) { - app_regs.REG_START_CAMERAS |= B_EN_CAM_OUT1; + app_regs.REG_START_CAMERAS |= B_CAMERA_OUTPUT1; } } bool app_write_REG_START_CAMERAS(void *a) { uint8_t reg = *((uint8_t*)a); - if ((reg & B_EN_CAM_OUT0) && !_states_.camera.do0) + if ((reg & B_CAMERA_OUTPUT0) && !_states_.camera.do0) { /* Make sure the output pin is equal to 0 for a while before start triggering the camera */ clr_DO0; _delay_us(16); // Measured, gives around 55us before the the first trigger pulse /* Start the camera */ - start_cameras(&TCF0, app_regs.REG_CAM_OUT0_FREQ); + start_cameras(&TCF0, app_regs.REG_CAMERA0_FREQUENCY); _states_.camera.do0 = true; } - if ((reg & B_EN_CAM_OUT1) && !_states_.camera.do1) + if ((reg & B_CAMERA_OUTPUT1) && !_states_.camera.do1) { /* Make sure the output pin is equal to 0 for a while before start triggering the camera */ clr_DO1; _delay_us(16); // Measured, gives around 55us before the the first trigger pulse /* Start the camera */ - start_cameras(&TCE0, app_regs.REG_CAM_OUT1_FREQ); + start_cameras(&TCE0, app_regs.REG_CAMERA1_FREQUENCY); _states_.camera.do1 = true; } @@ -1388,12 +1374,12 @@ bool app_write_REG_STOP_CAMERAS(void *a) { uint8_t reg = *((uint8_t*)a); - if ((reg & B_EN_CAM_OUT0) && _states_.camera.do0) + if ((reg & B_CAMERA_OUTPUT0) && _states_.camera.do0) { stop_camera_do0 = true; } - if ((reg & B_EN_CAM_OUT1) && _states_.camera.do1) + if ((reg & B_CAMERA_OUTPUT1) && _states_.camera.do1) { stop_camera_do1 = true; } @@ -1404,89 +1390,89 @@ bool app_write_REG_STOP_CAMERAS(void *a) /************************************************************************/ -/* REG_EN_SERVOS */ +/* REG_ENABLE_SERVOS */ /************************************************************************/ -void app_read_REG_EN_SERVOS(void) +void app_read_REG_ENABLE_SERVOS(void) { - app_regs.REG_EN_SERVOS = 0; + app_regs.REG_ENABLE_SERVOS = 0; if (_states_.servo.do2) { - app_regs.REG_EN_SERVOS |= B_EN_SERVO_OUT2; + app_regs.REG_ENABLE_SERVOS |= B_SERVO_OUTPUT2; } if (_states_.servo.do3) { - app_regs.REG_EN_SERVOS |= B_EN_SERVO_OUT3; + app_regs.REG_ENABLE_SERVOS |= B_SERVO_OUTPUT3; } } -bool app_write_REG_EN_SERVOS(void *a) +bool app_write_REG_ENABLE_SERVOS(void *a) { uint8_t reg = *((uint8_t*)a); - if ((reg & B_EN_SERVO_OUT2) && !_states_.servo.do2) + if ((reg & B_SERVO_OUTPUT2) && !_states_.servo.do2) { _states_.servo.do2 = true; - timer_type0_pwm(&TCD0, TIMER_PRESCALER_DIV64, (app_regs.REG_MOTOR_OUT2_PERIOD >> 1), (app_regs.REG_MOTOR_OUT2_PULSE >> 1), INT_LEVEL_OFF, INT_LEVEL_OFF); + timer_type0_pwm(&TCD0, TIMER_PRESCALER_DIV64, (app_regs.REG_SERVO_MOTOR2_PERIOD >> 1), (app_regs.REG_SERVO_MOTOR2_PULSE >> 1), INT_LEVEL_OFF, INT_LEVEL_OFF); } - if ((reg & B_EN_SERVO_OUT3) && !_states_.servo.do3) + if ((reg & B_SERVO_OUTPUT3) && !_states_.servo.do3) { _states_.servo.do3 = true; - timer_type0_pwm(&TCC0, TIMER_PRESCALER_DIV64, (app_regs.REG_MOTOR_OUT3_PERIOD >> 1), (app_regs.REG_MOTOR_OUT3_PULSE >> 1), INT_LEVEL_OFF, INT_LEVEL_OFF); + timer_type0_pwm(&TCC0, TIMER_PRESCALER_DIV64, (app_regs.REG_SERVO_MOTOR3_PERIOD >> 1), (app_regs.REG_SERVO_MOTOR3_PULSE >> 1), INT_LEVEL_OFF, INT_LEVEL_OFF); } - app_regs.REG_EN_SERVOS = reg; + app_regs.REG_ENABLE_SERVOS = reg; return true; } /************************************************************************/ -/* REG_DIS_SERVOS */ +/* REG_DISABLE_SERVOS */ /************************************************************************/ -void app_read_REG_DIS_SERVOS(void) {} -bool app_write_REG_DIS_SERVOS(void *a) +void app_read_REG_DISABLE_SERVOS(void) {} +bool app_write_REG_DISABLE_SERVOS(void *a) { uint8_t reg = *((uint8_t*)a); - if ((reg & B_EN_SERVO_OUT2) && _states_.servo.do2) + if ((reg & B_SERVO_OUTPUT2) && _states_.servo.do2) { _states_.servo.do2 = false; timer_type0_stop(&TCD0); } - if ((reg & B_EN_SERVO_OUT3) && _states_.servo.do3) + if ((reg & B_SERVO_OUTPUT3) && _states_.servo.do3) { _states_.servo.do3 = false; timer_type0_stop(&TCC0); } - app_regs.REG_DIS_SERVOS = reg; + app_regs.REG_DISABLE_SERVOS = reg; return true; } /************************************************************************/ -/* REG_EN_ENCODERS */ +/* REG_ENABLE_ENCODERS */ /************************************************************************/ extern int16_t previous_encoder_poke2; -void app_read_REG_EN_ENCODERS(void) +void app_read_REG_ENABLE_ENCODERS(void) { - app_regs.REG_EN_ENCODERS = 0; + app_regs.REG_ENABLE_ENCODERS = 0; if(_states_.quad_counter.port2) { - app_regs.REG_EN_ENCODERS |= B_EN_ENCODER_PORT2; + app_regs.REG_ENABLE_ENCODERS |= B_ENCODER_PORT2; } } -bool app_write_REG_EN_ENCODERS(void *a) +bool app_write_REG_ENABLE_ENCODERS(void *a) { uint8_t reg = *((uint8_t*)a); - if ((reg & B_EN_ENCODER_PORT2) && !_states_.quad_counter.port2) + if ((reg & B_ENCODER_PORT2) && !_states_.quad_counter.port2) { _states_.quad_counter.port2 = true; @@ -1514,7 +1500,7 @@ bool app_write_REG_EN_ENCODERS(void *a) TCD1_CTRLA=TC_CLKSEL_DIV1_gc; } - if (!(reg & B_EN_ENCODER_PORT2) && _states_.quad_counter.port2) + if (!(reg & B_ENCODER_PORT2) && _states_.quad_counter.port2) { if (_states_.quad_counter.port2) { @@ -1529,26 +1515,26 @@ bool app_write_REG_EN_ENCODERS(void *a) io_set_int(&PORTF, INT_LEVEL_LOW, 0, (3<<4), false); // POKE2_IR & IO IN /* Reset register */ - app_regs.REG_DATA[1] = 0; + app_regs.REG_ANALOG_DATA[1] = 0; } } - app_regs.REG_EN_ENCODERS = reg; + app_regs.REG_ENABLE_ENCODERS = reg; return true; } /************************************************************************/ -/* REG_CONF_ENCODERS */ +/* REG_ENCODER_MODE */ /************************************************************************/ -void app_read_REG_CONF_ENCODERS(void) {} -bool app_write_REG_CONF_ENCODERS(void *a) +void app_read_REG_ENCODER_MODE(void) {} +bool app_write_REG_ENCODER_MODE(void *a) { uint8_t reg = *((uint8_t*)a); - if (reg & ~MSK_ENCODERS_MODE) return false; + if (reg & ~MSK_ENCODER_MODE_CONFIG_SEL) return false; - app_regs.REG_CONF_ENCODERS = reg; + app_regs.REG_ENCODER_MODE = reg; return true; } /************************************************************************/ @@ -1594,43 +1580,43 @@ void app_read_REG_RESERVED9(void) {} bool app_write_REG_RESERVED9(void *a) {return true;} /************************************************************************/ -/* REG_CAM_OUT0_FRAME_ACQUIRED */ +/* REG_CAMERA0_FRAME */ /************************************************************************/ -void app_read_REG_CAM_OUT0_FRAME_ACQUIRED(void) {} -bool app_write_REG_CAM_OUT0_FRAME_ACQUIRED(void *a) {return false;} +void app_read_REG_CAMERA0_FRAME(void) {} +bool app_write_REG_CAMERA0_FRAME(void *a) { return false; } /************************************************************************/ -/* REG_CAM_OUT0_FREQ */ +/* REG_CAMERA0_FREQUENCY */ /************************************************************************/ -void app_read_REG_CAM_OUT0_FREQ(void) {} -bool app_write_REG_CAM_OUT0_FREQ(void *a) +void app_read_REG_CAMERA0_FREQUENCY(void) {} +bool app_write_REG_CAMERA0_FREQUENCY(void *a) { uint16_t reg = *((uint16_t*)a); if (reg < 2 || reg > 600) return false; - app_regs.REG_CAM_OUT0_FREQ = reg; + app_regs.REG_CAMERA0_FREQUENCY = reg; return true; } /************************************************************************/ -/* REG_CAM_OUT1_FRAME_ACQUIRED */ +/* REG_CAMERA1_FRAME */ /************************************************************************/ -void app_read_REG_CAM_OUT1_FRAME_ACQUIRED(void) {} -bool app_write_REG_CAM_OUT1_FRAME_ACQUIRED(void *a) {return false;} +void app_read_REG_CAMERA1_FRAME(void) {} +bool app_write_REG_CAMERA1_FRAME(void *a) { return false; } /************************************************************************/ -/* REG_CAM_OUT2_FREQ */ +/* REG_CAMERA1_FREQUENCY */ /************************************************************************/ -void app_read_REG_CAM_OUT1_FREQ(void) {} -bool app_write_REG_CAM_OUT1_FREQ(void *a) +void app_read_REG_CAMERA1_FREQUENCY(void) {} +bool app_write_REG_CAMERA1_FREQUENCY(void *a) { uint16_t reg = *((uint16_t*)a); if (reg < 2 || reg > 600) return false; - app_regs.REG_CAM_OUT1_FREQ = reg; + app_regs.REG_CAMERA1_FREQUENCY = reg; return true; } @@ -1658,10 +1644,10 @@ bool app_write_REG_RESERVED13(void *a) {return true;} /************************************************************************/ -/* REG_MOTOR_OUT2_PERIOD */ +/* REG_SERVO_MOTOR2_PERIOD */ /************************************************************************/ -void app_read_REG_MOTOR_OUT2_PERIOD(void) {} -bool app_write_REG_MOTOR_OUT2_PERIOD(void *a) +void app_read_REG_SERVO_MOTOR2_PERIOD(void) {} +bool app_write_REG_SERVO_MOTOR2_PERIOD(void *a) { uint16_t reg = *((uint16_t*)a); @@ -1673,14 +1659,15 @@ bool app_write_REG_MOTOR_OUT2_PERIOD(void *a) TCD0_PER = (reg >> 1) - 1; } - app_regs.REG_MOTOR_OUT2_PERIOD = reg; + app_regs.REG_SERVO_MOTOR2_PERIOD = reg; return true; } + /************************************************************************/ -/* REG_MOTOR_OUT2_PULSE */ +/* REG_SERVO_MOTOR2_PULSE */ /************************************************************************/ -void app_read_REG_MOTOR_OUT2_PULSE(void) {} -bool app_write_REG_MOTOR_OUT2_PULSE(void *a) +void app_read_REG_SERVO_MOTOR2_PULSE(void) {} +bool app_write_REG_SERVO_MOTOR2_PULSE(void *a) { uint16_t reg = *((uint16_t*)a); @@ -1692,16 +1679,16 @@ bool app_write_REG_MOTOR_OUT2_PULSE(void *a) TCD0_CCA = (reg >> 1) - 1; } - app_regs.REG_MOTOR_OUT2_PULSE = reg; + app_regs.REG_SERVO_MOTOR2_PULSE = reg; return true; } /************************************************************************/ -/* REG_MOTOR_OUT3_PERIOD */ +/* REG_SERVO_MOTOR3_PERIOD */ /************************************************************************/ -void app_read_REG_MOTOR_OUT3_PERIOD(void) {} -bool app_write_REG_MOTOR_OUT3_PERIOD(void *a) +void app_read_REG_SERVO_MOTOR3_PERIOD(void) {} +bool app_write_REG_SERVO_MOTOR3_PERIOD(void *a) { uint16_t reg = *((uint16_t*)a); @@ -1713,14 +1700,14 @@ bool app_write_REG_MOTOR_OUT3_PERIOD(void *a) TCC0_PER = (reg >> 1) - 1; } - app_regs.REG_MOTOR_OUT3_PERIOD = reg; + app_regs.REG_SERVO_MOTOR3_PERIOD = reg; return true; } /************************************************************************/ -/* REG_MOTOR_OUT3_PULSE */ +/* REG_SERVO_MOTOR3_PULSE */ /************************************************************************/ -void app_read_REG_MOTOR_OUT3_PULSE(void) {} -bool app_write_REG_MOTOR_OUT3_PULSE(void *a) +void app_read_REG_SERVO_MOTOR3_PULSE(void) {} +bool app_write_REG_SERVO_MOTOR3_PULSE(void *a) { uint16_t reg = *((uint16_t*)a); @@ -1732,7 +1719,7 @@ bool app_write_REG_MOTOR_OUT3_PULSE(void *a) TCC0_CCA = (reg >> 1) - 1; } - app_regs.REG_MOTOR_OUT3_PULSE = reg; + app_regs.REG_SERVO_MOTOR3_PULSE = reg; return true; } @@ -1760,14 +1747,14 @@ bool app_write_REG_RESERVED17(void *a) {return true;} /************************************************************************/ -/* REG_ENCODER_PORT2_RESET */ +/* REG_ENCODER_RESET */ /************************************************************************/ -void app_read_REG_ENCODERS_RESET(void) {} -bool app_write_REG_ENCODERS_RESET(void *a) +void app_read_REG_ENCODER_RESET(void) {} +bool app_write_REG_ENCODER_RESET(void *a) { uint8_t reg = *((uint8_t*)a); - if (reg & B_RST_ENCODER_PORT2) + if (reg & B_ENCODER_PORT2) { if (_states_.quad_counter.port2) { @@ -1776,7 +1763,7 @@ bool app_write_REG_ENCODERS_RESET(void *a) } } - app_regs.REG_ENCODERS_RESET = reg; + app_regs.REG_ENCODER_RESET = reg; return true; } @@ -1796,7 +1783,7 @@ bool app_write_REG_ENABLE_SERIAL_TIMESTAMP(void *a) { uint8_t reg = *((uint8_t*)a); - if ((reg & B_EN_SRL_TSTAMP_PORT2) && !_states_.timestamp_tx.port2) + if ((reg & B_TIMESTAMP_PORT2) && !_states_.timestamp_tx.port2) { _states_.timestamp_tx.port2 = true; @@ -1815,7 +1802,7 @@ bool app_write_REG_ENABLE_SERIAL_TIMESTAMP(void *a) } - if (!(reg & B_EN_ENCODER_PORT2) && _states_.timestamp_tx.port2) + if (!(reg & B_ENCODER_PORT2) && _states_.timestamp_tx.port2) { _states_.timestamp_tx.port2 = false; @@ -1862,11 +1849,11 @@ ISR(USARTF1_DRE_vect, ISR_NAKED) /************************************************************************/ void update_DIO_to_mimic (unsigned char reg) { - if (reg & GM_MIMIC_DIO0) + if (reg & GM_MIMIC_OUTPUT_DIO0) io_pin2out(&PORTD, 4, OUT_IO_DIGITAL, IN_EN_IO_EN); // DIO0 to output - if (reg & GM_MIMIC_DIO0) + if (reg & GM_MIMIC_OUTPUT_DIO0) io_pin2out(&PORTE, 4, OUT_IO_DIGITAL, IN_EN_IO_EN); // DIO1 to output - if (reg & GM_MIMIC_DIO0) + if (reg & GM_MIMIC_OUTPUT_DIO0) io_pin2out(&PORTF, 4, OUT_IO_DIGITAL, IN_EN_IO_EN); // DIO2 to output } @@ -1966,12 +1953,12 @@ bool app_write_REG_RESERVED23(void *a) {return true;} void app_read_REG_RESERVED24(void) {} bool app_write_REG_RESERVED24(void *a) {return true;} /************************************************************************/ -/* REG_RESERVED25 */ +/* REG_POKE_INPUT_FILTER */ /************************************************************************/ -void app_read_REG_POKE_INPUT_FILTER_MS(void) {} -bool app_write_REG_POKE_INPUT_FILTER_MS(void *a) +void app_read_REG_POKE_INPUT_FILTER(void) {} +bool app_write_REG_POKE_INPUT_FILTER(void *a) { uint8_t reg = *((uint8_t*)a); - app_regs.REG_POKE_INPUT_FILTER_MS = reg; + app_regs.REG_POKE_INPUT_FILTER = reg; return true; } \ No newline at end of file diff --git a/Firmware/Behavior/app_funcs.h b/Firmware/Behavior/app_funcs.h index 5d57c95..4b65154 100644 --- a/Firmware/Behavior/app_funcs.h +++ b/Firmware/Behavior/app_funcs.h @@ -20,26 +20,26 @@ /************************************************************************/ /* Prototypes */ /************************************************************************/ -void app_read_REG_PORT_DIS(void); +void app_read_REG_DIGITAL_INPUT_STATE(void); void app_read_REG_RESERVED0(void); -void app_read_REG_OUTPUTS_SET(void); -void app_read_REG_OUTPUTS_CLEAR(void); -void app_read_REG_OUTPUTS_TOGGLE(void); -void app_read_REG_OUTPUTS_OUT(void); -void app_read_REG_PORT_DIOS_SET(void); -void app_read_REG_PORT_DIOS_CLEAR(void); -void app_read_REG_PORT_DIOS_TOGGLE(void); -void app_read_REG_PORT_DIOS_OUT(void); -void app_read_REG_PORT_DIOS_CONF(void); -void app_read_REG_PORT_DIOS_IN(void); -void app_read_REG_DATA(void); -void app_read_REG_OUTPUT_PULSE_EN(void); -void app_read_REG_PULSE_PORT0_DO(void); -void app_read_REG_PULSE_PORT1_DO(void); -void app_read_REG_PULSE_PORT2_DO(void); -void app_read_REG_PULSE_PORT0_12V(void); -void app_read_REG_PULSE_PORT1_12V(void); -void app_read_REG_PULSE_PORT2_12V(void); +void app_read_REG_OUTPUT_SET(void); +void app_read_REG_OUTPUT_CLEAR(void); +void app_read_REG_OUTPUT_TOGGLE(void); +void app_read_REG_OUTPUT_STATE(void); +void app_read_REG_PORT_DIO_SET(void); +void app_read_REG_PORT_DIO_CLEAR(void); +void app_read_REG_PORT_DIO_TOGGLE(void); +void app_read_REG_PORT_DIO_STATE(void); +void app_read_REG_PORT_DIO_DIRECTION(void); +void app_read_REG_PORT_DIO_STATE_EVENT(void); +void app_read_REG_ANALOG_DATA(void); +void app_read_REG_OUTPUT_PULSE_ENABLE(void); +void app_read_REG_PULSE_DO_PORT0(void); +void app_read_REG_PULSE_DO_PORT1(void); +void app_read_REG_PULSE_DO_PORT2(void); +void app_read_REG_PULSE_SUPPLY_PORT0(void); +void app_read_REG_PULSE_SUPPLY_PORT1(void); +void app_read_REG_PULSE_SUPPLY_PORT2(void); void app_read_REG_PULSE_LED0(void); void app_read_REG_PULSE_LED1(void); void app_read_REG_PULSE_RGB0(void); @@ -48,30 +48,30 @@ void app_read_REG_PULSE_DO0(void); void app_read_REG_PULSE_DO1(void); void app_read_REG_PULSE_DO2(void); void app_read_REG_PULSE_DO3(void); -void app_read_REG_FREQ_DO0(void); -void app_read_REG_FREQ_DO1(void); -void app_read_REG_FREQ_DO2(void); -void app_read_REG_FREQ_DO3(void); -void app_read_REG_DCYCLE_DO0(void); -void app_read_REG_DCYCLE_DO1(void); -void app_read_REG_DCYCLE_DO2(void); -void app_read_REG_DCYCLE_DO3(void); +void app_read_REG_PWM_FREQUENCY_DO0(void); +void app_read_REG_PWM_FREQUENCY_DO1(void); +void app_read_REG_PWM_FREQUENCY_DO2(void); +void app_read_REG_PWM_FREQUENCY_DO3(void); +void app_read_REG_PWM_DUTY_CYCLE_DO0(void); +void app_read_REG_PWM_DUTY_CYCLE_DO1(void); +void app_read_REG_PWM_DUTY_CYCLE_DO2(void); +void app_read_REG_PWM_DUTY_CYCLE_DO3(void); void app_read_REG_PWM_START(void); void app_read_REG_PWM_STOP(void); -void app_read_REG_RGBS(void); +void app_read_REG_RGB_ALL(void); void app_read_REG_RGB0(void); void app_read_REG_RGB1(void); void app_read_REG_LED0_CURRENT(void); void app_read_REG_LED1_CURRENT(void); void app_read_REG_LED0_MAX_CURRENT(void); void app_read_REG_LED1_MAX_CURRENT(void); -void app_read_REG_EVNT_ENABLE(void); +void app_read_REG_EVENT_ENABLE(void); void app_read_REG_START_CAMERAS(void); void app_read_REG_STOP_CAMERAS(void); -void app_read_REG_EN_SERVOS(void); -void app_read_REG_DIS_SERVOS(void); -void app_read_REG_EN_ENCODERS(void); -void app_read_REG_CONF_ENCODERS(void); +void app_read_REG_ENABLE_SERVOS(void); +void app_read_REG_DISABLE_SERVOS(void); +void app_read_REG_ENABLE_ENCODERS(void); +void app_read_REG_ENCODER_MODE(void); void app_read_REG_RESERVED2(void); void app_read_REG_RESERVED3(void); void app_read_REG_RESERVED4(void); @@ -80,23 +80,23 @@ void app_read_REG_RESERVED6(void); void app_read_REG_RESERVED7(void); void app_read_REG_RESERVED8(void); void app_read_REG_RESERVED9(void); -void app_read_REG_CAM_OUT0_FRAME_ACQUIRED(void); -void app_read_REG_CAM_OUT0_FREQ(void); -void app_read_REG_CAM_OUT1_FRAME_ACQUIRED(void); -void app_read_REG_CAM_OUT1_FREQ(void); +void app_read_REG_CAMERA0_FRAME(void); +void app_read_REG_CAMERA0_FREQUENCY(void); +void app_read_REG_CAMERA1_FRAME(void); +void app_read_REG_CAMERA1_FREQUENCY(void); void app_read_REG_RESERVED10(void); void app_read_REG_RESERVED11(void); void app_read_REG_RESERVED12(void); void app_read_REG_RESERVED13(void); -void app_read_REG_MOTOR_OUT2_PERIOD(void); -void app_read_REG_MOTOR_OUT2_PULSE(void); -void app_read_REG_MOTOR_OUT3_PERIOD(void); -void app_read_REG_MOTOR_OUT3_PULSE(void); +void app_read_REG_SERVO_MOTOR2_PERIOD(void); +void app_read_REG_SERVO_MOTOR2_PULSE(void); +void app_read_REG_SERVO_MOTOR3_PERIOD(void); +void app_read_REG_SERVO_MOTOR3_PULSE(void); void app_read_REG_RESERVED14(void); void app_read_REG_RESERVED15(void); void app_read_REG_RESERVED16(void); void app_read_REG_RESERVED17(void); -void app_read_REG_ENCODERS_RESET(void); +void app_read_REG_ENCODER_RESET(void); void app_read_REG_RESERVED18(void); void app_read_REG_ENABLE_SERIAL_TIMESTAMP(void); void app_read_REG_MIMIC_PORT0_IR(void); @@ -110,29 +110,28 @@ void app_read_REG_MIMIC_PORT1_VALVE(void); void app_read_REG_MIMIC_PORT2_VALVE(void); void app_read_REG_RESERVED23(void); void app_read_REG_RESERVED24(void); -void app_read_REG_POKE_INPUT_FILTER_MS(void); +void app_read_REG_POKE_INPUT_FILTER(void); - -bool app_write_REG_PORT_DIS(void *a); +bool app_write_REG_DIGITAL_INPUT_STATE(void *a); bool app_write_REG_RESERVED0(void *a); -bool app_write_REG_OUTPUTS_SET(void *a); -bool app_write_REG_OUTPUTS_CLEAR(void *a); -bool app_write_REG_OUTPUTS_TOGGLE(void *a); -bool app_write_REG_OUTPUTS_OUT(void *a); -bool app_write_REG_PORT_DIOS_SET(void *a); -bool app_write_REG_PORT_DIOS_CLEAR(void *a); -bool app_write_REG_PORT_DIOS_TOGGLE(void *a); -bool app_write_REG_PORT_DIOS_OUT(void *a); -bool app_write_REG_PORT_DIOS_CONF(void *a); -bool app_write_REG_PORT_DIOS_IN(void *a); -bool app_write_REG_DATA(void *a); -bool app_write_REG_OUTPUT_PULSE_EN(void *a); -bool app_write_REG_PULSE_PORT0_DO(void *a); -bool app_write_REG_PULSE_PORT1_DO(void *a); -bool app_write_REG_PULSE_PORT2_DO(void *a); -bool app_write_REG_PULSE_PORT0_12V(void *a); -bool app_write_REG_PULSE_PORT1_12V(void *a); -bool app_write_REG_PULSE_PORT2_12V(void *a); +bool app_write_REG_OUTPUT_SET(void *a); +bool app_write_REG_OUTPUT_CLEAR(void *a); +bool app_write_REG_OUTPUT_TOGGLE(void *a); +bool app_write_REG_OUTPUT_STATE(void *a); +bool app_write_REG_PORT_DIO_SET(void *a); +bool app_write_REG_PORT_DIO_CLEAR(void *a); +bool app_write_REG_PORT_DIO_TOGGLE(void *a); +bool app_write_REG_PORT_DIO_STATE(void *a); +bool app_write_REG_PORT_DIO_DIRECTION(void *a); +bool app_write_REG_PORT_DIO_STATE_EVENT(void *a); +bool app_write_REG_ANALOG_DATA(void *a); +bool app_write_REG_OUTPUT_PULSE_ENABLE(void *a); +bool app_write_REG_PULSE_DO_PORT0(void *a); +bool app_write_REG_PULSE_DO_PORT1(void *a); +bool app_write_REG_PULSE_DO_PORT2(void *a); +bool app_write_REG_PULSE_SUPPLY_PORT0(void *a); +bool app_write_REG_PULSE_SUPPLY_PORT1(void *a); +bool app_write_REG_PULSE_SUPPLY_PORT2(void *a); bool app_write_REG_PULSE_LED0(void *a); bool app_write_REG_PULSE_LED1(void *a); bool app_write_REG_PULSE_RGB0(void *a); @@ -141,30 +140,30 @@ bool app_write_REG_PULSE_DO0(void *a); bool app_write_REG_PULSE_DO1(void *a); bool app_write_REG_PULSE_DO2(void *a); bool app_write_REG_PULSE_DO3(void *a); -bool app_write_REG_FREQ_DO0(void *a); -bool app_write_REG_FREQ_DO1(void *a); -bool app_write_REG_FREQ_DO2(void *a); -bool app_write_REG_FREQ_DO3(void *a); -bool app_write_REG_DCYCLE_DO0(void *a); -bool app_write_REG_DCYCLE_DO1(void *a); -bool app_write_REG_DCYCLE_DO2(void *a); -bool app_write_REG_DCYCLE_DO3(void *a); +bool app_write_REG_PWM_FREQUENCY_DO0(void *a); +bool app_write_REG_PWM_FREQUENCY_DO1(void *a); +bool app_write_REG_PWM_FREQUENCY_DO2(void *a); +bool app_write_REG_PWM_FREQUENCY_DO3(void *a); +bool app_write_REG_PWM_DUTY_CYCLE_DO0(void *a); +bool app_write_REG_PWM_DUTY_CYCLE_DO1(void *a); +bool app_write_REG_PWM_DUTY_CYCLE_DO2(void *a); +bool app_write_REG_PWM_DUTY_CYCLE_DO3(void *a); bool app_write_REG_PWM_START(void *a); bool app_write_REG_PWM_STOP(void *a); -bool app_write_REG_RGBS(void *a); +bool app_write_REG_RGB_ALL(void *a); bool app_write_REG_RGB0(void *a); bool app_write_REG_RGB1(void *a); bool app_write_REG_LED0_CURRENT(void *a); bool app_write_REG_LED1_CURRENT(void *a); bool app_write_REG_LED0_MAX_CURRENT(void *a); bool app_write_REG_LED1_MAX_CURRENT(void *a); -bool app_write_REG_EVNT_ENABLE(void *a); +bool app_write_REG_EVENT_ENABLE(void *a); bool app_write_REG_START_CAMERAS(void *a); bool app_write_REG_STOP_CAMERAS(void *a); -bool app_write_REG_EN_SERVOS(void *a); -bool app_write_REG_DIS_SERVOS(void *a); -bool app_write_REG_EN_ENCODERS(void *a); -bool app_write_REG_CONF_ENCODERS(void *a); +bool app_write_REG_ENABLE_SERVOS(void *a); +bool app_write_REG_DISABLE_SERVOS(void *a); +bool app_write_REG_ENABLE_ENCODERS(void *a); +bool app_write_REG_ENCODER_MODE(void *a); bool app_write_REG_RESERVED2(void *a); bool app_write_REG_RESERVED3(void *a); bool app_write_REG_RESERVED4(void *a); @@ -173,23 +172,23 @@ bool app_write_REG_RESERVED6(void *a); bool app_write_REG_RESERVED7(void *a); bool app_write_REG_RESERVED8(void *a); bool app_write_REG_RESERVED9(void *a); -bool app_write_REG_CAM_OUT0_FRAME_ACQUIRED(void *a); -bool app_write_REG_CAM_OUT0_FREQ(void *a); -bool app_write_REG_CAM_OUT1_FRAME_ACQUIRED(void *a); -bool app_write_REG_CAM_OUT1_FREQ(void *a); +bool app_write_REG_CAMERA0_FRAME(void *a); +bool app_write_REG_CAMERA0_FREQUENCY(void *a); +bool app_write_REG_CAMERA1_FRAME(void *a); +bool app_write_REG_CAMERA1_FREQUENCY(void *a); bool app_write_REG_RESERVED10(void *a); bool app_write_REG_RESERVED11(void *a); bool app_write_REG_RESERVED12(void *a); bool app_write_REG_RESERVED13(void *a); -bool app_write_REG_MOTOR_OUT2_PERIOD(void *a); -bool app_write_REG_MOTOR_OUT2_PULSE(void *a); -bool app_write_REG_MOTOR_OUT3_PERIOD(void *a); -bool app_write_REG_MOTOR_OUT3_PULSE(void *a); +bool app_write_REG_SERVO_MOTOR2_PERIOD(void *a); +bool app_write_REG_SERVO_MOTOR2_PULSE(void *a); +bool app_write_REG_SERVO_MOTOR3_PERIOD(void *a); +bool app_write_REG_SERVO_MOTOR3_PULSE(void *a); bool app_write_REG_RESERVED14(void *a); bool app_write_REG_RESERVED15(void *a); bool app_write_REG_RESERVED16(void *a); bool app_write_REG_RESERVED17(void *a); -bool app_write_REG_ENCODERS_RESET(void *a); +bool app_write_REG_ENCODER_RESET(void *a); bool app_write_REG_RESERVED18(void *a); bool app_write_REG_ENABLE_SERIAL_TIMESTAMP(void *a); bool app_write_REG_MIMIC_PORT0_IR(void *a); @@ -203,7 +202,7 @@ bool app_write_REG_MIMIC_PORT1_VALVE(void *a); bool app_write_REG_MIMIC_PORT2_VALVE(void *a); bool app_write_REG_RESERVED23(void *a); bool app_write_REG_RESERVED24(void *a); -bool app_write_REG_POKE_INPUT_FILTER_MS(void *a); +bool app_write_REG_POKE_INPUT_FILTER(void *a); #endif /* _APP_FUNCTIONS_H_ */ \ No newline at end of file diff --git a/Firmware/Behavior/app_ios_and_regs.c b/Firmware/Behavior/app_ios_and_regs.c index 559c824..821c4d9 100644 --- a/Firmware/Behavior/app_ios_and_regs.c +++ b/Firmware/Behavior/app_ios_and_regs.c @@ -6,17 +6,17 @@ extern AppRegs app_regs; void mimic_ir_or_valve (uint8_t reg, uint8_t what_to_do) { - if (reg & MSK_MIMIC) + if (reg & MSK_MIMIC_OUTPUT_SEL) { switch (reg) { - case GM_MIMIC_DO0: if (what_to_do == _SET_IO_) set_DO0; if (what_to_do == _CLR_IO_) clr_DO0; if (what_to_do == _TGL_IO_) tgl_DO0; break; - case GM_MIMIC_DO1: if (what_to_do == _SET_IO_) set_DO1; if (what_to_do == _CLR_IO_) clr_DO1; if (what_to_do == _TGL_IO_) tgl_DO1; break; - case GM_MIMIC_DO2: if (what_to_do == _SET_IO_) set_DO2; if (what_to_do == _CLR_IO_) clr_DO2; if (what_to_do == _TGL_IO_) tgl_DO2; break; - case GM_MIMIC_DO3: if (what_to_do == _SET_IO_) set_DO3; if (what_to_do == _CLR_IO_) clr_DO3; if (what_to_do == _TGL_IO_) tgl_DO3; break; - case GM_MIMIC_DIO0: if (what_to_do == _SET_IO_) set_io(PORTD, 5); if (what_to_do == _CLR_IO_) clear_io(PORTD, 5); if (what_to_do == _TGL_IO_) toggle_io(PORTD, 5); break; - case GM_MIMIC_DIO1: if (what_to_do == _SET_IO_) set_io(PORTE, 5); if (what_to_do == _CLR_IO_) clear_io(PORTE, 5); if (what_to_do == _TGL_IO_) toggle_io(PORTE, 5); break; - case GM_MIMIC_DIO2: if (what_to_do == _SET_IO_) set_io(PORTF, 5); if (what_to_do == _CLR_IO_) clear_io(PORTF, 5); if (what_to_do == _TGL_IO_) toggle_io(PORTF, 5); break; + case GM_MIMIC_OUTPUT_DO0: if (what_to_do == _SET_IO_) set_DO0; if (what_to_do == _CLR_IO_) clr_DO0; if (what_to_do == _TGL_IO_) tgl_DO0; break; + case GM_MIMIC_OUTPUT_DO1: if (what_to_do == _SET_IO_) set_DO1; if (what_to_do == _CLR_IO_) clr_DO1; if (what_to_do == _TGL_IO_) tgl_DO1; break; + case GM_MIMIC_OUTPUT_DO2: if (what_to_do == _SET_IO_) set_DO2; if (what_to_do == _CLR_IO_) clr_DO2; if (what_to_do == _TGL_IO_) tgl_DO2; break; + case GM_MIMIC_OUTPUT_DO3: if (what_to_do == _SET_IO_) set_DO3; if (what_to_do == _CLR_IO_) clr_DO3; if (what_to_do == _TGL_IO_) tgl_DO3; break; + case GM_MIMIC_OUTPUT_DIO0: if (what_to_do == _SET_IO_) set_io(PORTD, 5); if (what_to_do == _CLR_IO_) clear_io(PORTD, 5); if (what_to_do == _TGL_IO_) toggle_io(PORTD, 5); break; + case GM_MIMIC_OUTPUT_DIO1: if (what_to_do == _SET_IO_) set_io(PORTE, 5); if (what_to_do == _CLR_IO_) clear_io(PORTE, 5); if (what_to_do == _TGL_IO_) toggle_io(PORTE, 5); break; + case GM_MIMIC_OUTPUT_DIO2: if (what_to_do == _SET_IO_) set_io(PORTF, 5); if (what_to_do == _CLR_IO_) clear_io(PORTF, 5); if (what_to_do == _TGL_IO_) toggle_io(PORTF, 5); break; } } } @@ -26,7 +26,8 @@ void mimic_ir_or_valve (uint8_t reg, uint8_t what_to_do) /* Configure and initialize IOs */ /************************************************************************/ void init_ios(void) -{ /* Configure input pins */ +{ + /* Configure input pins */ io_pin2in(&PORTD, 4, PULL_IO_UP, SENSE_IO_EDGES_BOTH); // POKE0_IR io_pin2in(&PORTD, 5, PULL_IO_UP, SENSE_IO_EDGES_BOTH); // POKE0_IO io_pin2in(&PORTE, 4, PULL_IO_UP, SENSE_IO_EDGES_BOTH); // POKE1_IR @@ -269,26 +270,26 @@ uint16_t app_regs_n_elements[] = { }; uint8_t *app_regs_pointer[] = { - (uint8_t*)(&app_regs.REG_PORT_DIS), + (uint8_t*)(&app_regs.REG_DIGITAL_INPUT_STATE), (uint8_t*)(&app_regs.REG_RESERVED0), - (uint8_t*)(&app_regs.REG_OUTPUTS_SET), - (uint8_t*)(&app_regs.REG_OUTPUTS_CLEAR), - (uint8_t*)(&app_regs.REG_OUTPUTS_TOGGLE), - (uint8_t*)(&app_regs.REG_OUTPUTS_OUT), - (uint8_t*)(&app_regs.REG_PORT_DIOS_SET), - (uint8_t*)(&app_regs.REG_PORT_DIOS_CLEAR), - (uint8_t*)(&app_regs.REG_PORT_DIOS_TOGGLE), - (uint8_t*)(&app_regs.REG_PORT_DIOS_OUT), - (uint8_t*)(&app_regs.REG_PORT_DIOS_CONF), - (uint8_t*)(&app_regs.REG_PORT_DIOS_IN), - (uint8_t*)(app_regs.REG_DATA), - (uint8_t*)(&app_regs.REG_OUTPUT_PULSE_EN), - (uint8_t*)(&app_regs.REG_PULSE_PORT0_DO), - (uint8_t*)(&app_regs.REG_PULSE_PORT1_DO), - (uint8_t*)(&app_regs.REG_PULSE_PORT2_DO), - (uint8_t*)(&app_regs.REG_PULSE_PORT0_12V), - (uint8_t*)(&app_regs.REG_PULSE_PORT1_12V), - (uint8_t*)(&app_regs.REG_PULSE_PORT2_12V), + (uint8_t*)(&app_regs.REG_OUTPUT_SET), + (uint8_t*)(&app_regs.REG_OUTPUT_CLEAR), + (uint8_t*)(&app_regs.REG_OUTPUT_TOGGLE), + (uint8_t*)(&app_regs.REG_OUTPUT_STATE), + (uint8_t*)(&app_regs.REG_PORT_DIO_SET), + (uint8_t*)(&app_regs.REG_PORT_DIO_CLEAR), + (uint8_t*)(&app_regs.REG_PORT_DIO_TOGGLE), + (uint8_t*)(&app_regs.REG_PORT_DIO_STATE), + (uint8_t*)(&app_regs.REG_PORT_DIO_DIRECTION), + (uint8_t*)(&app_regs.REG_PORT_DIO_STATE_EVENT), + (uint8_t*)(&app_regs.REG_ANALOG_DATA), + (uint8_t*)(&app_regs.REG_OUTPUT_PULSE_ENABLE), + (uint8_t*)(&app_regs.REG_PULSE_DO_PORT0), + (uint8_t*)(&app_regs.REG_PULSE_DO_PORT1), + (uint8_t*)(&app_regs.REG_PULSE_DO_PORT2), + (uint8_t*)(&app_regs.REG_PULSE_SUPPLY_PORT0), + (uint8_t*)(&app_regs.REG_PULSE_SUPPLY_PORT1), + (uint8_t*)(&app_regs.REG_PULSE_SUPPLY_PORT2), (uint8_t*)(&app_regs.REG_PULSE_LED0), (uint8_t*)(&app_regs.REG_PULSE_LED1), (uint8_t*)(&app_regs.REG_PULSE_RGB0), @@ -297,30 +298,30 @@ uint8_t *app_regs_pointer[] = { (uint8_t*)(&app_regs.REG_PULSE_DO1), (uint8_t*)(&app_regs.REG_PULSE_DO2), (uint8_t*)(&app_regs.REG_PULSE_DO3), - (uint8_t*)(&app_regs.REG_FREQ_DO0), - (uint8_t*)(&app_regs.REG_FREQ_DO1), - (uint8_t*)(&app_regs.REG_FREQ_DO2), - (uint8_t*)(&app_regs.REG_FREQ_DO3), - (uint8_t*)(&app_regs.REG_DCYCLE_DO0), - (uint8_t*)(&app_regs.REG_DCYCLE_DO1), - (uint8_t*)(&app_regs.REG_DCYCLE_DO2), - (uint8_t*)(&app_regs.REG_DCYCLE_DO3), + (uint8_t*)(&app_regs.REG_PWM_FREQUENCY_DO0), + (uint8_t*)(&app_regs.REG_PWM_FREQUENCY_DO1), + (uint8_t*)(&app_regs.REG_PWM_FREQUENCY_DO2), + (uint8_t*)(&app_regs.REG_PWM_FREQUENCY_DO3), + (uint8_t*)(&app_regs.REG_PWM_DUTY_CYCLE_DO0), + (uint8_t*)(&app_regs.REG_PWM_DUTY_CYCLE_DO1), + (uint8_t*)(&app_regs.REG_PWM_DUTY_CYCLE_DO2), + (uint8_t*)(&app_regs.REG_PWM_DUTY_CYCLE_DO3), (uint8_t*)(&app_regs.REG_PWM_START), (uint8_t*)(&app_regs.REG_PWM_STOP), - (uint8_t*)(app_regs.REG_RGBS), - (uint8_t*)(app_regs.REG_RGB0), - (uint8_t*)(app_regs.REG_RGB1), + (uint8_t*)(&app_regs.REG_RGB_ALL), + (uint8_t*)(&app_regs.REG_RGB0), + (uint8_t*)(&app_regs.REG_RGB1), (uint8_t*)(&app_regs.REG_LED0_CURRENT), (uint8_t*)(&app_regs.REG_LED1_CURRENT), (uint8_t*)(&app_regs.REG_LED0_MAX_CURRENT), (uint8_t*)(&app_regs.REG_LED1_MAX_CURRENT), - (uint8_t*)(&app_regs.REG_EVNT_ENABLE), + (uint8_t*)(&app_regs.REG_EVENT_ENABLE), (uint8_t*)(&app_regs.REG_START_CAMERAS), (uint8_t*)(&app_regs.REG_STOP_CAMERAS), - (uint8_t*)(&app_regs.REG_EN_SERVOS), - (uint8_t*)(&app_regs.REG_DIS_SERVOS), - (uint8_t*)(&app_regs.REG_EN_ENCODERS), - (uint8_t*)(&app_regs.REG_CONF_ENCODERS), + (uint8_t*)(&app_regs.REG_ENABLE_SERVOS), + (uint8_t*)(&app_regs.REG_DISABLE_SERVOS), + (uint8_t*)(&app_regs.REG_ENABLE_ENCODERS), + (uint8_t*)(&app_regs.REG_ENCODER_MODE), (uint8_t*)(&app_regs.REG_RESERVED2), (uint8_t*)(&app_regs.REG_RESERVED3), (uint8_t*)(&app_regs.REG_RESERVED4), @@ -329,23 +330,23 @@ uint8_t *app_regs_pointer[] = { (uint8_t*)(&app_regs.REG_RESERVED7), (uint8_t*)(&app_regs.REG_RESERVED8), (uint8_t*)(&app_regs.REG_RESERVED9), - (uint8_t*)(&app_regs.REG_CAM_OUT0_FRAME_ACQUIRED), - (uint8_t*)(&app_regs.REG_CAM_OUT0_FREQ), - (uint8_t*)(&app_regs.REG_CAM_OUT1_FRAME_ACQUIRED), - (uint8_t*)(&app_regs.REG_CAM_OUT1_FREQ), + (uint8_t*)(&app_regs.REG_CAMERA0_FRAME), + (uint8_t*)(&app_regs.REG_CAMERA0_FREQUENCY), + (uint8_t*)(&app_regs.REG_CAMERA1_FRAME), + (uint8_t*)(&app_regs.REG_CAMERA1_FREQUENCY), (uint8_t*)(&app_regs.REG_RESERVED10), (uint8_t*)(&app_regs.REG_RESERVED11), (uint8_t*)(&app_regs.REG_RESERVED12), (uint8_t*)(&app_regs.REG_RESERVED13), - (uint8_t*)(&app_regs.REG_MOTOR_OUT2_PERIOD), - (uint8_t*)(&app_regs.REG_MOTOR_OUT2_PULSE), - (uint8_t*)(&app_regs.REG_MOTOR_OUT3_PERIOD), - (uint8_t*)(&app_regs.REG_MOTOR_OUT3_PULSE), + (uint8_t*)(&app_regs.REG_SERVO_MOTOR2_PERIOD), + (uint8_t*)(&app_regs.REG_SERVO_MOTOR2_PULSE), + (uint8_t*)(&app_regs.REG_SERVO_MOTOR3_PERIOD), + (uint8_t*)(&app_regs.REG_SERVO_MOTOR3_PULSE), (uint8_t*)(&app_regs.REG_RESERVED14), (uint8_t*)(&app_regs.REG_RESERVED15), (uint8_t*)(&app_regs.REG_RESERVED16), (uint8_t*)(&app_regs.REG_RESERVED17), - (uint8_t*)(&app_regs.REG_ENCODERS_RESET), + (uint8_t*)(&app_regs.REG_ENCODER_RESET), (uint8_t*)(&app_regs.REG_RESERVED18), (uint8_t*)(&app_regs.REG_ENABLE_SERIAL_TIMESTAMP), (uint8_t*)(&app_regs.REG_MIMIC_PORT0_IR), @@ -359,5 +360,5 @@ uint8_t *app_regs_pointer[] = { (uint8_t*)(&app_regs.REG_MIMIC_PORT2_VALVE), (uint8_t*)(&app_regs.REG_RESERVED23), (uint8_t*)(&app_regs.REG_RESERVED24), - (uint8_t*)(&app_regs.REG_POKE_INPUT_FILTER_MS) + (uint8_t*)(&app_regs.REG_POKE_INPUT_FILTER) }; \ No newline at end of file diff --git a/Firmware/Behavior/app_ios_and_regs.h b/Firmware/Behavior/app_ios_and_regs.h index 2fcd64c..1f5cfaf 100644 --- a/Firmware/Behavior/app_ios_and_regs.h +++ b/Firmware/Behavior/app_ios_and_regs.h @@ -12,38 +12,40 @@ void mimic_ir_or_valve (uint8_t reg, uint8_t what_t_do); /************************************************************************/ /* Definition of input pins */ /************************************************************************/ -// POKE0_IR Description: Poke 0 infrared -// POKE0_IO Description: Poke 0 DIO -// POKE1_IR Description: Poke 1 infrared -// POKE1_IO Description: Poke 1 DIO -// POKE2_IR Description: Poke 2 infrared -// POKE2_IO Description: Poke 2 DIO +// POKE0_IR Description: Poke 0 infrared +// POKE0_IO Description: Poke 0 DIO +// POKE1_IR Description: Poke 1 infrared +// POKE1_IO Description: Poke 1 DIO +// POKE2_IR Description: Poke 2 infrared +// POKE2_IO Description: Poke 2 DIO +// ADC1_AVAILABLE Description: ADC1 is available on hardware +// DI3 Description: Input DI3 -#define read_POKE0_IR read_io(PORTD, 4) // POKE0_IR -#define read_POKE0_IO read_io(PORTD, 5) // POKE0_IO -#define read_POKE1_IR read_io(PORTE, 4) // POKE1_IR -#define read_POKE1_IO read_io(PORTE, 5) // POKE1_IO -#define read_POKE2_IR read_io(PORTF, 4) // POKE2_IR -#define read_POKE2_IO read_io(PORTF, 5) // POKE2_IO -#define read_ADC1_AVAILABLE read_io(PORTJ, 0) // ADC1_AVAILABLE -#define read_DI3 read_io(PORTH, 0) // DI3 +#define read_POKE0_IR read_io(PORTD, 4) // POKE0_IR +#define read_POKE0_IO read_io(PORTD, 5) // POKE0_IO +#define read_POKE1_IR read_io(PORTE, 4) // POKE1_IR +#define read_POKE1_IO read_io(PORTE, 5) // POKE1_IO +#define read_POKE2_IR read_io(PORTF, 4) // POKE2_IR +#define read_POKE2_IO read_io(PORTF, 5) // POKE2_IO +#define read_ADC1_AVAILABLE read_io(PORTJ, 0) // ADC1_AVAILABLE +#define read_DI3 read_io(PORTH, 0) // DI3 /************************************************************************/ /* Definition of output pins */ /************************************************************************/ -// DO3 Description: Output DO0 -// DO2 Description: Output DO1 -// DO1 Description: Output DO2 -// DO0 Description: Output DO3 -// LED0 Description: Output LED0 -// LED1 Description: Output LED1 -// RGBS Description: One wire LEDs -// POKE0_LED Description: Poke 0 digital output -// POKE0_VALVE Description: Poke 0 Valve -// POKE1_LED Description: Poke 1 digital output -// POKE1_VALVE Description: Poke 1 Valve -// POKE2_LED Description: Poke 2 digital output -// POKE2_VALVE Description: Poke 2 Valve +// DO3 Description: Output DO0 +// DO2 Description: Output DO1 +// DO1 Description: Output DO2 +// DO0 Description: Output DO3 +// LED0 Description: Output LED0 +// LED1 Description: Output LED1 +// RGBS Description: One wire LEDs +// POKE0_LED Description: Poke 0 digital output +// POKE0_VALVE Description: Poke 0 Valve +// POKE1_LED Description: Poke 1 digital output +// POKE1_VALVE Description: Poke 1 Valve +// POKE2_LED Description: Poke 2 digital output +// POKE2_VALVE Description: Poke 2 Valve /* DO3 */ #define set_DO3 set_io(PORTC, 0) @@ -129,26 +131,26 @@ void mimic_ir_or_valve (uint8_t reg, uint8_t what_t_do); /************************************************************************/ typedef struct { - uint8_t REG_PORT_DIS; + uint8_t REG_DIGITAL_INPUT_STATE; uint8_t REG_RESERVED0; - uint16_t REG_OUTPUTS_SET; - uint16_t REG_OUTPUTS_CLEAR; - uint16_t REG_OUTPUTS_TOGGLE; - uint16_t REG_OUTPUTS_OUT; - uint8_t REG_PORT_DIOS_SET; - uint8_t REG_PORT_DIOS_CLEAR; - uint8_t REG_PORT_DIOS_TOGGLE; - uint8_t REG_PORT_DIOS_OUT; - uint8_t REG_PORT_DIOS_CONF; - uint8_t REG_PORT_DIOS_IN; - int16_t REG_DATA[3]; - uint16_t REG_OUTPUT_PULSE_EN; - uint16_t REG_PULSE_PORT0_DO; - uint16_t REG_PULSE_PORT1_DO; - uint16_t REG_PULSE_PORT2_DO; - uint16_t REG_PULSE_PORT0_12V; - uint16_t REG_PULSE_PORT1_12V; - uint16_t REG_PULSE_PORT2_12V; + uint16_t REG_OUTPUT_SET; + uint16_t REG_OUTPUT_CLEAR; + uint16_t REG_OUTPUT_TOGGLE; + uint16_t REG_OUTPUT_STATE; + uint8_t REG_PORT_DIO_SET; + uint8_t REG_PORT_DIO_CLEAR; + uint8_t REG_PORT_DIO_TOGGLE; + uint8_t REG_PORT_DIO_STATE; + uint8_t REG_PORT_DIO_DIRECTION; + uint8_t REG_PORT_DIO_STATE_EVENT; + int16_t REG_ANALOG_DATA[3]; + uint16_t REG_OUTPUT_PULSE_ENABLE; + uint16_t REG_PULSE_DO_PORT0; + uint16_t REG_PULSE_DO_PORT1; + uint16_t REG_PULSE_DO_PORT2; + uint16_t REG_PULSE_SUPPLY_PORT0; + uint16_t REG_PULSE_SUPPLY_PORT1; + uint16_t REG_PULSE_SUPPLY_PORT2; uint16_t REG_PULSE_LED0; uint16_t REG_PULSE_LED1; uint16_t REG_PULSE_RGB0; @@ -157,30 +159,30 @@ typedef struct uint16_t REG_PULSE_DO1; uint16_t REG_PULSE_DO2; uint16_t REG_PULSE_DO3; - uint16_t REG_FREQ_DO0; - uint16_t REG_FREQ_DO1; - uint16_t REG_FREQ_DO2; - uint16_t REG_FREQ_DO3; - uint8_t REG_DCYCLE_DO0; - uint8_t REG_DCYCLE_DO1; - uint8_t REG_DCYCLE_DO2; - uint8_t REG_DCYCLE_DO3; + uint16_t REG_PWM_FREQUENCY_DO0; + uint16_t REG_PWM_FREQUENCY_DO1; + uint16_t REG_PWM_FREQUENCY_DO2; + uint16_t REG_PWM_FREQUENCY_DO3; + uint8_t REG_PWM_DUTY_CYCLE_DO0; + uint8_t REG_PWM_DUTY_CYCLE_DO1; + uint8_t REG_PWM_DUTY_CYCLE_DO2; + uint8_t REG_PWM_DUTY_CYCLE_DO3; uint8_t REG_PWM_START; uint8_t REG_PWM_STOP; - uint8_t REG_RGBS[6]; + uint8_t REG_RGB_ALL[6]; uint8_t REG_RGB0[3]; uint8_t REG_RGB1[3]; uint8_t REG_LED0_CURRENT; uint8_t REG_LED1_CURRENT; uint8_t REG_LED0_MAX_CURRENT; uint8_t REG_LED1_MAX_CURRENT; - uint8_t REG_EVNT_ENABLE; + uint8_t REG_EVENT_ENABLE; uint8_t REG_START_CAMERAS; uint8_t REG_STOP_CAMERAS; - uint8_t REG_EN_SERVOS; - uint8_t REG_DIS_SERVOS; - uint8_t REG_EN_ENCODERS; - uint8_t REG_CONF_ENCODERS; + uint8_t REG_ENABLE_SERVOS; + uint8_t REG_DISABLE_SERVOS; + uint8_t REG_ENABLE_ENCODERS; + uint8_t REG_ENCODER_MODE; uint8_t REG_RESERVED2; uint8_t REG_RESERVED3; uint8_t REG_RESERVED4; @@ -189,23 +191,23 @@ typedef struct uint8_t REG_RESERVED7; uint8_t REG_RESERVED8; uint8_t REG_RESERVED9; - uint8_t REG_CAM_OUT0_FRAME_ACQUIRED; - uint16_t REG_CAM_OUT0_FREQ; - uint8_t REG_CAM_OUT1_FRAME_ACQUIRED; - uint16_t REG_CAM_OUT1_FREQ; + uint8_t REG_CAMERA0_FRAME; + uint16_t REG_CAMERA0_FREQUENCY; + uint8_t REG_CAMERA1_FRAME; + uint16_t REG_CAMERA1_FREQUENCY; uint8_t REG_RESERVED10; uint8_t REG_RESERVED11; uint8_t REG_RESERVED12; uint8_t REG_RESERVED13; - uint16_t REG_MOTOR_OUT2_PERIOD; - uint16_t REG_MOTOR_OUT2_PULSE; - uint16_t REG_MOTOR_OUT3_PERIOD; - uint16_t REG_MOTOR_OUT3_PULSE; + uint16_t REG_SERVO_MOTOR2_PERIOD; + uint16_t REG_SERVO_MOTOR2_PULSE; + uint16_t REG_SERVO_MOTOR3_PERIOD; + uint16_t REG_SERVO_MOTOR3_PULSE; uint8_t REG_RESERVED14; uint8_t REG_RESERVED15; uint8_t REG_RESERVED16; uint8_t REG_RESERVED17; - uint8_t REG_ENCODERS_RESET; + uint8_t REG_ENCODER_RESET; uint8_t REG_RESERVED18; uint8_t REG_ENABLE_SERIAL_TIMESTAMP; uint8_t REG_MIMIC_PORT0_IR; @@ -219,107 +221,107 @@ typedef struct uint8_t REG_MIMIC_PORT2_VALVE; uint8_t REG_RESERVED23; uint8_t REG_RESERVED24; - uint8_t REG_POKE_INPUT_FILTER_MS; + uint8_t REG_POKE_INPUT_FILTER; } AppRegs; /************************************************************************/ /* Registers' address */ /************************************************************************/ /* Registers */ -#define ADD_REG_PORT_DIS 32 // U8 Reflects the state of DI digital lines of each Port -#define ADD_REG_RESERVED0 33 // U8 Reserved for future use -#define ADD_REG_OUTPUTS_SET 34 // U16 Set the correspondent output -#define ADD_REG_OUTPUTS_CLEAR 35 // U16 Clear the correspondent output -#define ADD_REG_OUTPUTS_TOGGLE 36 // U16 Toggle the correspondent output -#define ADD_REG_OUTPUTS_OUT 37 // U16 Control the correspondent output -#define ADD_REG_PORT_DIOS_SET 38 // U8 Set the correspondent DIO -#define ADD_REG_PORT_DIOS_CLEAR 39 // U8 Clear the correspondent DIO -#define ADD_REG_PORT_DIOS_TOGGLE 40 // U8 Toggle the correspondent DIO -#define ADD_REG_PORT_DIOS_OUT 41 // U8 Control the correspondent DIO -#define ADD_REG_PORT_DIOS_CONF 42 // U8 Set the DIOs direction (1 is output) -#define ADD_REG_PORT_DIOS_IN 43 // U8 State of the DIOs -#define ADD_REG_DATA 44 // I16 Voltage at ADC input and decoder (poke 2) value -#define ADD_REG_OUTPUT_PULSE_EN 45 // U16 Enable the output pulse for the selected output -#define ADD_REG_PULSE_PORT0_DO 46 // U16 Configuration of the output pulse [1 : 65535] -#define ADD_REG_PULSE_PORT1_DO 47 // U16 -#define ADD_REG_PULSE_PORT2_DO 48 // U16 -#define ADD_REG_PULSE_PORT0_12V 49 // U16 -#define ADD_REG_PULSE_PORT1_12V 50 // U16 -#define ADD_REG_PULSE_PORT2_12V 51 // U16 -#define ADD_REG_PULSE_LED0 52 // U16 -#define ADD_REG_PULSE_LED1 53 // U16 -#define ADD_REG_PULSE_RGB0 54 // U16 -#define ADD_REG_PULSE_RGB1 55 // U16 -#define ADD_REG_PULSE_DO0 56 // U16 -#define ADD_REG_PULSE_DO1 57 // U16 -#define ADD_REG_PULSE_DO2 58 // U16 -#define ADD_REG_PULSE_DO3 59 // U16 -#define ADD_REG_FREQ_DO0 60 // U16 Frequency of the output [1 : TBD] -#define ADD_REG_FREQ_DO1 61 // U16 -#define ADD_REG_FREQ_DO2 62 // U16 -#define ADD_REG_FREQ_DO3 63 // U16 -#define ADD_REG_DCYCLE_DO0 64 // U8 Dutycycle of the output [1 : 99] -#define ADD_REG_DCYCLE_DO1 65 // U8 -#define ADD_REG_DCYCLE_DO2 66 // U8 -#define ADD_REG_DCYCLE_DO3 67 // U8 -#define ADD_REG_PWM_START 68 // U8 Start the PWM output on the selected output -#define ADD_REG_PWM_STOP 69 // U8 Stop the PWM output on the selected output -#define ADD_REG_RGBS 70 // U8 [RGB0 Green] [RGB0 Red] [RGB0 Blue] [RGB1 Green] [RGB1 Red] [RGB1 Blue] -#define ADD_REG_RGB0 71 // U8 [RGB0 Green] [RGB0 Red] [RGB0 Blue] -#define ADD_REG_RGB1 72 // U8 [RGB1 Green] [RGB1 Red] [RGB1 Blue] -#define ADD_REG_LED0_CURRENT 73 // U8 Configuration of current to drive LED 0 [2:100] -#define ADD_REG_LED1_CURRENT 74 // U8 Configuration of current to drive LED 1 [2:100] -#define ADD_REG_LED0_MAX_CURRENT 75 // U8 Configuration of current to drive LED 0 [5:100] -#define ADD_REG_LED1_MAX_CURRENT 76 // U8 Configuration of current to drive LED 1 [5:100] -#define ADD_REG_EVNT_ENABLE 77 // U8 Enable the Events -#define ADD_REG_START_CAMERAS 78 // U8 Enable cameras -#define ADD_REG_STOP_CAMERAS 79 // U8 Disable cameras -#define ADD_REG_EN_SERVOS 80 // U8 Enable servo motors control -#define ADD_REG_DIS_SERVOS 81 // U8 Disable servo motors control -#define ADD_REG_EN_ENCODERS 82 // U8 Enable encoders -#define ADD_REG_CONF_ENCODERS 83 // U8 Configure the operation mode of the quadrature encoders -#define ADD_REG_RESERVED2 84 // U8 Reserved for future use -#define ADD_REG_RESERVED3 85 // U8 Reserved for future use -#define ADD_REG_RESERVED4 86 // U8 Reserved for future use -#define ADD_REG_RESERVED5 87 // U8 Reserved for future use -#define ADD_REG_RESERVED6 88 // U8 Reserved for future use -#define ADD_REG_RESERVED7 89 // U8 Reserved for future use -#define ADD_REG_RESERVED8 90 // U8 Reserved for future use -#define ADD_REG_RESERVED9 91 // U8 Reserved for future use -#define ADD_REG_CAM_OUT0_FRAME_ACQUIRED 92 // U8 -#define ADD_REG_CAM_OUT0_FREQ 93 // U16 Configures the camera's sample frequency [1;600] -#define ADD_REG_CAM_OUT1_FRAME_ACQUIRED 94 // U8 -#define ADD_REG_CAM_OUT1_FREQ 95 // U16 Configures the camera's sample frequency [1;600] -#define ADD_REG_RESERVED10 96 // U8 Reserved for future use -#define ADD_REG_RESERVED11 97 // U8 Reserved for future use -#define ADD_REG_RESERVED12 98 // U8 Reserved for future use -#define ADD_REG_RESERVED13 99 // U8 Reserved for future use -#define ADD_REG_MOTOR_OUT2_PERIOD 100 // U16 Configures the servo motor period (us) (sensitive to 2 us) -#define ADD_REG_MOTOR_OUT2_PULSE 101 // U16 Configures the servo motor pulse (us) (sensitive to 2 us) -#define ADD_REG_MOTOR_OUT3_PERIOD 102 // U16 Configures the servo motor period (us) (sensitive to 2 us) -#define ADD_REG_MOTOR_OUT3_PULSE 103 // U16 Configures the servo motor pulse (us) (sensitive to 2 us) +#define ADD_REG_DIGITAL_INPUT_STATE 32 // U8 Reflects the state of DI digital lines of each Port +#define ADD_REG_RESERVED0 33 // U8 Reserved for future use +#define ADD_REG_OUTPUT_SET 34 // U16 Set the specified digital output lines. +#define ADD_REG_OUTPUT_CLEAR 35 // U16 Clear the specified digital output lines +#define ADD_REG_OUTPUT_TOGGLE 36 // U16 Toggle the specified digital output lines +#define ADD_REG_OUTPUT_STATE 37 // U16 Write the state of all digital output lines +#define ADD_REG_PORT_DIO_SET 38 // U8 Set the specified port DIO lines +#define ADD_REG_PORT_DIO_CLEAR 39 // U8 Clear the specified port DIO lines +#define ADD_REG_PORT_DIO_TOGGLE 40 // U8 Toggle the specified port DIO lines +#define ADD_REG_PORT_DIO_STATE 41 // U8 Write the state of all port DIO lines +#define ADD_REG_PORT_DIO_DIRECTION 42 // U8 Specifies which of the port DIO lines are outputs +#define ADD_REG_PORT_DIO_STATE_EVENT 43 // U8 Specifies the state of the port DIO lines on a line change +#define ADD_REG_ANALOG_DATA 44 // I16 Voltage at the ADC input and encoder value on Port 2 +#define ADD_REG_OUTPUT_PULSE_ENABLE 45 // U16 Enables the pulse function for the specified output lines +#define ADD_REG_PULSE_DO_PORT0 46 // U16 Specifies the duration of the output pulse in milliseconds. +#define ADD_REG_PULSE_DO_PORT1 47 // U16 Specifies the duration of the output pulse in milliseconds. +#define ADD_REG_PULSE_DO_PORT2 48 // U16 Specifies the duration of the output pulse in milliseconds. +#define ADD_REG_PULSE_SUPPLY_PORT0 49 // U16 Specifies the duration of the output pulse in milliseconds. +#define ADD_REG_PULSE_SUPPLY_PORT1 50 // U16 Specifies the duration of the output pulse in milliseconds. +#define ADD_REG_PULSE_SUPPLY_PORT2 51 // U16 Specifies the duration of the output pulse in milliseconds. +#define ADD_REG_PULSE_LED0 52 // U16 Specifies the duration of the output pulse in milliseconds. +#define ADD_REG_PULSE_LED1 53 // U16 Specifies the duration of the output pulse in milliseconds. +#define ADD_REG_PULSE_RGB0 54 // U16 Specifies the duration of the output pulse in milliseconds. +#define ADD_REG_PULSE_RGB1 55 // U16 Specifies the duration of the output pulse in milliseconds. +#define ADD_REG_PULSE_DO0 56 // U16 Specifies the duration of the output pulse in milliseconds. +#define ADD_REG_PULSE_DO1 57 // U16 Specifies the duration of the output pulse in milliseconds. +#define ADD_REG_PULSE_DO2 58 // U16 Specifies the duration of the output pulse in milliseconds. +#define ADD_REG_PULSE_DO3 59 // U16 Specifies the duration of the output pulse in milliseconds. +#define ADD_REG_PWM_FREQUENCY_DO0 60 // U16 Specifies the frequency of the PWM at DO0. +#define ADD_REG_PWM_FREQUENCY_DO1 61 // U16 Specifies the frequency of the PWM at DO1. +#define ADD_REG_PWM_FREQUENCY_DO2 62 // U16 Specifies the frequency of the PWM at DO2. +#define ADD_REG_PWM_FREQUENCY_DO3 63 // U16 Specifies the frequency of the PWM at DO3. +#define ADD_REG_PWM_DUTY_CYCLE_DO0 64 // U8 Specifies the duty cycle of the PWM at DO0. +#define ADD_REG_PWM_DUTY_CYCLE_DO1 65 // U8 Specifies the duty cycle of the PWM at DO1. +#define ADD_REG_PWM_DUTY_CYCLE_DO2 66 // U8 Specifies the duty cycle of the PWM at DO2. +#define ADD_REG_PWM_DUTY_CYCLE_DO3 67 // U8 Specifies the duty cycle of the PWM at DO3. +#define ADD_REG_PWM_START 68 // U8 Starts the PWM on the selected output lines. +#define ADD_REG_PWM_STOP 69 // U8 Stops the PWM on the selected output lines. +#define ADD_REG_RGB_ALL 70 // U8 Specifies the state of all RGB LED channels. +#define ADD_REG_RGB0 71 // U8 Specifies the state of the RGB0 LED channels. +#define ADD_REG_RGB1 72 // U8 Specifies the state of the RGB1 LED channels. +#define ADD_REG_LED0_CURRENT 73 // U8 Specifies the configuration of current to drive LED 0. +#define ADD_REG_LED1_CURRENT 74 // U8 Specifies the configuration of current to drive LED 1. +#define ADD_REG_LED0_MAX_CURRENT 75 // U8 Specifies the configuration of current to drive LED 0. +#define ADD_REG_LED1_MAX_CURRENT 76 // U8 Specifies the configuration of current to drive LED 1. +#define ADD_REG_EVENT_ENABLE 77 // U8 Specifies the active events in the device. +#define ADD_REG_START_CAMERAS 78 // U8 Specifies the camera outputs to enable in the device. +#define ADD_REG_STOP_CAMERAS 79 // U8 Specifies the camera outputs to disable in the device. An event will be issued when the trigger signal is actually stopped being generated. +#define ADD_REG_ENABLE_SERVOS 80 // U8 Specifies the servo outputs to enable in the device. +#define ADD_REG_DISABLE_SERVOS 81 // U8 Specifies the servo outputs to disable in the device. +#define ADD_REG_ENABLE_ENCODERS 82 // U8 Specifies the port quadrature counters to enable in the device. +#define ADD_REG_ENCODER_MODE 83 // U8 Configures the operation mode of the quadrature encoders. +#define ADD_REG_RESERVED2 84 // U8 Reserved for future use +#define ADD_REG_RESERVED3 85 // U8 Reserved for future use +#define ADD_REG_RESERVED4 86 // U8 Reserved for future use +#define ADD_REG_RESERVED5 87 // U8 Reserved for future use +#define ADD_REG_RESERVED6 88 // U8 Reserved for future use +#define ADD_REG_RESERVED7 89 // U8 Reserved for future use +#define ADD_REG_RESERVED8 90 // U8 Reserved for future use +#define ADD_REG_RESERVED9 91 // U8 Reserved for future use +#define ADD_REG_CAMERA0_FRAME 92 // U8 Specifies that a frame was acquired on camera 0. +#define ADD_REG_CAMERA0_FREQUENCY 93 // U16 Specifies the trigger frequency for camera 0. +#define ADD_REG_CAMERA1_FRAME 94 // U8 Specifies that a frame was acquired on camera 1. +#define ADD_REG_CAMERA1_FREQUENCY 95 // U16 Specifies the trigger frequency for camera 1. +#define ADD_REG_RESERVED10 96 // U8 Reserved for future use +#define ADD_REG_RESERVED11 97 // U8 Reserved for future use +#define ADD_REG_RESERVED12 98 // U8 Reserved for future use +#define ADD_REG_RESERVED13 99 // U8 Reserved for future use +#define ADD_REG_SERVO_MOTOR2_PERIOD 100 // U16 Specifies the period of the servo motor in DO2, in microseconds. +#define ADD_REG_SERVO_MOTOR2_PULSE 101 // U16 Specifies the pulse of the servo motor in DO2, in microseconds. +#define ADD_REG_SERVO_MOTOR3_PERIOD 102 // U16 Specifies the period of the servo motor in DO3, in microseconds. +#define ADD_REG_SERVO_MOTOR3_PULSE 103 // U16 Specifies the pulse of the servo motor in DO3, in microseconds. #define ADD_REG_RESERVED14 104 // U8 Reserved for future use #define ADD_REG_RESERVED15 105 // U8 Reserved for future use #define ADD_REG_RESERVED16 106 // U8 Reserved for future use #define ADD_REG_RESERVED17 107 // U8 Reserved for future use -#define ADD_REG_ENCODERS_RESET 108 // U8 Resets the encoders counter to ZERO +#define ADD_REG_ENCODER_RESET 108 // U8 Reset the counter of the specified encoders to zero. #define ADD_REG_RESERVED18 109 // U8 Reserved for future use -#define ADD_REG_ENABLE_SERIAL_TIMESTAMP 110 // U8 Enables the timestamp TX -#define ADD_REG_MIMIC_PORT0_IR 111 // U8 -#define ADD_REG_MIMIC_PORT1_IR 112 // U8 -#define ADD_REG_MIMIC_PORT2_IR 113 // U8 -#define ADD_REG_RESERVED20 114 // U8 -#define ADD_REG_RESERVED21 115 // U8 -#define ADD_REG_RESERVED22 116 // U8 -#define ADD_REG_MIMIC_PORT0_VALVE 117 // U8 -#define ADD_REG_MIMIC_PORT1_VALVE 118 // U8 -#define ADD_REG_MIMIC_PORT2_VALVE 119 // U8 -#define ADD_REG_RESERVED23 120 // U8 -#define ADD_REG_RESERVED24 121 // U8 -#define ADD_REG_POKE_INPUT_FILTER_MS 122 // U8 Set the low pass filter time value for the pokes inputs (ms) +#define ADD_REG_ENABLE_SERIAL_TIMESTAMP 110 // U8 Enables the timestamp for serial TX. +#define ADD_REG_MIMIC_PORT0_IR 111 // U8 Specifies the digital output to mimic the Port 0 IR state. +#define ADD_REG_MIMIC_PORT1_IR 112 // U8 Specifies the digital output to mimic the Port 1 IR state. +#define ADD_REG_MIMIC_PORT2_IR 113 // U8 Specifies the digital output to mimic the Port 2 IR state. +#define ADD_REG_RESERVED20 114 // U8 Reserved for future use +#define ADD_REG_RESERVED21 115 // U8 Reserved for future use +#define ADD_REG_RESERVED22 116 // U8 Reserved for future use +#define ADD_REG_MIMIC_PORT0_VALVE 117 // U8 Specifies the digital output to mimic the Port 0 valve state. +#define ADD_REG_MIMIC_PORT1_VALVE 118 // U8 Specifies the digital output to mimic the Port 1 valve state. +#define ADD_REG_MIMIC_PORT2_VALVE 119 // U8 Specifies the digital output to mimic the Port 2 valve state. +#define ADD_REG_RESERVED23 120 // U8 Reserved for future use +#define ADD_REG_RESERVED24 121 // U8 Reserved for future use +#define ADD_REG_POKE_INPUT_FILTER 122 // U8 Specifies the low pass filter time value for poke inputs, in ms. /************************************************************************/ -/* PWM Generator registers' memory limits */ +/* Behavior registers' memory limits */ /* */ /* DON'T change the APP_REGS_ADD_MIN value !!! */ /* DON'T change these names !!! */ @@ -332,55 +334,54 @@ typedef struct /************************************************************************/ /* Registers' bits */ /************************************************************************/ -#define B_DI0 (1<<0) // Port 0 digital input -#define B_DI1 (1<<1) // Port 1 digital input -#define B_DI2 (1<<2) // Port 2 digital input -#define B_DI3 (1<<3) // Digital input DI3 -#define B_PORT0_DO (1<<0) // -#define B_PORT1_DO (1<<1) // -#define B_PORT2_DO (1<<2) // -#define B_PORT0_12V (1<<3) // -#define B_PORT1_12V (1<<4) // -#define B_PORT2_12V (1<<5) // -#define B_LED0 (1<<6) // -#define B_LED1 (1<<7) // -#define B_RGB0 (1<<8) // -#define B_RGB1 (1<<9) // -#define B_DO0 (1<<10) // -#define B_DO1 (1<<11) // -#define B_DO2 (1<<12) // -#define B_DO3 (1<<13) // -#define B_DIO0 (1<<0) // -#define B_DIO1 (1<<1) // -#define B_DIO2 (1<<2) // -#define B_PWM_DO0 (1<<0) // -#define B_PWM_DO1 (1<<1) // -#define B_PWM_DO2 (1<<2) // -#define B_PWM_DO3 (1<<3) // -#define B_EVT_PORT_DIS (1<<0) // Event of register POKE_IN -#define B_EVT_PORT_DIOS_IN (1<<1) // Event of register POKE_DIOS_IN -#define B_EVT_DATA (1<<2) // Event of register ADC -#define B_EVT_CAM0 (1<<3) // Event of CAM_OUT0_FRAME_ACQUIRED -#define B_EVT_CAM1 (1<<4) // Event of CAM_OUT1_FRAME_ACQUIRED -#define B_EN_CAM_OUT0 (1<<0) // Camera on digital output 0 -#define B_EN_CAM_OUT1 (1<<1) // Camera on digital output 1 -#define B_EN_SERVO_OUT2 (1<<2) // Servo on digital output 2 -#define B_EN_SERVO_OUT3 (1<<3) // Servo on digital output 3 -#define B_EN_ENCODER_PORT2 (1<<2) // Encoder on port 2 -#define MSK_ENCODERS_MODE 0x01 // -#define GM_POSITION 0x00 // -#define GM_DISPLACEMENT 0x01 // -#define B_CAM_ACQ (1<<0) // Camera frame was triggered -#define B_RST_ENCODER_PORT2 (1<<2) // Reset the encoder counter on Port 2 -#define B_EN_SRL_TSTAMP_PORT2 (1<<2) // Enable the serial timestamp TX on Port 2 -#define MSK_MIMIC 0x0F // -#define GM_MIMIC_NONE 0x00 // -#define GM_MIMIC_DIO0 0x01 // Is reflected on DIO0 -#define GM_MIMIC_DIO1 0x02 // Is reflected on DIO1 -#define GM_MIMIC_DIO2 0x03 // Is reflected on DIO2 -#define GM_MIMIC_DO0 0x04 // Is reflected on DO0 -#define GM_MIMIC_DO1 0x05 // Is reflected on DO1 -#define GM_MIMIC_DO2 0x06 // Is reflected on DO2 -#define GM_MIMIC_DO3 0x07 // Is reflected on DO3 +#define B_DIPORT0 (1<<0) // +#define B_DIPORT1 (1<<1) // +#define B_DIPORT2 (1<<2) // +#define B_DI3 (1<<3) // +#define B_DOPORT0 (1<<0) // +#define B_DOPORT1 (1<<1) // +#define B_DOPORT2 (1<<2) // +#define B_SUPPLY_PORT0 (1<<3) // +#define B_SUPPLY_PORT1 (1<<4) // +#define B_SUPPLY_PORT2 (1<<5) // +#define B_LED0 (1<<6) // +#define B_LED1 (1<<7) // +#define B_RGB0 (1<<8) // +#define B_RGB1 (1<<9) // +#define B_DO0 (1<<10) // +#define B_DO1 (1<<11) // +#define B_DO2 (1<<12) // +#define B_DO3 (1<<13) // +#define B_DIO0 (1<<0) // +#define B_DIO1 (1<<1) // +#define B_DIO2 (1<<2) // +#define B_PWM_DO0 (1<<0) // +#define B_PWM_DO1 (1<<1) // +#define B_PWM_DO2 (1<<2) // +#define B_PWM_DO3 (1<<3) // +#define B_PORT_DI (1<<0) // +#define B_PORT_DIO (1<<1) // +#define B_ANALOG_DATA (1<<2) // +#define B_CAMERA0 (1<<3) // +#define B_CAMERA1 (1<<4) // +#define B_CAMERA_OUTPUT0 (1<<0) // +#define B_CAMERA_OUTPUT1 (1<<1) // +#define B_SERVO_OUTPUT2 (1<<2) // +#define B_SERVO_OUTPUT3 (1<<3) // +#define B_ENCODER_PORT2 (1<<2) // +#define B_FRAME_ACQUIRED (1<<0) // +#define B_TIMESTAMP_PORT2 (1<<2) // +#define MSK_MIMIC_OUTPUT_SEL 0x07 // +#define GM_MIMIC_OUTPUT_NONE 0x00 // +#define GM_MIMIC_OUTPUT_DIO0 0x01 // +#define GM_MIMIC_OUTPUT_DIO1 0x02 // +#define GM_MIMIC_OUTPUT_DIO2 0x03 // +#define GM_MIMIC_OUTPUT_DO0 0x04 // +#define GM_MIMIC_OUTPUT_DO1 0x05 // +#define GM_MIMIC_OUTPUT_DO2 0x06 // +#define GM_MIMIC_OUTPUT_DO3 0x07 // +#define MSK_ENCODER_MODE_CONFIG_SEL 0x01 // +#define GM_ENCODER_MODE_CONFIG_POSITION 0x00 // +#define GM_ENCODER_MODE_CONFIG_DISPLACEMENT 0x01 // #endif /* _APP_REGS_H_ */ \ No newline at end of file diff --git a/Firmware/Behavior/interrupts.c b/Firmware/Behavior/interrupts.c index ff83cc1..8946ee9 100644 --- a/Firmware/Behavior/interrupts.c +++ b/Firmware/Behavior/interrupts.c @@ -35,14 +35,14 @@ extern uint8_t int0_enable_counter; ISR(PORTD_INT0_vect, ISR_NAKED) { - uint8_t reg_port_dis = app_regs.REG_PORT_DIS; - uint8_t reg_port_dios_in = app_regs.REG_PORT_DIOS_IN; + uint8_t reg_port_dis = app_regs.REG_DIGITAL_INPUT_STATE; + uint8_t reg_port_dios_in = app_regs.REG_PORT_DIO_STATE_EVENT; - app_regs.REG_PORT_DIS &= ~B_DI0; - app_regs.REG_PORT_DIS |= (read_POKE0_IR) ? B_DI0 : 0; + app_regs.REG_DIGITAL_INPUT_STATE &= ~B_DIPORT0; + app_regs.REG_DIGITAL_INPUT_STATE |= (read_POKE0_IR) ? B_DIPORT0 : 0; - app_regs.REG_PORT_DIOS_IN &= ~B_DIO0; - app_regs.REG_PORT_DIOS_IN |= (read_POKE0_IO) ? B_DIO0 : 0; + app_regs.REG_PORT_DIO_STATE_EVENT &= ~B_DIO0; + app_regs.REG_PORT_DIO_STATE_EVENT |= (read_POKE0_IO) ? B_DIO0 : 0; if(read_POKE0_IR) @@ -50,22 +50,22 @@ ISR(PORTD_INT0_vect, ISR_NAKED) else mimic_ir_or_valve(app_regs.REG_MIMIC_PORT0_IR, _CLR_IO_); - if (app_regs.REG_EVNT_ENABLE & B_EVT_PORT_DIS) + if (app_regs.REG_EVENT_ENABLE & B_PORT_DI) { - if (reg_port_dis != app_regs.REG_PORT_DIS) + if (reg_port_dis != app_regs.REG_DIGITAL_INPUT_STATE) { - core_func_send_event(ADD_REG_PORT_DIS, true); + core_func_send_event(ADD_REG_DIGITAL_INPUT_STATE, true); - if (app_regs.REG_POKE_INPUT_FILTER_MS) + if (app_regs.REG_POKE_INPUT_FILTER) { PORTD_INTCTRL &= 0xFC; // Disable interrupt - int0_enable_counter = app_regs.REG_POKE_INPUT_FILTER_MS; + int0_enable_counter = app_regs.REG_POKE_INPUT_FILTER; } } - if (reg_port_dios_in != app_regs.REG_PORT_DIOS_IN) + if (reg_port_dios_in != app_regs.REG_PORT_DIO_STATE_EVENT) { - core_func_send_event(ADD_REG_PORT_DIOS_IN, true); + core_func_send_event(ADD_REG_PORT_DIO_STATE_EVENT, true); } } @@ -79,36 +79,36 @@ extern uint8_t int1_enable_counter; ISR(PORTE_INT0_vect, ISR_NAKED) { - uint8_t reg_port_dis = app_regs.REG_PORT_DIS; - uint8_t reg_port_dios_in = app_regs.REG_PORT_DIOS_IN; + uint8_t reg_port_dis = app_regs.REG_DIGITAL_INPUT_STATE; + uint8_t reg_port_dios_in = app_regs.REG_PORT_DIO_STATE_EVENT; - app_regs.REG_PORT_DIS &= ~B_DI1; - app_regs.REG_PORT_DIS |= (read_POKE1_IR) ? B_DI1 : 0; + app_regs.REG_DIGITAL_INPUT_STATE &= ~B_DIPORT1; + app_regs.REG_DIGITAL_INPUT_STATE |= (read_POKE1_IR) ? B_DIPORT1 : 0; - app_regs.REG_PORT_DIOS_IN &= ~B_DIO1; - app_regs.REG_PORT_DIOS_IN |= (read_POKE1_IO) ? B_DIO1 : 0; + app_regs.REG_PORT_DIO_STATE_EVENT &= ~B_DIO1; + app_regs.REG_PORT_DIO_STATE_EVENT |= (read_POKE1_IO) ? B_DIO1 : 0; if(read_POKE1_IR) mimic_ir_or_valve(app_regs.REG_MIMIC_PORT1_IR, _SET_IO_); else mimic_ir_or_valve(app_regs.REG_MIMIC_PORT1_IR, _CLR_IO_); - if (app_regs.REG_EVNT_ENABLE & B_EVT_PORT_DIS) + if (app_regs.REG_EVENT_ENABLE & B_PORT_DI) { - if (reg_port_dis != app_regs.REG_PORT_DIS) + if (reg_port_dis != app_regs.REG_DIGITAL_INPUT_STATE) { - core_func_send_event(ADD_REG_PORT_DIS, true); + core_func_send_event(ADD_REG_DIGITAL_INPUT_STATE, true); - if (app_regs.REG_POKE_INPUT_FILTER_MS) + if (app_regs.REG_POKE_INPUT_FILTER) { PORTE_INTCTRL &= 0xFC; // Disable interrupt - int1_enable_counter = app_regs.REG_POKE_INPUT_FILTER_MS; + int1_enable_counter = app_regs.REG_POKE_INPUT_FILTER; } } - if (reg_port_dios_in != app_regs.REG_PORT_DIOS_IN) + if (reg_port_dios_in != app_regs.REG_PORT_DIO_STATE_EVENT) { - core_func_send_event(ADD_REG_PORT_DIOS_IN, true); + core_func_send_event(ADD_REG_PORT_DIO_STATE_EVENT, true); } } @@ -122,35 +122,35 @@ extern uint8_t int2_enable_counter; ISR(PORTF_INT0_vect, ISR_NAKED) { - uint8_t reg_port_dis = app_regs.REG_PORT_DIS; - uint8_t reg_port_dios_in = app_regs.REG_PORT_DIOS_IN; + uint8_t reg_port_dis = app_regs.REG_DIGITAL_INPUT_STATE; + uint8_t reg_port_dios_in = app_regs.REG_PORT_DIO_STATE_EVENT; - app_regs.REG_PORT_DIS &= ~B_DI2; - app_regs.REG_PORT_DIS |= (read_POKE2_IR) ? B_DI2 : 0; + app_regs.REG_DIGITAL_INPUT_STATE &= ~B_DIPORT2; + app_regs.REG_DIGITAL_INPUT_STATE |= (read_POKE2_IR) ? B_DIPORT2 : 0; - app_regs.REG_PORT_DIOS_IN &= ~B_DIO2; - app_regs.REG_PORT_DIOS_IN |= (read_POKE2_IO) ? B_DIO2 : 0; + app_regs.REG_PORT_DIO_STATE_EVENT &= ~B_DIO2; + app_regs.REG_PORT_DIO_STATE_EVENT |= (read_POKE2_IO) ? B_DIO2 : 0; if(read_POKE2_IR) mimic_ir_or_valve(app_regs.REG_MIMIC_PORT2_IR, _SET_IO_); else mimic_ir_or_valve(app_regs.REG_MIMIC_PORT2_IR, _CLR_IO_); - if (app_regs.REG_EVNT_ENABLE & B_EVT_PORT_DIS) + if (app_regs.REG_EVENT_ENABLE & B_PORT_DI) { - if (reg_port_dis != app_regs.REG_PORT_DIS) + if (reg_port_dis != app_regs.REG_DIGITAL_INPUT_STATE) { - core_func_send_event(ADD_REG_PORT_DIS, true); + core_func_send_event(ADD_REG_DIGITAL_INPUT_STATE, true); - if (app_regs.REG_POKE_INPUT_FILTER_MS) + if (app_regs.REG_POKE_INPUT_FILTER) { PORTF_INTCTRL &= 0xFC; // Disable interrupt - int2_enable_counter = app_regs.REG_POKE_INPUT_FILTER_MS; + int2_enable_counter = app_regs.REG_POKE_INPUT_FILTER; } } - if (reg_port_dios_in != app_regs.REG_PORT_DIOS_IN) + if (reg_port_dios_in != app_regs.REG_PORT_DIO_STATE_EVENT) { - core_func_send_event(ADD_REG_PORT_DIOS_IN, true); + core_func_send_event(ADD_REG_PORT_DIO_STATE_EVENT, true); } } @@ -162,16 +162,16 @@ ISR(PORTF_INT0_vect, ISR_NAKED) /************************************************************************/ ISR(PORTH_INT0_vect, ISR_NAKED) { - uint8_t reg_port_dis = app_regs.REG_PORT_DIS; + uint8_t reg_port_dis = app_regs.REG_DIGITAL_INPUT_STATE; - app_regs.REG_PORT_DIS &= ~B_DI3; - app_regs.REG_PORT_DIS |= (read_DI3) ? B_DI3 : 0; + app_regs.REG_DIGITAL_INPUT_STATE &= ~B_DI3; + app_regs.REG_DIGITAL_INPUT_STATE |= (read_DI3) ? B_DI3 : 0; - if (app_regs.REG_EVNT_ENABLE & B_EVT_PORT_DIS) + if (app_regs.REG_EVENT_ENABLE & B_PORT_DI) { - if (reg_port_dis != app_regs.REG_PORT_DIS) + if (reg_port_dis != app_regs.REG_DIGITAL_INPUT_STATE) { - core_func_send_event(ADD_REG_PORT_DIS, true); + core_func_send_event(ADD_REG_DIGITAL_INPUT_STATE, true); } } @@ -204,10 +204,10 @@ ISR(TCF0_OVF_vect, ISR_NAKED) if (_states_.camera.do0) { - if (app_regs.REG_EVNT_ENABLE & B_EVT_CAM0) + if (app_regs.REG_EVENT_ENABLE & B_CAMERA0) { - app_regs.REG_CAM_OUT0_FRAME_ACQUIRED = 1; - core_func_send_event(ADD_REG_CAM_OUT0_FRAME_ACQUIRED, true); + app_regs.REG_CAMERA0_FRAME = 1; + core_func_send_event(ADD_REG_CAMERA0_FRAME, true); } } @@ -226,7 +226,7 @@ ISR(TCF0_CCA_vect, ISR_NAKED) timer_type0_stop(&TCF0); _states_.camera.do0 = false; - app_regs.REG_STOP_CAMERAS = B_EN_CAM_OUT0; + app_regs.REG_STOP_CAMERAS = B_CAMERA_OUTPUT0; core_func_send_event(ADD_REG_STOP_CAMERAS, true); } } @@ -249,10 +249,10 @@ ISR(TCE0_OVF_vect, ISR_NAKED) if (_states_.camera.do1) { - if (app_regs.REG_EVNT_ENABLE & B_EVT_CAM1) + if (app_regs.REG_EVENT_ENABLE & B_CAMERA1) { - app_regs.REG_CAM_OUT1_FRAME_ACQUIRED = 1; - core_func_send_event(ADD_REG_CAM_OUT1_FRAME_ACQUIRED, true); + app_regs.REG_CAMERA1_FRAME = 1; + core_func_send_event(ADD_REG_CAMERA1_FRAME, true); } } @@ -271,7 +271,7 @@ ISR(TCE0_CCA_vect, ISR_NAKED) timer_type0_stop(&TCE0); _states_.camera.do1 = false; - app_regs.REG_STOP_CAMERAS = B_EN_CAM_OUT1; + app_regs.REG_STOP_CAMERAS = B_CAMERA_OUTPUT1; core_func_send_event(ADD_REG_STOP_CAMERAS, true); } } @@ -327,7 +327,7 @@ ISR(ADCA_CH0_vect, ISR_NAKED) first_adc_channel = false; /* Read ADC0 Channel 0 */ - app_regs.REG_DATA[0] = ((int16_t)(ADCA_CH0_RES & 0x0FFF)) - AdcOffset; + app_regs.REG_ANALOG_DATA[0] = ((int16_t)(ADCA_CH0_RES & 0x0FFF)) - AdcOffset; if (read_ADC1_AVAILABLE) { @@ -343,22 +343,22 @@ ISR(ADCA_CH0_vect, ISR_NAKED) else { /* Read ADC0 Channel 2 */ - app_regs.REG_DATA[2] = ((int16_t)(ADCA_CH0_RES & 0x0FFF)) - AdcOffset; + app_regs.REG_ANALOG_DATA[2] = ((int16_t)(ADCA_CH0_RES & 0x0FFF)) - AdcOffset; /* Validate readings */ - if (app_regs.REG_DATA[0] < 0) - app_regs.REG_DATA[0] = 0; - if (app_regs.REG_DATA[2] < 0) - app_regs.REG_DATA[2] = 0; + if (app_regs.REG_ANALOG_DATA[0] < 0) + app_regs.REG_ANALOG_DATA[0] = 0; + if (app_regs.REG_ANALOG_DATA[2] < 0) + app_regs.REG_ANALOG_DATA[2] = 0; send_event = true; } if (send_event) { - if (app_regs.REG_EVNT_ENABLE & B_EVT_DATA) + if (app_regs.REG_EVENT_ENABLE & B_ANALOG_DATA) { - core_func_send_event(ADD_REG_DATA, false); + core_func_send_event(ADD_REG_ANALOG_DATA, false); } } diff --git a/Firmware/Behavior/ios.yml b/Firmware/Behavior/ios.yml new file mode 100644 index 0000000..c789fa7 --- /dev/null +++ b/Firmware/Behavior/ios.yml @@ -0,0 +1,134 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/harp-tech/protocol/refs/heads/main/schema/ios.json +DO3: + pinNumber: 0 + direction: output + allowRead: true + port: PORTC + description: Output DO0 +DO2: + pinNumber: 0 + direction: output + allowRead: true + port: PORTD + description: Output DO1 +DO1: + pinNumber: 0 + direction: output + allowRead: true + port: PORTE + description: Output DO2 +DO0: + pinNumber: 0 + direction: output + allowRead: true + port: PORTF + description: Output DO3 +LED0: + pinNumber: 6 + direction: output + allowRead: true + invert: true + port: PORTB + description: Output LED0 +LED1: + pinNumber: 5 + direction: output + allowRead: true + invert: true + port: PORTB + description: Output LED1 +RGBS: + pinNumber: 5 + direction: output + port: PORTC + description: One wire LEDs +POKE0_IR: + pinNumber: 4 + direction: input + triggerMode: toggle + interruptPriority: low + port: PORTD + description: Poke 0 infrared +POKE0_IO: + pinNumber: 5 + direction: input + triggerMode: toggle + port: PORTD + description: Poke 0 DIO +POKE0_LED: + pinNumber: 6 + direction: output + allowRead: true + port: PORTD + description: Poke 0 digital output +POKE0_VALVE: + pinNumber: 7 + direction: output + allowRead: true + port: PORTD + description: Poke 0 Valve +POKE1_IR: + pinNumber: 4 + direction: input + triggerMode: toggle + interruptPriority: low + port: PORTE + description: Poke 1 infrared +POKE1_IO: + pinNumber: 5 + direction: input + triggerMode: toggle + port: PORTE + description: Poke 1 DIO +POKE1_LED: + pinNumber: 6 + direction: output + allowRead: true + port: PORTE + description: Poke 1 digital output +POKE1_VALVE: + pinNumber: 7 + direction: output + allowRead: true + port: PORTE + description: Poke 1 Valve +POKE2_IR: + pinNumber: 4 + direction: input + triggerMode: toggle + interruptPriority: low + port: PORTF + description: Poke 2 infrared +POKE2_IO: + pinNumber: 5 + direction: input + triggerMode: toggle + port: PORTF + description: Poke 2 DIO +POKE2_LED: + pinNumber: 6 + direction: output + allowRead: true + port: PORTF + description: Poke 2 digital output +POKE2_VALVE: + pinNumber: 7 + direction: output + allowRead: true + port: PORTF + description: Poke 2 Valve +ADC1_AVAILABLE: + pinNumber: 0 + direction: input + pinMode: pulldown + triggerMode: toggle + port: PORTJ + description: ADC1 is available on hardware +DI3: + pinNumber: 0 + direction: input + pinMode: tristate + triggerMode: toggle + interruptPriority: low + port: PORTH + description: Input DI3 diff --git a/device.yml b/device.yml index 2d81051..c1835be 100644 --- a/device.yml +++ b/device.yml @@ -3,7 +3,7 @@ # yaml-language-server: $schema=https://harp-tech.org/draft-02/schema/device.json device: Behavior whoAmI: 1216 -firmwareVersion: "3.3" +firmwareVersion: "3.4" hardwareTargets: "2.0" registers: DigitalInputState: From 685434b055d4f51b1e90fd655ab6dd73849d73c7 Mon Sep 17 00:00:00 2001 From: glopesdev Date: Thu, 12 Mar 2026 15:09:31 +0000 Subject: [PATCH 3/7] Regenerate bit mask names Using the latest version of the generators we can avoid merging acronym words at the start of a name. --- Firmware/Behavior/app_funcs.c | 42 ++++++++++++++-------------- Firmware/Behavior/app_ios_and_regs.h | 12 ++++---- Firmware/Behavior/interrupts.c | 12 ++++---- Firmware/Behavior/ios.yml | 2 +- 4 files changed, 34 insertions(+), 34 deletions(-) diff --git a/Firmware/Behavior/app_funcs.c b/Firmware/Behavior/app_funcs.c index a23ee9e..5fa505e 100644 --- a/Firmware/Behavior/app_funcs.c +++ b/Firmware/Behavior/app_funcs.c @@ -213,9 +213,9 @@ bool (*app_func_wr_pointer[])(void*) = { /************************************************************************/ void app_read_REG_DIGITAL_INPUT_STATE(void) { - app_regs.REG_DIGITAL_INPUT_STATE = (read_POKE0_IR) ? B_DIPORT0 : 0; - app_regs.REG_DIGITAL_INPUT_STATE |= (read_POKE1_IR) ? B_DIPORT1 : 0; - app_regs.REG_DIGITAL_INPUT_STATE |= (read_POKE2_IR) ? B_DIPORT2 : 0; + app_regs.REG_DIGITAL_INPUT_STATE = (read_POKE0_IR) ? B_DI_PORT0 : 0; + app_regs.REG_DIGITAL_INPUT_STATE |= (read_POKE1_IR) ? B_DI_PORT1 : 0; + app_regs.REG_DIGITAL_INPUT_STATE |= (read_POKE2_IR) ? B_DI_PORT2 : 0; app_regs.REG_DIGITAL_INPUT_STATE |= (read_DI3) ? B_DI3 : 0; } bool app_write_REG_DIGITAL_INPUT_STATE(void *a) { return false; } @@ -238,9 +238,9 @@ bool app_write_REG_RESERVED0(void *a) bool rgb0_on = false; bool rgb1_on = false; -#define start_POKE0_LED do {set_POKE0_LED; if (app_regs.REG_OUTPUT_PULSE_ENABLE & B_DOPORT0) pulse_countdown.poke0_led = app_regs.REG_PULSE_DO_PORT0 + 1; } while(0) -#define start_POKE1_LED do {set_POKE1_LED; if (app_regs.REG_OUTPUT_PULSE_ENABLE & B_DOPORT1) pulse_countdown.poke1_led = app_regs.REG_PULSE_DO_PORT1 + 1; } while(0) -#define start_POKE2_LED do {set_POKE2_LED; if (app_regs.REG_OUTPUT_PULSE_ENABLE & B_DOPORT2) pulse_countdown.poke2_led = app_regs.REG_PULSE_DO_PORT2 + 1; } while(0) +#define start_POKE0_LED do {set_POKE0_LED; if (app_regs.REG_OUTPUT_PULSE_ENABLE & B_DO_PORT0) pulse_countdown.poke0_led = app_regs.REG_PULSE_DO_PORT0 + 1; } while(0) +#define start_POKE1_LED do {set_POKE1_LED; if (app_regs.REG_OUTPUT_PULSE_ENABLE & B_DO_PORT1) pulse_countdown.poke1_led = app_regs.REG_PULSE_DO_PORT1 + 1; } while(0) +#define start_POKE2_LED do {set_POKE2_LED; if (app_regs.REG_OUTPUT_PULSE_ENABLE & B_DO_PORT2) pulse_countdown.poke2_led = app_regs.REG_PULSE_DO_PORT2 + 1; } while(0) #define start_POKE0_VALVE do {set_POKE0_VALVE; if (app_regs.REG_OUTPUT_PULSE_ENABLE & B_SUPPLY_PORT0) pulse_countdown.poke0_valve = app_regs.REG_PULSE_SUPPLY_PORT0 + 1; } while(0) #define start_POKE1_VALVE do {set_POKE1_VALVE; if (app_regs.REG_OUTPUT_PULSE_ENABLE & B_SUPPLY_PORT1) pulse_countdown.poke1_valve = app_regs.REG_PULSE_SUPPLY_PORT1 + 1; } while(0) @@ -298,9 +298,9 @@ bool app_write_REG_OUTPUT_SET(void *a) { uint16_t reg = *((uint16_t*)a); - if (reg & B_DOPORT0) start_POKE0_LED; - if (reg & B_DOPORT1) start_POKE1_LED; - if (reg & B_DOPORT2) start_POKE2_LED; + if (reg & B_DO_PORT0) start_POKE0_LED; + if (reg & B_DO_PORT1) start_POKE1_LED; + if (reg & B_DO_PORT2) start_POKE2_LED; if (reg & B_SUPPLY_PORT0) start_POKE0_VALVE; if (reg & B_SUPPLY_PORT1) start_POKE1_VALVE; @@ -336,9 +336,9 @@ bool app_write_REG_OUTPUT_CLEAR(void *a) { uint16_t reg = *((uint16_t*)a); - if (reg & B_DOPORT0) clr_POKE0_LED; - if (reg & B_DOPORT1) clr_POKE1_LED; - if (reg & B_DOPORT2) clr_POKE2_LED; + if (reg & B_DO_PORT0) clr_POKE0_LED; + if (reg & B_DO_PORT1) clr_POKE1_LED; + if (reg & B_DO_PORT2) clr_POKE2_LED; if (reg & B_SUPPLY_PORT0) clr_POKE0_VALVE; if (reg & B_SUPPLY_PORT1) clr_POKE1_VALVE; @@ -374,9 +374,9 @@ bool app_write_REG_OUTPUT_TOGGLE(void *a) { uint16_t reg = *((uint16_t*)a); - if (reg & B_DOPORT0) { if (read_POKE0_LED) tgl_POKE0_LED; else start_POKE0_LED;} - if (reg & B_DOPORT1) { if (read_POKE1_LED) tgl_POKE1_LED; else start_POKE1_LED;} - if (reg & B_DOPORT2) { if (read_POKE2_LED) tgl_POKE2_LED; else start_POKE2_LED;} + if (reg & B_DO_PORT0) { if (read_POKE0_LED) tgl_POKE0_LED; else start_POKE0_LED;} + if (reg & B_DO_PORT1) { if (read_POKE1_LED) tgl_POKE1_LED; else start_POKE1_LED;} + if (reg & B_DO_PORT2) { if (read_POKE2_LED) tgl_POKE2_LED; else start_POKE2_LED;} if (reg & B_SUPPLY_PORT0) { if (read_POKE0_VALVE) tgl_POKE0_VALVE; else start_POKE0_VALVE;} if (reg & B_SUPPLY_PORT1) { if (read_POKE1_VALVE) tgl_POKE1_VALVE; else start_POKE1_VALVE;} @@ -422,9 +422,9 @@ bool app_write_REG_OUTPUT_TOGGLE(void *a) /************************************************************************/ void app_read_REG_OUTPUT_STATE(void) { - app_regs.REG_OUTPUT_STATE = (read_POKE0_LED) ? B_DOPORT0 : 0; - app_regs.REG_OUTPUT_STATE |= (read_POKE1_LED) ? B_DOPORT1 : 0; - app_regs.REG_OUTPUT_STATE |= (read_POKE2_LED) ? B_DOPORT2 : 0; + app_regs.REG_OUTPUT_STATE = (read_POKE0_LED) ? B_DO_PORT0 : 0; + app_regs.REG_OUTPUT_STATE |= (read_POKE1_LED) ? B_DO_PORT1 : 0; + app_regs.REG_OUTPUT_STATE |= (read_POKE2_LED) ? B_DO_PORT2 : 0; app_regs.REG_OUTPUT_STATE |= (read_POKE0_VALVE) ? B_SUPPLY_PORT0: 0; app_regs.REG_OUTPUT_STATE |= (read_POKE1_VALVE) ? B_SUPPLY_PORT1: 0; @@ -450,9 +450,9 @@ bool app_write_REG_OUTPUT_STATE(void *a) prev_rgb0_on = rgb0_on; prev_rgb1_on = rgb1_on; - if (reg & B_DOPORT0) start_POKE0_LED; else clr_POKE0_LED; - if (reg & B_DOPORT1) start_POKE1_LED; else clr_POKE1_LED; - if (reg & B_DOPORT2) start_POKE2_LED; else clr_POKE2_LED; + if (reg & B_DO_PORT0) start_POKE0_LED; else clr_POKE0_LED; + if (reg & B_DO_PORT1) start_POKE1_LED; else clr_POKE1_LED; + if (reg & B_DO_PORT2) start_POKE2_LED; else clr_POKE2_LED; if (reg & B_SUPPLY_PORT0) start_POKE0_VALVE; else clr_POKE0_VALVE; if (reg & B_SUPPLY_PORT1) start_POKE1_VALVE; else clr_POKE1_VALVE; diff --git a/Firmware/Behavior/app_ios_and_regs.h b/Firmware/Behavior/app_ios_and_regs.h index 1f5cfaf..f6f1615 100644 --- a/Firmware/Behavior/app_ios_and_regs.h +++ b/Firmware/Behavior/app_ios_and_regs.h @@ -334,13 +334,13 @@ typedef struct /************************************************************************/ /* Registers' bits */ /************************************************************************/ -#define B_DIPORT0 (1<<0) // -#define B_DIPORT1 (1<<1) // -#define B_DIPORT2 (1<<2) // +#define B_DI_PORT0 (1<<0) // +#define B_DI_PORT1 (1<<1) // +#define B_DI_PORT2 (1<<2) // #define B_DI3 (1<<3) // -#define B_DOPORT0 (1<<0) // -#define B_DOPORT1 (1<<1) // -#define B_DOPORT2 (1<<2) // +#define B_DO_PORT0 (1<<0) // +#define B_DO_PORT1 (1<<1) // +#define B_DO_PORT2 (1<<2) // #define B_SUPPLY_PORT0 (1<<3) // #define B_SUPPLY_PORT1 (1<<4) // #define B_SUPPLY_PORT2 (1<<5) // diff --git a/Firmware/Behavior/interrupts.c b/Firmware/Behavior/interrupts.c index 8946ee9..5a2c663 100644 --- a/Firmware/Behavior/interrupts.c +++ b/Firmware/Behavior/interrupts.c @@ -38,8 +38,8 @@ ISR(PORTD_INT0_vect, ISR_NAKED) uint8_t reg_port_dis = app_regs.REG_DIGITAL_INPUT_STATE; uint8_t reg_port_dios_in = app_regs.REG_PORT_DIO_STATE_EVENT; - app_regs.REG_DIGITAL_INPUT_STATE &= ~B_DIPORT0; - app_regs.REG_DIGITAL_INPUT_STATE |= (read_POKE0_IR) ? B_DIPORT0 : 0; + app_regs.REG_DIGITAL_INPUT_STATE &= ~B_DI_PORT0; + app_regs.REG_DIGITAL_INPUT_STATE |= (read_POKE0_IR) ? B_DI_PORT0 : 0; app_regs.REG_PORT_DIO_STATE_EVENT &= ~B_DIO0; app_regs.REG_PORT_DIO_STATE_EVENT |= (read_POKE0_IO) ? B_DIO0 : 0; @@ -82,8 +82,8 @@ ISR(PORTE_INT0_vect, ISR_NAKED) uint8_t reg_port_dis = app_regs.REG_DIGITAL_INPUT_STATE; uint8_t reg_port_dios_in = app_regs.REG_PORT_DIO_STATE_EVENT; - app_regs.REG_DIGITAL_INPUT_STATE &= ~B_DIPORT1; - app_regs.REG_DIGITAL_INPUT_STATE |= (read_POKE1_IR) ? B_DIPORT1 : 0; + app_regs.REG_DIGITAL_INPUT_STATE &= ~B_DI_PORT1; + app_regs.REG_DIGITAL_INPUT_STATE |= (read_POKE1_IR) ? B_DI_PORT1 : 0; app_regs.REG_PORT_DIO_STATE_EVENT &= ~B_DIO1; app_regs.REG_PORT_DIO_STATE_EVENT |= (read_POKE1_IO) ? B_DIO1 : 0; @@ -125,8 +125,8 @@ ISR(PORTF_INT0_vect, ISR_NAKED) uint8_t reg_port_dis = app_regs.REG_DIGITAL_INPUT_STATE; uint8_t reg_port_dios_in = app_regs.REG_PORT_DIO_STATE_EVENT; - app_regs.REG_DIGITAL_INPUT_STATE &= ~B_DIPORT2; - app_regs.REG_DIGITAL_INPUT_STATE |= (read_POKE2_IR) ? B_DIPORT2 : 0; + app_regs.REG_DIGITAL_INPUT_STATE &= ~B_DI_PORT2; + app_regs.REG_DIGITAL_INPUT_STATE |= (read_POKE2_IR) ? B_DI_PORT2 : 0; app_regs.REG_PORT_DIO_STATE_EVENT &= ~B_DIO2; app_regs.REG_PORT_DIO_STATE_EVENT |= (read_POKE2_IO) ? B_DIO2 : 0; diff --git a/Firmware/Behavior/ios.yml b/Firmware/Behavior/ios.yml index c789fa7..2cfd2ea 100644 --- a/Firmware/Behavior/ios.yml +++ b/Firmware/Behavior/ios.yml @@ -1,4 +1,4 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/harp-tech/protocol/refs/heads/main/schema/ios.json +# yaml-language-server: $schema=https://harp-tech.org/draft-02/schema/ios.json DO3: pinNumber: 0 direction: output From 1eb092a19911aa7df7d372fc9d823300332c3c41 Mon Sep 17 00:00:00 2001 From: glopesdev Date: Thu, 12 Mar 2026 15:56:28 +0000 Subject: [PATCH 4/7] Add missing descriptions from device masks --- Firmware/Behavior/app_ios_and_regs.h | 46 +++---- Interface/Harp.Behavior/Device.Generated.cs | 136 ++++++++++++++++++++ device.yml | 92 +++++++++---- 3 files changed, 228 insertions(+), 46 deletions(-) diff --git a/Firmware/Behavior/app_ios_and_regs.h b/Firmware/Behavior/app_ios_and_regs.h index f6f1615..2893021 100644 --- a/Firmware/Behavior/app_ios_and_regs.h +++ b/Firmware/Behavior/app_ios_and_regs.h @@ -334,10 +334,10 @@ typedef struct /************************************************************************/ /* Registers' bits */ /************************************************************************/ -#define B_DI_PORT0 (1<<0) // -#define B_DI_PORT1 (1<<1) // -#define B_DI_PORT2 (1<<2) // -#define B_DI3 (1<<3) // +#define B_DI_PORT0 (1<<0) // Port 0 digital input +#define B_DI_PORT1 (1<<1) // Port 1 digital input +#define B_DI_PORT2 (1<<2) // Port 2 digital input +#define B_DI3 (1<<3) // Digital input DI3 #define B_DO_PORT0 (1<<0) // #define B_DO_PORT1 (1<<1) // #define B_DO_PORT2 (1<<2) // @@ -359,27 +359,27 @@ typedef struct #define B_PWM_DO1 (1<<1) // #define B_PWM_DO2 (1<<2) // #define B_PWM_DO3 (1<<3) // -#define B_PORT_DI (1<<0) // -#define B_PORT_DIO (1<<1) // -#define B_ANALOG_DATA (1<<2) // -#define B_CAMERA0 (1<<3) // -#define B_CAMERA1 (1<<4) // -#define B_CAMERA_OUTPUT0 (1<<0) // -#define B_CAMERA_OUTPUT1 (1<<1) // -#define B_SERVO_OUTPUT2 (1<<2) // -#define B_SERVO_OUTPUT3 (1<<3) // -#define B_ENCODER_PORT2 (1<<2) // -#define B_FRAME_ACQUIRED (1<<0) // -#define B_TIMESTAMP_PORT2 (1<<2) // +#define B_PORT_DI (1<<0) // Event from register DigitalInputState +#define B_PORT_DIO (1<<1) // Event from register PortDIOStateEvent +#define B_ANALOG_DATA (1<<2) // Event from register AnalogData +#define B_CAMERA0 (1<<3) // Event from register Camera0Frame +#define B_CAMERA1 (1<<4) // Event from register Camera1Frame +#define B_CAMERA_OUTPUT0 (1<<0) // Camera on digital output 0 +#define B_CAMERA_OUTPUT1 (1<<1) // Camera on digital output 1 +#define B_SERVO_OUTPUT2 (1<<2) // Servo on digital output 2 +#define B_SERVO_OUTPUT3 (1<<3) // Servo on digital output 3 +#define B_ENCODER_PORT2 (1<<2) // Encoder on port 2 +#define B_FRAME_ACQUIRED (1<<0) // Camera frame was triggered +#define B_TIMESTAMP_PORT2 (1<<2) // Enable the serial timestamp TX on Port 2 #define MSK_MIMIC_OUTPUT_SEL 0x07 // #define GM_MIMIC_OUTPUT_NONE 0x00 // -#define GM_MIMIC_OUTPUT_DIO0 0x01 // -#define GM_MIMIC_OUTPUT_DIO1 0x02 // -#define GM_MIMIC_OUTPUT_DIO2 0x03 // -#define GM_MIMIC_OUTPUT_DO0 0x04 // -#define GM_MIMIC_OUTPUT_DO1 0x05 // -#define GM_MIMIC_OUTPUT_DO2 0x06 // -#define GM_MIMIC_OUTPUT_DO3 0x07 // +#define GM_MIMIC_OUTPUT_DIO0 0x01 // Is reflected on DIO0 +#define GM_MIMIC_OUTPUT_DIO1 0x02 // Is reflected on DIO1 +#define GM_MIMIC_OUTPUT_DIO2 0x03 // Is reflected on DIO2 +#define GM_MIMIC_OUTPUT_DO0 0x04 // Is reflected on DO0 +#define GM_MIMIC_OUTPUT_DO1 0x05 // Is reflected on DO1 +#define GM_MIMIC_OUTPUT_DO2 0x06 // Is reflected on DO2 +#define GM_MIMIC_OUTPUT_DO3 0x07 // Is reflected on DO3 #define MSK_ENCODER_MODE_CONFIG_SEL 0x01 // #define GM_ENCODER_MODE_CONFIG_POSITION 0x00 // #define GM_ENCODER_MODE_CONFIG_DISPLACEMENT 0x01 // diff --git a/Interface/Harp.Behavior/Device.Generated.cs b/Interface/Harp.Behavior/Device.Generated.cs index 9e2674c..3a59156 100644 --- a/Interface/Harp.Behavior/Device.Generated.cs +++ b/Interface/Harp.Behavior/Device.Generated.cs @@ -12259,10 +12259,33 @@ public override string ToString() [Flags] public enum DigitalInputs : byte { + /// + /// Specifies that no flags are defined. + /// None = 0x0, + + /// + /// Port 0 digital input + /// + [Description("Port 0 digital input")] DIPort0 = 0x1, + + /// + /// Port 1 digital input + /// + [Description("Port 1 digital input")] DIPort1 = 0x2, + + /// + /// Port 2 digital input + /// + [Description("Port 2 digital input")] DIPort2 = 0x4, + + /// + /// Digital input DI3 + /// + [Description("Digital input DI3")] DI3 = 0x8 } @@ -12320,11 +12343,39 @@ public enum PwmOutputs : byte [Flags] public enum Events : byte { + /// + /// Specifies that no flags are defined. + /// None = 0x0, + + /// + /// Event from register DigitalInputState + /// + [Description("Event from register DigitalInputState")] PortDI = 0x1, + + /// + /// Event from register PortDIOStateEvent + /// + [Description("Event from register PortDIOStateEvent")] PortDIO = 0x2, + + /// + /// Event from register AnalogData + /// + [Description("Event from register AnalogData")] AnalogData = 0x4, + + /// + /// Event from register Camera0Frame + /// + [Description("Event from register Camera0Frame")] Camera0 = 0x8, + + /// + /// Event from register Camera1Frame + /// + [Description("Event from register Camera1Frame")] Camera1 = 0x10 } @@ -12334,8 +12385,21 @@ public enum Events : byte [Flags] public enum CameraOutputs : byte { + /// + /// Specifies that no flags are defined. + /// None = 0x0, + + /// + /// Camera on digital output 0 + /// + [Description("Camera on digital output 0")] CameraOutput0 = 0x1, + + /// + /// Camera on digital output 1 + /// + [Description("Camera on digital output 1")] CameraOutput1 = 0x2 } @@ -12345,8 +12409,21 @@ public enum CameraOutputs : byte [Flags] public enum ServoOutputs : byte { + /// + /// Specifies that no flags are defined. + /// None = 0x0, + + /// + /// Servo on digital output 2 + /// + [Description("Servo on digital output 2")] ServoOutput2 = 0x4, + + /// + /// Servo on digital output 3 + /// + [Description("Servo on digital output 3")] ServoOutput3 = 0x8 } @@ -12356,7 +12433,15 @@ public enum ServoOutputs : byte [Flags] public enum EncoderInputs : byte { + /// + /// Specifies that no flags are defined. + /// None = 0x0, + + /// + /// Encoder on port 2 + /// + [Description("Encoder on port 2")] EncoderPort2 = 0x4 } @@ -12366,7 +12451,15 @@ public enum EncoderInputs : byte [Flags] public enum FrameAcquired : byte { + /// + /// Specifies that no flags are defined. + /// None = 0x0, + + /// + /// Camera frame was triggered + /// + [Description("Camera frame was triggered")] FrameAcquired = 0x1 } @@ -12376,7 +12469,15 @@ public enum FrameAcquired : byte [Flags] public enum SerialTimestampPorts : byte { + /// + /// Specifies that no flags are defined. + /// None = 0x0, + + /// + /// Enable the serial timestamp TX on Port 2 + /// + [Description("Enable the serial timestamp TX on Port 2")] TimestampPort2 = 0x4 } @@ -12386,12 +12487,47 @@ public enum SerialTimestampPorts : byte public enum MimicOutput : byte { None = 0, + + /// + /// Is reflected on DIO0 + /// + [Description("Is reflected on DIO0")] DIO0 = 1, + + /// + /// Is reflected on DIO1 + /// + [Description("Is reflected on DIO1")] DIO1 = 2, + + /// + /// Is reflected on DIO2 + /// + [Description("Is reflected on DIO2")] DIO2 = 3, + + /// + /// Is reflected on DO0 + /// + [Description("Is reflected on DO0")] DO0 = 4, + + /// + /// Is reflected on DO1 + /// + [Description("Is reflected on DO1")] DO1 = 5, + + /// + /// Is reflected on DO2 + /// + [Description("Is reflected on DO2")] DO2 = 6, + + /// + /// Is reflected on DO3 + /// + [Description("Is reflected on DO3")] DO3 = 7 } diff --git a/device.yml b/device.yml index c1835be..3341a17 100644 --- a/device.yml +++ b/device.yml @@ -438,10 +438,18 @@ bitMasks: DigitalInputs: description: Specifies the state of port digital input lines. bits: - DIPort0: 0x1 - DIPort1: 0x2 - DIPort2: 0x4 - DI3: 0x8 + DIPort0: + value: 0x1 + description: Port 0 digital input + DIPort1: + value: 0x2 + description: Port 1 digital input + DIPort2: + value: 0x4 + description: Port 2 digital input + DI3: + value: 0x8 + description: Digital input DI3 DigitalOutputs: description: Specifies the state of port digital output lines. bits: @@ -475,45 +483,83 @@ bitMasks: Events: description: Specifies the active events in the device. bits: - PortDI: 0x1 - PortDIO: 0x2 - AnalogData: 0x4 - Camera0: 0x8 - Camera1: 0x10 + PortDI: + value: 0x1 + description: Event from register DigitalInputState + PortDIO: + value: 0x2 + description: Event from register PortDIOStateEvent + AnalogData: + value: 0x4 + description: Event from register AnalogData + Camera0: + value: 0x8 + description: Event from register Camera0Frame + Camera1: + value: 0x10 + description: Event from register Camera1Frame CameraOutputs: description: Specifies camera output enable bits. bits: - CameraOutput0: 0x1 - CameraOutput1: 0x2 + CameraOutput0: + value: 0x1 + description: Camera on digital output 0 + CameraOutput1: + value: 0x2 + description: Camera on digital output 1 ServoOutputs: description: Specifies servo output enable bits. bits: - ServoOutput2: 0x4 - ServoOutput3: 0x8 + ServoOutput2: + value: 0x4 + description: Servo on digital output 2 + ServoOutput3: + value: 0x8 + description: Servo on digital output 3 EncoderInputs: description: Specifies quadrature counter enable bits. bits: - EncoderPort2: 0x4 + EncoderPort2: + value: 0x4 + description: Encoder on port 2 FrameAcquired: description: Specifies that camera frame was acquired. bits: - FrameAcquired: 0x1 + FrameAcquired: + value: 0x1 + description: Camera frame was triggered SerialTimestampPorts: description: Specifies available timestamp TX ports. bits: - TimestampPort2: 0x4 + TimestampPort2: + value: 0x4 + description: Enable the serial timestamp TX on Port 2 groupMasks: MimicOutput: description: Specifies the target IO on which to mimic the specified register. values: None: 0 - DIO0: 1 - DIO1: 2 - DIO2: 3 - DO0: 4 - DO1: 5 - DO2: 6 - DO3: 7 + DIO0: + value: 1 + description: Is reflected on DIO0 + DIO1: + value: 2 + description: Is reflected on DIO1 + DIO2: + value: 3 + description: Is reflected on DIO2 + DO0: + value: 4 + description: Is reflected on DO0 + DO1: + value: 5 + description: Is reflected on DO1 + DO2: + value: 6 + description: Is reflected on DO2 + DO3: + value: 7 + description: Is reflected on DO3 EncoderModeConfig: description: Specifies the type of reading made from the quadrature encoder. values: From 80092a9db4fe597997c55f8bddc9ddb2c9427cec Mon Sep 17 00:00:00 2001 From: glopesdev Date: Thu, 12 Mar 2026 20:53:45 +0000 Subject: [PATCH 5/7] Ensure address alignment --- Firmware/Behavior/app_ios_and_regs.h | 46 ++++++++++++++-------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/Firmware/Behavior/app_ios_and_regs.h b/Firmware/Behavior/app_ios_and_regs.h index 2893021..7b61ef5 100644 --- a/Firmware/Behavior/app_ios_and_regs.h +++ b/Firmware/Behavior/app_ios_and_regs.h @@ -296,29 +296,29 @@ typedef struct #define ADD_REG_RESERVED11 97 // U8 Reserved for future use #define ADD_REG_RESERVED12 98 // U8 Reserved for future use #define ADD_REG_RESERVED13 99 // U8 Reserved for future use -#define ADD_REG_SERVO_MOTOR2_PERIOD 100 // U16 Specifies the period of the servo motor in DO2, in microseconds. -#define ADD_REG_SERVO_MOTOR2_PULSE 101 // U16 Specifies the pulse of the servo motor in DO2, in microseconds. -#define ADD_REG_SERVO_MOTOR3_PERIOD 102 // U16 Specifies the period of the servo motor in DO3, in microseconds. -#define ADD_REG_SERVO_MOTOR3_PULSE 103 // U16 Specifies the pulse of the servo motor in DO3, in microseconds. -#define ADD_REG_RESERVED14 104 // U8 Reserved for future use -#define ADD_REG_RESERVED15 105 // U8 Reserved for future use -#define ADD_REG_RESERVED16 106 // U8 Reserved for future use -#define ADD_REG_RESERVED17 107 // U8 Reserved for future use -#define ADD_REG_ENCODER_RESET 108 // U8 Reset the counter of the specified encoders to zero. -#define ADD_REG_RESERVED18 109 // U8 Reserved for future use -#define ADD_REG_ENABLE_SERIAL_TIMESTAMP 110 // U8 Enables the timestamp for serial TX. -#define ADD_REG_MIMIC_PORT0_IR 111 // U8 Specifies the digital output to mimic the Port 0 IR state. -#define ADD_REG_MIMIC_PORT1_IR 112 // U8 Specifies the digital output to mimic the Port 1 IR state. -#define ADD_REG_MIMIC_PORT2_IR 113 // U8 Specifies the digital output to mimic the Port 2 IR state. -#define ADD_REG_RESERVED20 114 // U8 Reserved for future use -#define ADD_REG_RESERVED21 115 // U8 Reserved for future use -#define ADD_REG_RESERVED22 116 // U8 Reserved for future use -#define ADD_REG_MIMIC_PORT0_VALVE 117 // U8 Specifies the digital output to mimic the Port 0 valve state. -#define ADD_REG_MIMIC_PORT1_VALVE 118 // U8 Specifies the digital output to mimic the Port 1 valve state. -#define ADD_REG_MIMIC_PORT2_VALVE 119 // U8 Specifies the digital output to mimic the Port 2 valve state. -#define ADD_REG_RESERVED23 120 // U8 Reserved for future use -#define ADD_REG_RESERVED24 121 // U8 Reserved for future use -#define ADD_REG_POKE_INPUT_FILTER 122 // U8 Specifies the low pass filter time value for poke inputs, in ms. +#define ADD_REG_SERVO_MOTOR2_PERIOD 100 // U16 Specifies the period of the servo motor in DO2, in microseconds. +#define ADD_REG_SERVO_MOTOR2_PULSE 101 // U16 Specifies the pulse of the servo motor in DO2, in microseconds. +#define ADD_REG_SERVO_MOTOR3_PERIOD 102 // U16 Specifies the period of the servo motor in DO3, in microseconds. +#define ADD_REG_SERVO_MOTOR3_PULSE 103 // U16 Specifies the pulse of the servo motor in DO3, in microseconds. +#define ADD_REG_RESERVED14 104 // U8 Reserved for future use +#define ADD_REG_RESERVED15 105 // U8 Reserved for future use +#define ADD_REG_RESERVED16 106 // U8 Reserved for future use +#define ADD_REG_RESERVED17 107 // U8 Reserved for future use +#define ADD_REG_ENCODER_RESET 108 // U8 Reset the counter of the specified encoders to zero. +#define ADD_REG_RESERVED18 109 // U8 Reserved for future use +#define ADD_REG_ENABLE_SERIAL_TIMESTAMP 110 // U8 Enables the timestamp for serial TX. +#define ADD_REG_MIMIC_PORT0_IR 111 // U8 Specifies the digital output to mimic the Port 0 IR state. +#define ADD_REG_MIMIC_PORT1_IR 112 // U8 Specifies the digital output to mimic the Port 1 IR state. +#define ADD_REG_MIMIC_PORT2_IR 113 // U8 Specifies the digital output to mimic the Port 2 IR state. +#define ADD_REG_RESERVED20 114 // U8 Reserved for future use +#define ADD_REG_RESERVED21 115 // U8 Reserved for future use +#define ADD_REG_RESERVED22 116 // U8 Reserved for future use +#define ADD_REG_MIMIC_PORT0_VALVE 117 // U8 Specifies the digital output to mimic the Port 0 valve state. +#define ADD_REG_MIMIC_PORT1_VALVE 118 // U8 Specifies the digital output to mimic the Port 1 valve state. +#define ADD_REG_MIMIC_PORT2_VALVE 119 // U8 Specifies the digital output to mimic the Port 2 valve state. +#define ADD_REG_RESERVED23 120 // U8 Reserved for future use +#define ADD_REG_RESERVED24 121 // U8 Reserved for future use +#define ADD_REG_POKE_INPUT_FILTER 122 // U8 Specifies the low pass filter time value for poke inputs, in ms. /************************************************************************/ /* Behavior registers' memory limits */ From 344577ef46baf6cee201ae06f04c232d0955f8bf Mon Sep 17 00:00:00 2001 From: glopesdev Date: Tue, 17 Mar 2026 15:02:44 +0000 Subject: [PATCH 6/7] Regenerate interface using harp toolkit The latest release of harp toolkit deprecates the legacy Generators project. T4 templates are also pre-compiled meaning there is no need to install dotnet-t4. --- .config/dotnet-tools.json | 13 + .github/workflows/Harp.Behavior.yml | 9 +- Firmware/Behavior/ios.yml | 75 +++- Generators/Generators.csproj | 32 -- .../Harp.Behavior/AsyncDevice.Generated.cs | 398 +++++++++--------- Interface/Harp.Behavior/Device.Generated.cs | 106 +++++ Interface/Harp.Behavior/Harp.Behavior.csproj | 1 + 7 files changed, 375 insertions(+), 259 deletions(-) create mode 100644 .config/dotnet-tools.json delete mode 100644 Generators/Generators.csproj diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json new file mode 100644 index 0000000..d3c7d2e --- /dev/null +++ b/.config/dotnet-tools.json @@ -0,0 +1,13 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "harp.toolkit": { + "version": "0.2.0", + "commands": [ + "harp.toolkit" + ], + "rollForward": false + } + } +} \ No newline at end of file diff --git a/.github/workflows/Harp.Behavior.yml b/.github/workflows/Harp.Behavior.yml index 2bf2904..6ec6f5d 100644 --- a/.github/workflows/Harp.Behavior.yml +++ b/.github/workflows/Harp.Behavior.yml @@ -82,8 +82,8 @@ jobs: with: dotnet-version: 8.x - - name: Set up T4 - run: dotnet tool install -g dotnet-t4 --version 3.0.0 + - name: Set up .NET tools + run: dotnet tool restore # ----------------------------------------------------------------------- Configure build - name: Configure build @@ -91,11 +91,8 @@ jobs: uses: harp-tech/configure-build@v1 # ----------------------------------------------------------------------- Regenerate - - name: Restore generators - run: dotnet restore Generators - - name: Run generators - run: dotnet build Generators --no-restore --configuration ${{matrix.configuration}} + run: dotnet harp.toolkit generate interface -o Interface/${{github.workflow}} - name: Verify pre-generated code was up-to-date id: verify-dist diff --git a/Firmware/Behavior/ios.yml b/Firmware/Behavior/ios.yml index 2cfd2ea..0eab945 100644 --- a/Firmware/Behavior/ios.yml +++ b/Firmware/Behavior/ios.yml @@ -1,134 +1,165 @@ -# yaml-language-server: $schema=https://harp-tech.org/draft-02/schema/ios.json DO3: + port: PORTC pinNumber: 0 direction: output allowRead: true - port: PORTC + initialState: low description: Output DO0 DO2: + port: PORTD pinNumber: 0 direction: output allowRead: true - port: PORTD + initialState: low description: Output DO1 DO1: + port: PORTE pinNumber: 0 direction: output allowRead: true - port: PORTE + initialState: low description: Output DO2 DO0: + port: PORTF pinNumber: 0 direction: output allowRead: true - port: PORTF + initialState: low description: Output DO3 LED0: + port: PORTB pinNumber: 6 direction: output allowRead: true + initialState: low invert: true - port: PORTB description: Output LED0 LED1: + port: PORTB pinNumber: 5 direction: output allowRead: true + initialState: low invert: true - port: PORTB description: Output LED1 RGBS: + port: PORTC pinNumber: 5 direction: output - port: PORTC + allowRead: false + initialState: low description: One wire LEDs POKE0_IR: + port: PORTD pinNumber: 4 direction: input + pinMode: pullup triggerMode: toggle interruptPriority: low - port: PORTD + interruptNumber: 0 description: Poke 0 infrared POKE0_IO: + port: PORTD pinNumber: 5 direction: input + pinMode: pullup triggerMode: toggle - port: PORTD + interruptPriority: "off" + interruptNumber: 0 description: Poke 0 DIO POKE0_LED: + port: PORTD pinNumber: 6 direction: output allowRead: true - port: PORTD + initialState: low description: Poke 0 digital output POKE0_VALVE: + port: PORTD pinNumber: 7 direction: output allowRead: true - port: PORTD + initialState: low description: Poke 0 Valve POKE1_IR: + port: PORTE pinNumber: 4 direction: input + pinMode: pullup triggerMode: toggle interruptPriority: low - port: PORTE + interruptNumber: 0 description: Poke 1 infrared POKE1_IO: + port: PORTE pinNumber: 5 direction: input + pinMode: pullup triggerMode: toggle - port: PORTE + interruptPriority: "off" + interruptNumber: 0 description: Poke 1 DIO POKE1_LED: + port: PORTE pinNumber: 6 direction: output allowRead: true - port: PORTE + initialState: low description: Poke 1 digital output POKE1_VALVE: + port: PORTE pinNumber: 7 direction: output allowRead: true - port: PORTE + initialState: low description: Poke 1 Valve POKE2_IR: + port: PORTF pinNumber: 4 direction: input + pinMode: pullup triggerMode: toggle interruptPriority: low - port: PORTF + interruptNumber: 0 description: Poke 2 infrared POKE2_IO: + port: PORTF pinNumber: 5 direction: input + pinMode: pullup triggerMode: toggle - port: PORTF + interruptPriority: "off" + interruptNumber: 0 description: Poke 2 DIO POKE2_LED: + port: PORTF pinNumber: 6 direction: output allowRead: true - port: PORTF + initialState: low description: Poke 2 digital output POKE2_VALVE: + port: PORTF pinNumber: 7 direction: output allowRead: true - port: PORTF + initialState: low description: Poke 2 Valve ADC1_AVAILABLE: + port: PORTJ pinNumber: 0 direction: input pinMode: pulldown triggerMode: toggle - port: PORTJ + interruptPriority: "off" + interruptNumber: 0 description: ADC1 is available on hardware DI3: + port: PORTH pinNumber: 0 direction: input pinMode: tristate triggerMode: toggle interruptPriority: low - port: PORTH + interruptNumber: 0 description: Input DI3 diff --git a/Generators/Generators.csproj b/Generators/Generators.csproj deleted file mode 100644 index b215cbb..0000000 --- a/Generators/Generators.csproj +++ /dev/null @@ -1,32 +0,0 @@ - - - true - Harp.Behavior - net6.0 - latest - bin - - - ..\device.yml - ..\ios.yml - - - ..\Interface\Harp.Behavior - ..\Firmware\Harp.Behavior - - - - - - - -p:MetadataPath=$(DeviceMetadata) -p:Namespace=$(RootNamespace) -P=$(TargetDir) - -p:RegisterMetadataPath=$(DeviceMetadata) -p:IOMetadataPath=$(IOMetadata) -P=$(TargetDir) - - - - - \ No newline at end of file diff --git a/Interface/Harp.Behavior/AsyncDevice.Generated.cs b/Interface/Harp.Behavior/AsyncDevice.Generated.cs index 8765dfd..2cb61fc 100644 --- a/Interface/Harp.Behavior/AsyncDevice.Generated.cs +++ b/Interface/Harp.Behavior/AsyncDevice.Generated.cs @@ -49,7 +49,7 @@ internal AsyncDevice(string portName) } /// - /// Asynchronously reads the contents of the DigitalInputState register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -65,7 +65,7 @@ public async Task ReadDigitalInputStateAsync(CancellationToken ca } /// - /// Asynchronously reads the timestamped contents of the DigitalInputState register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -81,7 +81,7 @@ public async Task> ReadTimestampedDigitalInputStateAs } /// - /// Asynchronously reads the contents of the OutputSet register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -97,7 +97,7 @@ public async Task ReadOutputSetAsync(CancellationToken cancellat } /// - /// Asynchronously reads the timestamped contents of the OutputSet register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -113,7 +113,7 @@ public async Task> ReadTimestampedOutputSetAsync(Can } /// - /// Asynchronously writes a value to the OutputSet register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -127,7 +127,7 @@ public async Task WriteOutputSetAsync(DigitalOutputs value, CancellationToken ca } /// - /// Asynchronously reads the contents of the OutputClear register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -143,7 +143,7 @@ public async Task ReadOutputClearAsync(CancellationToken cancell } /// - /// Asynchronously reads the timestamped contents of the OutputClear register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -159,7 +159,7 @@ public async Task> ReadTimestampedOutputClearAsync(C } /// - /// Asynchronously writes a value to the OutputClear register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -173,7 +173,7 @@ public async Task WriteOutputClearAsync(DigitalOutputs value, CancellationToken } /// - /// Asynchronously reads the contents of the OutputToggle register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -189,7 +189,7 @@ public async Task ReadOutputToggleAsync(CancellationToken cancel } /// - /// Asynchronously reads the timestamped contents of the OutputToggle register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -205,7 +205,7 @@ public async Task> ReadTimestampedOutputToggleAsync( } /// - /// Asynchronously writes a value to the OutputToggle register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -219,7 +219,7 @@ public async Task WriteOutputToggleAsync(DigitalOutputs value, CancellationToken } /// - /// Asynchronously reads the contents of the OutputState register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -235,7 +235,7 @@ public async Task ReadOutputStateAsync(CancellationToken cancell } /// - /// Asynchronously reads the timestamped contents of the OutputState register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -251,7 +251,7 @@ public async Task> ReadTimestampedOutputStateAsync(C } /// - /// Asynchronously writes a value to the OutputState register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -265,7 +265,7 @@ public async Task WriteOutputStateAsync(DigitalOutputs value, CancellationToken } /// - /// Asynchronously reads the contents of the PortDIOSet register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -281,7 +281,7 @@ public async Task ReadPortDIOSetAsync(CancellationToken cancella } /// - /// Asynchronously reads the timestamped contents of the PortDIOSet register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -297,7 +297,7 @@ public async Task> ReadTimestampedPortDIOSetAsync(Ca } /// - /// Asynchronously writes a value to the PortDIOSet register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -311,7 +311,7 @@ public async Task WritePortDIOSetAsync(PortDigitalIOS value, CancellationToken c } /// - /// Asynchronously reads the contents of the PortDIOClear register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -327,7 +327,7 @@ public async Task ReadPortDIOClearAsync(CancellationToken cancel } /// - /// Asynchronously reads the timestamped contents of the PortDIOClear register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -343,7 +343,7 @@ public async Task> ReadTimestampedPortDIOClearAsync( } /// - /// Asynchronously writes a value to the PortDIOClear register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -357,7 +357,7 @@ public async Task WritePortDIOClearAsync(PortDigitalIOS value, CancellationToken } /// - /// Asynchronously reads the contents of the PortDIOToggle register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -373,7 +373,7 @@ public async Task ReadPortDIOToggleAsync(CancellationToken cance } /// - /// Asynchronously reads the timestamped contents of the PortDIOToggle register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -389,7 +389,7 @@ public async Task> ReadTimestampedPortDIOToggleAsync } /// - /// Asynchronously writes a value to the PortDIOToggle register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -403,7 +403,7 @@ public async Task WritePortDIOToggleAsync(PortDigitalIOS value, CancellationToke } /// - /// Asynchronously reads the contents of the PortDIOState register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -419,7 +419,7 @@ public async Task ReadPortDIOStateAsync(CancellationToken cancel } /// - /// Asynchronously reads the timestamped contents of the PortDIOState register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -435,7 +435,7 @@ public async Task> ReadTimestampedPortDIOStateAsync( } /// - /// Asynchronously writes a value to the PortDIOState register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -449,7 +449,7 @@ public async Task WritePortDIOStateAsync(PortDigitalIOS value, CancellationToken } /// - /// Asynchronously reads the contents of the PortDIODirection register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -465,7 +465,7 @@ public async Task ReadPortDIODirectionAsync(CancellationToken ca } /// - /// Asynchronously reads the timestamped contents of the PortDIODirection register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -481,7 +481,7 @@ public async Task> ReadTimestampedPortDIODirectionAs } /// - /// Asynchronously writes a value to the PortDIODirection register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -495,7 +495,7 @@ public async Task WritePortDIODirectionAsync(PortDigitalIOS value, CancellationT } /// - /// Asynchronously reads the contents of the PortDIOStateEvent register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -511,7 +511,7 @@ public async Task ReadPortDIOStateEventAsync(CancellationToken c } /// - /// Asynchronously reads the timestamped contents of the PortDIOStateEvent register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -527,7 +527,7 @@ public async Task> ReadTimestampedPortDIOStateEventA } /// - /// Asynchronously reads the contents of the AnalogData register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -543,7 +543,7 @@ public async Task ReadAnalogDataAsync(CancellationToken cance } /// - /// Asynchronously reads the timestamped contents of the AnalogData register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -559,7 +559,7 @@ public async Task> ReadTimestampedAnalogDataAsync } /// - /// Asynchronously reads the contents of the OutputPulseEnable register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -575,7 +575,7 @@ public async Task ReadOutputPulseEnableAsync(CancellationToken c } /// - /// Asynchronously reads the timestamped contents of the OutputPulseEnable register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -591,7 +591,7 @@ public async Task> ReadTimestampedOutputPulseEnableA } /// - /// Asynchronously writes a value to the OutputPulseEnable register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -605,7 +605,7 @@ public async Task WriteOutputPulseEnableAsync(DigitalOutputs value, Cancellation } /// - /// Asynchronously reads the contents of the PulseDOPort0 register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -621,7 +621,7 @@ public async Task ReadPulseDOPort0Async(CancellationToken cancellationTo } /// - /// Asynchronously reads the timestamped contents of the PulseDOPort0 register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -637,7 +637,7 @@ public async Task> ReadTimestampedPulseDOPort0Async(Cancella } /// - /// Asynchronously writes a value to the PulseDOPort0 register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -651,7 +651,7 @@ public async Task WritePulseDOPort0Async(ushort value, CancellationToken cancell } /// - /// Asynchronously reads the contents of the PulseDOPort1 register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -667,7 +667,7 @@ public async Task ReadPulseDOPort1Async(CancellationToken cancellationTo } /// - /// Asynchronously reads the timestamped contents of the PulseDOPort1 register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -683,7 +683,7 @@ public async Task> ReadTimestampedPulseDOPort1Async(Cancella } /// - /// Asynchronously writes a value to the PulseDOPort1 register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -697,7 +697,7 @@ public async Task WritePulseDOPort1Async(ushort value, CancellationToken cancell } /// - /// Asynchronously reads the contents of the PulseDOPort2 register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -713,7 +713,7 @@ public async Task ReadPulseDOPort2Async(CancellationToken cancellationTo } /// - /// Asynchronously reads the timestamped contents of the PulseDOPort2 register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -729,7 +729,7 @@ public async Task> ReadTimestampedPulseDOPort2Async(Cancella } /// - /// Asynchronously writes a value to the PulseDOPort2 register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -743,7 +743,7 @@ public async Task WritePulseDOPort2Async(ushort value, CancellationToken cancell } /// - /// Asynchronously reads the contents of the PulseSupplyPort0 register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -759,7 +759,7 @@ public async Task ReadPulseSupplyPort0Async(CancellationToken cancellati } /// - /// Asynchronously reads the timestamped contents of the PulseSupplyPort0 register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -775,7 +775,7 @@ public async Task> ReadTimestampedPulseSupplyPort0Async(Canc } /// - /// Asynchronously writes a value to the PulseSupplyPort0 register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -789,7 +789,7 @@ public async Task WritePulseSupplyPort0Async(ushort value, CancellationToken can } /// - /// Asynchronously reads the contents of the PulseSupplyPort1 register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -805,7 +805,7 @@ public async Task ReadPulseSupplyPort1Async(CancellationToken cancellati } /// - /// Asynchronously reads the timestamped contents of the PulseSupplyPort1 register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -821,7 +821,7 @@ public async Task> ReadTimestampedPulseSupplyPort1Async(Canc } /// - /// Asynchronously writes a value to the PulseSupplyPort1 register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -835,7 +835,7 @@ public async Task WritePulseSupplyPort1Async(ushort value, CancellationToken can } /// - /// Asynchronously reads the contents of the PulseSupplyPort2 register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -851,7 +851,7 @@ public async Task ReadPulseSupplyPort2Async(CancellationToken cancellati } /// - /// Asynchronously reads the timestamped contents of the PulseSupplyPort2 register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -867,7 +867,7 @@ public async Task> ReadTimestampedPulseSupplyPort2Async(Canc } /// - /// Asynchronously writes a value to the PulseSupplyPort2 register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -881,7 +881,7 @@ public async Task WritePulseSupplyPort2Async(ushort value, CancellationToken can } /// - /// Asynchronously reads the contents of the PulseLed0 register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -897,7 +897,7 @@ public async Task ReadPulseLed0Async(CancellationToken cancellationToken } /// - /// Asynchronously reads the timestamped contents of the PulseLed0 register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -913,7 +913,7 @@ public async Task> ReadTimestampedPulseLed0Async(Cancellatio } /// - /// Asynchronously writes a value to the PulseLed0 register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -927,7 +927,7 @@ public async Task WritePulseLed0Async(ushort value, CancellationToken cancellati } /// - /// Asynchronously reads the contents of the PulseLed1 register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -943,7 +943,7 @@ public async Task ReadPulseLed1Async(CancellationToken cancellationToken } /// - /// Asynchronously reads the timestamped contents of the PulseLed1 register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -959,7 +959,7 @@ public async Task> ReadTimestampedPulseLed1Async(Cancellatio } /// - /// Asynchronously writes a value to the PulseLed1 register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -973,7 +973,7 @@ public async Task WritePulseLed1Async(ushort value, CancellationToken cancellati } /// - /// Asynchronously reads the contents of the PulseRgb0 register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -989,7 +989,7 @@ public async Task ReadPulseRgb0Async(CancellationToken cancellationToken } /// - /// Asynchronously reads the timestamped contents of the PulseRgb0 register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -1005,7 +1005,7 @@ public async Task> ReadTimestampedPulseRgb0Async(Cancellatio } /// - /// Asynchronously writes a value to the PulseRgb0 register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -1019,7 +1019,7 @@ public async Task WritePulseRgb0Async(ushort value, CancellationToken cancellati } /// - /// Asynchronously reads the contents of the PulseRgb1 register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -1035,7 +1035,7 @@ public async Task ReadPulseRgb1Async(CancellationToken cancellationToken } /// - /// Asynchronously reads the timestamped contents of the PulseRgb1 register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -1051,7 +1051,7 @@ public async Task> ReadTimestampedPulseRgb1Async(Cancellatio } /// - /// Asynchronously writes a value to the PulseRgb1 register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -1065,7 +1065,7 @@ public async Task WritePulseRgb1Async(ushort value, CancellationToken cancellati } /// - /// Asynchronously reads the contents of the PulseDO0 register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -1081,7 +1081,7 @@ public async Task ReadPulseDO0Async(CancellationToken cancellationToken } /// - /// Asynchronously reads the timestamped contents of the PulseDO0 register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -1097,7 +1097,7 @@ public async Task> ReadTimestampedPulseDO0Async(Cancellation } /// - /// Asynchronously writes a value to the PulseDO0 register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -1111,7 +1111,7 @@ public async Task WritePulseDO0Async(ushort value, CancellationToken cancellatio } /// - /// Asynchronously reads the contents of the PulseDO1 register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -1127,7 +1127,7 @@ public async Task ReadPulseDO1Async(CancellationToken cancellationToken } /// - /// Asynchronously reads the timestamped contents of the PulseDO1 register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -1143,7 +1143,7 @@ public async Task> ReadTimestampedPulseDO1Async(Cancellation } /// - /// Asynchronously writes a value to the PulseDO1 register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -1157,7 +1157,7 @@ public async Task WritePulseDO1Async(ushort value, CancellationToken cancellatio } /// - /// Asynchronously reads the contents of the PulseDO2 register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -1173,7 +1173,7 @@ public async Task ReadPulseDO2Async(CancellationToken cancellationToken } /// - /// Asynchronously reads the timestamped contents of the PulseDO2 register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -1189,7 +1189,7 @@ public async Task> ReadTimestampedPulseDO2Async(Cancellation } /// - /// Asynchronously writes a value to the PulseDO2 register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -1203,7 +1203,7 @@ public async Task WritePulseDO2Async(ushort value, CancellationToken cancellatio } /// - /// Asynchronously reads the contents of the PulseDO3 register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -1219,7 +1219,7 @@ public async Task ReadPulseDO3Async(CancellationToken cancellationToken } /// - /// Asynchronously reads the timestamped contents of the PulseDO3 register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -1235,7 +1235,7 @@ public async Task> ReadTimestampedPulseDO3Async(Cancellation } /// - /// Asynchronously writes a value to the PulseDO3 register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -1249,7 +1249,7 @@ public async Task WritePulseDO3Async(ushort value, CancellationToken cancellatio } /// - /// Asynchronously reads the contents of the PwmFrequencyDO0 register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -1265,7 +1265,7 @@ public async Task ReadPwmFrequencyDO0Async(CancellationToken cancellatio } /// - /// Asynchronously reads the timestamped contents of the PwmFrequencyDO0 register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -1281,7 +1281,7 @@ public async Task> ReadTimestampedPwmFrequencyDO0Async(Cance } /// - /// Asynchronously writes a value to the PwmFrequencyDO0 register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -1295,7 +1295,7 @@ public async Task WritePwmFrequencyDO0Async(ushort value, CancellationToken canc } /// - /// Asynchronously reads the contents of the PwmFrequencyDO1 register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -1311,7 +1311,7 @@ public async Task ReadPwmFrequencyDO1Async(CancellationToken cancellatio } /// - /// Asynchronously reads the timestamped contents of the PwmFrequencyDO1 register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -1327,7 +1327,7 @@ public async Task> ReadTimestampedPwmFrequencyDO1Async(Cance } /// - /// Asynchronously writes a value to the PwmFrequencyDO1 register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -1341,7 +1341,7 @@ public async Task WritePwmFrequencyDO1Async(ushort value, CancellationToken canc } /// - /// Asynchronously reads the contents of the PwmFrequencyDO2 register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -1357,7 +1357,7 @@ public async Task ReadPwmFrequencyDO2Async(CancellationToken cancellatio } /// - /// Asynchronously reads the timestamped contents of the PwmFrequencyDO2 register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -1373,7 +1373,7 @@ public async Task> ReadTimestampedPwmFrequencyDO2Async(Cance } /// - /// Asynchronously writes a value to the PwmFrequencyDO2 register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -1387,7 +1387,7 @@ public async Task WritePwmFrequencyDO2Async(ushort value, CancellationToken canc } /// - /// Asynchronously reads the contents of the PwmFrequencyDO3 register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -1403,7 +1403,7 @@ public async Task ReadPwmFrequencyDO3Async(CancellationToken cancellatio } /// - /// Asynchronously reads the timestamped contents of the PwmFrequencyDO3 register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -1419,7 +1419,7 @@ public async Task> ReadTimestampedPwmFrequencyDO3Async(Cance } /// - /// Asynchronously writes a value to the PwmFrequencyDO3 register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -1433,7 +1433,7 @@ public async Task WritePwmFrequencyDO3Async(ushort value, CancellationToken canc } /// - /// Asynchronously reads the contents of the PwmDutyCycleDO0 register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -1449,7 +1449,7 @@ public async Task ReadPwmDutyCycleDO0Async(CancellationToken cancellationT } /// - /// Asynchronously reads the timestamped contents of the PwmDutyCycleDO0 register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -1465,7 +1465,7 @@ public async Task> ReadTimestampedPwmDutyCycleDO0Async(Cancell } /// - /// Asynchronously writes a value to the PwmDutyCycleDO0 register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -1479,7 +1479,7 @@ public async Task WritePwmDutyCycleDO0Async(byte value, CancellationToken cancel } /// - /// Asynchronously reads the contents of the PwmDutyCycleDO1 register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -1495,7 +1495,7 @@ public async Task ReadPwmDutyCycleDO1Async(CancellationToken cancellationT } /// - /// Asynchronously reads the timestamped contents of the PwmDutyCycleDO1 register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -1511,7 +1511,7 @@ public async Task> ReadTimestampedPwmDutyCycleDO1Async(Cancell } /// - /// Asynchronously writes a value to the PwmDutyCycleDO1 register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -1525,7 +1525,7 @@ public async Task WritePwmDutyCycleDO1Async(byte value, CancellationToken cancel } /// - /// Asynchronously reads the contents of the PwmDutyCycleDO2 register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -1541,7 +1541,7 @@ public async Task ReadPwmDutyCycleDO2Async(CancellationToken cancellationT } /// - /// Asynchronously reads the timestamped contents of the PwmDutyCycleDO2 register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -1557,7 +1557,7 @@ public async Task> ReadTimestampedPwmDutyCycleDO2Async(Cancell } /// - /// Asynchronously writes a value to the PwmDutyCycleDO2 register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -1571,7 +1571,7 @@ public async Task WritePwmDutyCycleDO2Async(byte value, CancellationToken cancel } /// - /// Asynchronously reads the contents of the PwmDutyCycleDO3 register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -1587,7 +1587,7 @@ public async Task ReadPwmDutyCycleDO3Async(CancellationToken cancellationT } /// - /// Asynchronously reads the timestamped contents of the PwmDutyCycleDO3 register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -1603,7 +1603,7 @@ public async Task> ReadTimestampedPwmDutyCycleDO3Async(Cancell } /// - /// Asynchronously writes a value to the PwmDutyCycleDO3 register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -1617,7 +1617,7 @@ public async Task WritePwmDutyCycleDO3Async(byte value, CancellationToken cancel } /// - /// Asynchronously reads the contents of the PwmStart register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -1633,7 +1633,7 @@ public async Task ReadPwmStartAsync(CancellationToken cancellationTo } /// - /// Asynchronously reads the timestamped contents of the PwmStart register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -1649,7 +1649,7 @@ public async Task> ReadTimestampedPwmStartAsync(Cancella } /// - /// Asynchronously writes a value to the PwmStart register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -1663,7 +1663,7 @@ public async Task WritePwmStartAsync(PwmOutputs value, CancellationToken cancell } /// - /// Asynchronously reads the contents of the PwmStop register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -1679,7 +1679,7 @@ public async Task ReadPwmStopAsync(CancellationToken cancellationTok } /// - /// Asynchronously reads the timestamped contents of the PwmStop register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -1695,7 +1695,7 @@ public async Task> ReadTimestampedPwmStopAsync(Cancellat } /// - /// Asynchronously writes a value to the PwmStop register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -1709,7 +1709,7 @@ public async Task WritePwmStopAsync(PwmOutputs value, CancellationToken cancella } /// - /// Asynchronously reads the contents of the RgbAll register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -1725,7 +1725,7 @@ public async Task ReadRgbAllAsync(CancellationToken cancellationT } /// - /// Asynchronously reads the timestamped contents of the RgbAll register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -1741,7 +1741,7 @@ public async Task> ReadTimestampedRgbAllAsync(Cancell } /// - /// Asynchronously writes a value to the RgbAll register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -1755,7 +1755,7 @@ public async Task WriteRgbAllAsync(RgbAllPayload value, CancellationToken cancel } /// - /// Asynchronously reads the contents of the Rgb0 register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -1771,7 +1771,7 @@ public async Task ReadRgb0Async(CancellationToken cancellationToken } /// - /// Asynchronously reads the timestamped contents of the Rgb0 register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -1787,7 +1787,7 @@ public async Task> ReadTimestampedRgb0Async(Cancellation } /// - /// Asynchronously writes a value to the Rgb0 register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -1801,7 +1801,7 @@ public async Task WriteRgb0Async(RgbPayload value, CancellationToken cancellatio } /// - /// Asynchronously reads the contents of the Rgb1 register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -1817,7 +1817,7 @@ public async Task ReadRgb1Async(CancellationToken cancellationToken } /// - /// Asynchronously reads the timestamped contents of the Rgb1 register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -1833,7 +1833,7 @@ public async Task> ReadTimestampedRgb1Async(Cancellation } /// - /// Asynchronously writes a value to the Rgb1 register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -1847,7 +1847,7 @@ public async Task WriteRgb1Async(RgbPayload value, CancellationToken cancellatio } /// - /// Asynchronously reads the contents of the Led0Current register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -1863,7 +1863,7 @@ public async Task ReadLed0CurrentAsync(CancellationToken cancellationToken } /// - /// Asynchronously reads the timestamped contents of the Led0Current register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -1879,7 +1879,7 @@ public async Task> ReadTimestampedLed0CurrentAsync(Cancellatio } /// - /// Asynchronously writes a value to the Led0Current register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -1893,7 +1893,7 @@ public async Task WriteLed0CurrentAsync(byte value, CancellationToken cancellati } /// - /// Asynchronously reads the contents of the Led1Current register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -1909,7 +1909,7 @@ public async Task ReadLed1CurrentAsync(CancellationToken cancellationToken } /// - /// Asynchronously reads the timestamped contents of the Led1Current register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -1925,7 +1925,7 @@ public async Task> ReadTimestampedLed1CurrentAsync(Cancellatio } /// - /// Asynchronously writes a value to the Led1Current register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -1939,7 +1939,7 @@ public async Task WriteLed1CurrentAsync(byte value, CancellationToken cancellati } /// - /// Asynchronously reads the contents of the Led0MaxCurrent register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -1955,7 +1955,7 @@ public async Task ReadLed0MaxCurrentAsync(CancellationToken cancellationTo } /// - /// Asynchronously reads the timestamped contents of the Led0MaxCurrent register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -1971,7 +1971,7 @@ public async Task> ReadTimestampedLed0MaxCurrentAsync(Cancella } /// - /// Asynchronously writes a value to the Led0MaxCurrent register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -1985,7 +1985,7 @@ public async Task WriteLed0MaxCurrentAsync(byte value, CancellationToken cancell } /// - /// Asynchronously reads the contents of the Led1MaxCurrent register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -2001,7 +2001,7 @@ public async Task ReadLed1MaxCurrentAsync(CancellationToken cancellationTo } /// - /// Asynchronously reads the timestamped contents of the Led1MaxCurrent register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -2017,7 +2017,7 @@ public async Task> ReadTimestampedLed1MaxCurrentAsync(Cancella } /// - /// Asynchronously writes a value to the Led1MaxCurrent register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -2031,7 +2031,7 @@ public async Task WriteLed1MaxCurrentAsync(byte value, CancellationToken cancell } /// - /// Asynchronously reads the contents of the EventEnable register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -2047,7 +2047,7 @@ public async Task ReadEventEnableAsync(CancellationToken cancellationTok } /// - /// Asynchronously reads the timestamped contents of the EventEnable register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -2063,7 +2063,7 @@ public async Task> ReadTimestampedEventEnableAsync(Cancellat } /// - /// Asynchronously writes a value to the EventEnable register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -2077,7 +2077,7 @@ public async Task WriteEventEnableAsync(Events value, CancellationToken cancella } /// - /// Asynchronously reads the contents of the StartCameras register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -2093,7 +2093,7 @@ public async Task ReadStartCamerasAsync(CancellationToken cancell } /// - /// Asynchronously reads the timestamped contents of the StartCameras register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -2109,7 +2109,7 @@ public async Task> ReadTimestampedStartCamerasAsync(C } /// - /// Asynchronously writes a value to the StartCameras register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -2123,7 +2123,7 @@ public async Task WriteStartCamerasAsync(CameraOutputs value, CancellationToken } /// - /// Asynchronously reads the contents of the StopCameras register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -2139,7 +2139,7 @@ public async Task ReadStopCamerasAsync(CancellationToken cancella } /// - /// Asynchronously reads the timestamped contents of the StopCameras register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -2155,7 +2155,7 @@ public async Task> ReadTimestampedStopCamerasAsync(Ca } /// - /// Asynchronously writes a value to the StopCameras register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -2169,7 +2169,7 @@ public async Task WriteStopCamerasAsync(CameraOutputs value, CancellationToken c } /// - /// Asynchronously reads the contents of the EnableServos register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -2185,7 +2185,7 @@ public async Task ReadEnableServosAsync(CancellationToken cancella } /// - /// Asynchronously reads the timestamped contents of the EnableServos register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -2201,7 +2201,7 @@ public async Task> ReadTimestampedEnableServosAsync(Ca } /// - /// Asynchronously writes a value to the EnableServos register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -2215,7 +2215,7 @@ public async Task WriteEnableServosAsync(ServoOutputs value, CancellationToken c } /// - /// Asynchronously reads the contents of the DisableServos register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -2231,7 +2231,7 @@ public async Task ReadDisableServosAsync(CancellationToken cancell } /// - /// Asynchronously reads the timestamped contents of the DisableServos register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -2247,7 +2247,7 @@ public async Task> ReadTimestampedDisableServosAsync(C } /// - /// Asynchronously writes a value to the DisableServos register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -2261,7 +2261,7 @@ public async Task WriteDisableServosAsync(ServoOutputs value, CancellationToken } /// - /// Asynchronously reads the contents of the EnableEncoders register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -2277,7 +2277,7 @@ public async Task ReadEnableEncodersAsync(CancellationToken cance } /// - /// Asynchronously reads the timestamped contents of the EnableEncoders register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -2293,7 +2293,7 @@ public async Task> ReadTimestampedEnableEncodersAsync } /// - /// Asynchronously writes a value to the EnableEncoders register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -2307,7 +2307,7 @@ public async Task WriteEnableEncodersAsync(EncoderInputs value, CancellationToke } /// - /// Asynchronously reads the contents of the EncoderMode register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -2323,7 +2323,7 @@ public async Task ReadEncoderModeAsync(CancellationToken canc } /// - /// Asynchronously reads the timestamped contents of the EncoderMode register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -2339,7 +2339,7 @@ public async Task> ReadTimestampedEncoderModeAsyn } /// - /// Asynchronously writes a value to the EncoderMode register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -2353,7 +2353,7 @@ public async Task WriteEncoderModeAsync(EncoderModeConfig value, CancellationTok } /// - /// Asynchronously reads the contents of the Camera0Frame register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -2369,7 +2369,7 @@ public async Task ReadCamera0FrameAsync(CancellationToken cancell } /// - /// Asynchronously reads the timestamped contents of the Camera0Frame register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -2385,7 +2385,7 @@ public async Task> ReadTimestampedCamera0FrameAsync(C } /// - /// Asynchronously reads the contents of the Camera0Frequency register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -2401,7 +2401,7 @@ public async Task ReadCamera0FrequencyAsync(CancellationToken cancellati } /// - /// Asynchronously reads the timestamped contents of the Camera0Frequency register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -2417,7 +2417,7 @@ public async Task> ReadTimestampedCamera0FrequencyAsync(Canc } /// - /// Asynchronously writes a value to the Camera0Frequency register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -2431,7 +2431,7 @@ public async Task WriteCamera0FrequencyAsync(ushort value, CancellationToken can } /// - /// Asynchronously reads the contents of the Camera1Frame register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -2447,7 +2447,7 @@ public async Task ReadCamera1FrameAsync(CancellationToken cancell } /// - /// Asynchronously reads the timestamped contents of the Camera1Frame register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -2463,7 +2463,7 @@ public async Task> ReadTimestampedCamera1FrameAsync(C } /// - /// Asynchronously reads the contents of the Camera1Frequency register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -2479,7 +2479,7 @@ public async Task ReadCamera1FrequencyAsync(CancellationToken cancellati } /// - /// Asynchronously reads the timestamped contents of the Camera1Frequency register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -2495,7 +2495,7 @@ public async Task> ReadTimestampedCamera1FrequencyAsync(Canc } /// - /// Asynchronously writes a value to the Camera1Frequency register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -2509,7 +2509,7 @@ public async Task WriteCamera1FrequencyAsync(ushort value, CancellationToken can } /// - /// Asynchronously reads the contents of the ServoMotor2Period register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -2525,7 +2525,7 @@ public async Task ReadServoMotor2PeriodAsync(CancellationToken cancellat } /// - /// Asynchronously reads the timestamped contents of the ServoMotor2Period register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -2541,7 +2541,7 @@ public async Task> ReadTimestampedServoMotor2PeriodAsync(Can } /// - /// Asynchronously writes a value to the ServoMotor2Period register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -2555,7 +2555,7 @@ public async Task WriteServoMotor2PeriodAsync(ushort value, CancellationToken ca } /// - /// Asynchronously reads the contents of the ServoMotor2Pulse register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -2571,7 +2571,7 @@ public async Task ReadServoMotor2PulseAsync(CancellationToken cancellati } /// - /// Asynchronously reads the timestamped contents of the ServoMotor2Pulse register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -2587,7 +2587,7 @@ public async Task> ReadTimestampedServoMotor2PulseAsync(Canc } /// - /// Asynchronously writes a value to the ServoMotor2Pulse register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -2601,7 +2601,7 @@ public async Task WriteServoMotor2PulseAsync(ushort value, CancellationToken can } /// - /// Asynchronously reads the contents of the ServoMotor3Period register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -2617,7 +2617,7 @@ public async Task ReadServoMotor3PeriodAsync(CancellationToken cancellat } /// - /// Asynchronously reads the timestamped contents of the ServoMotor3Period register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -2633,7 +2633,7 @@ public async Task> ReadTimestampedServoMotor3PeriodAsync(Can } /// - /// Asynchronously writes a value to the ServoMotor3Period register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -2647,7 +2647,7 @@ public async Task WriteServoMotor3PeriodAsync(ushort value, CancellationToken ca } /// - /// Asynchronously reads the contents of the ServoMotor3Pulse register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -2663,7 +2663,7 @@ public async Task ReadServoMotor3PulseAsync(CancellationToken cancellati } /// - /// Asynchronously reads the timestamped contents of the ServoMotor3Pulse register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -2679,7 +2679,7 @@ public async Task> ReadTimestampedServoMotor3PulseAsync(Canc } /// - /// Asynchronously writes a value to the ServoMotor3Pulse register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -2693,7 +2693,7 @@ public async Task WriteServoMotor3PulseAsync(ushort value, CancellationToken can } /// - /// Asynchronously reads the contents of the EncoderReset register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -2709,7 +2709,7 @@ public async Task ReadEncoderResetAsync(CancellationToken cancell } /// - /// Asynchronously reads the timestamped contents of the EncoderReset register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -2725,7 +2725,7 @@ public async Task> ReadTimestampedEncoderResetAsync(C } /// - /// Asynchronously writes a value to the EncoderReset register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -2739,7 +2739,7 @@ public async Task WriteEncoderResetAsync(EncoderInputs value, CancellationToken } /// - /// Asynchronously reads the contents of the EnableSerialTimestamp register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -2755,7 +2755,7 @@ public async Task ReadEnableSerialTimestampAsync(Cancellat } /// - /// Asynchronously reads the timestamped contents of the EnableSerialTimestamp register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -2771,7 +2771,7 @@ public async Task> ReadTimestampedEnableSerial } /// - /// Asynchronously writes a value to the EnableSerialTimestamp register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -2785,7 +2785,7 @@ public async Task WriteEnableSerialTimestampAsync(SerialTimestampPorts value, Ca } /// - /// Asynchronously reads the contents of the MimicPort0IR register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -2801,7 +2801,7 @@ public async Task ReadMimicPort0IRAsync(CancellationToken cancellat } /// - /// Asynchronously reads the timestamped contents of the MimicPort0IR register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -2817,7 +2817,7 @@ public async Task> ReadTimestampedMimicPort0IRAsync(Can } /// - /// Asynchronously writes a value to the MimicPort0IR register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -2831,7 +2831,7 @@ public async Task WriteMimicPort0IRAsync(MimicOutput value, CancellationToken ca } /// - /// Asynchronously reads the contents of the MimicPort1IR register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -2847,7 +2847,7 @@ public async Task ReadMimicPort1IRAsync(CancellationToken cancellat } /// - /// Asynchronously reads the timestamped contents of the MimicPort1IR register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -2863,7 +2863,7 @@ public async Task> ReadTimestampedMimicPort1IRAsync(Can } /// - /// Asynchronously writes a value to the MimicPort1IR register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -2877,7 +2877,7 @@ public async Task WriteMimicPort1IRAsync(MimicOutput value, CancellationToken ca } /// - /// Asynchronously reads the contents of the MimicPort2IR register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -2893,7 +2893,7 @@ public async Task ReadMimicPort2IRAsync(CancellationToken cancellat } /// - /// Asynchronously reads the timestamped contents of the MimicPort2IR register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -2909,7 +2909,7 @@ public async Task> ReadTimestampedMimicPort2IRAsync(Can } /// - /// Asynchronously writes a value to the MimicPort2IR register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -2923,7 +2923,7 @@ public async Task WriteMimicPort2IRAsync(MimicOutput value, CancellationToken ca } /// - /// Asynchronously reads the contents of the MimicPort0Valve register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -2939,7 +2939,7 @@ public async Task ReadMimicPort0ValveAsync(CancellationToken cancel } /// - /// Asynchronously reads the timestamped contents of the MimicPort0Valve register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -2955,7 +2955,7 @@ public async Task> ReadTimestampedMimicPort0ValveAsync( } /// - /// Asynchronously writes a value to the MimicPort0Valve register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -2969,7 +2969,7 @@ public async Task WriteMimicPort0ValveAsync(MimicOutput value, CancellationToken } /// - /// Asynchronously reads the contents of the MimicPort1Valve register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -2985,7 +2985,7 @@ public async Task ReadMimicPort1ValveAsync(CancellationToken cancel } /// - /// Asynchronously reads the timestamped contents of the MimicPort1Valve register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -3001,7 +3001,7 @@ public async Task> ReadTimestampedMimicPort1ValveAsync( } /// - /// Asynchronously writes a value to the MimicPort1Valve register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -3015,7 +3015,7 @@ public async Task WriteMimicPort1ValveAsync(MimicOutput value, CancellationToken } /// - /// Asynchronously reads the contents of the MimicPort2Valve register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -3031,7 +3031,7 @@ public async Task ReadMimicPort2ValveAsync(CancellationToken cancel } /// - /// Asynchronously reads the timestamped contents of the MimicPort2Valve register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -3047,7 +3047,7 @@ public async Task> ReadTimestampedMimicPort2ValveAsync( } /// - /// Asynchronously writes a value to the MimicPort2Valve register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// @@ -3061,7 +3061,7 @@ public async Task WriteMimicPort2ValveAsync(MimicOutput value, CancellationToken } /// - /// Asynchronously reads the contents of the PokeInputFilter register. + /// Asynchronously reads the contents of the register. /// /// /// A which can be used to cancel the operation. @@ -3077,7 +3077,7 @@ public async Task ReadPokeInputFilterAsync(CancellationToken cancellationT } /// - /// Asynchronously reads the timestamped contents of the PokeInputFilter register. + /// Asynchronously reads the timestamped contents of the register. /// /// /// A which can be used to cancel the operation. @@ -3093,7 +3093,7 @@ public async Task> ReadTimestampedPokeInputFilterAsync(Cancell } /// - /// Asynchronously writes a value to the PokeInputFilter register. + /// Asynchronously writes a value to the register. /// /// The value to be stored in the register. /// diff --git a/Interface/Harp.Behavior/Device.Generated.cs b/Interface/Harp.Behavior/Device.Generated.cs index 3a59156..0e36d0d 100644 --- a/Interface/Harp.Behavior/Device.Generated.cs +++ b/Interface/Harp.Behavior/Device.Generated.cs @@ -191,6 +191,7 @@ public override IObservable> Process(IObse /// Represents an operator that writes the sequence of " messages /// to the standard Harp storage format. /// + [DefaultProperty(nameof(Path))] [Description("Writes the sequence of Behavior messages to the standard Harp storage format.")] public partial class DeviceDataWriter : Sink, INamedElement { @@ -12539,4 +12540,109 @@ public enum EncoderModeConfig : byte Position = 0, Displacement = 1 } + + internal static partial class PayloadMarshal + { + internal static T[] GetSubArray(T[] array, int offset, int count) + { + var result = new T[count]; + Array.Copy(array, offset, result, 0, count); + return result; + } + + internal static byte ReadByte(ArraySegment segment) => segment.Array[segment.Offset]; + + internal static sbyte ReadSByte(ArraySegment segment) => (sbyte)segment.Array[segment.Offset]; + + internal static ushort ReadUInt16(ArraySegment segment) => BitConverter.ToUInt16(segment.Array, segment.Offset); + + internal static short ReadInt16(ArraySegment segment) => BitConverter.ToInt16(segment.Array, segment.Offset); + + internal static uint ReadUInt32(ArraySegment segment) => BitConverter.ToUInt32(segment.Array, segment.Offset); + + internal static int ReadInt32(ArraySegment segment) => BitConverter.ToInt32(segment.Array, segment.Offset); + + internal static ulong ReadUInt64(ArraySegment segment) => BitConverter.ToUInt64(segment.Array, segment.Offset); + + internal static long ReadInt64(ArraySegment segment) => BitConverter.ToInt64(segment.Array, segment.Offset); + + internal static float ReadSingle(ArraySegment segment) => BitConverter.ToSingle(segment.Array, segment.Offset); + + internal static string ReadUtf8String(ArraySegment segment) + { + var count = Array.IndexOf(segment.Array, (byte)0, segment.Offset, segment.Count) - segment.Offset; + return System.Text.Encoding.UTF8.GetString(segment.Array, segment.Offset, count < 0 ? segment.Count : count); + } + + internal static void Write(ArraySegment segment, byte value) => segment.Array[segment.Offset] = value; + + internal static void Write(ArraySegment segment, sbyte value) => segment.Array[segment.Offset] = (byte)value; + + internal static void Write(ArraySegment segment, ushort value) + { + segment.Array[segment.Offset] = (byte)value; + segment.Array[segment.Offset + 1] = (byte)(value >> 8); + } + + internal static void Write(ArraySegment segment, short value) + { + segment.Array[segment.Offset] = (byte)value; + segment.Array[segment.Offset + 1] = (byte)(value >> 8); + } + + internal static void Write(ArraySegment segment, uint value) + { + segment.Array[segment.Offset] = (byte)value; + segment.Array[segment.Offset + 1] = (byte)(value >> 8); + segment.Array[segment.Offset + 2] = (byte)(value >> 16); + segment.Array[segment.Offset + 3] = (byte)(value >> 24); + } + + internal static void Write(ArraySegment segment, int value) + { + segment.Array[segment.Offset] = (byte)value; + segment.Array[segment.Offset + 1] = (byte)(value >> 8); + segment.Array[segment.Offset + 2] = (byte)(value >> 16); + segment.Array[segment.Offset + 3] = (byte)(value >> 24); + } + + internal static void Write(ArraySegment segment, ulong value) + { + segment.Array[segment.Offset] = (byte)value; + segment.Array[segment.Offset + 1] = (byte)(value >> 8); + segment.Array[segment.Offset + 2] = (byte)(value >> 16); + segment.Array[segment.Offset + 3] = (byte)(value >> 24); + segment.Array[segment.Offset + 4] = (byte)(value >> 32); + segment.Array[segment.Offset + 5] = (byte)(value >> 40); + segment.Array[segment.Offset + 6] = (byte)(value >> 48); + segment.Array[segment.Offset + 7] = (byte)(value >> 56); + } + + internal static void Write(ArraySegment segment, long value) + { + segment.Array[segment.Offset] = (byte)value; + segment.Array[segment.Offset + 1] = (byte)(value >> 8); + segment.Array[segment.Offset + 2] = (byte)(value >> 16); + segment.Array[segment.Offset + 3] = (byte)(value >> 24); + segment.Array[segment.Offset + 4] = (byte)(value >> 32); + segment.Array[segment.Offset + 5] = (byte)(value >> 40); + segment.Array[segment.Offset + 6] = (byte)(value >> 48); + segment.Array[segment.Offset + 7] = (byte)(value >> 56); + } + + internal static unsafe void Write(ArraySegment segment, float value) => Write(segment, *(int*)&value); + + internal static unsafe void Write(ArraySegment segment, string value) => + System.Text.Encoding.UTF8.GetBytes(value, 0, Math.Min(value.Length, segment.Count), segment.Array, segment.Offset); + + internal static void Write(ArraySegment segment, T[] values) where T : unmanaged + { + Buffer.BlockCopy(values, 0, segment.Array, segment.Offset, segment.Count); + } + + internal static void Write(ArraySegment segment, T[] values) + { + Array.Copy(values, 0, segment.Array, segment.Offset, segment.Count); + } + } } diff --git a/Interface/Harp.Behavior/Harp.Behavior.csproj b/Interface/Harp.Behavior/Harp.Behavior.csproj index 04f6642..9320794 100644 --- a/Interface/Harp.Behavior/Harp.Behavior.csproj +++ b/Interface/Harp.Behavior/Harp.Behavior.csproj @@ -16,6 +16,7 @@ README.md ..\bin\$(Configuration) net462;netstandard2.0 + true 9.0 From ab778e323541494700ebdc282427d7483ef2fbec Mon Sep 17 00:00:00 2001 From: glopesdev Date: Sun, 22 Mar 2026 10:09:27 +0000 Subject: [PATCH 7/7] Adopt naming convention for mask suffix This allows removing redundant words from firmware definition names. The version of the generators is also updated bringing minor improvements to interface documentation wording. --- .config/dotnet-tools.json | 2 +- Firmware/Behavior/app.c | 2 +- Firmware/Behavior/app_funcs.c | 2 +- Firmware/Behavior/app_ios_and_regs.c | 2 +- Firmware/Behavior/app_ios_and_regs.h | 98 +-- .../Harp.Behavior/AsyncDevice.Generated.cs | 676 +++++++++--------- Interface/Harp.Behavior/Device.Generated.cs | 20 +- device.yml | 4 +- 8 files changed, 403 insertions(+), 403 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index d3c7d2e..ac75f2c 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "harp.toolkit": { - "version": "0.2.0", + "version": "0.2.2", "commands": [ "harp.toolkit" ], diff --git a/Firmware/Behavior/app.c b/Firmware/Behavior/app.c index b5f8094..adf41df 100644 --- a/Firmware/Behavior/app.c +++ b/Firmware/Behavior/app.c @@ -374,7 +374,7 @@ void core_callback_t_before_exec(void) { int16_t timer_cnt = TCD1_CNT; - if (app_regs.REG_ENCODER_MODE == GM_ENCODER_MODE_CONFIG_POSITION) + if (app_regs.REG_ENCODER_MODE == GM_ENCODER_MODE_POSITION) { if (timer_cnt > 32768) { diff --git a/Firmware/Behavior/app_funcs.c b/Firmware/Behavior/app_funcs.c index 5fa505e..26d3826 100644 --- a/Firmware/Behavior/app_funcs.c +++ b/Firmware/Behavior/app_funcs.c @@ -1532,7 +1532,7 @@ bool app_write_REG_ENCODER_MODE(void *a) { uint8_t reg = *((uint8_t*)a); - if (reg & ~MSK_ENCODER_MODE_CONFIG_SEL) return false; + if (reg & ~MSK_ENCODER_MODE) return false; app_regs.REG_ENCODER_MODE = reg; return true; diff --git a/Firmware/Behavior/app_ios_and_regs.c b/Firmware/Behavior/app_ios_and_regs.c index 821c4d9..29869bb 100644 --- a/Firmware/Behavior/app_ios_and_regs.c +++ b/Firmware/Behavior/app_ios_and_regs.c @@ -6,7 +6,7 @@ extern AppRegs app_regs; void mimic_ir_or_valve (uint8_t reg, uint8_t what_to_do) { - if (reg & MSK_MIMIC_OUTPUT_SEL) + if (reg & MSK_MIMIC_OUTPUT) { switch (reg) { diff --git a/Firmware/Behavior/app_ios_and_regs.h b/Firmware/Behavior/app_ios_and_regs.h index 7b61ef5..7119555 100644 --- a/Firmware/Behavior/app_ios_and_regs.h +++ b/Firmware/Behavior/app_ios_and_regs.h @@ -334,54 +334,54 @@ typedef struct /************************************************************************/ /* Registers' bits */ /************************************************************************/ -#define B_DI_PORT0 (1<<0) // Port 0 digital input -#define B_DI_PORT1 (1<<1) // Port 1 digital input -#define B_DI_PORT2 (1<<2) // Port 2 digital input -#define B_DI3 (1<<3) // Digital input DI3 -#define B_DO_PORT0 (1<<0) // -#define B_DO_PORT1 (1<<1) // -#define B_DO_PORT2 (1<<2) // -#define B_SUPPLY_PORT0 (1<<3) // -#define B_SUPPLY_PORT1 (1<<4) // -#define B_SUPPLY_PORT2 (1<<5) // -#define B_LED0 (1<<6) // -#define B_LED1 (1<<7) // -#define B_RGB0 (1<<8) // -#define B_RGB1 (1<<9) // -#define B_DO0 (1<<10) // -#define B_DO1 (1<<11) // -#define B_DO2 (1<<12) // -#define B_DO3 (1<<13) // -#define B_DIO0 (1<<0) // -#define B_DIO1 (1<<1) // -#define B_DIO2 (1<<2) // -#define B_PWM_DO0 (1<<0) // -#define B_PWM_DO1 (1<<1) // -#define B_PWM_DO2 (1<<2) // -#define B_PWM_DO3 (1<<3) // -#define B_PORT_DI (1<<0) // Event from register DigitalInputState -#define B_PORT_DIO (1<<1) // Event from register PortDIOStateEvent -#define B_ANALOG_DATA (1<<2) // Event from register AnalogData -#define B_CAMERA0 (1<<3) // Event from register Camera0Frame -#define B_CAMERA1 (1<<4) // Event from register Camera1Frame -#define B_CAMERA_OUTPUT0 (1<<0) // Camera on digital output 0 -#define B_CAMERA_OUTPUT1 (1<<1) // Camera on digital output 1 -#define B_SERVO_OUTPUT2 (1<<2) // Servo on digital output 2 -#define B_SERVO_OUTPUT3 (1<<3) // Servo on digital output 3 -#define B_ENCODER_PORT2 (1<<2) // Encoder on port 2 -#define B_FRAME_ACQUIRED (1<<0) // Camera frame was triggered -#define B_TIMESTAMP_PORT2 (1<<2) // Enable the serial timestamp TX on Port 2 -#define MSK_MIMIC_OUTPUT_SEL 0x07 // -#define GM_MIMIC_OUTPUT_NONE 0x00 // -#define GM_MIMIC_OUTPUT_DIO0 0x01 // Is reflected on DIO0 -#define GM_MIMIC_OUTPUT_DIO1 0x02 // Is reflected on DIO1 -#define GM_MIMIC_OUTPUT_DIO2 0x03 // Is reflected on DIO2 -#define GM_MIMIC_OUTPUT_DO0 0x04 // Is reflected on DO0 -#define GM_MIMIC_OUTPUT_DO1 0x05 // Is reflected on DO1 -#define GM_MIMIC_OUTPUT_DO2 0x06 // Is reflected on DO2 -#define GM_MIMIC_OUTPUT_DO3 0x07 // Is reflected on DO3 -#define MSK_ENCODER_MODE_CONFIG_SEL 0x01 // -#define GM_ENCODER_MODE_CONFIG_POSITION 0x00 // -#define GM_ENCODER_MODE_CONFIG_DISPLACEMENT 0x01 // +#define B_DI_PORT0 (1<<0) // Port 0 digital input +#define B_DI_PORT1 (1<<1) // Port 1 digital input +#define B_DI_PORT2 (1<<2) // Port 2 digital input +#define B_DI3 (1<<3) // Digital input DI3 +#define B_DO_PORT0 (1<<0) // +#define B_DO_PORT1 (1<<1) // +#define B_DO_PORT2 (1<<2) // +#define B_SUPPLY_PORT0 (1<<3) // +#define B_SUPPLY_PORT1 (1<<4) // +#define B_SUPPLY_PORT2 (1<<5) // +#define B_LED0 (1<<6) // +#define B_LED1 (1<<7) // +#define B_RGB0 (1<<8) // +#define B_RGB1 (1<<9) // +#define B_DO0 (1<<10) // +#define B_DO1 (1<<11) // +#define B_DO2 (1<<12) // +#define B_DO3 (1<<13) // +#define B_DIO0 (1<<0) // +#define B_DIO1 (1<<1) // +#define B_DIO2 (1<<2) // +#define B_PWM_DO0 (1<<0) // +#define B_PWM_DO1 (1<<1) // +#define B_PWM_DO2 (1<<2) // +#define B_PWM_DO3 (1<<3) // +#define B_PORT_DI (1<<0) // Event from register DigitalInputState +#define B_PORT_DIO (1<<1) // Event from register PortDIOStateEvent +#define B_ANALOG_DATA (1<<2) // Event from register AnalogData +#define B_CAMERA0 (1<<3) // Event from register Camera0Frame +#define B_CAMERA1 (1<<4) // Event from register Camera1Frame +#define B_CAMERA_OUTPUT0 (1<<0) // Camera on digital output 0 +#define B_CAMERA_OUTPUT1 (1<<1) // Camera on digital output 1 +#define B_SERVO_OUTPUT2 (1<<2) // Servo on digital output 2 +#define B_SERVO_OUTPUT3 (1<<3) // Servo on digital output 3 +#define B_ENCODER_PORT2 (1<<2) // Encoder on port 2 +#define B_FRAME_ACQUIRED (1<<0) // Camera frame was triggered +#define B_TIMESTAMP_PORT2 (1<<2) // Enable the serial timestamp TX on Port 2 +#define MSK_MIMIC_OUTPUT 0x07 // +#define GM_MIMIC_OUTPUT_NONE 0x00 // +#define GM_MIMIC_OUTPUT_DIO0 0x01 // Is reflected on DIO0 +#define GM_MIMIC_OUTPUT_DIO1 0x02 // Is reflected on DIO1 +#define GM_MIMIC_OUTPUT_DIO2 0x03 // Is reflected on DIO2 +#define GM_MIMIC_OUTPUT_DO0 0x04 // Is reflected on DO0 +#define GM_MIMIC_OUTPUT_DO1 0x05 // Is reflected on DO1 +#define GM_MIMIC_OUTPUT_DO2 0x06 // Is reflected on DO2 +#define GM_MIMIC_OUTPUT_DO3 0x07 // Is reflected on DO3 +#define MSK_ENCODER_MODE 0x01 // +#define GM_ENCODER_MODE_POSITION 0x00 // +#define GM_ENCODER_MODE_DISPLACEMENT 0x01 // #endif /* _APP_REGS_H_ */ \ No newline at end of file diff --git a/Interface/Harp.Behavior/AsyncDevice.Generated.cs b/Interface/Harp.Behavior/AsyncDevice.Generated.cs index 2cb61fc..14306ac 100644 --- a/Interface/Harp.Behavior/AsyncDevice.Generated.cs +++ b/Interface/Harp.Behavior/AsyncDevice.Generated.cs @@ -55,8 +55,8 @@ internal AsyncDevice(string portName) /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadDigitalInputStateAsync(CancellationToken cancellationToken = default) { @@ -71,8 +71,8 @@ public async Task ReadDigitalInputStateAsync(CancellationToken ca /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedDigitalInputStateAsync(CancellationToken cancellationToken = default) { @@ -87,8 +87,8 @@ public async Task> ReadTimestampedDigitalInputStateAs /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadOutputSetAsync(CancellationToken cancellationToken = default) { @@ -103,8 +103,8 @@ public async Task ReadOutputSetAsync(CancellationToken cancellat /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedOutputSetAsync(CancellationToken cancellationToken = default) { @@ -115,7 +115,7 @@ public async Task> ReadTimestampedOutputSetAsync(Can /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -133,8 +133,8 @@ public async Task WriteOutputSetAsync(DigitalOutputs value, CancellationToken ca /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadOutputClearAsync(CancellationToken cancellationToken = default) { @@ -149,8 +149,8 @@ public async Task ReadOutputClearAsync(CancellationToken cancell /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedOutputClearAsync(CancellationToken cancellationToken = default) { @@ -161,7 +161,7 @@ public async Task> ReadTimestampedOutputClearAsync(C /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -179,8 +179,8 @@ public async Task WriteOutputClearAsync(DigitalOutputs value, CancellationToken /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadOutputToggleAsync(CancellationToken cancellationToken = default) { @@ -195,8 +195,8 @@ public async Task ReadOutputToggleAsync(CancellationToken cancel /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedOutputToggleAsync(CancellationToken cancellationToken = default) { @@ -207,7 +207,7 @@ public async Task> ReadTimestampedOutputToggleAsync( /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -225,8 +225,8 @@ public async Task WriteOutputToggleAsync(DigitalOutputs value, CancellationToken /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadOutputStateAsync(CancellationToken cancellationToken = default) { @@ -241,8 +241,8 @@ public async Task ReadOutputStateAsync(CancellationToken cancell /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedOutputStateAsync(CancellationToken cancellationToken = default) { @@ -253,7 +253,7 @@ public async Task> ReadTimestampedOutputStateAsync(C /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -271,8 +271,8 @@ public async Task WriteOutputStateAsync(DigitalOutputs value, CancellationToken /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadPortDIOSetAsync(CancellationToken cancellationToken = default) { @@ -287,8 +287,8 @@ public async Task ReadPortDIOSetAsync(CancellationToken cancella /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedPortDIOSetAsync(CancellationToken cancellationToken = default) { @@ -299,7 +299,7 @@ public async Task> ReadTimestampedPortDIOSetAsync(Ca /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -317,8 +317,8 @@ public async Task WritePortDIOSetAsync(PortDigitalIOS value, CancellationToken c /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadPortDIOClearAsync(CancellationToken cancellationToken = default) { @@ -333,8 +333,8 @@ public async Task ReadPortDIOClearAsync(CancellationToken cancel /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedPortDIOClearAsync(CancellationToken cancellationToken = default) { @@ -345,7 +345,7 @@ public async Task> ReadTimestampedPortDIOClearAsync( /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -363,8 +363,8 @@ public async Task WritePortDIOClearAsync(PortDigitalIOS value, CancellationToken /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadPortDIOToggleAsync(CancellationToken cancellationToken = default) { @@ -379,8 +379,8 @@ public async Task ReadPortDIOToggleAsync(CancellationToken cance /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedPortDIOToggleAsync(CancellationToken cancellationToken = default) { @@ -391,7 +391,7 @@ public async Task> ReadTimestampedPortDIOToggleAsync /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -409,8 +409,8 @@ public async Task WritePortDIOToggleAsync(PortDigitalIOS value, CancellationToke /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadPortDIOStateAsync(CancellationToken cancellationToken = default) { @@ -425,8 +425,8 @@ public async Task ReadPortDIOStateAsync(CancellationToken cancel /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedPortDIOStateAsync(CancellationToken cancellationToken = default) { @@ -437,7 +437,7 @@ public async Task> ReadTimestampedPortDIOStateAsync( /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -455,8 +455,8 @@ public async Task WritePortDIOStateAsync(PortDigitalIOS value, CancellationToken /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadPortDIODirectionAsync(CancellationToken cancellationToken = default) { @@ -471,8 +471,8 @@ public async Task ReadPortDIODirectionAsync(CancellationToken ca /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedPortDIODirectionAsync(CancellationToken cancellationToken = default) { @@ -483,7 +483,7 @@ public async Task> ReadTimestampedPortDIODirectionAs /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -501,8 +501,8 @@ public async Task WritePortDIODirectionAsync(PortDigitalIOS value, CancellationT /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadPortDIOStateEventAsync(CancellationToken cancellationToken = default) { @@ -517,8 +517,8 @@ public async Task ReadPortDIOStateEventAsync(CancellationToken c /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedPortDIOStateEventAsync(CancellationToken cancellationToken = default) { @@ -533,8 +533,8 @@ public async Task> ReadTimestampedPortDIOStateEventA /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadAnalogDataAsync(CancellationToken cancellationToken = default) { @@ -549,8 +549,8 @@ public async Task ReadAnalogDataAsync(CancellationToken cance /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedAnalogDataAsync(CancellationToken cancellationToken = default) { @@ -565,8 +565,8 @@ public async Task> ReadTimestampedAnalogDataAsync /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadOutputPulseEnableAsync(CancellationToken cancellationToken = default) { @@ -581,8 +581,8 @@ public async Task ReadOutputPulseEnableAsync(CancellationToken c /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedOutputPulseEnableAsync(CancellationToken cancellationToken = default) { @@ -593,7 +593,7 @@ public async Task> ReadTimestampedOutputPulseEnableA /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -611,8 +611,8 @@ public async Task WriteOutputPulseEnableAsync(DigitalOutputs value, Cancellation /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadPulseDOPort0Async(CancellationToken cancellationToken = default) { @@ -627,8 +627,8 @@ public async Task ReadPulseDOPort0Async(CancellationToken cancellationTo /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedPulseDOPort0Async(CancellationToken cancellationToken = default) { @@ -639,7 +639,7 @@ public async Task> ReadTimestampedPulseDOPort0Async(Cancella /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -657,8 +657,8 @@ public async Task WritePulseDOPort0Async(ushort value, CancellationToken cancell /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadPulseDOPort1Async(CancellationToken cancellationToken = default) { @@ -673,8 +673,8 @@ public async Task ReadPulseDOPort1Async(CancellationToken cancellationTo /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedPulseDOPort1Async(CancellationToken cancellationToken = default) { @@ -685,7 +685,7 @@ public async Task> ReadTimestampedPulseDOPort1Async(Cancella /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -703,8 +703,8 @@ public async Task WritePulseDOPort1Async(ushort value, CancellationToken cancell /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadPulseDOPort2Async(CancellationToken cancellationToken = default) { @@ -719,8 +719,8 @@ public async Task ReadPulseDOPort2Async(CancellationToken cancellationTo /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedPulseDOPort2Async(CancellationToken cancellationToken = default) { @@ -731,7 +731,7 @@ public async Task> ReadTimestampedPulseDOPort2Async(Cancella /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -749,8 +749,8 @@ public async Task WritePulseDOPort2Async(ushort value, CancellationToken cancell /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadPulseSupplyPort0Async(CancellationToken cancellationToken = default) { @@ -765,8 +765,8 @@ public async Task ReadPulseSupplyPort0Async(CancellationToken cancellati /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedPulseSupplyPort0Async(CancellationToken cancellationToken = default) { @@ -777,7 +777,7 @@ public async Task> ReadTimestampedPulseSupplyPort0Async(Canc /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -795,8 +795,8 @@ public async Task WritePulseSupplyPort0Async(ushort value, CancellationToken can /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadPulseSupplyPort1Async(CancellationToken cancellationToken = default) { @@ -811,8 +811,8 @@ public async Task ReadPulseSupplyPort1Async(CancellationToken cancellati /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedPulseSupplyPort1Async(CancellationToken cancellationToken = default) { @@ -823,7 +823,7 @@ public async Task> ReadTimestampedPulseSupplyPort1Async(Canc /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -841,8 +841,8 @@ public async Task WritePulseSupplyPort1Async(ushort value, CancellationToken can /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadPulseSupplyPort2Async(CancellationToken cancellationToken = default) { @@ -857,8 +857,8 @@ public async Task ReadPulseSupplyPort2Async(CancellationToken cancellati /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedPulseSupplyPort2Async(CancellationToken cancellationToken = default) { @@ -869,7 +869,7 @@ public async Task> ReadTimestampedPulseSupplyPort2Async(Canc /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -887,8 +887,8 @@ public async Task WritePulseSupplyPort2Async(ushort value, CancellationToken can /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadPulseLed0Async(CancellationToken cancellationToken = default) { @@ -903,8 +903,8 @@ public async Task ReadPulseLed0Async(CancellationToken cancellationToken /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedPulseLed0Async(CancellationToken cancellationToken = default) { @@ -915,7 +915,7 @@ public async Task> ReadTimestampedPulseLed0Async(Cancellatio /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -933,8 +933,8 @@ public async Task WritePulseLed0Async(ushort value, CancellationToken cancellati /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadPulseLed1Async(CancellationToken cancellationToken = default) { @@ -949,8 +949,8 @@ public async Task ReadPulseLed1Async(CancellationToken cancellationToken /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedPulseLed1Async(CancellationToken cancellationToken = default) { @@ -961,7 +961,7 @@ public async Task> ReadTimestampedPulseLed1Async(Cancellatio /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -979,8 +979,8 @@ public async Task WritePulseLed1Async(ushort value, CancellationToken cancellati /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadPulseRgb0Async(CancellationToken cancellationToken = default) { @@ -995,8 +995,8 @@ public async Task ReadPulseRgb0Async(CancellationToken cancellationToken /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedPulseRgb0Async(CancellationToken cancellationToken = default) { @@ -1007,7 +1007,7 @@ public async Task> ReadTimestampedPulseRgb0Async(Cancellatio /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -1025,8 +1025,8 @@ public async Task WritePulseRgb0Async(ushort value, CancellationToken cancellati /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadPulseRgb1Async(CancellationToken cancellationToken = default) { @@ -1041,8 +1041,8 @@ public async Task ReadPulseRgb1Async(CancellationToken cancellationToken /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedPulseRgb1Async(CancellationToken cancellationToken = default) { @@ -1053,7 +1053,7 @@ public async Task> ReadTimestampedPulseRgb1Async(Cancellatio /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -1071,8 +1071,8 @@ public async Task WritePulseRgb1Async(ushort value, CancellationToken cancellati /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadPulseDO0Async(CancellationToken cancellationToken = default) { @@ -1087,8 +1087,8 @@ public async Task ReadPulseDO0Async(CancellationToken cancellationToken /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedPulseDO0Async(CancellationToken cancellationToken = default) { @@ -1099,7 +1099,7 @@ public async Task> ReadTimestampedPulseDO0Async(Cancellation /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -1117,8 +1117,8 @@ public async Task WritePulseDO0Async(ushort value, CancellationToken cancellatio /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadPulseDO1Async(CancellationToken cancellationToken = default) { @@ -1133,8 +1133,8 @@ public async Task ReadPulseDO1Async(CancellationToken cancellationToken /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedPulseDO1Async(CancellationToken cancellationToken = default) { @@ -1145,7 +1145,7 @@ public async Task> ReadTimestampedPulseDO1Async(Cancellation /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -1163,8 +1163,8 @@ public async Task WritePulseDO1Async(ushort value, CancellationToken cancellatio /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadPulseDO2Async(CancellationToken cancellationToken = default) { @@ -1179,8 +1179,8 @@ public async Task ReadPulseDO2Async(CancellationToken cancellationToken /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedPulseDO2Async(CancellationToken cancellationToken = default) { @@ -1191,7 +1191,7 @@ public async Task> ReadTimestampedPulseDO2Async(Cancellation /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -1209,8 +1209,8 @@ public async Task WritePulseDO2Async(ushort value, CancellationToken cancellatio /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadPulseDO3Async(CancellationToken cancellationToken = default) { @@ -1225,8 +1225,8 @@ public async Task ReadPulseDO3Async(CancellationToken cancellationToken /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedPulseDO3Async(CancellationToken cancellationToken = default) { @@ -1237,7 +1237,7 @@ public async Task> ReadTimestampedPulseDO3Async(Cancellation /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -1255,8 +1255,8 @@ public async Task WritePulseDO3Async(ushort value, CancellationToken cancellatio /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadPwmFrequencyDO0Async(CancellationToken cancellationToken = default) { @@ -1271,8 +1271,8 @@ public async Task ReadPwmFrequencyDO0Async(CancellationToken cancellatio /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedPwmFrequencyDO0Async(CancellationToken cancellationToken = default) { @@ -1283,7 +1283,7 @@ public async Task> ReadTimestampedPwmFrequencyDO0Async(Cance /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -1301,8 +1301,8 @@ public async Task WritePwmFrequencyDO0Async(ushort value, CancellationToken canc /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadPwmFrequencyDO1Async(CancellationToken cancellationToken = default) { @@ -1317,8 +1317,8 @@ public async Task ReadPwmFrequencyDO1Async(CancellationToken cancellatio /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedPwmFrequencyDO1Async(CancellationToken cancellationToken = default) { @@ -1329,7 +1329,7 @@ public async Task> ReadTimestampedPwmFrequencyDO1Async(Cance /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -1347,8 +1347,8 @@ public async Task WritePwmFrequencyDO1Async(ushort value, CancellationToken canc /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadPwmFrequencyDO2Async(CancellationToken cancellationToken = default) { @@ -1363,8 +1363,8 @@ public async Task ReadPwmFrequencyDO2Async(CancellationToken cancellatio /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedPwmFrequencyDO2Async(CancellationToken cancellationToken = default) { @@ -1375,7 +1375,7 @@ public async Task> ReadTimestampedPwmFrequencyDO2Async(Cance /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -1393,8 +1393,8 @@ public async Task WritePwmFrequencyDO2Async(ushort value, CancellationToken canc /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadPwmFrequencyDO3Async(CancellationToken cancellationToken = default) { @@ -1409,8 +1409,8 @@ public async Task ReadPwmFrequencyDO3Async(CancellationToken cancellatio /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedPwmFrequencyDO3Async(CancellationToken cancellationToken = default) { @@ -1421,7 +1421,7 @@ public async Task> ReadTimestampedPwmFrequencyDO3Async(Cance /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -1439,8 +1439,8 @@ public async Task WritePwmFrequencyDO3Async(ushort value, CancellationToken canc /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadPwmDutyCycleDO0Async(CancellationToken cancellationToken = default) { @@ -1455,8 +1455,8 @@ public async Task ReadPwmDutyCycleDO0Async(CancellationToken cancellationT /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedPwmDutyCycleDO0Async(CancellationToken cancellationToken = default) { @@ -1467,7 +1467,7 @@ public async Task> ReadTimestampedPwmDutyCycleDO0Async(Cancell /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -1485,8 +1485,8 @@ public async Task WritePwmDutyCycleDO0Async(byte value, CancellationToken cancel /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadPwmDutyCycleDO1Async(CancellationToken cancellationToken = default) { @@ -1501,8 +1501,8 @@ public async Task ReadPwmDutyCycleDO1Async(CancellationToken cancellationT /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedPwmDutyCycleDO1Async(CancellationToken cancellationToken = default) { @@ -1513,7 +1513,7 @@ public async Task> ReadTimestampedPwmDutyCycleDO1Async(Cancell /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -1531,8 +1531,8 @@ public async Task WritePwmDutyCycleDO1Async(byte value, CancellationToken cancel /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadPwmDutyCycleDO2Async(CancellationToken cancellationToken = default) { @@ -1547,8 +1547,8 @@ public async Task ReadPwmDutyCycleDO2Async(CancellationToken cancellationT /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedPwmDutyCycleDO2Async(CancellationToken cancellationToken = default) { @@ -1559,7 +1559,7 @@ public async Task> ReadTimestampedPwmDutyCycleDO2Async(Cancell /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -1577,8 +1577,8 @@ public async Task WritePwmDutyCycleDO2Async(byte value, CancellationToken cancel /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadPwmDutyCycleDO3Async(CancellationToken cancellationToken = default) { @@ -1593,8 +1593,8 @@ public async Task ReadPwmDutyCycleDO3Async(CancellationToken cancellationT /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedPwmDutyCycleDO3Async(CancellationToken cancellationToken = default) { @@ -1605,7 +1605,7 @@ public async Task> ReadTimestampedPwmDutyCycleDO3Async(Cancell /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -1623,8 +1623,8 @@ public async Task WritePwmDutyCycleDO3Async(byte value, CancellationToken cancel /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadPwmStartAsync(CancellationToken cancellationToken = default) { @@ -1639,8 +1639,8 @@ public async Task ReadPwmStartAsync(CancellationToken cancellationTo /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedPwmStartAsync(CancellationToken cancellationToken = default) { @@ -1651,7 +1651,7 @@ public async Task> ReadTimestampedPwmStartAsync(Cancella /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -1669,8 +1669,8 @@ public async Task WritePwmStartAsync(PwmOutputs value, CancellationToken cancell /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadPwmStopAsync(CancellationToken cancellationToken = default) { @@ -1685,8 +1685,8 @@ public async Task ReadPwmStopAsync(CancellationToken cancellationTok /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedPwmStopAsync(CancellationToken cancellationToken = default) { @@ -1697,7 +1697,7 @@ public async Task> ReadTimestampedPwmStopAsync(Cancellat /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -1715,8 +1715,8 @@ public async Task WritePwmStopAsync(PwmOutputs value, CancellationToken cancella /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadRgbAllAsync(CancellationToken cancellationToken = default) { @@ -1731,8 +1731,8 @@ public async Task ReadRgbAllAsync(CancellationToken cancellationT /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedRgbAllAsync(CancellationToken cancellationToken = default) { @@ -1743,7 +1743,7 @@ public async Task> ReadTimestampedRgbAllAsync(Cancell /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -1761,8 +1761,8 @@ public async Task WriteRgbAllAsync(RgbAllPayload value, CancellationToken cancel /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadRgb0Async(CancellationToken cancellationToken = default) { @@ -1777,8 +1777,8 @@ public async Task ReadRgb0Async(CancellationToken cancellationToken /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedRgb0Async(CancellationToken cancellationToken = default) { @@ -1789,7 +1789,7 @@ public async Task> ReadTimestampedRgb0Async(Cancellation /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -1807,8 +1807,8 @@ public async Task WriteRgb0Async(RgbPayload value, CancellationToken cancellatio /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadRgb1Async(CancellationToken cancellationToken = default) { @@ -1823,8 +1823,8 @@ public async Task ReadRgb1Async(CancellationToken cancellationToken /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedRgb1Async(CancellationToken cancellationToken = default) { @@ -1835,7 +1835,7 @@ public async Task> ReadTimestampedRgb1Async(Cancellation /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -1853,8 +1853,8 @@ public async Task WriteRgb1Async(RgbPayload value, CancellationToken cancellatio /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadLed0CurrentAsync(CancellationToken cancellationToken = default) { @@ -1869,8 +1869,8 @@ public async Task ReadLed0CurrentAsync(CancellationToken cancellationToken /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedLed0CurrentAsync(CancellationToken cancellationToken = default) { @@ -1881,7 +1881,7 @@ public async Task> ReadTimestampedLed0CurrentAsync(Cancellatio /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -1899,8 +1899,8 @@ public async Task WriteLed0CurrentAsync(byte value, CancellationToken cancellati /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadLed1CurrentAsync(CancellationToken cancellationToken = default) { @@ -1915,8 +1915,8 @@ public async Task ReadLed1CurrentAsync(CancellationToken cancellationToken /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedLed1CurrentAsync(CancellationToken cancellationToken = default) { @@ -1927,7 +1927,7 @@ public async Task> ReadTimestampedLed1CurrentAsync(Cancellatio /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -1945,8 +1945,8 @@ public async Task WriteLed1CurrentAsync(byte value, CancellationToken cancellati /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadLed0MaxCurrentAsync(CancellationToken cancellationToken = default) { @@ -1961,8 +1961,8 @@ public async Task ReadLed0MaxCurrentAsync(CancellationToken cancellationTo /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedLed0MaxCurrentAsync(CancellationToken cancellationToken = default) { @@ -1973,7 +1973,7 @@ public async Task> ReadTimestampedLed0MaxCurrentAsync(Cancella /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -1991,8 +1991,8 @@ public async Task WriteLed0MaxCurrentAsync(byte value, CancellationToken cancell /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadLed1MaxCurrentAsync(CancellationToken cancellationToken = default) { @@ -2007,8 +2007,8 @@ public async Task ReadLed1MaxCurrentAsync(CancellationToken cancellationTo /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedLed1MaxCurrentAsync(CancellationToken cancellationToken = default) { @@ -2019,7 +2019,7 @@ public async Task> ReadTimestampedLed1MaxCurrentAsync(Cancella /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -2037,8 +2037,8 @@ public async Task WriteLed1MaxCurrentAsync(byte value, CancellationToken cancell /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadEventEnableAsync(CancellationToken cancellationToken = default) { @@ -2053,8 +2053,8 @@ public async Task ReadEventEnableAsync(CancellationToken cancellationTok /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedEventEnableAsync(CancellationToken cancellationToken = default) { @@ -2065,7 +2065,7 @@ public async Task> ReadTimestampedEventEnableAsync(Cancellat /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -2083,8 +2083,8 @@ public async Task WriteEventEnableAsync(Events value, CancellationToken cancella /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadStartCamerasAsync(CancellationToken cancellationToken = default) { @@ -2099,8 +2099,8 @@ public async Task ReadStartCamerasAsync(CancellationToken cancell /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedStartCamerasAsync(CancellationToken cancellationToken = default) { @@ -2111,7 +2111,7 @@ public async Task> ReadTimestampedStartCamerasAsync(C /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -2129,8 +2129,8 @@ public async Task WriteStartCamerasAsync(CameraOutputs value, CancellationToken /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadStopCamerasAsync(CancellationToken cancellationToken = default) { @@ -2145,8 +2145,8 @@ public async Task ReadStopCamerasAsync(CancellationToken cancella /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedStopCamerasAsync(CancellationToken cancellationToken = default) { @@ -2157,7 +2157,7 @@ public async Task> ReadTimestampedStopCamerasAsync(Ca /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -2175,8 +2175,8 @@ public async Task WriteStopCamerasAsync(CameraOutputs value, CancellationToken c /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadEnableServosAsync(CancellationToken cancellationToken = default) { @@ -2191,8 +2191,8 @@ public async Task ReadEnableServosAsync(CancellationToken cancella /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedEnableServosAsync(CancellationToken cancellationToken = default) { @@ -2203,7 +2203,7 @@ public async Task> ReadTimestampedEnableServosAsync(Ca /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -2221,8 +2221,8 @@ public async Task WriteEnableServosAsync(ServoOutputs value, CancellationToken c /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadDisableServosAsync(CancellationToken cancellationToken = default) { @@ -2237,8 +2237,8 @@ public async Task ReadDisableServosAsync(CancellationToken cancell /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedDisableServosAsync(CancellationToken cancellationToken = default) { @@ -2249,7 +2249,7 @@ public async Task> ReadTimestampedDisableServosAsync(C /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -2267,8 +2267,8 @@ public async Task WriteDisableServosAsync(ServoOutputs value, CancellationToken /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadEnableEncodersAsync(CancellationToken cancellationToken = default) { @@ -2283,8 +2283,8 @@ public async Task ReadEnableEncodersAsync(CancellationToken cance /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedEnableEncodersAsync(CancellationToken cancellationToken = default) { @@ -2295,7 +2295,7 @@ public async Task> ReadTimestampedEnableEncodersAsync /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -2313,10 +2313,10 @@ public async Task WriteEnableEncodersAsync(EncoderInputs value, CancellationToke /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// - public async Task ReadEncoderModeAsync(CancellationToken cancellationToken = default) + public async Task ReadEncoderModeAsync(CancellationToken cancellationToken = default) { var reply = await CommandAsync(HarpCommand.ReadByte(EncoderMode.Address), cancellationToken); return EncoderMode.GetPayload(reply); @@ -2329,10 +2329,10 @@ public async Task ReadEncoderModeAsync(CancellationToken canc /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// - public async Task> ReadTimestampedEncoderModeAsync(CancellationToken cancellationToken = default) + public async Task> ReadTimestampedEncoderModeAsync(CancellationToken cancellationToken = default) { var reply = await CommandAsync(HarpCommand.ReadByte(EncoderMode.Address), cancellationToken); return EncoderMode.GetTimestampedPayload(reply); @@ -2341,12 +2341,12 @@ public async Task> ReadTimestampedEncoderModeAsyn /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// /// The task object representing the asynchronous write operation. - public async Task WriteEncoderModeAsync(EncoderModeConfig value, CancellationToken cancellationToken = default) + public async Task WriteEncoderModeAsync(EncoderModeMask value, CancellationToken cancellationToken = default) { var request = EncoderMode.FromPayload(MessageType.Write, value); await CommandAsync(request, cancellationToken); @@ -2359,8 +2359,8 @@ public async Task WriteEncoderModeAsync(EncoderModeConfig value, CancellationTok /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadCamera0FrameAsync(CancellationToken cancellationToken = default) { @@ -2375,8 +2375,8 @@ public async Task ReadCamera0FrameAsync(CancellationToken cancell /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedCamera0FrameAsync(CancellationToken cancellationToken = default) { @@ -2391,8 +2391,8 @@ public async Task> ReadTimestampedCamera0FrameAsync(C /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadCamera0FrequencyAsync(CancellationToken cancellationToken = default) { @@ -2407,8 +2407,8 @@ public async Task ReadCamera0FrequencyAsync(CancellationToken cancellati /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedCamera0FrequencyAsync(CancellationToken cancellationToken = default) { @@ -2419,7 +2419,7 @@ public async Task> ReadTimestampedCamera0FrequencyAsync(Canc /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -2437,8 +2437,8 @@ public async Task WriteCamera0FrequencyAsync(ushort value, CancellationToken can /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadCamera1FrameAsync(CancellationToken cancellationToken = default) { @@ -2453,8 +2453,8 @@ public async Task ReadCamera1FrameAsync(CancellationToken cancell /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedCamera1FrameAsync(CancellationToken cancellationToken = default) { @@ -2469,8 +2469,8 @@ public async Task> ReadTimestampedCamera1FrameAsync(C /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadCamera1FrequencyAsync(CancellationToken cancellationToken = default) { @@ -2485,8 +2485,8 @@ public async Task ReadCamera1FrequencyAsync(CancellationToken cancellati /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedCamera1FrequencyAsync(CancellationToken cancellationToken = default) { @@ -2497,7 +2497,7 @@ public async Task> ReadTimestampedCamera1FrequencyAsync(Canc /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -2515,8 +2515,8 @@ public async Task WriteCamera1FrequencyAsync(ushort value, CancellationToken can /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadServoMotor2PeriodAsync(CancellationToken cancellationToken = default) { @@ -2531,8 +2531,8 @@ public async Task ReadServoMotor2PeriodAsync(CancellationToken cancellat /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedServoMotor2PeriodAsync(CancellationToken cancellationToken = default) { @@ -2543,7 +2543,7 @@ public async Task> ReadTimestampedServoMotor2PeriodAsync(Can /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -2561,8 +2561,8 @@ public async Task WriteServoMotor2PeriodAsync(ushort value, CancellationToken ca /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadServoMotor2PulseAsync(CancellationToken cancellationToken = default) { @@ -2577,8 +2577,8 @@ public async Task ReadServoMotor2PulseAsync(CancellationToken cancellati /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedServoMotor2PulseAsync(CancellationToken cancellationToken = default) { @@ -2589,7 +2589,7 @@ public async Task> ReadTimestampedServoMotor2PulseAsync(Canc /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -2607,8 +2607,8 @@ public async Task WriteServoMotor2PulseAsync(ushort value, CancellationToken can /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadServoMotor3PeriodAsync(CancellationToken cancellationToken = default) { @@ -2623,8 +2623,8 @@ public async Task ReadServoMotor3PeriodAsync(CancellationToken cancellat /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedServoMotor3PeriodAsync(CancellationToken cancellationToken = default) { @@ -2635,7 +2635,7 @@ public async Task> ReadTimestampedServoMotor3PeriodAsync(Can /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -2653,8 +2653,8 @@ public async Task WriteServoMotor3PeriodAsync(ushort value, CancellationToken ca /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadServoMotor3PulseAsync(CancellationToken cancellationToken = default) { @@ -2669,8 +2669,8 @@ public async Task ReadServoMotor3PulseAsync(CancellationToken cancellati /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedServoMotor3PulseAsync(CancellationToken cancellationToken = default) { @@ -2681,7 +2681,7 @@ public async Task> ReadTimestampedServoMotor3PulseAsync(Canc /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -2699,8 +2699,8 @@ public async Task WriteServoMotor3PulseAsync(ushort value, CancellationToken can /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadEncoderResetAsync(CancellationToken cancellationToken = default) { @@ -2715,8 +2715,8 @@ public async Task ReadEncoderResetAsync(CancellationToken cancell /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedEncoderResetAsync(CancellationToken cancellationToken = default) { @@ -2727,7 +2727,7 @@ public async Task> ReadTimestampedEncoderResetAsync(C /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -2745,8 +2745,8 @@ public async Task WriteEncoderResetAsync(EncoderInputs value, CancellationToken /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadEnableSerialTimestampAsync(CancellationToken cancellationToken = default) { @@ -2761,8 +2761,8 @@ public async Task ReadEnableSerialTimestampAsync(Cancellat /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedEnableSerialTimestampAsync(CancellationToken cancellationToken = default) { @@ -2773,7 +2773,7 @@ public async Task> ReadTimestampedEnableSerial /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -2791,8 +2791,8 @@ public async Task WriteEnableSerialTimestampAsync(SerialTimestampPorts value, Ca /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadMimicPort0IRAsync(CancellationToken cancellationToken = default) { @@ -2807,8 +2807,8 @@ public async Task ReadMimicPort0IRAsync(CancellationToken cancellat /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedMimicPort0IRAsync(CancellationToken cancellationToken = default) { @@ -2819,7 +2819,7 @@ public async Task> ReadTimestampedMimicPort0IRAsync(Can /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -2837,8 +2837,8 @@ public async Task WriteMimicPort0IRAsync(MimicOutput value, CancellationToken ca /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadMimicPort1IRAsync(CancellationToken cancellationToken = default) { @@ -2853,8 +2853,8 @@ public async Task ReadMimicPort1IRAsync(CancellationToken cancellat /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedMimicPort1IRAsync(CancellationToken cancellationToken = default) { @@ -2865,7 +2865,7 @@ public async Task> ReadTimestampedMimicPort1IRAsync(Can /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -2883,8 +2883,8 @@ public async Task WriteMimicPort1IRAsync(MimicOutput value, CancellationToken ca /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadMimicPort2IRAsync(CancellationToken cancellationToken = default) { @@ -2899,8 +2899,8 @@ public async Task ReadMimicPort2IRAsync(CancellationToken cancellat /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedMimicPort2IRAsync(CancellationToken cancellationToken = default) { @@ -2911,7 +2911,7 @@ public async Task> ReadTimestampedMimicPort2IRAsync(Can /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -2929,8 +2929,8 @@ public async Task WriteMimicPort2IRAsync(MimicOutput value, CancellationToken ca /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadMimicPort0ValveAsync(CancellationToken cancellationToken = default) { @@ -2945,8 +2945,8 @@ public async Task ReadMimicPort0ValveAsync(CancellationToken cancel /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedMimicPort0ValveAsync(CancellationToken cancellationToken = default) { @@ -2957,7 +2957,7 @@ public async Task> ReadTimestampedMimicPort0ValveAsync( /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -2975,8 +2975,8 @@ public async Task WriteMimicPort0ValveAsync(MimicOutput value, CancellationToken /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadMimicPort1ValveAsync(CancellationToken cancellationToken = default) { @@ -2991,8 +2991,8 @@ public async Task ReadMimicPort1ValveAsync(CancellationToken cancel /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedMimicPort1ValveAsync(CancellationToken cancellationToken = default) { @@ -3003,7 +3003,7 @@ public async Task> ReadTimestampedMimicPort1ValveAsync( /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -3021,8 +3021,8 @@ public async Task WriteMimicPort1ValveAsync(MimicOutput value, CancellationToken /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadMimicPort2ValveAsync(CancellationToken cancellationToken = default) { @@ -3037,8 +3037,8 @@ public async Task ReadMimicPort2ValveAsync(CancellationToken cancel /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedMimicPort2ValveAsync(CancellationToken cancellationToken = default) { @@ -3049,7 +3049,7 @@ public async Task> ReadTimestampedMimicPort2ValveAsync( /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// @@ -3067,8 +3067,8 @@ public async Task WriteMimicPort2ValveAsync(MimicOutput value, CancellationToken /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the register payload. /// public async Task ReadPokeInputFilterAsync(CancellationToken cancellationToken = default) { @@ -3083,8 +3083,8 @@ public async Task ReadPokeInputFilterAsync(CancellationToken cancellationT /// A which can be used to cancel the operation. /// /// - /// A task that represents the asynchronous read operation. The - /// property contains the timestamped register payload. + /// A task that represents the asynchronous read operation. The task result contains + /// the timestamped register payload. /// public async Task> ReadTimestampedPokeInputFilterAsync(CancellationToken cancellationToken = default) { @@ -3095,7 +3095,7 @@ public async Task> ReadTimestampedPokeInputFilterAsync(Cancell /// /// Asynchronously writes a value to the register. /// - /// The value to be stored in the register. + /// The value to write in the register. /// /// A which can be used to cancel the operation. /// diff --git a/Interface/Harp.Behavior/Device.Generated.cs b/Interface/Harp.Behavior/Device.Generated.cs index 0e36d0d..d790aa4 100644 --- a/Interface/Harp.Behavior/Device.Generated.cs +++ b/Interface/Harp.Behavior/Device.Generated.cs @@ -5825,9 +5825,9 @@ public partial class EncoderMode /// /// A object representing the register message. /// A value representing the message payload. - public static EncoderModeConfig GetPayload(HarpMessage message) + public static EncoderModeMask GetPayload(HarpMessage message) { - return (EncoderModeConfig)message.GetPayloadByte(); + return (EncoderModeMask)message.GetPayloadByte(); } /// @@ -5835,10 +5835,10 @@ public static EncoderModeConfig GetPayload(HarpMessage message) /// /// A object representing the register message. /// A value representing the timestamped message payload. - public static Timestamped GetTimestampedPayload(HarpMessage message) + public static Timestamped GetTimestampedPayload(HarpMessage message) { var payload = message.GetTimestampedPayloadByte(); - return Timestamped.Create((EncoderModeConfig)payload.Value, payload.Seconds); + return Timestamped.Create((EncoderModeMask)payload.Value, payload.Seconds); } /// @@ -5850,7 +5850,7 @@ public static Timestamped GetTimestampedPayload(HarpMessage m /// A object for the register /// with the specified message type and payload. /// - public static HarpMessage FromPayload(MessageType messageType, EncoderModeConfig value) + public static HarpMessage FromPayload(MessageType messageType, EncoderModeMask value) { return HarpMessage.FromByte(Address, messageType, (byte)value); } @@ -5866,7 +5866,7 @@ public static HarpMessage FromPayload(MessageType messageType, EncoderModeConfig /// A object for the register /// with the specified message type, timestamp, and payload. /// - public static HarpMessage FromPayload(double timestamp, MessageType messageType, EncoderModeConfig value) + public static HarpMessage FromPayload(double timestamp, MessageType messageType, EncoderModeMask value) { return HarpMessage.FromByte(Address, timestamp, messageType, (byte)value); } @@ -5890,7 +5890,7 @@ public partial class TimestampedEncoderMode /// /// A object representing the register message. /// A value representing the timestamped message payload. - public static Timestamped GetPayload(HarpMessage message) + public static Timestamped GetPayload(HarpMessage message) { return EncoderMode.GetTimestampedPayload(message); } @@ -11093,13 +11093,13 @@ public partial class CreateEncoderModePayload /// Gets or sets the value that configures the operation mode of the quadrature encoders. /// [Description("The value that configures the operation mode of the quadrature encoders.")] - public EncoderModeConfig EncoderMode { get; set; } + public EncoderModeMask EncoderMode { get; set; } /// /// Creates a message payload for the EncoderMode register. /// /// The created message payload value. - public EncoderModeConfig GetPayload() + public EncoderModeMask GetPayload() { return EncoderMode; } @@ -12535,7 +12535,7 @@ public enum MimicOutput : byte /// /// Specifies the type of reading made from the quadrature encoder. /// - public enum EncoderModeConfig : byte + public enum EncoderModeMask : byte { Position = 0, Displacement = 1 diff --git a/device.yml b/device.yml index 3341a17..c17dfaa 100644 --- a/device.yml +++ b/device.yml @@ -280,7 +280,7 @@ registers: address: 83 type: U8 access: Write - maskType: EncoderModeConfig + maskType: EncoderModeMask description: Configures the operation mode of the quadrature encoders. Reserved2: <<: *reserved @@ -560,7 +560,7 @@ groupMasks: DO3: value: 7 description: Is reflected on DO3 - EncoderModeConfig: + EncoderModeMask: description: Specifies the type of reading made from the quadrature encoder. values: Position: 0