:py:mod:`lager.peripherals` =========================== .. py:module:: lager.peripherals Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: lager.peripherals.Bus lager.peripherals.GPIO lager.peripherals.PWM lager.peripherals.POWERBUS lager.peripherals.SPI lager.peripherals.I2C lager.peripherals.SERIAL lager.peripherals.ADC lager.peripherals.JSCOPE Attributes ~~~~~~~~~~ .. autoapisummary:: lager.peripherals.SPI_DEV lager.peripherals.I2C_DEV lager.peripherals.SERIAL_DEV lager.peripherals.ADC_AVG_BYTES lager.peripherals.ADC_CONST lager.peripherals.gpio_mappings .. py:data:: SPI_DEV :annotation: = 0 .. py:data:: I2C_DEV :annotation: = 1 .. py:data:: SERIAL_DEV :annotation: = /dev/ttyS0 .. py:data:: ADC_AVG_BYTES .. py:data:: ADC_CONST :annotation: = 0.0012939453125 .. py:data:: gpio_mappings .. py:class:: Bus Bases: :py:obj:`enum.Enum` Generic enumeration. Derive from this class to define new enumerations. .. py:attribute:: BUS_3V3 :annotation: = 0 .. py:attribute:: BUS_5V :annotation: = 5 .. py:class:: GPIO(pi) .. py:method:: _get_pin(pin) .. py:method:: write(pin, level) .. py:method:: read(pin) .. py:method:: set_mode(pin, mode) .. py:method:: set_pull_up_down(pin, pud) .. py:method:: callback(pin, edge=pigpio.RISING_EDGE, func=None) .. py:class:: PWM(pi) .. py:method:: _get_pin(pin) .. py:method:: set_dutycycle(pin, dutycycle) .. py:method:: set_frequency(pin, freq) .. py:method:: set_range(pin, range) .. py:class:: POWERBUS(pi) .. py:method:: set(bus, value) .. py:class:: SPI(pi, device=SPI_DEV) .. py:method:: connect(mode, speed) .. py:method:: __enter__() .. py:method:: __exit__(type, value, tb) .. py:method:: __getattr__(attr) .. py:class:: I2C(pi, device=I2C_DEV) .. py:method:: connect(addr) .. py:method:: __enter__() .. py:method:: __exit__(type, value, tb) .. py:method:: __getattr__(attr) .. py:class:: SERIAL(pi) .. py:method:: connect(baud) .. py:method:: __enter__() .. py:method:: __exit__(type, value, tb) .. py:method:: __getattr__(attr) .. py:class:: ADC(pi) .. py:method:: __enter__() .. py:method:: __exit__(type, value, tb) .. py:method:: setup_read(spi, average_count) .. py:method:: read_adc(spi, output) .. py:method:: read(output='mv', channel=None, average_count=None) Read the ADC .. py:class:: JSCOPE .. py:method:: __enter__() .. py:method:: __exit__(type, value, tb) .. py:method:: __getattr__(attr)