|
71 | 71 |
|
72 | 72 | from micropython import const
|
73 | 73 |
|
74 |
| -import adafruit_bus_device.spi_device as spi_device |
| 74 | +import adafruit_bus_device.spi_device as spidev |
75 | 75 |
|
76 | 76 |
|
77 | 77 | __version__ = "0.0.0-auto.0"
|
@@ -293,8 +293,8 @@ def __init__(self, spi, cs, reset, frequency, *, sync_word=b'\x2D\xD4',
|
293 | 293 | self._tx_power = 13
|
294 | 294 | self.high_power = high_power
|
295 | 295 | # Device support SPI mode 0 (polarity & phase = 0) up to a max of 10mhz.
|
296 |
| - self._device = spi_device.SPIDevice(spi, cs, baudrate=baudrate, |
297 |
| - polarity=0, phase=0) |
| 296 | + self._device = spidev.SPIDevice(spi, cs, baudrate=baudrate, |
| 297 | + polarity=0, phase=0) |
298 | 298 | # Setup reset as a digital output that's low.
|
299 | 299 | self._reset = reset
|
300 | 300 | self._reset.switch_to_output(value=False)
|
@@ -585,17 +585,16 @@ def tx_power(self):
|
585 | 585 | if pa0 and not pa1 and not pa2:
|
586 | 586 | # -18 to 13 dBm range
|
587 | 587 | return -18 + self.output_power
|
588 |
| - elif not pa0 and pa1 and not pa2: |
| 588 | + if not pa0 and pa1 and not pa2: |
589 | 589 | # -2 to 13 dBm range
|
590 | 590 | return -18 + self.output_power
|
591 |
| - elif not pa0 and pa1 and pa2 and not self.high_power: |
| 591 | + if not pa0 and pa1 and pa2 and not self.high_power: |
592 | 592 | # 2 to 17 dBm range
|
593 | 593 | return -14 + self.output_power
|
594 |
| - elif not pa0 and pa1 and pa2 and self.high_power: |
| 594 | + if not pa0 and pa1 and pa2 and self.high_power: |
595 | 595 | # 5 to 20 dBm range
|
596 | 596 | return -11 + self.output_power
|
597 |
| - else: |
598 |
| - raise RuntimeError('Power amplifiers in unknown state!') |
| 597 | + raise RuntimeError('Power amplifiers in unknown state!') |
599 | 598 |
|
600 | 599 | @tx_power.setter
|
601 | 600 | def tx_power(self, val):
|
|
0 commit comments