Critical Link MityCam SoC Firmware  1.0
Critical Link MityCam SoC Firmware
tcLatticeMIPI Class Reference

#include <LatticeMIPI.h>

Collaboration diagram for tcLatticeMIPI:

Public Member Functions

 tcLatticeMIPI (void)
 
virtual ~tcLatticeMIPI (void)
 
int Initialize (std::string arSpiDevPath, std::string CSName)
 
int ReleaseSPI (void)
 
int ReopenSPI (void)
 
bool IsAlive (void)
 
int GetVersion (uint8_t &anVersion)
 
int GetNumLanes (uint8_t &anNumLanes)
 
int ReadRegister (uint8_t offset, uint8_t &value)
 
int WriteRegister (uint8_t offset, uint8_t value)
 
int reset (void)
 

Protected Attributes

tcMutex mcSpiDevMutex
 thread safe lock for SPI access More...
 
tcSPIDevice * mpSPIDevice
 
tsSPIConfiguration msSPIConfiguration
 
bool mbNOIO
 
MityDSP::tcGpioSingle * mpCS
 Sensor Board Specific GPIOs for control. More...
 

Detailed Description

The tcLatticeMIPI class provides a basic interface to the MIPI Deserializer bitstreams loaded on the Lattice parts for the HWK1411 FPGA (and potentially others)

Constructor & Destructor Documentation

◆ tcLatticeMIPI()

tcLatticeMIPI::tcLatticeMIPI ( void  )

Constructor

◆ ~tcLatticeMIPI()

tcLatticeMIPI::~tcLatticeMIPI ( void  )
virtual

Destructor

Member Function Documentation

◆ GetNumLanes()

int tcLatticeMIPI::GetNumLanes ( uint8_t &  anNumLanes)

Fetch the number of lanes the bitstream supports.

Parameters
[out]anNumLanesthe supported number of lanes
Returns
non-zero on error

◆ GetVersion()

int tcLatticeMIPI::GetVersion ( uint8_t &  anVersion)

Get the version of the MIPI bitstream

Parameters
[out]anVersionthe version number
Returns
non-zero on error

◆ Initialize()

int tcLatticeMIPI::Initialize ( std::string  arSpiDevPath,
std::string  CSName 
)

Initialize the MIPI SPI interface. open the SPIDEV device and the gpio for the chip select.

Parameters
arSpiDevPathfull path to the spidev device to use
CSNamename of the chip select pin in /sys/kernel/debug/gpio listing
Returns
non-zero on error.

◆ IsAlive()

bool tcLatticeMIPI::IsAlive ( void  )
Returns
true if the device is communicating properly.

◆ ReadRegister()

int tcLatticeMIPI::ReadRegister ( uint8_t  offset,
uint8_t &  value 
)

Threadsafe register read routine.

Parameters
offsetthe register offset
[out]offsetthe value read
Returns
non-zero on error

◆ ReleaseSPI()

int tcLatticeMIPI::ReleaseSPI ( void  )

Release the SPI device. This can be used if the device needs to be temporarily controlled by another piece of software, etc.

Returns
non-zero on error

◆ ReopenSPI()

int tcLatticeMIPI::ReopenSPI ( void  )

Reattach the SPI device. This can be used after a call to ReleaseSPI

Returns
non-zero on error

◆ reset()

int tcLatticeMIPI::reset ( void  )

Reset the Lattice MIPI bitstream

Returns
non-zero on error.

◆ WriteRegister()

int tcLatticeMIPI::WriteRegister ( uint8_t  offset,
uint8_t  value 
)

Threadsafe register write routine.

Parameters
offsetthe register offset
valuethe value to write
Returns
non-zero on error

Member Data Documentation

◆ mbNOIO

bool tcLatticeMIPI::mbNOIO
protected

◆ mcSpiDevMutex

tcMutex tcLatticeMIPI::mcSpiDevMutex
mutableprotected

thread safe lock for SPI access

◆ mpCS

MityDSP::tcGpioSingle* tcLatticeMIPI::mpCS
protected

Sensor Board Specific GPIOs for control.

◆ mpSPIDevice

tcSPIDevice* tcLatticeMIPI::mpSPIDevice
protected

◆ msSPIConfiguration

tsSPIConfiguration tcLatticeMIPI::msSPIConfiguration
protected

The documentation for this class was generated from the following files: