diff --git a/LICENSE b/LICENSE index 20d269c..13bf6f6 100644 --- a/LICENSE +++ b/LICENSE @@ -16,4 +16,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file +SOFTWARE. diff --git a/LoRaRF/SX126x.py b/LoRaRF/SX126x.py index 7fca7fc..5320941 100644 --- a/LoRaRF/SX126x.py +++ b/LoRaRF/SX126x.py @@ -229,7 +229,7 @@ class SX126x(BaseLoRa) : POWER_SAVING_GAIN = 0x94 # power saving gain register value BOOSTED_GAIN = 0x96 # boosted gain register value - # TX and RX operation status + # TX and RX operation status STATUS_DEFAULT = 0 # default status (false) STATUS_TX_WAIT = 1 STATUS_TX_TIMEOUT = 2 @@ -1036,7 +1036,7 @@ def setRxTxFallbackMode(self, fallbackMode: int) : def writeRegister(self, address: int, data: tuple, nData: int) : buf = ( - (address >> 8) & 0xFF, + (address >> 8) & 0xFF, address & 0xFF ) + tuple(data) self._writeBytes(0x0D, buf, nData+2) @@ -1109,7 +1109,7 @@ def setRfFrequency(self, rfFreq: int) : def setPacketType(self, packetType: int) : self._writeBytes(0x8A, (packetType,), 1) - def getPakcetType(self) -> int : + def getPacketType(self) -> int : buf = self._readBytes(0x11, 2) return buf[1] @@ -1222,7 +1222,7 @@ def clearDeviceErrors(self) : ### SX126X API: WORKAROUND FUNCTIONS ### def _fixLoRaBw500(self, bw: int) : - packetType = self.getPakcetType() + packetType = self.getPacketType() buf = self.readRegister(self.REG_TX_MODULATION, 1) value = buf[0] | 0x04 if packetType == self.LORA_MODEM and bw == self.BW_500000 : diff --git a/LoRaRF/SX127x.py b/LoRaRF/SX127x.py index be96c6b..de229ec 100644 --- a/LoRaRF/SX127x.py +++ b/LoRaRF/SX127x.py @@ -251,7 +251,7 @@ def setCurrentProtection(self, current: int) : self.writeRegister(self.REG_OCP, 0x20 | ocpTrim) def setOscillator(self, option: int) : - + cfg = self.OSC_CRYSTAL if option == self.OSC_TCXO : cfg = self.OSC_TCXO @@ -354,7 +354,7 @@ def setSpreadingFactor(self, sf: int) : # set appropriate signal detection optimize and threshold optimize = 0x03 threshold = 0x0A - if sf == 6 : + if sf == 6 : optimize = 0x05 threshold = 0x0C self.writeRegister(self.REG_DETECTION_OPTIMIZE, optimize) diff --git a/examples/SX127x/driver_rx.py b/examples/SX127x/driver_rx.py index 399802d..719cee1 100644 --- a/examples/SX127x/driver_rx.py +++ b/examples/SX127x/driver_rx.py @@ -104,7 +104,7 @@ def settingFunction() : print("Set syncWord to 0x{:02X}".format(reg)) def receiveFunction(message: list) : - + print("\n-- RECEIVE FUNCTION --") # Activate interrupt when transmit done on DIO0 diff --git a/examples/SX127x/driver_tx.py b/examples/SX127x/driver_tx.py index f1ccbef..3998257 100644 --- a/examples/SX127x/driver_tx.py +++ b/examples/SX127x/driver_tx.py @@ -102,7 +102,7 @@ def settingFunction() : print("Set syncWord to 0x{:02X}".format(reg)) def transmitFunction(message: list) : - + print("\n-- TRANSMIT FUNCTION --") # Configure FIFO address and address pointer for TX operation diff --git a/pyproject.toml b/pyproject.toml index b5a3c46..374b58c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,4 +3,4 @@ requires = [ "setuptools>=42", "wheel" ] -build-backend = "setuptools.build_meta" \ No newline at end of file +build-backend = "setuptools.build_meta" diff --git a/setup.cfg b/setup.cfg index 6005098..8165e25 100644 --- a/setup.cfg +++ b/setup.cfg @@ -19,7 +19,7 @@ classifiers = [options] include_package_data = True -packages = +packages = LoRaRF python_requires = >=2.7 install_requires =