mirror of
https://github.com/soypat/lora.git
synced 2026-09-10 22:19:26 +00:00
add latest barebone additions
This commit is contained in:
@@ -12,6 +12,9 @@ type DeviceLoRaBare struct {
|
||||
}
|
||||
|
||||
func (d *DeviceLoRaBare) Configure(c lora.Config) (err error) {
|
||||
// Taken from both:
|
||||
// pico-lorawan/src/lorawan.c
|
||||
// pico-lorawan/lib/LoRaMac-node/src/radio/sx1276/sx1276.c
|
||||
d.DL.Reset()
|
||||
// Seems to take just under ~6ms. Wait 20ms.
|
||||
err = d.DL.rxFSKChainCalibration(20 * time.Millisecond)
|
||||
|
||||
+2
-1
@@ -245,6 +245,7 @@ func (d *DeviceLoRa) Reset() {
|
||||
time.Sleep(1 * time.Millisecond)
|
||||
d.rst(true)
|
||||
time.Sleep(6 * time.Millisecond)
|
||||
d.csEnable(false)
|
||||
}
|
||||
|
||||
// IsConnected reads the version register and checks if it matches the expected value.
|
||||
@@ -947,7 +948,7 @@ func (d *DeviceLoRa) setHopPeriod(val uint8) error { return d.Write8(regHOP_PERI
|
||||
|
||||
func (d *DeviceLoRa) writeMasked8(addr uint8, mask, value byte) error {
|
||||
if value != 0 && value&^mask != 0 {
|
||||
println("value", value, "mask", mask)
|
||||
println("addr", addr, "value", value, "mask", mask)
|
||||
panic("misuse of writeMasked8") // Bug in this package if hit.
|
||||
}
|
||||
existing, err := d.read8(addr)
|
||||
|
||||
Reference in New Issue
Block a user