2020-11-03 19:24:35 +01:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2019 Brett Witherspoon
|
|
|
|
* Copyright (c) 2020 Friedt Professional Engineering Services, Inc
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef ZEPHYR_DRIVERS_IEEE802154_IEEE802154_CC13XX_CC26XX_SUBG_H_
|
|
|
|
#define ZEPHYR_DRIVERS_IEEE802154_IEEE802154_CC13XX_CC26XX_SUBG_H_
|
|
|
|
|
2022-05-06 10:25:46 +02:00
|
|
|
#include <zephyr/kernel.h>
|
|
|
|
#include <zephyr/net/net_if.h>
|
2022-08-27 09:34:54 +02:00
|
|
|
#include <zephyr/net/ieee802154.h>
|
2023-05-30 12:39:31 +02:00
|
|
|
#include <zephyr/net/ieee802154_radio.h>
|
2020-11-03 19:24:35 +01:00
|
|
|
|
|
|
|
#include <ti/drivers/rf/RF.h>
|
|
|
|
|
|
|
|
#include <driverlib/rf_common_cmd.h>
|
|
|
|
#include <driverlib/rf_data_entry.h>
|
|
|
|
#include <driverlib/rf_ieee_cmd.h>
|
|
|
|
#include <driverlib/rf_prop_cmd.h>
|
|
|
|
#include <driverlib/rf_mailbox.h>
|
|
|
|
|
|
|
|
#define CC13XX_CC26XX_NUM_RX_BUF \
|
|
|
|
CONFIG_IEEE802154_CC13XX_CC26XX_SUB_GHZ_NUM_RX_BUF
|
|
|
|
|
2020-11-11 17:12:02 +01:00
|
|
|
/* Three additional bytes for length, RSSI and status values from CPE */
|
|
|
|
#define CC13XX_CC26XX_RX_BUF_SIZE (IEEE802154_MAX_PHY_PACKET_SIZE + 3)
|
2020-11-03 19:24:35 +01:00
|
|
|
|
2023-05-30 12:39:31 +02:00
|
|
|
#define CC13XX_CC26XX_TX_BUF_SIZE (IEEE802154_PHY_SUN_FSK_PHR_LEN + IEEE802154_MAX_PHY_PACKET_SIZE)
|
2020-11-03 19:24:35 +01:00
|
|
|
|
2023-06-11 14:32:55 +02:00
|
|
|
#define CC13XX_CC26XX_INVALID_RSSI INT8_MIN
|
2020-11-03 19:24:35 +01:00
|
|
|
|
|
|
|
struct ieee802154_cc13xx_cc26xx_subg_data {
|
2023-09-29 09:14:00 +02:00
|
|
|
/* protects writable data and serializes access to the API */
|
|
|
|
struct k_sem lock;
|
|
|
|
|
2020-11-03 19:24:35 +01:00
|
|
|
RF_Handle rf_handle;
|
|
|
|
RF_Object rf_object;
|
|
|
|
|
|
|
|
struct net_if *iface;
|
2023-08-29 16:42:36 +02:00
|
|
|
uint8_t mac[8]; /* in big endian */
|
2020-11-03 19:24:35 +01:00
|
|
|
|
2023-09-29 09:17:00 +02:00
|
|
|
bool is_up;
|
|
|
|
|
2020-11-03 19:24:35 +01:00
|
|
|
dataQueue_t rx_queue;
|
|
|
|
rfc_dataEntryPointer_t rx_entry[CC13XX_CC26XX_NUM_RX_BUF];
|
|
|
|
uint8_t rx_data[CC13XX_CC26XX_NUM_RX_BUF][CC13XX_CC26XX_RX_BUF_SIZE];
|
|
|
|
uint8_t tx_data[CC13XX_CC26XX_TX_BUF_SIZE];
|
|
|
|
|
|
|
|
/* Common Radio Commands */
|
|
|
|
volatile rfc_CMD_FS_t cmd_fs;
|
|
|
|
|
|
|
|
/* Sub-GHz Radio Commands */
|
|
|
|
volatile rfc_CMD_PROP_RX_ADV_t cmd_prop_rx_adv;
|
|
|
|
volatile rfc_CMD_PROP_TX_ADV_t cmd_prop_tx_adv;
|
|
|
|
volatile rfc_propRxOutput_t cmd_prop_rx_adv_output;
|
|
|
|
volatile rfc_CMD_PROP_CS_t cmd_prop_cs;
|
2023-09-29 08:40:37 +02:00
|
|
|
|
|
|
|
RF_CmdHandle rx_cmd_handle;
|
2020-11-03 19:24:35 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* ZEPHYR_DRIVERS_IEEE802154_IEEE802154_CC13XX_CC26XX_SUBG_H_ */
|