mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-07-26 10:38:41 +00:00
62663c1832
* add SPI driver for semtech sx128x chips Co-authored-by: Copilot <copilot@github.com> * handle busy loop better * switch to time based busy timeout Co-authored-by: Copilot <copilot@github.com> * comment functions * start on using types for function inputs * use types where applicable and align with datasheet more Co-authored-by: Copilot <copilot@github.com> * work on exporting less constants * only export "actionable" errors * combine identical constants * add crude lora rx and tx examples * change from type aliases to local types --------- Co-authored-by: Copilot <copilot@github.com>
70 lines
3.2 KiB
Go
70 lines
3.2 KiB
Go
package sx128x
|
|
|
|
const (
|
|
|
|
// SX128X register map
|
|
REG_FIRMWARE_VERSIONS = uint16(0x153)
|
|
REG_RX_GAIN = uint16(0x891)
|
|
REG_MANUAL_GAIN_SETTING = uint16(0x895)
|
|
REG_LNA_GAIN_VALUE = uint16(0x89E)
|
|
REG_LNA_GAIN_CONTROL = uint16(0x89F)
|
|
REG_SYNCH_PEAK_ATTENUATION = uint16(0x8C2)
|
|
REG_PAYLOAD_LENGTH = uint16(0x901)
|
|
REG_LORA_HEADER_MODE = uint16(0x903)
|
|
REG_RANGING_REQUEST_ADDRESS_BYTE_3 = uint16(0x912)
|
|
REG_RANGING_REQUEST_ADDRESS_BYTE_2 = uint16(0x913)
|
|
REG_RANGING_REQUEST_ADDRESS_BYTE_1 = uint16(0x914)
|
|
REG_RANGING_REQUEST_ADDRESS_BYTE_0 = uint16(0x915)
|
|
REG_RANGING_DEVICE_ADDRESS_BYTE_3 = uint16(0x916)
|
|
REG_RANGING_DEVICE_ADDRESS_BYTE_2 = uint16(0x917)
|
|
REG_RANGING_DEVICE_ADDRESS_BYTE_1 = uint16(0x918)
|
|
REG_RANGING_DEVICE_ADDRESS_BYTE_0 = uint16(0x919)
|
|
REG_RANGING_FILTER_WINDOW_SIZE = uint16(0x91E)
|
|
REG_RESET_RANGING_FILTER = uint16(0x923)
|
|
REG_RANGING_RESULT_MUX = uint16(0x924)
|
|
REG_SF_ADDITIONAL_CONFIGURATION = uint16(0x925)
|
|
REG_RANGING_CALIBRATION_BYTE_2 = uint16(0x92B)
|
|
REG_RANGING_CALIBRATION_BYTE_1 = uint16(0x92C)
|
|
REG_RANGING_CALIBRATION_BYTE_0 = uint16(0x92D)
|
|
REG_RANGING_ID_CHECK_LENGTH = uint16(0x931)
|
|
REG_FREQUENCY_ERROR_CORRECTION = uint16(0x93C)
|
|
REG_CAD_DETECT_PEAK = uint16(0x942)
|
|
REG_LORA_SYNC_WORD_MSB = uint16(0x944)
|
|
REG_LORA_SYNC_WORD_LSB = uint16(0x945)
|
|
REG_HEADER_CRC = uint16(0x954)
|
|
REG_CODING_RATE = uint16(0x950)
|
|
REG_FEI_BYTE_2 = uint16(0x954)
|
|
REG_FEI_BYTE_1 = uint16(0x955)
|
|
REG_FEI_BYTE_0 = uint16(0x956)
|
|
REG_RANGING_RESULT_BYTE_2 = uint16(0x961)
|
|
REG_RANGING_RESULT_BYTE_1 = uint16(0x962)
|
|
REG_RANGING_RESULT_BYTE_0 = uint16(0x963)
|
|
REG_RANGING_RSSI = uint16(0x964)
|
|
REG_FREEZE_RANGING_RESULT = uint16(0x97F)
|
|
REG_PACKET_PREAMBLE_SETTINGS = uint16(0x9C1)
|
|
REG_WHITENING_INITIAL_VALUE = uint16(0x9C5)
|
|
REG_CRC_POLYNOMIAL_DEFINITION_MSB = uint16(0x9C6)
|
|
REG_CRC_POLYNOMIAL_DEFINITION_LSB = uint16(0x9C7)
|
|
REG_CRC_POLYNOMIAL_SEED_BYTE_2 = uint16(0x9C7)
|
|
REG_CRC_POLYNOMIAL_SEED_BYTE_1 = uint16(0x9C8)
|
|
REG_CRC_POLYNOMIAL_SEED_BYTE_0 = uint16(0x9C9)
|
|
REG_CRC_MSB_INITIAL_VALUE = uint16(0x9C8)
|
|
REG_CRC_LSB_INITIAL_VALUE = uint16(0x9C9)
|
|
REG_SYNC_ADDRESS_CONTROL = uint16(0x9CD)
|
|
REG_SYNC_ADDRESS_1_BYTE_4 = uint16(0x9CE)
|
|
REG_SYNC_ADDRESS_1_BYTE_3 = uint16(0x9CF)
|
|
REG_SYNC_ADDRESS_1_BYTE_2 = uint16(0x9D0)
|
|
REG_SYNC_ADDRESS_1_BYTE_1 = uint16(0x9D1)
|
|
REG_SYNC_ADDRESS_1_BYTE_0 = uint16(0x9D2)
|
|
REG_SYNC_ADDRESS_2_BYTE_4 = uint16(0x9D3)
|
|
REG_SYNC_ADDRESS_2_BYTE_3 = uint16(0x9D4)
|
|
REG_SYNC_ADDRESS_2_BYTE_2 = uint16(0x9D5)
|
|
REG_SYNC_ADDRESS_2_BYTE_1 = uint16(0x9D6)
|
|
REG_SYNC_ADDRESS_2_BYTE_0 = uint16(0x9D7)
|
|
REG_SYNC_ADDRESS_3_BYTE_4 = uint16(0x9D8)
|
|
REG_SYNC_ADDRESS_3_BYTE_3 = uint16(0x9D9)
|
|
REG_SYNC_ADDRESS_3_BYTE_2 = uint16(0x9DA)
|
|
REG_SYNC_ADDRESS_3_BYTE_1 = uint16(0x9DB)
|
|
REG_SYNC_ADDRESS_3_BYTE_0 = uint16(0x9DC)
|
|
)
|