/********************************************************************* * @fn macSrcMatchSetEnableBit * * @brief Set or clear the enable bit in the SRCMATCH EN register * * @param index - index of the entry in the source address table * @param option - true (set the enable bit), or false (clear the enable bit) * * @return none */ static void macSrcMatchSetEnableBit( uint8 index, bool option ) { uint24 enable; enable = MAC_RADIO_SRC_MATCH_GET_EN(); if( option == TRUE ) { if( macSrcMatchAddrMode == SADDR_MODE_SHORT ) { enable |= ( (uint24)0x01 << index ); MAC_RADIO_SRC_MATCH_SET_SHORTEN( enable ); } else { enable |= ( (uint24)0x01 << ( index * 2 ) ); MAC_RADIO_SRC_MATCH_SET_EXTEN( enable ); } } else { if( macSrcMatchAddrMode == SADDR_MODE_SHORT ) { enable &= ~( (uint24)0x01 << index ); MAC_RADIO_SRC_MATCH_SET_SHORTEN( enable ); } else { enable &= ~( (uint24)0x01 << ( index * 2 ) ); MAC_RADIO_SRC_MATCH_SET_EXTEN( enable ); } } }
/********************************************************************* * @fn macSrcMatchSetEnableBit * * @brief Set or clear the enable bit in the SRCMATCH EN register * * @param index - index of the entry in the source address table * @param option - true (set the enable bit), or false (clear the * enable bit) * @param macSrcMatchAddrMode - Address Mode for the entry. Valid values * are SADDR_MODE_SHORT or SADDR_MODE_EXT * * @return none */ static void macSrcMatchSetEnableBit(uint8 index, bool option, uint8 macSrcMatchAddrMode) { uint24 enable; uint8 buf[MAC_SRCMATCH_ENABLE_BITMAP_LEN]; if( option == TRUE ) { if( macSrcMatchAddrMode == SADDR_MODE_SHORT ) { enable = MAC_RADIO_SRC_MATCH_GET_SHORTADDR_EN(); enable |= ( (uint24)0x01 << index ); osal_buffer_uint24( buf, enable ); MAC_RADIO_SRC_MATCH_SET_SHORTEN( buf ); } else { enable = MAC_RADIO_SRC_MATCH_GET_EXTADDR_EN(); enable |= ( (uint24)0x01 << ( index * EXT_ADDR_INDEX_SIZE) ); osal_buffer_uint24( buf, enable ); MAC_RADIO_SRC_MATCH_SET_EXTEN( buf ); } } else { if( macSrcMatchAddrMode == SADDR_MODE_SHORT ) { enable = MAC_RADIO_SRC_MATCH_GET_SHORTADDR_EN(); enable &= ~( (uint24)0x01 << index ); osal_buffer_uint24( buf, enable ); MAC_RADIO_SRC_MATCH_SET_SHORTEN( buf ); } else { enable = MAC_RADIO_SRC_MATCH_GET_EXTADDR_EN(); enable &= ~( (uint24)0x01 << ( index * EXT_ADDR_INDEX_SIZE ) ); osal_buffer_uint24( buf, enable ); MAC_RADIO_SRC_MATCH_SET_EXTEN( buf ); } } }