hal_event_adapter

HAL adapter converting hardware signals and interrupts into internal events and actions.

Inherited Component

Inherited Requirements

Relationship Diagram

UML class diagram for hal_event_adapter

SW Unit Relations

Incoming Relations

Relation

UML Type

Visibility

Source Unit

Description

SWR-017

dependency

private

ao_monitoring

Monitoring consumes hardware-adapted sensor events.

SWR-018

dependency

private

ao_modbus_server

Modbus server uses hardware-adapted UART events.

SWR-019

dependency

private

drv_rgb_led

LED driver uses hardware abstraction events.

Data Types

hal_event_adapter_contextstruct

Internal runtime context for hal_event_adapter.

Struct Members

Name

Type

Description

sensor_path_ready

bool

Sensor HAL path readiness.

uart_path_ready

bool

UART HAL path readiness.

led_path_ready

bool

LED HAL path readiness.

last_hal_tick

uint32_t

Last adaptation tick.

hal_event_adapter_eventstruct

Event payload handled by hal_event_adapter.

Struct Members

Name

Type

Description

signal_id

uint16_t

HAL adapter event id.

source_channel

uint8_t

HAL source channel.

raw_code

uint16_t

Raw HAL code.

data_valid

bool

Raw data validation result.

hal_event_adapter_resultenum

Result code for hal_event_adapter operations.

Enum Members

Name

Value

Description

OK

0

HAL event normalized.

SOURCE_UNAVAILABLE

1

Expected source unavailable.

NORMALIZATION_ERROR

2

Payload normalization failed.

Attributes

Attribute

Type

Visibility

Description

ctx

hal_event_adapter_context

private

Runtime context for hal_event_adapter state timing and error tracking.

Methods

dispatch

  • Return Type: hal_event_adapter_result

  • Visibility: public

  • Description: Process one hal_event_adapter event and update runtime outputs.

Parameters

Name

Type

Direction

Description

event

hal_event_adapter_event

in

Process one hal_event_adapter event and update runtime outputs.

init

  • Return Type: hal_event_adapter_result

  • Visibility: public

  • Description: Initialize hal_event_adapter runtime state and dependencies.

Dynamic Behaviour

Activity Diagrams

hal_event_adapter_activity

@startuml
start
:Receive raw HAL interrupt or poll data;
:Normalize hardware payload;
if (source == sensor) then (yes)
  :Build monitoring event;
elseif (source == uart) then (yes)
  :Build modbus RX or TX event;
elseif (source == led driver) then (yes)
  :Build LED driver completion event;
endif
:Publish normalized event to dispatcher;
stop
@enduml

This activity diagram documents HAL adaptation flow from raw interrupt or polled hardware signals to normalized software events with source specific mapping for sensors communication and LED subsystems.

Timing Diagrams

hal_event_adapter_timing

@startuml
robust "hal_event_adapter" as HAL
scale max 1200 width
concise "io event" as E

@0
E is irq_or_poll
HAL is normalize_event

@60
HAL is route_channel

@120
HAL is publish_upstream

@180
HAL is idle
@enduml

This timing diagram characterizes adapter latency from raw hardware event detection to normalized event publication and helps budget interrupt or polling integration delays.

Sequence Diagrams

SEQ-004_Modbus_Event_Servicing

@startuml

hide footbox
title Modbus Server Event Servicing

participant ao_runtime_supervisor
participant ao_modbus_server
participant hal_event_adapter

ao_runtime_supervisor -> ao_modbus_server : dispatch comms_event
ao_modbus_server -> hal_event_adapter : request UART I/O
hal_event_adapter --> ao_modbus_server : uart_rx/tx completion
ao_modbus_server -> hal_event_adapter : publish protocol response

@enduml

Runtime-driven communication events are processed by the Modbus server through hardware-adapted UART event exchange.