drv_rgb_led

Driver unit applying LED command events to RGB hardware channels.

Inherited Component

Inherited Requirements

Relationship Diagram

UML class diagram for drv_rgb_led

SW Unit Relations

Outgoing Relations

Relation

UML Type

Visibility

Target Unit

Description

SWR-019

dependency

private

hal_event_adapter

LED driver uses hardware abstraction events.

Incoming Relations

Relation

UML Type

Visibility

Source Unit

Description

SWR-016

dependency

public

ao_status_indication

Status indication commands LED driver outputs.

Data Types

drv_rgb_led_contextstruct

Internal runtime context for drv_rgb_led.

Struct Members

Name

Type

Description

driver_state

uint8_t

Driver state.

color_code

uint8_t

Applied color code.

blink_period_ms

uint16_t

Applied blink period.

hw_ready

bool

Hardware readiness.

drv_rgb_led_eventstruct

Event payload handled by drv_rgb_led.

Struct Members

Name

Type

Description

signal_id

uint16_t

LED driver event id.

requested_color

uint8_t

Requested color code.

blink_enable

bool

Blink command.

intensity_pct

uint8_t

Requested intensity percent.

drv_rgb_led_resultenum

Result code for drv_rgb_led operations.

Enum Members

Name

Value

Description

OK

0

LED command applied.

HAL_WRITE_ERROR

1

HAL write failed.

UNSUPPORTED_PATTERN

2

Pattern not supported.

Attributes

Attribute

Type

Visibility

Description

ctx

drv_rgb_led_context

private

Runtime context for drv_rgb_led state timing and error tracking.

Methods

dispatch

  • Return Type: drv_rgb_led_result

  • Visibility: public

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

Parameters

Name

Type

Direction

Description

event

drv_rgb_led_event

in

Process one drv_rgb_led event and update runtime outputs.

init

  • Return Type: drv_rgb_led_result

  • Visibility: public

  • Description: Initialize drv_rgb_led runtime state and dependencies.

Dynamic Behaviour

Activity Diagrams

drv_rgb_led_activity

@startuml
start
:Receive IF_StatusLedCommand;
:Decode requested color or pattern;
:Map to hardware channel values;
:Write PWM or GPIO outputs via HAL;
if (write failed?) then (yes)
  :Emit driver error event;
else (no)
  :Confirm applied output;
endif
stop
@enduml

This activity diagram defines driver level translation from abstract LED intents into hardware channel writes including failure handling behavior when output programming does not complete as requested.

Timing Diagrams

drv_rgb_led_timing

@startuml
robust "drv_rgb_led" as LED
scale max 1200 width
concise "led command" as C

@0
C is rx
LED is decode

@40
LED is map_hw_values

@90
LED is write_hw

@150
LED is applied
@enduml

This timing diagram shows driver execution from command reception through hardware mapping and write completion to validate tight actuation timing in the LED indication chain.

Sequence Diagrams

SEQ-003_Status_To_LED_Indication

@startuml

hide footbox
title Diagnostic Status To LED Indication

participant ao_diagnostics
participant ao_status_indication
participant sm_led_indication
participant drv_rgb_led

ao_diagnostics -> ao_status_indication : IF_OperatingStatus(system_status)
ao_status_indication -> sm_led_indication : evaluate indication pattern
sm_led_indication -> ao_status_indication : resolved LED intent
ao_status_indication -> drv_rgb_led : IF_StatusLedCommand(led_command)

@enduml

Diagnostics status outputs are transformed by status indication logic into concrete LED driver commands.