Contiki 2.6

stm32w-radio.c File Reference

Machine dependent STM32W radio code. More...

#include "hal/error.h"
#include "hal/hal.h"
#include "contiki.h"
#include "net/mac/frame802154.h"
#include "dev/stm32w-radio.h"
#include "net/netstack.h"
#include "net/packetbuf.h"
#include "net/rime/rimestats.h"
#include "sys/rtimer.h"
#include "dev/leds.h"

Go to the source code of this file.

Functions

void ST_RadioReceiveIsrCallback (u8 *packet, boolean ackFramePendingSet, u32 time, u16 errors, s8 rssi)
 This function is called by the library when a packet has been received.
void ST_RadioTransmitCompleteIsrCallback (StStatus status, u32 txSyncTime, boolean framePending)
 This function is called by the library once after each ST_RadioTransmit() call that returned successfully.
boolean ST_RadioDataPendingShortIdIsrCallback (int16u shortId)
 This function is called by the library after the short address fields of a packet have been received.
boolean ST_RadioDataPendingLongIdIsrCallback (int8u *longId)
 This function is called by the library after the long address fields of a packet have been received.
void ST_RadioOverflowIsrCallback (void)
 This function is called by the library in response to a receive overflow event if this notification is enabled by a call to ST_RadioEnableOverflowNotification().
void ST_RadioSfdSentIsrCallback (u32 sfdSentTime)
 This function is called by the library in response to an SFD sent event if this notification has been enabled by a call to ST_RadioEnableSfdSentNotification().
void ST_RadioMacTimerCompareIsrCallback (void)
 This function is called by the library in response to MAC timer comparison event.

Detailed Description

Machine dependent STM32W radio code.

Author:
Salvatore Pitrulli Chi-Anh La la@imag.fr Simon Duquennoy <simonduq@sics.se>

Definition in file stm32w-radio.c.


Function Documentation

boolean ST_RadioDataPendingLongIdIsrCallback ( u8 *  longId)

This function is called by the library after the long address fields of a packet have been received.

The library will set the frame pending bit in the outgoing ACK only if the return value is TRUE. The application must lookup the eui64 in its own data structures and return TRUE if there is data pending, FALSE otherwise. It is critical that this function complete as quickly as possible to ensure the frame pending bit can be set before the ACK is transmitted.

Returns:
TRUE if the frame pending bit should be set in the outgoing ACK.

Definition at line 596 of file stm32w-radio.c.

References FALSE.

boolean ST_RadioDataPendingShortIdIsrCallback ( u16  shortId)

This function is called by the library after the short address fields of a packet have been received.

The library will set the frame pending bit in the outgoing ACK only if the return value is TRUE. The application must lookup shortId in its own data structures and return TRUE if there is data pending, FALSE otherwise. It is critical that this function complete as quickly as possible to ensure the frame pending bit can be set before the ACK is transmitted.

Returns:
TRUE if the frame pending bit should be set in the outgoing ACK.

Definition at line 591 of file stm32w-radio.c.

References FALSE.

void ST_RadioReceiveIsrCallback ( u8 *  packet,
boolean  ackFramePendingSet,
u32  time,
u16  errors,
s8  rssi 
)

This function is called by the library when a packet has been received.

Parameters:
*packetpoints to the packet data beginning with the length byte. The CRC bytes will have been removed from the packet.
ackFramePendingSetTRUE if the library set the Frame Pending bit in the hardware-generated MAC ACK to this packet, FALSE otherwise.
timeThe value of the MAC timer when the SFD was received for this packet.
errorsThe number of correlator errors in the packet.
rssiThe energy detected over the last 8 symbols of the packet in units of dBm.

Definition at line 500 of file stm32w-radio.c.

References process_poll().

void ST_RadioSfdSentIsrCallback ( u32  sfdSentTime)

This function is called by the library in response to an SFD sent event if this notification has been enabled by a call to ST_RadioEnableSfdSentNotification().

NOTE: This callback is called for ACKs as well as normal packets.

NOTE: In cases of extreme interrupt latency it is possible that sfdSentTime may contain the SFD time of the last received packet instead of the time of the last transmitted packet.

Parameters:
sfdSentTimethe value of the MAC timer when the SFD was sent in the last transmitted packet.

Definition at line 649 of file stm32w-radio.c.

void ST_RadioTransmitCompleteIsrCallback ( StStatus  status,
u32  sfdSentTime,
boolean  framePending 
)

This function is called by the library once after each ST_RadioTransmit() call that returned successfully.

If the ST_RadioTransmit() call returned an error ST_RadioTransmitCompleteIsrCallback() will not be called.

NOTE: ST_RadioTransmit() can be called again within the context of this callback.

Parameters:
statusparameter indicates one of the following conditions: ::ST_SUCCESS - the last byte of the non-ACK-request packet has been transmitted. ::ST_PHY_ACK_RECEIVED - the requested ACK was received. ::ST_MAC_NO_ACK_RECEIVED - the requested ACK was not received in time. ::ST_PHY_TX_CCA_FAIL - unable to transmit due to lack of clear channel on all attempts. ::ST_PHY_TX_UNDERFLOW - DMA underflow occurred while transmitting. Should never happen. ::ST_PHY_TX_INCOMPLETE - The PLL synthesizer failed to lock while transmitting. Should never happen.
sfdSentTimethe value of the MAC timer captured when the SFD was sent.
framePendingTRUE if the received ACK indicates that data is pending for this node, FALSE otherwise.

Definition at line 533 of file stm32w-radio.c.