Exemple #1
0
void nRFAPI_SetTxPower(unsigned char power)
{
    if(power>3)
        power=3;

    nRFCMD_RegWriteStatusRead(RF_SETUP | WRITE_REG,NRF_RFOPTIONS | (power<<1));
}
Exemple #2
0
void nRFAPI_SetFeatures(unsigned char features)
{
    unsigned const char ACTIVATE_SEQUENCE[] = {ACTIVATE, 0x73};
    unsigned char dummy_buffer[sizeof(ACTIVATE_SEQUENCE)] = {0,0};
    nRFCMD_ReadWriteBuffer(ACTIVATE_SEQUENCE, dummy_buffer, sizeof(ACTIVATE_SEQUENCE));
    nRFCMD_RegWriteStatusRead(FEATURE, features);
}
Exemple #3
0
void nRFAPI_TxRetries(unsigned char count)
{
    if(count>15)
        count=15;

    // setup delay of 500us+86us
    nRFCMD_RegWriteStatusRead(SETUP_RETR | WRITE_REG,0x10 | count);
}
Exemple #4
0
unsigned char nRFAPI_SetSizeMac(unsigned char addr_size)
{
    if(addr_size>=3 && addr_size<=5)
        addr_size-=2;
    else
        addr_size=0;

    nRFCMD_RegWriteStatusRead(SETUP_AW | WRITE_REG,addr_size);

    return addr_size;
}
Exemple #5
0
void nRFAPI_SetPipeSizeRX(unsigned char pipe,unsigned char size)
{
    if(pipe<=5)
        nRFCMD_RegWriteStatusRead((RX_PW_P0 + pipe) | WRITE_REG,size);
}
Exemple #6
0
unsigned char nRFAPI_ClearIRQ(unsigned char status)
{
    return nRFCMD_RegWriteStatusRead(STATUS | WRITE_REG, status & MASK_IRQ_FLAGS);
}
Exemple #7
0
void nRFAPI_SetChannel(unsigned char channel)
{
    nRFCMD_RegWriteStatusRead(RF_CH | WRITE_REG,channel&0x7f);
}
Exemple #8
0
void nRFAPI_PipesAck(unsigned char mask)
{
    nRFCMD_RegWriteStatusRead(EN_AA | WRITE_REG,mask & 0x3F);
}
Exemple #9
0
void nRFAPI_PipesEnable(unsigned char mask)
{
    nRFCMD_RegWriteStatusRead(EN_RXADDR | WRITE_REG,mask & 0x3F);
}
Exemple #10
0
void
nRFAPI_PipesAck (uint8_t mask)
{
  nRFCMD_RegWriteStatusRead (EN_AA | WRITE_REG, mask & 0x3F);
}
Exemple #11
0
void
nRFAPI_PowerDown (void)
{
  /* power don nRF24L01 */
  nRFCMD_RegWriteStatusRead (CONFIG | WRITE_REG, 0x00);
}
Exemple #12
0
void
nRFAPI_SetRxMode (uint8_t receive)
{
  nRFCMD_RegWriteStatusRead (CONFIG | WRITE_REG, receive ? 0x3B : 0x3A);
}
Exemple #13
0
void
nRFAPI_SetPipeSizeRX (uint8_t pipe, uint8_t size)
{
  if (pipe <= 5)
    nRFCMD_RegWriteStatusRead ((RX_PW_P0 + pipe) | WRITE_REG, size);
}
Exemple #14
0
uint8_t
nRFAPI_ClearIRQ (uint8_t status)
{
  return nRFCMD_RegWriteStatusRead (STATUS | WRITE_REG,
				    status & MASK_IRQ_FLAGS);
}
Exemple #15
0
void
nRFAPI_SetChannel (uint8_t channel)
{
  nRFCMD_RegWriteStatusRead (RF_CH | WRITE_REG, channel & 0x7f);
}
Exemple #16
0
void nRFAPI_SetRxMode(unsigned char receive)
{
    nRFCMD_RegWriteStatusRead(CONFIG | WRITE_REG,receive ? 0x3B : 0x3A);
}
Exemple #17
0
void
nRFAPI_PipesEnable (uint8_t mask)
{
  nRFCMD_RegWriteStatusRead (EN_RXADDR | WRITE_REG, mask & 0x3F);
}