sx1262 module telemetry + SPP service implementation. More...
#include "spp/services/sx1262/sx1262.h"#include <stdio.h>#include <string.h>#include "spp/core/packet.h"#include "spp/hal/spi.h"#include "spp/hal/gpio/gpio.h"#include "spp/hal/time/time.h"Go to the source code of this file.
Variables | |
| static SPP_Packet_t | mailboxData [K_SX1262_MAILBOX_SIZE] = {0} |
| static spp_uint8_t | mailboxHead = 0 |
| static spp_uint8_t | mailboxTail = 0 |
| static spp_uint8_t | mailboxCount = 0 |
| static spp_uint32_t | s_frame_number = 1 |
| static SPP_SERVICE_ConsumerContract_t | sx1262Contract |
| volatile spp_bool_t | g_txDoneFlag = SPP_FALSE |
| SPP_GpioIsrCtx_t | g_dio1Ctx = { .p_flag = &g_txDoneFlag } |
sx1262 module telemetry + SPP service implementation.
Definition in file sx1262.c.
|
static |
Definition at line 57 of file sx1262.c.
References K_SPP_OK, SPP_SERVICES_SX1262_init(), and SX1262_InitInterrupts().
Referenced by SPP_SERVICES_SX1262_init().
|
static |
Definition at line 78 of file sx1262.c.
References K_ICM20948_SERVICE_APID, K_SPP_OK, mailboxCount, mailboxData, mailboxHead, s_frame_number, SPP_Packet_t, SPP_SERVICES_SX1262_bmpPacket_to_text(), SPP_SERVICES_SX1262_consumeData(), and SPP_SERVICES_SX1262_icmPacket_to_text().
Referenced by SPP_SERVICES_SX1262_consumeData().
|
static |
Definition at line 64 of file sx1262.c.
References K_SPP_ERROR, K_SPP_OK, mailboxCount, mailboxData, mailboxTail, SPP_Packet_t, and SPP_SERVICES_SX1262_deliverToMailbox().
Referenced by SPP_SERVICES_SX1262_deliverToMailbox().
|
static |
Definition at line 109 of file sx1262.c.
References SPP_SERVICES_SX1262_getConsumerContract(), and sx1262Contract.
Referenced by SPP_SERVICES_SX1262_getConsumerContract().
|
static |
Definition at line 170 of file sx1262.c.
References SPP_Packet_t, and SPP_SERVICES_SX1262_bmpPacket_to_text().
Referenced by SPP_SERVICES_SX1262_bmpPacket_to_text(), and SPP_SERVICES_SX1262_consumeData().
|
static |
Definition at line 183 of file sx1262.c.
References SPP_Packet_t, and SPP_SERVICES_SX1262_icmPacket_to_text().
Referenced by SPP_SERVICES_SX1262_consumeData(), and SPP_SERVICES_SX1262_icmPacket_to_text().
| SPP_RetVal_t SX1262_Transmit | ( | void * | p_handle, |
| spp_uint8_t * | p_data, | ||
| spp_uint8_t | length ) |
Definition at line 113 of file sx1262.c.
References g_txDoneFlag, K_SPP_OK, SX1262_CalibrateImage(), SX1262_SetBufferBaseAddress(), SX1262_SetDioIrqParams(), SX1262_SetModulationParams(), SX1262_SetPacketParams(), SX1262_SetPacketType(), SX1262_SetPaConfig(), SX1262_SetRfFrequency(), SX1262_SetStandby(), SX1262_SetTx(), SX1262_SetTxParams(), SX1262_Transmit(), SX1262_WaitForTxDone(), and SX1262_WriteBuffer().
Referenced by SX1262_Transmit().
| SPP_RetVal_t SX1262_SetStandby | ( | void * | p_handle | ) |
Definition at line 204 of file sx1262.c.
References K_SPP_OK, SPP_HAL_SPI_transmit(), SX1262_OPCODE_SET_STANDBY, SX1262_SetStandby(), and SX1262_WaitBusy().
Referenced by SX1262_SetStandby(), and SX1262_Transmit().
| SPP_RetVal_t SX1262_SetTx | ( | void * | p_handle, |
| spp_uint32_t | timeout ) |
Definition at line 216 of file sx1262.c.
References K_SPP_OK, SPP_HAL_SPI_transmit(), SX1262_OPCODE_SET_TX, SX1262_SetTx(), and SX1262_WaitBusy().
Referenced by SX1262_SetTx(), and SX1262_Transmit().
| SPP_RetVal_t SX1262_SetPacketType | ( | void * | p_handle | ) |
Definition at line 239 of file sx1262.c.
References K_SPP_OK, SPP_HAL_SPI_transmit(), SX1262_OPCODE_SET_PACKET_TYPE, SX1262_SetPacketType(), and SX1262_WaitBusy().
Referenced by SX1262_SetPacketType(), and SX1262_Transmit().
| SPP_RetVal_t SX1262_SetRfFrequency | ( | void * | p_handle | ) |
Definition at line 252 of file sx1262.c.
References K_SPP_OK, SPP_HAL_SPI_transmit(), SX1262_OPCODE_SET_RF_FRECUENCY, SX1262_SetRfFrequency(), and SX1262_WaitBusy().
Referenced by SX1262_SetRfFrequency(), and SX1262_Transmit().
| SPP_RetVal_t SX1262_SetPaConfig | ( | void * | p_handle | ) |
Definition at line 267 of file sx1262.c.
References K_SPP_OK, SPP_HAL_SPI_transmit(), SX1262_OPCODE_SET_PA_CONFIG, SX1262_SetPaConfig(), and SX1262_WaitBusy().
Referenced by SX1262_SetPaConfig(), and SX1262_Transmit().
| SPP_RetVal_t SX1262_CalibrateImage | ( | void * | p_handle | ) |
Definition at line 282 of file sx1262.c.
References K_SPP_OK, SPP_HAL_SPI_transmit(), SX1262_CalibrateImage(), SX1262_OPCODE_CALIBRATE_IMAGE, and SX1262_WaitBusy().
Referenced by SX1262_CalibrateImage(), and SX1262_Transmit().
| SPP_RetVal_t SX1262_SetTxParams | ( | void * | p_handle | ) |
Definition at line 296 of file sx1262.c.
References K_SPP_OK, SPP_HAL_SPI_transmit(), SX1262_OPCODE_SET_TX_PARAMS, SX1262_SetTxParams(), and SX1262_WaitBusy().
Referenced by SX1262_SetTxParams(), and SX1262_Transmit().
| SPP_RetVal_t SX1262_SetBufferBaseAddress | ( | void * | p_handle | ) |
Definition at line 312 of file sx1262.c.
References K_SPP_OK, SPP_HAL_SPI_transmit(), SX1262_OPCODE_SET_BUFFER_BASE_ADDRESS, SX1262_SetBufferBaseAddress(), and SX1262_WaitBusy().
Referenced by SX1262_SetBufferBaseAddress(), and SX1262_Transmit().
| SPP_RetVal_t SX1262_WriteBuffer | ( | void * | p_handle, |
| spp_uint8_t * | p_data, | ||
| spp_uint8_t | length ) |
Definition at line 325 of file sx1262.c.
References K_SPP_OK, SPP_HAL_SPI_transmit(), SX1262_OPCODE_WRITE_BUFFER, SX1262_WaitBusy(), and SX1262_WriteBuffer().
Referenced by SX1262_Transmit(), and SX1262_WriteBuffer().
| SPP_RetVal_t SX1262_SetModulationParams | ( | void * | p_handle, |
| spp_uint8_t | sf, | ||
| spp_uint8_t | bw, | ||
| spp_uint8_t | cr, | ||
| spp_uint8_t | ldro ) |
Definition at line 350 of file sx1262.c.
References K_SPP_OK, SPP_HAL_SPI_transmit(), SX1262_OPCODE_SET_MODULATION_PARAMS, SX1262_SetModulationParams(), and SX1262_WaitBusy().
Referenced by SX1262_SetModulationParams(), and SX1262_Transmit().
| SPP_RetVal_t SX1262_SetPacketParams | ( | void * | p_handle, |
| spp_uint16_t | preambleLength, | ||
| spp_uint8_t | payloadLength ) |
Definition at line 365 of file sx1262.c.
References K_SPP_OK, SPP_HAL_SPI_transmit(), SX1262_OPCODE_SET_PACKET_PARAMS, SX1262_SetPacketParams(), and SX1262_WaitBusy().
Referenced by SX1262_SetPacketParams(), and SX1262_Transmit().
| SPP_RetVal_t SX1262_SetDioIrqParams | ( | void * | p_handle, |
| spp_uint16_t | irqMask, | ||
| spp_uint16_t | dio1Mask, | ||
| spp_uint16_t | dio2Mask, | ||
| spp_uint16_t | dio3Mask ) |
Definition at line 387 of file sx1262.c.
References SPP_HAL_SPI_transmit(), SX1262_OPCODE_SET_DIO_IRQ_PARAMS, SX1262_SetDioIrqParams(), and SX1262_WaitBusy().
Referenced by SX1262_SetDioIrqParams(), and SX1262_Transmit().
| SPP_RetVal_t SX1262_ClearIrqStatus | ( | void * | p_handle, |
| spp_uint16_t | clearMask ) |
Definition at line 404 of file sx1262.c.
References K_SPP_OK, SPP_HAL_SPI_transmit(), SX1262_ClearIrqStatus(), SX1262_OPCODE_CLEAR_IRQ_STATUS, and SX1262_WaitBusy().
Referenced by SX1262_ClearIrqStatus(), and SX1262_WaitForTxDone().
| void SX1262_InitInterrupts | ( | void | ) |
Definition at line 418 of file sx1262.c.
References g_dio1Ctx, SPP_HAL_GPIO_configInterrupt(), SPP_HAL_GPIO_registerIsr(), SX1262_InitInterrupts(), and SX126X_DIO1_PIN.
Referenced by SPP_SERVICES_SX1262_init(), and SX1262_InitInterrupts().
| SPP_RetVal_t SX1262_WaitForTxDone | ( | void * | p_handle | ) |
Definition at line 427 of file sx1262.c.
References g_txDoneFlag, SX1262_ClearIrqStatus(), and SX1262_WaitForTxDone().
Referenced by SX1262_Transmit(), and SX1262_WaitForTxDone().
| SPP_RetVal_t SX1262_WaitBusy | ( | void | ) |
Definition at line 451 of file sx1262.c.
References K_SPP_OK, SX1262_BUSY_PIN, and SX1262_WaitBusy().
Referenced by SX1262_CalibrateImage(), SX1262_ClearIrqStatus(), SX1262_SetBufferBaseAddress(), SX1262_SetDioIrqParams(), SX1262_SetModulationParams(), SX1262_SetPacketParams(), SX1262_SetPacketType(), SX1262_SetPaConfig(), SX1262_SetRfFrequency(), SX1262_SetStandby(), SX1262_SetTx(), SX1262_SetTxParams(), SX1262_WaitBusy(), and SX1262_WriteBuffer().
|
static |
Definition at line 20 of file sx1262.c.
Referenced by SPP_SERVICES_SX1262_consumeData(), and SPP_SERVICES_SX1262_deliverToMailbox().
|
static |
Definition at line 22 of file sx1262.c.
Referenced by SPP_SERVICES_SX1262_consumeData().
|
static |
Definition at line 23 of file sx1262.c.
Referenced by SPP_SERVICES_SX1262_deliverToMailbox().
|
static |
Definition at line 24 of file sx1262.c.
Referenced by SPP_SERVICES_SX1262_consumeData(), and SPP_SERVICES_SX1262_deliverToMailbox().
|
static |
Definition at line 26 of file sx1262.c.
Referenced by SPP_SERVICES_SX1262_consumeData().
|
static |
Definition at line 28 of file sx1262.c.
Referenced by SPP_SERVICES_SX1262_getConsumerContract().
| volatile spp_bool_t g_txDoneFlag = SPP_FALSE |
Definition at line 38 of file sx1262.c.
Referenced by SX1262_Transmit(), and SX1262_WaitForTxDone().
| SPP_GpioIsrCtx_t g_dio1Ctx = { .p_flag = &g_txDoneFlag } |
Definition at line 39 of file sx1262.c.
Referenced by SX1262_InitInterrupts().