22 #define SIMPLEMAC_VERSION_MAJOR 1
27 #define SIMPLEMAC_VERSION_MINOR 0
32 #define SIMPLEMAC_VERSION_PATCH 2
37 #define SIMPLEMAC_VERSION_QUAL ""
39 #define _SQUOTEME(a) #a
40 #define SQUOTEME(a) _SQUOTEME(a)
45 #define SIMPLEMAC_VERSION_STRING SQUOTEME(SIMPLEMAC_VERSION_MAJOR) "." SQUOTEME(SIMPLEMAC_VERSION_MINOR) "." SQUOTEME(SIMPLEMAC_VERSION_PATCH) SIMPLEMAC_VERSION_QUAL
50 #define SECURITY_BLOCK_SIZE 16 // bytes
51 #define MIN_RADIO_POWER -43 // dBm
52 #define MAX_RADIO_POWER 3 // dBm
56 ST_RADIO_POWER_MODE_RX_ON,
57 ST_RADIO_POWER_MODE_OFF
59 typedef u8 RadioPowerMode;
69 #define RADIO_CCA_ATTEMPT_MAX_DEFAULT 4
70 #define RADIO_BACKOFF_EXPONENT_MIN_DEFAULT 3
71 #define RADIO_BACKOFF_EXPONENT_MAX_DEFAULT 5
77 u8 backoffExponentMin;
78 u8 backoffExponentMax;
80 } RadioTransmitConfig;
93 #define ST_TX_POWER_MODE_DEFAULT 0x0000
97 #define ST_TX_POWER_MODE_BOOST 0x0001
102 #define ST_TX_POWER_MODE_ALTERNATE 0x0002
107 #define ST_TX_POWER_MODE_BOOST_AND_ALTERNATE (ST_TX_POWER_MODE_BOOST \
108 |ST_TX_POWER_MODE_ALTERNATE)
109 #ifndef DOXYGEN_SHOULD_SKIP_THIS
114 #define ST_TX_POWER_MODE_USE_TOKEN 0x8000
115 #endif//DOXYGEN_SHOULD_SKIP_THIS
121 #define ST_MAX_802_15_4_CHANNEL_NUMBER 26
126 #define ST_MIN_802_15_4_CHANNEL_NUMBER 11
131 #define ST_NUM_802_15_4_CHANNELS \
132 (ST_MAX_802_15_4_CHANNEL_NUMBER - ST_MIN_802_15_4_CHANNEL_NUMBER + 1)
173 StStatus ST_RadioInit(RadioPowerMode initialRadioPowerMode);
178 void ST_RadioWake(
void);
188 void ST_RadioSleep(
void);
220 StStatus ST_RadioSetChannel(u8 channel);
227 u8 ST_RadioGetChannel(
void);
248 StStatus ST_RadioSetChannelAndForceCalibration(u8 channel);
261 boolean ST_RadioCheckRadio(
void);
268 void ST_RadioCalibrateCurrentChannel(
void);
302 StStatus ST_RadioTransmit(u8* packet);
331 boolean framePending);
339 void ST_RadioSetEdCcaThreshold(s8 threshold);
347 s8 ST_RadioGetEdCcaThreshold(
void);
355 void ST_RadioEnableSfdSentNotification(
boolean enable);
363 boolean ST_RadioSfdSentNotificationEnabled(
void);
396 StStatus ST_RadioSetPower(s8 power);
403 s8 ST_RadioGetPower(
void);
435 boolean ackFramePendingSet,
448 void ST_RadioEnableAddressFiltering(
boolean enable);
455 boolean ST_RadioAddressFilteringEnabled(
void);
469 void ST_RadioEnableAutoAck(
boolean enable);
476 boolean ST_RadioAutoAckEnabled(
void);
485 void ST_RadioSetNodeId(u16 nodeId);
493 u16 ST_RadioGetNodeId(
void);
501 void ST_RadioSetPanId(u16 panId);
509 u16 ST_RadioGetPanId(
void);
520 u8* ST_RadioGetEui64(
void);
562 void ST_RadioSetCoordinator(
boolean coordinator);
569 boolean ST_RadioDeviceIsCoordinator(
void);
577 void ST_RadioEnableOverflowNotification(
boolean enable);
585 boolean ST_RadioOverflowNotificationEnabled(
void);
606 void ST_RadioEnableReceiveCrc(
boolean enable);
614 boolean ST_RadioReceiveCrcEnabled(
void);
636 u32 ST_RadioGetMacTimer(
void);
646 void ST_RadioEnableMacTimerCompare(
boolean enable);
655 boolean ST_RadioMacTimerCompareEnabled(
void);
662 void ST_RadioSetMacTimerCompare(u32 value);
669 u32 ST_RadioGetMacTimerCompare(
void);
693 void ST_AesSetKey(u8* key);
700 void ST_AesGetKey(u8* key);
711 void ST_AesEncrypt(u8* block);
734 void ST_RadioStartTransmitTone(
void);
740 void ST_RadioStopTransmitTone(
void);
751 void ST_RadioStartTransmitStream(
void);
757 void ST_RadioStopTransmitStream(
void);
765 s8 ST_RadioEnergyDetection(
void);
774 void ST_RadioGetRandomNumbers(u16 *rn, u8 count);
781 boolean ST_RadioChannelIsClear(
void);
792 void ST_RadioEnablePacketTrace(
boolean enable);
799 boolean ST_RadioPacketTraceEnabled(
void);
819 StStatus ST_RadioSetPowerMode(u16 txPowerMode);
828 u16 ST_RadioGetPowerMode(
void);