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

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

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

Go to the source code of this file.

Functions

bool priv_ra8_rmac_phy_internal_speed_ok (ra8_err_t err, uint16_t reg_value, uint16_t mask)
 Pure predicate: PHY register read OK AND mask bit set.

Detailed Description

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

Declares module-private PHY decode predicates shared by the RMAC driver and focused host tests.

Definition in file ra8_rmac_phy_internal.h.

Function Documentation

◆ priv_ra8_rmac_phy_internal_speed_ok()

bool priv_ra8_rmac_phy_internal_speed_ok ( ra8_err_t err,
uint16_t reg_value,
uint16_t mask )

Pure predicate: PHY register read OK AND mask bit set.

Reusable for both the 1000FULL and 1000HALF speed-decode tests at libs/ra8_hal/src/ra8_rmac_phy.c lines 352 and 356 inside ra8_rmac_phy_link_status_get.

Parameters
[in]errResult of the prior MIIM read.
[in]reg_valueRegister value just read.
[in]maskSpeed-bit mask to test.
Returns
Boolean speed-detected predicate.
Return values
trueCaller may set the corresponding speed enum.
falseEither the read failed or the bit is clear.
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:
  • err=k_ra8_ok, mask&val=0 -> false
  • err=k_ra8_ok, mask&val=mask -> true (varies right)
  • err!=k_ra8_ok, mask&val=mask -> false (varies left)
Since
0.1.0

Pure predicate: PHY register read OK AND mask bit set.

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

Parameters
[in]errResult of the prior MIIM read.
[in]reg_valueRegister value just read.
[in]maskSpeed-bit mask to test.
Returns
Boolean predicate.
Return values
trueSpeed bit set and read OK.
falseOtherwise.
Precondition
None.
None.
Postcondition
No state mutated.
Return depends solely on inputs.
Note
Pure; thread-safe.
Since
0.1.0

Definition at line 44 of file ra8_rmac_phy.c.

References k_ra8_ok.

Referenced by internal_resolve_speed().