Verified Commit a3671183 authored by Jakob Moser's avatar Jakob Moser
Browse files

Provide 3.3V voltage on GPIO pin

parent 8bf8f14d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@
			background: black !important;
		}

		.pin1 .pin {
		.pin31 .pin {
			background: gray !important;
		}

+5 −4
Original line number Diff line number Diff line
@@ -2,12 +2,17 @@ from collections.abc import Callable
from time import sleep

from pirc522 import RFID
import RPi.GPIO as GPIO

from poolpay.card.CardReader import CardReader


class Pirc522CardReader(CardReader):
    def __init__(self) -> None:
        # Provide 3.3V
        GPIO.setmode(GPIO.BOARD)
        GPIO.setup(31, GPIO.OUT, initial=1)

        # Open this on SPI1 bus, because SPI0's pins are taken by the LCD.
        # Technically, it might be possible to connect both LCD and Card Interface to
        # the same SPI0 bus (making one device=0, and the other device=1),
@@ -48,8 +53,4 @@ class Pirc522CardReader(CardReader):
        self._handle_removal = handle_removal

    def close(self) -> None:
        # Always stop crypto1 when done working
        self._reader.stop_crypto()

        # Calls GPIO cleanup
        self._reader.cleanup()