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

Test-access surface for ra8_usb_pal internal helpers (MC/DC). More...

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

Go to the source code of this file.

Functions

bool priv_usb_pal_should_dispatch_event (const void *event_fn, uint16_t mask, uint16_t none_value)
 Pure predicate: callback non-NULL AND mask non-zero.
bool priv_usb_pal_ep_out_of_range (uint8_t ep_addr, uint8_t ep_max)
 Pure predicate: endpoint number is zero OR exceeds max.

Detailed Description

Test-access surface for ra8_usb_pal internal helpers (MC/DC).

Declares the module-private pure predicates shared by the PAL implementation and its focused hosted qualification test.

Tag
[Ring 3 / PAL] {World: NS}

Definition in file ra8_usb_pal_internal.h.

Function Documentation

◆ priv_usb_pal_ep_out_of_range()

bool priv_usb_pal_ep_out_of_range ( uint8_t ep_addr,
uint8_t ep_max )

Pure predicate: endpoint number is zero OR exceeds max.

Promoted from the inline OR at libs/ra8_usb_pal/src/ra8_usb_pal.c inside ra8_usb_pal_ep_recv.

Parameters
[in]ep_addrEndpoint number (after addr_mask strip).
[in]ep_maxMaximum permitted endpoint number.
Returns
Boolean reject predicate.
Return values
trueCaller must return k_ra8_err_invalid_arg.
falseEndpoint is in range.
Precondition
None.
None.
Postcondition
No state mutated.
Return depends solely on the two inputs.
Note
Test-access only. Pure function.
MC/DC:
2-condition OR; N+1 = 3 vectors:
  • ep=1, ep_max=10 -> false
  • ep=0, ep_max=10 -> true (varies left)
  • ep=11, ep_max=10 -> true (varies right)
Since
0.1.0

Pure predicate: endpoint number is zero OR exceeds max.

Promoted helper so the line-559 OR can be driven under MC/DC.

Parameters
[in]ep_addrEndpoint number.
[in]ep_maxMaximum permitted endpoint number.
Returns
Boolean reject predicate.
Return values
trueCaller returns invalid-arg.
falseEndpoint is in range.
Precondition
None.
None.
Postcondition
No state mutated.
Return depends solely on inputs.
Note
Pure; thread-safe.
Since
0.1.0

Definition at line 67 of file ra8_usb_pal.c.

Referenced by ra8_usb_pal_ep_open(), ra8_usb_pal_ep_recv(), and ra8_usb_pal_ep_send().

◆ priv_usb_pal_should_dispatch_event()

bool priv_usb_pal_should_dispatch_event ( const void * event_fn,
uint16_t mask,
uint16_t none_value )

Pure predicate: callback non-NULL AND mask non-zero.

Promoted from the inline AND at libs/ra8_usb_pal/src/ra8_usb_pal.c inside internal_usb_event.

Parameters
[in]event_fnApplication callback (NULL when none).
[in]maskTranslated event-mask bits.
[in]none_valueNumeric value of k_ra8_usb_pal_event_none.
Returns
Boolean dispatch predicate.
Return values
trueCaller must invoke event_fn.
falseSkip the callback.
Precondition
None.
None.
Postcondition
No state mutated.
Return depends solely on the three inputs.
Note
Test-access only. Pure function.
MC/DC:
2-condition AND; N+1 = 3 vectors:
  • cb=NULL, mask=evt -> false (left varies vs V2)
  • cb!=NULL, mask=evt -> true
  • cb!=NULL, mask=none -> false (right varies vs V2)
Since
0.1.0

Pure predicate: callback non-NULL AND mask non-zero.

Promoted helper so the line-218 AND can be driven under MC/DC.

Parameters
[in]event_fnApplication callback.
[in]maskTranslated event-mask bits.
[in]none_valueNumeric value of k_ra8_usb_pal_event_none.
Returns
Boolean predicate.
Return values
trueCaller invokes event_fn.
falseSkip the callback.
Precondition
None.
None.
Postcondition
No state mutated.
Return depends solely on inputs.
Note
Pure; thread-safe.
Since
0.1.0

Definition at line 47 of file ra8_usb_pal.c.

Referenced by internal_usb_event().