ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_usb_cdc_internal.h File Reference

Test-access surface for the USB CDC line-coding decoder. More...

#include <stdint.h>
#include "ra8_attributes.h"
Include dependency graph for ra8_usb_cdc_internal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void ra8_usb_cdc_test_apply_line_coding (const uint8_t *data, uint16_t len)
 Drive the private SET_LINE_CODING decoder from host tests.

Detailed Description

Test-access surface for the USB CDC line-coding decoder.

Declares the line-coding decoder so host tests can exercise its compound input guard without manufacturing an asynchronous EP0 OUT packet. Production callers continue to reach it only through the CDC SETUP handler.

Definition in file ra8_usb_cdc_internal.h.

Function Documentation

◆ ra8_usb_cdc_test_apply_line_coding()

void ra8_usb_cdc_test_apply_line_coding ( const uint8_t * data,
uint16_t len )

Drive the private SET_LINE_CODING decoder from host tests.

Forwards the caller-owned payload to the same private decoder used by the CDC SETUP handler. This is a test-access seam only; production code continues to call the private helper directly.

Parameters
[in]dataPointer to the line-coding payload in host byte order; may be null to exercise the reject path.
[in]lenLength of data in bytes.
Precondition
The CDC state has been initialized by ra8_usb_cdc_init().
When data is non-null, it references at least len readable bytes.
Postcondition
A valid seven-byte payload replaces every cached line-coding field.
A null or short payload leaves the cached line coding unchanged.
Note
Not thread-safe; production calls originate in the USB control path.
MC/DC:
Decision (data == nullptr) || (len < 7) uses N+1 = 3 vectors:
  • non-null data, length 7: false control vector
  • null data, length 7: first condition independently makes the result true
  • non-null data, length 6: second condition independently makes it true
Since
0.1.0

Definition at line 241 of file ra8_usb_cdc.c.

References internal_apply_line_coding().