nrf24l01/nrf24.c
// Set transceiver DynamicPayloadLength feature for all the pipes
// input:
//   mode - status, one of nRF24_DPL_xx values
Set transceiver DynamicPayloadLength feature for all the pipes
input:
mode - status, one of nRF24_DPL_xx values
Set transceiver DynamicPayloadLength feature for all the pipes input : mode - status one of nRF24_DPL_xx values
void nRF24_SetDynamicPayloadLength(uint8_t mode) {
	uint8_t reg;
	reg  = nRF24_ReadReg(nRF24_REG_FEATURE);
	if(mode) {
		nRF24_WriteReg(nRF24_REG_FEATURE, reg | nRF24_FEATURE_EN_DPL);
		nRF24_WriteReg(nRF24_REG_DYNPD, 0x1F);
	} else {
		nRF24_WriteReg(nRF24_REG_FEATURE, reg &~ nRF24_FEATURE_EN_DPL);
		nRF24_WriteReg(nRF24_REG_DYNPD, 0x0);
	}
}
void nRF24_SetDynamicPayloadLength ( uint8_t mode ) { uint8_t reg ; reg = nRF24_ReadReg ( nRF24_REG_FEATURE ) ; if ( mode ) { nRF24_WriteReg ( nRF24_REG_FEATURE , reg | nRF24_FEATURE_EN_DPL ) ; nRF24_WriteReg ( nRF24_REG_DYNPD , 0x1F ) ; } else { nRF24_WriteReg ( nRF24_REG_FEATURE , reg & ~ nRF24_FEATURE_EN_DPL ) ; nRF24_WriteReg ( nRF24_REG_DYNPD , 0x0 ) ; } }
Set transceiver DynamicPayloadLength feature for all the pipes
input:
mode - status, one of nRF24_DPL_xx values
Set transceiver DynamicPayloadLength feature for all the pipes input : mode - status one of nRF24_DPL_xx values