Skip to main content

set_flags

Function set_flags 

Source
fn set_flags(fpga: &XilinxSysFPGA, new_flags: u32) -> Result<String, FpgadError>
Expand description

Set the programming flags in sysfs.

Writes the flags to /sys/class/fpga_manager/<device>/flags in undecorated hexadecimal (decimal 32 -> undecorated hex 20) and verifies that the write succeeded by reading the value back. Also checks and logs the FPGA state after setting flags.

§Arguments

  • flags - The flags value to set

§Returns: Result<(), FpgadError>

  • Ok(()) - Flags set and verified successfully
  • Err(FpgadError::IOWrite) - Failed to write flags file
  • Err(FpgadError::IORead) - Failed to read back flags or state
  • Err(FpgadError::Flag) - Read-back value doesn’t match written value