Qudi
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
pi_pwm.PiPWM Class Reference

Hardware module for Raspberry Pi-based PWM controller. More...

Inheritance diagram for pi_pwm.PiPWM:
Inheritance graph
[legend]
Collaboration diagram for pi_pwm.PiPWM:
Collaboration graph
[legend]

Public Member Functions

def __init__ (self, kwargs)
 
def on_activate (self)
 Activate module.
 
def on_deactivate (self)
 Deactivate module.
 
def setupPins (self)
 Set Raspberry Pi GPIO pins to the right mode.
 
def startPWM (self)
 Start the PWM output.
 
def stopPWM (self)
 Stop the PWM output.
 
def changeDutyCycle (self, duty)
 Set the PWM duty cycle in percent. More...
 
def setControlValue (self, value)
 Set control value for this controller. More...
 
def getControlValue (self)
 Get control value for this controller. More...
 
def getControlUnit (self)
 Get unit for control value. More...
 
def getControlLimits (self)
 Get minimum and maxuimum value for control value. More...
 
- Public Member Functions inherited from core.module.BaseMixin
def __init__ (self, manager, name, config=None, callbacks=None, kwargs)
 Initialise Base class object and set up its state machine. More...
 
def log (self)
 Returns a logger object.
 
def is_module_threaded (self)
 Returns whether the module shall be started in a thread.
 
def on_activate (self)
 Method called when module is activated. More...
 
def on_deactivate (self)
 Method called when module is deactivated. More...
 
def getStatusVariables (self)
 Return a dict of variable names and their content representing the module state for saving. More...
 
def setStatusVariables (self, variableDict)
 Give a module a dict of variable names and their content representing the module state. More...
 
def getConfiguration (self)
 Return the configration dictionary for this module. More...
 
def get_connector (self, connector_name)
 Return module connected to the given named connector. More...
 
- Public Member Functions inherited from core.module.ModuleMeta
def __new__ (cls, name, bases, attrs)
 Collect declared Connectors, ConfigOptions and StatusVars into dictionaries. More...
 

Public Attributes

 threadlock
 
 inapin
 
 inbpin
 
 pwmpin
 
 enapin
 
 enbpin
 
 diapin
 
 dibpin
 
 fanpin
 
 p
 
 dutycycle
 
- Public Attributes inherited from core.module.BaseMixin
 module_state
 
 connectors
 

Static Public Attributes

 channel = ConfigOption('channel', 0, missing='warn')
 
 freq = ConfigOption('frequency', 100)
 

Detailed Description

Hardware module for Raspberry Pi-based PWM controller.

Example config for copy-paste:

pi_pwm: module 'pi_pwm.PiPWM' channel 0 frequency 100 # in Hz

Member Function Documentation

◆ changeDutyCycle()

def pi_pwm.PiPWM.changeDutyCycle (   self,
  duty 
)

Set the PWM duty cycle in percent.

Parameters
floatduty: PWM duty cycle 0 < duty < 100

◆ getControlLimits()

def pi_pwm.PiPWM.getControlLimits (   self)

Get minimum and maxuimum value for control value.

Returns
tuple(float, float): min and max control value

◆ getControlUnit()

def pi_pwm.PiPWM.getControlUnit (   self)

Get unit for control value.

Returns
tuple(str, str): short and text form of unit

◆ getControlValue()

def pi_pwm.PiPWM.getControlValue (   self)

Get control value for this controller.

Returns
float: control value, in this case duty cycle in percent

◆ setControlValue()

def pi_pwm.PiPWM.setControlValue (   self,
  value 
)

Set control value for this controller.

Parameters
floatvalue: control value, in this case duty cycle in percent

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