mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-12-13 08:30:04 +01:00
with docs
This commit is contained in:
@@ -11,7 +11,8 @@ add_executable(gendoc src/gendoc.cpp)
|
||||
# This is a bit hacky, but better than exposing stuff?
|
||||
target_include_directories(gendoc PRIVATE ${PROJECT_SOURCE_DIR}/slsDetectorSoftware/src)
|
||||
target_link_libraries(gendoc PRIVATE
|
||||
slsDetectorShared
|
||||
slsDetectorStatic
|
||||
|
||||
)
|
||||
set_target_properties(gendoc PROPERTIES
|
||||
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
|
||||
|
||||
@@ -1816,16 +1816,47 @@ class Detector(CppDetectorApi):
|
||||
return self._register
|
||||
|
||||
def define_reg(self, name, addr):
|
||||
"""
|
||||
[Ctb] Define a name for a register to be used later with reg.
|
||||
|
||||
Example
|
||||
--------
|
||||
|
||||
d.define_reg('myreg',addr=0x6)
|
||||
"""
|
||||
addr = RegisterAddress(addr)
|
||||
self.setRegisterDefinition(name, addr)
|
||||
|
||||
|
||||
def define_bit(self, name, addr, bit):
|
||||
"""
|
||||
[Ctb] Define a name for a bit in a register to be used later with setBit/clearBit/getBit
|
||||
|
||||
Example
|
||||
--------
|
||||
|
||||
d.define_bit('mybit',addr=0x6, bit=7)
|
||||
"""
|
||||
addr = RegisterAddress(addr)
|
||||
bit = BitAddress(addr, bit)
|
||||
self.setBitDefinition(name, bit)
|
||||
|
||||
def setBit(self, bit_or_addr, number=None):
|
||||
"""
|
||||
Set a bit in a register
|
||||
[Ctb] Can use a named bit address
|
||||
|
||||
Example
|
||||
--------
|
||||
d.setBit(0x5, 3)
|
||||
|
||||
#Ctb
|
||||
d.setBit('mybit')
|
||||
|
||||
myreg = RegisterAddress(0x5)
|
||||
mybit = BitAddress(myreg, 5)
|
||||
d.setBit(mybit)
|
||||
"""
|
||||
#Old usage passing two ints
|
||||
if isinstance(bit_or_addr, int):
|
||||
return super().setBit(bit_or_addr, number)
|
||||
@@ -1836,6 +1867,21 @@ class Detector(CppDetectorApi):
|
||||
return super().setBit(bit_or_addr)
|
||||
|
||||
def clearBit(self, bit_or_addr, number=None):
|
||||
"""
|
||||
Clear a bit in a register
|
||||
[Ctb] Can use a named bit address
|
||||
|
||||
Example
|
||||
--------
|
||||
d.clearBit(0x5, 3)
|
||||
|
||||
#Ctb
|
||||
d.clearBit('mybit')
|
||||
|
||||
myreg = RegisterAddress(0x5)
|
||||
mybit = BitAddress(myreg, 5)
|
||||
d.clearBit(mybit)
|
||||
"""
|
||||
#Old usage passing two ints
|
||||
if isinstance(bit_or_addr, int):
|
||||
return super().clearBit(bit_or_addr, number)
|
||||
@@ -1847,6 +1893,21 @@ class Detector(CppDetectorApi):
|
||||
|
||||
@element
|
||||
def getBit(self, bit_or_addr, number=None):
|
||||
"""
|
||||
Get a bit from a register
|
||||
[Ctb] Can use a named bit address
|
||||
|
||||
Example
|
||||
--------
|
||||
d.getBit(0x5, 3)
|
||||
|
||||
#Ctb
|
||||
d.getBit('mybit')
|
||||
|
||||
myreg = RegisterAddress(0x5)
|
||||
mybit = BitAddress(myreg, 5)
|
||||
d.getBit(mybit)
|
||||
"""
|
||||
#Old usage passing two ints
|
||||
if isinstance(bit_or_addr, int):
|
||||
return super().getBit(bit_or_addr, number)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "CmdParser.h"
|
||||
#include "HelpDacs.h"
|
||||
#include "sls/Detector.h"
|
||||
|
||||
#include "sls/bit_utils.h"
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
Reference in New Issue
Block a user