Skip to content

Commit

Permalink
Config for Dragino LoRa + GPS Board
Browse files Browse the repository at this point in the history
The config was adjusted according to [1], to support the Dragino
LoRa + GPS Board on the Raspberry Pi 3.

[1] mayeranalytics#21
  • Loading branch information
jonashoechst authored and amotl committed Apr 27, 2020
1 parent 918f20d commit 8eadfc1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
2 changes: 2 additions & 0 deletions SX127x/LoRa.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ def wrapper(self, val):
class LoRa(object):

spi = BOARD.SpiDev() # init and get the baord's SPI
spi.max_speed_hz = SPI_BAUD_RATE.MAX_SPEED_HZ
spi.mode = SPI_MODE.SPI_MODE
mode = None # the mode is backed up here
backup_registers = []
verbose = True
Expand Down
6 changes: 3 additions & 3 deletions SX127x/board_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ class BOARD:
This is the Raspberry Pi board with one LED and a modtronix inAir9B.
"""
# Note that the BCOM numbering for the GPIOs is used.
DIO0 = 22 # RaspPi GPIO 22
DIO0 = 4 # RaspPi GPIO 22
DIO1 = 23 # RaspPi GPIO 23
DIO2 = 24 # RaspPi GPIO 24
DIO3 = 25 # RaspPi GPIO 25
DIO3 = 21 # RaspPi GPIO 25
LED = 18 # RaspPi GPIO 18 connects to the LED on the proto shield
SWITCH = 4 # RaspPi GPIO 4 connects to a switch
SWITCH = 7 # RaspPi GPIO 4 connects to a switch

# The spi object is kept here
spi = None
Expand Down
10 changes: 10 additions & 0 deletions SX127x/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,3 +188,13 @@ class FSK:
IMAGE_CAL = 0x3B
DIO_MAPPING_1 = 0x40
DIO_MAPPING_2 = 0x41


@add_lookup
class SPI_BAUD_RATE:
MAX_SPEED_HZ = 5000


@add_lookup
class SPI_MODE:
SPI_MODE = 0b01

0 comments on commit 8eadfc1

Please sign in to comment.