SLOA192B April 2014 – March 2019 TRF7970A , TRF7970A
The peer-to-peer NFC stack is initialized by setting the bInitiatorEnabled or bTargetEnabled bits inside the sP2PSupportedModes variable. If both bInitiatorEnabled and bTargetEnabled are set, the stack operates in a switching mechanism similar to how NFC enabled handsets operate when NFC is enabled. For this demo, all passive target and initiator bitrates are enabled.
// Enable Peer 2 Peer Supported Modes
g_sP2PSupportedModes.bits.bTargetEnabled = 1;
g_sP2PSupportedModes.bits.bInitiatorEnabled = 1;
// Set P2P Supported Bit Rates - Target mode
g_sP2PSupportedTargetBitrates.bits.bPassive106kbps = 1;
g_sP2PSupportedTargetBitrates.bits.bPassive212kbps = 1;
g_sP2PSupportedTargetBitrates.bits.bPassive424kbps = 1;
g_sP2PSupportedTargetBitrates.bits.bActive106kbps = 0;
g_sP2PSupportedTargetBitrates.bits.bActive212kbps = 0;
g_sP2PSupportedTargetBitrates.bits.bActive424kbps = 0;
// Set P2P Supported Bit Rates - Initiator mode
g_sP2PSupportedInitiatorBitrates.bits.bPassive106kbps = 1;
g_sP2PSupportedInitiatorBitrates.bits.bPassive212kbps = 1;
g_sP2PSupportedInitiatorBitrates.bits.bPassive424kbps = 1;
g_sP2PSupportedInitiatorBitrates.bits.bActive106kbps = 0;
g_sP2PSupportedInitiatorBitrates.bits.bActive212kbps = 0;
g_sP2PSupportedInitiatorBitrates.bits.bActive424kbps = 0;
// Configure Peer 2 Peer functions for the correct modes and communication bitrates
NFC_P2P_configure(g_sP2PSupportedModes,g_sP2PSupportedTargetBitrates,g_sP2PSupportedInitiatorBitrates);