Solaris Software
Loading...
Searching...
No Matches
sx1262.h
Go to the documentation of this file.
1/**
2 * @file sx1262.h
3 * @brief SX1262 LoRa telemetry consumer interface and configuration.
4 */
5
6#ifndef SPP_SERVICES_SX1262_H
7#define SPP_SERVICES_SX1262_H
8
10#include "spp/core/packet.h"
12
13/* -----------------------------------------
14 DEFINES
15--------------------------------------------*/
16#define K_SX1262_MAILBOX_SIZE 100U
17#define K_SX1262_TASK_TIMEOUT_MS 1000U
18
19#define SX1262_OPCODE_SET_STANDBY 0x80
20#define SX1262_OPCODE_SET_TX 0x83
21#define SX1262_OPCODE_SET_PACKET_TYPE 0x8A
22#define SX1262_OPCODE_SET_RF_FRECUENCY 0x86
23#define SX1262_OPCODE_SET_PA_CONFIG 0x95
24#define SX1262_OPCODE_SET_TX_PARAMS 0x8E
25#define SX1262_OPCODE_SET_BUFFER_BASE_ADDRESS 0x8F
26#define SX1262_OPCODE_WRITE_BUFFER 0x0E
27#define SX1262_OPCODE_SET_MODULATION_PARAMS 0x8B
28#define SX1262_OPCODE_SET_PACKET_PARAMS 0x8C
29#define SX1262_OPCODE_SET_DIO_IRQ_PARAMS 0x08
30#define SX1262_OPCODE_CLEAR_IRQ_STATUS 0x02
31#define SX1262_OPCODE_CALIBRATE_IMAGE 0x98
32#define SX1262_OPCODE_WRITE_REGISTER 0x0D
33#define K_SX1262_MAX_PACKETS_TO_TRANSMIT 50U
34#define SX1262_MAX_BUSY_TIMEOUT_MS 1000U
35#define SX1262_MAX_DONE_TIMEOUT_MS 2000U
36
37#define SX1262_BUSY_PIN 5
38#define SX1262_DIO1_PIN 6
39#define SX126X_NRESET_PIN 7
40#define K_SX1262_SPI 2U
41
42/* IRQ status */
43#define SX1262_OPCODE_GET_IRQ_STATUS 0x12
44#define SX1262_IRQ_TX_DONE 0x0001U
45#define SX1262_IRQ_TIMEOUT 0x0200U
46
47#define SX1262_OPCODE_SET_REGULATOR_MODE 0x96U
48#define SX1262_REGULATOR_DC_DC 0x01U
49#define SX1262_OPCODE_SET_DIO3_AS_TCXO_CTRL 0x97U
50#define SX1262_TCXO_VOLTAGE_1V7 0x01U
51#define SX1262_TCXO_STARTUP_DELAY 0x000140UL
52#define SX1262_OPCODE_CALIBRATE 0x89U
53#define SX1262_CALIBRATE_ALL 0x7FU
54#define SX1262_OPCODE_CLEAR_DEVICE_ERRORS 0x07U
55#define SX1262_OPCODE_GET_DEVICE_ERRORS 0x17U
56
65
73
74/* -----------------------------------------
75 PUBLIC DECLARATIONS
76--------------------------------------------*/
77
78/**
79 * @brief Returns the SX1262 consumer contract for PUBSUB registration.
80 * @return Pointer to the static consumer contract.
81 */
83
84#endif /* SPP_SERVICES_SX1262_H */
Solaris Packet Protocol (SPP) packet structure definitions.
Standard return-value type used across all SPP modules.
SPP module descriptor and registry API.
Describes the contract of a consumer module. This module needs to have:
Definition service.h:40
spp_uint32_t timer_ms
Definition sx1262.h:71
spp_uint32_t frame_number
Definition sx1262.h:69
SX1262_TxState_t tx_state
Definition sx1262.h:70
void * p_spi
Definition sx1262.h:68
const SPP_SERVICE_ConsumerContract_t * SPP_SERVICES_SX1262_getConsumerContract(void)
Returns the SX1262 consumer contract for PUBSUB registration.
Definition sx1262.c:80
SX1262_TxState_t
Definition sx1262.h:58
@ SX1262_TX_STATE_WAIT_TX_DONE
Definition sx1262.h:63
@ SX1262_TX_STATE_WRITE_BUFFER
Definition sx1262.h:60
@ SX1262_TX_STATE_IDLE
Definition sx1262.h:59
@ SX1262_TX_STATE_SET_PARAMS
Definition sx1262.h:61
@ SX1262_TX_STATE_SET_TX
Definition sx1262.h:62
uint32_t spp_uint32_t
Definition types.h:31