Compare commits

...

1 Commits

Author SHA1 Message Date
deadprogram 992c02c661 lora: add starting point for US915 settings
Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-09-17 19:50:39 +02:00
2 changed files with 52 additions and 0 deletions
+1
View File
@@ -80,6 +80,7 @@ const (
const (
MHz_868_1 = 868100000
MHz_868_5 = 868500000
MHz_902_3 = 902300000
MHz_916_8 = 916800000
MHz_923_3 = 923300000
)
+51
View File
@@ -0,0 +1,51 @@
package region
import "tinygo.org/x/drivers/lora"
const (
US915_DEFAULT_PREAMBLE_LEN = 8
US915_DEFAULT_TX_POWER_DBM = 20
)
type RegionSettingsUS915 struct {
joinRequestChannel *Channel
joinAcceptChannel *Channel
uplinkChannel *Channel
}
// see https://www.thethingsnetwork.org/docs/lorawan/regional-parameters/#us902-928-ism-band
func US915() *RegionSettingsUS915 {
return &RegionSettingsUS915{
joinRequestChannel: &Channel{lora.MHz_902_3,
lora.Bandwidth_125_0,
lora.SpreadingFactor10,
lora.CodingRate4_5,
US915_DEFAULT_PREAMBLE_LEN,
US915_DEFAULT_TX_POWER_DBM},
joinAcceptChannel: &Channel{lora.MHz_923_3,
lora.Bandwidth_500_0,
lora.SpreadingFactor7,
lora.CodingRate4_5,
US915_DEFAULT_PREAMBLE_LEN,
US915_DEFAULT_TX_POWER_DBM},
uplinkChannel: &Channel{lora.MHz_902_3,
lora.Bandwidth_125_0,
lora.SpreadingFactor7,
lora.CodingRate4_5,
US915_DEFAULT_PREAMBLE_LEN,
US915_DEFAULT_TX_POWER_DBM},
}
}
func (r *RegionSettingsUS915) JoinRequestChannel() *Channel {
return r.joinRequestChannel
}
func (r *RegionSettingsUS915) JoinAcceptChannel() *Channel {
return r.joinAcceptChannel
}
func (r *RegionSettingsUS915) UplinkChannel() *Channel {
return r.uplinkChannel
}