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,
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);
void ST_RadioEnableAutoAck(boolean enable)
This function enables or disables automatic transmission of ACKs in response to received packets whic...
void ST_RadioMacTimerCompareIsrCallback(void)
This function is called by the library in response to MAC timer comparison event. ...
void ST_RadioReceiveIsrCallback(uint8_t *packet, boolean ackFramePendingSet, uint32_t time, uint16_t errors, int8_t rssi)
This function is called by the library when a packet has been received.
u8 * ST_RadioGetEui64(void)
This function get the EUI 64 of the node.
void ST_RadioEnableOverflowNotification(boolean enable)
This function enables or disables notification of DMA receive buffer overflow events via ST_RadioOver...
void ST_RadioEnableReceiveCrc(boolean enable)
This function enables or disables discarding received packets that fail the Cyclic Redundancy Check...
void ST_RadioSetCoordinator(boolean coordinator)
This function sets or clears coordinator mode for this node.
boolean ST_RadioDeviceIsCoordinator(void)
This function gets the coordinator status of the node.
boolean ST_RadioAddressFilteringEnabled(void)
This function gets the address filtering status of the device.
u16 ST_RadioGetNodeId(void)
This function gets the short address of the node.
u16 ST_RadioGetPanId(void)
This function gets the PAN id of the node.
boolean ST_RadioDataPendingLongIdIsrCallback(uint8_t *longId)
This function is called by the library after the long address fields of a packet have been received...
boolean ST_RadioDataPendingShortIdIsrCallback(uint16_t shortId)
This function is called by the library after the short address fields of a packet have been received...
boolean ST_RadioOverflowNotificationEnabled(void)
This function indicates whether the overflow notification via ST_RadioOverflowIsrCallback() is enable...
void ST_RadioTransmitCompleteIsrCallback(StStatus status, uint32_t txSyncTime, boolean framePending)
This function is called by the library once after each ST_RadioTransmit() call that returned successf...
boolean ST_RadioAutoAckEnabled(void)
This function gets the automatic acknowledgement status of the device.
void ST_RadioSetNodeId(u16 nodeId)
This function sets the short address of the node.
boolean ST_RadioReceiveCrcEnabled(void)
This function gets the receive CRC configuration of the node.
void ST_RadioEnableAddressFiltering(boolean enable)
This function enables or disables address filtering on PAN ID, node ID, and EUI 64.
void ST_RadioSfdSentIsrCallback(uint32_t sfdSentTime)
This function is called by the library in response to an SFD sent event if this notification has been...
void ST_RadioOverflowIsrCallback(void)
This function is called by the library in response to a receive overflow event if this notification i...
void ST_RadioSetPanId(u16 panId)
This function sets the PAN id of the node.