SatNOGS-COMMS  4.1.0
A COMMS subsystem for CubeSats
Loading...
Searching...
No Matches
satnogs::comms::lib::fpga Class Reference

#include <fpga.hpp>

Public Types

enum class  reg : uint32_t { id = 0 , version = 1 , status = 2 }
enum class  hw : uint8_t { NONE , ALINX_AC7Z020 , LIBREWAVE }
enum class  boot_mode : uint8_t { JTAG , NAND , QSPI , EMMC }

Public Member Functions

 fpga (hw h, bsp::spi &spi, power &pwr, bsp::gpio &fpga_done, bsp::gpio &boot_sel_1, bsp::gpio &boot_sel_0)
 Construct a new fpga::fpga object and disables it to ensure now excess power is accidentally used during resets.
void enable (bool en=true)
 Enable/disable the FPGA subsystem.
bool enabled () const
 Returns the state of the FPGA.
void write_reg (uint32_t regreg, uint32_t val)
uint32_t read_reg (uint32_t regreg)
void write_reg (reg r, uint32_t val)
uint32_t read_reg (reg r)
bool get_fpga_done () const
void set_boot_mode (boot_mode mode)
boot_mode get_boot_mode () const

Detailed Description

Definition at line 32 of file fpga.hpp.

Member Enumeration Documentation

◆ boot_mode

enum class satnogs::comms::lib::fpga::boot_mode : uint8_t
strong
Enumerator
JTAG 
NAND 
QSPI 
EMMC 

Definition at line 49 of file fpga.hpp.

◆ hw

enum class satnogs::comms::lib::fpga::hw : uint8_t
strong
Enumerator
NONE 
ALINX_AC7Z020 
LIBREWAVE 

Definition at line 42 of file fpga.hpp.

◆ reg

enum class satnogs::comms::lib::fpga::reg : uint32_t
strong
Enumerator
id 
version 
status 

Definition at line 35 of file fpga.hpp.

Constructor & Destructor Documentation

◆ fpga()

satnogs::comms::lib::fpga::fpga ( hw h,
bsp::spi & spi,
power & pwr,
bsp::gpio & fpga_done,
bsp::gpio & boot_sel_1,
bsp::gpio & boot_sel_0 )

Construct a new fpga::fpga object and disables it to ensure now excess power is accidentally used during resets.

Parameters
hthe FPGA type attached
spiSPI peripheral to communicate with the FPGA
pwrthe power subsystem
fpga_donethe FPGA_DONE GPIO
boot_sel_1second gpio for setting boot mode
boot_sel_0first gpio for setting boot mode

boot modes: mode boot_sel_1 boot_sel_0 JTAG 0 0 NAND 0 1 QSPI 1 0 EMMC 1 1

Definition at line 49 of file fpga.cpp.

Member Function Documentation

◆ enable()

void satnogs::comms::lib::fpga::enable ( bool en = true)

Enable/disable the FPGA subsystem.

Parameters
entrue to enable, false to disable

Definition at line 83 of file fpga.cpp.

◆ enabled()

bool satnogs::comms::lib::fpga::enabled ( ) const

Returns the state of the FPGA.

Returns
true if it is enabled
false if it is disabled

Definition at line 95 of file fpga.cpp.

◆ get_boot_mode()

fpga::boot_mode satnogs::comms::lib::fpga::get_boot_mode ( ) const

Definition at line 164 of file fpga.cpp.

◆ get_fpga_done()

bool satnogs::comms::lib::fpga::get_fpga_done ( ) const

Definition at line 127 of file fpga.cpp.

◆ read_reg() [1/2]

uint32_t satnogs::comms::lib::fpga::read_reg ( reg r)

Definition at line 120 of file fpga.cpp.

◆ read_reg() [2/2]

uint32_t satnogs::comms::lib::fpga::read_reg ( uint32_t reg)

Definition at line 107 of file fpga.cpp.

◆ set_boot_mode()

void satnogs::comms::lib::fpga::set_boot_mode ( boot_mode mode)

Definition at line 133 of file fpga.cpp.

◆ write_reg() [1/2]

void satnogs::comms::lib::fpga::write_reg ( reg r,
uint32_t val )

Definition at line 114 of file fpga.cpp.

◆ write_reg() [2/2]

void satnogs::comms::lib::fpga::write_reg ( uint32_t reg,
uint32_t val )

Definition at line 101 of file fpga.cpp.


The documentation for this class was generated from the following files:
  • libsatnogs-comms/include/satnogs-comms-lib/fpga.hpp
  • libsatnogs-comms/src/fpga.cpp