Skip to main content

Hardware Abstraction Layer

Overview

TrinovaQ Studio provides tools to interact with embedded hardware without leaving the IDE. This includes a register bit manipulation view and a serial monitor.

Requirements Specification

IDFeature NameDescriptionConstraints
TRQ-HW-001Register ViewerVisualizes 32-bit hardware registers with bit-level toggling capabilities.Supported Peripherals: GPIOA, CAN1, WWDG.
TRQ-HW-002Read-Only ProtectionPrevents users from modifying registers marked as Read-Only (RO) in the definition file.Logic: if (targetReg.access === 'RO') return;.
TRQ-HW-003Serial MonitorProvides UART communication with external devices. Supports auto-discovery of COM ports.Baud Rates: 9600, 115200. Backend: serialport library.

Peripheral Definitions

The tool includes built-in definitions for the following mock peripherals:

GPIOA (General Purpose I/O)

  • MODER (Offset 0x00): Port mode register.
  • OTYPER (Offset 0x04): Output type register.
  • OSPEEDR (Offset 0x08): Output speed register.

CAN1 (Controller Area Network)

  • MCR (Offset 0x00): Master Control Register.
  • MSR (Offset 0x04): Master Status Register (RO).

WWDG (Window Watchdog)

  • CR (Offset 0x00): Control Register (Critical for safety).