예제 #1
0
void A7105_WriteReg(u8 address, u8 data)
{
    CS_LO();
    PROTOSPI_xfer(address);
    PROTOSPI_xfer(data);
    CS_HI();
}
예제 #2
0
u8 NRF24L01_ReadReg(u8 reg)
{
    CS_LO();
    PROTOSPI_xfer(R_REGISTER | (REGISTER_MASK & reg));
    u8 data = PROTOSPI_xfer(0xFF);
    CS_HI();
    return data;
}
예제 #3
0
uint8_t nRF24L01::readReg(uint8_t reg)
{
    CS_LO();
    PROTOSPI_xfer(R_REGISTER | (REGISTER_MASK & reg));
    uint8_t data = PROTOSPI_xfer(0xFF);
    CS_HI();
    return data;
}
예제 #4
0
uint8_t nRF24L01::writeReg(uint8_t reg, uint8_t data)
{
    CS_LO();
    uint8_t res = PROTOSPI_xfer(W_REGISTER | (REGISTER_MASK & reg));
    PROTOSPI_xfer(data);
    CS_HI();
    return res;
}
예제 #5
0
uint8_t nRF24L01::activate(uint8_t code)
{
    CS_LO();
    uint8_t res = PROTOSPI_xfer(ACTIVATE);
    PROTOSPI_xfer(code);
    CS_HI();
    return res;
}
예제 #6
0
u8 NRF24L01_Activate(u8 code)
{
    CS_LO();
    u8 res = PROTOSPI_xfer(ACTIVATE);
    PROTOSPI_xfer(code);
    CS_HI();
    return res;
}
예제 #7
0
u8 NRF24L01_WriteReg(u8 reg, u8 data)
{
    CS_LO();
    u8 res = PROTOSPI_xfer(W_REGISTER | (REGISTER_MASK & reg));
    PROTOSPI_xfer(data);
    CS_HI();
    return res;
}
예제 #8
0
u8 CC2500_ReadReg(u8 address)
{
    CS_LO();
    PROTOSPI_xfer(CC2500_READ_SINGLE | address);
    u8 data = PROTOSPI_xfer(0);
    CS_HI();
    return data;
}
예제 #9
0
void CC2500_WriteRegisterMulti(u8 address, const u8 data[], u8 length)
{
    CS_LO();
    PROTOSPI_xfer(CC2500_WRITE_BURST | address);
    for(int i = 0; i < length; i++)
    {
        PROTOSPI_xfer(data[i]);
    }
    CS_HI();
}
예제 #10
0
uint8_t nRF24L01::readPayload(uint8_t *data, uint8_t length)
{
    CS_LO();
    uint8_t res = PROTOSPI_xfer(R_RX_PAYLOAD);
    for(uint8_t i = 0; i < length; i++)
    {
        data[i] = PROTOSPI_xfer(0xFF);
    }
    CS_HI();
    return res;
}
예제 #11
0
uint8_t nRF24L01::readRegisterMulti(uint8_t reg, uint8_t data[], uint8_t length)
{
    CS_LO();
    uint8_t res = PROTOSPI_xfer(R_REGISTER | (REGISTER_MASK & reg));
    for(uint8_t i = 0; i < length; i++)
    {
        data[i] = PROTOSPI_xfer(0xFF);
    }
    CS_HI();
    return res;
}
예제 #12
0
uint8_t nRF24L01::writePayload(uint8_t *data, uint8_t length)
{
    CS_LO();
    uint8_t res = PROTOSPI_xfer(W_TX_PAYLOAD);
    for (uint8_t i = 0; i < length; i++)
    {
        PROTOSPI_xfer(data[i]);
    }
    CS_HI();
    return res;
}
예제 #13
0
uint8_t nRF24L01::writeRegisterMulti(uint8_t reg, const uint8_t data[], uint8_t length)
{
    CS_LO();
    uint8_t res = PROTOSPI_xfer(W_REGISTER | ( REGISTER_MASK & reg));
    for (uint8_t i = 0; i < length; i++)
    {
        PROTOSPI_xfer(data[i]);
    }
    CS_HI();
    return res;
}
예제 #14
0
u8 NRF24L01_WriteRegisterMulti(u8 reg, const u8 data[], u8 length)
{
    CS_LO();
    u8 res = PROTOSPI_xfer(W_REGISTER | ( REGISTER_MASK & reg));
    for (u8 i = 0; i < length; i++)
    {
        PROTOSPI_xfer(data[i]);
    }
    CS_HI();
    return res;
}
예제 #15
0
u8 NRF24L01_ReadRegisterMulti(u8 reg, u8 data[], u8 length)
{
    CS_LO();
    u8 res = PROTOSPI_xfer(R_REGISTER | (REGISTER_MASK & reg));
    for(u8 i = 0; i < length; i++)
    {
        data[i] = PROTOSPI_xfer(0xFF);
    }
    CS_HI();
    return res;
}
예제 #16
0
u8 NRF24L01_ReadPayload(u8 *data, u8 length)
{
    CS_LO();
    u8 res = PROTOSPI_xfer(R_RX_PAYLOAD);
    for(u8 i = 0; i < length; i++)
    {
        data[i] = PROTOSPI_xfer(0xFF);
    }
    CS_HI();
    return res;
}
예제 #17
0
u8 NRF24L01_WritePayload(u8 *data, u8 length)
{
    CS_LO();
    u8 res = PROTOSPI_xfer(W_TX_PAYLOAD);
    for (u8 i = 0; i < length; i++)
    {
        PROTOSPI_xfer(data[i]);
    }
    CS_HI();
    return res;
}
예제 #18
0
void CC2500_ReadRegisterMulti(u8 address, u8 data[], u8 length)
{
    unsigned char i;

    CS_LO();
    PROTOSPI_xfer(CC2500_READ_BURST | address);
    for(i = 0; i < length; i++)
    {
        data[i] = PROTOSPI_xfer(0);
    }
    CS_HI();
}
예제 #19
0
uint8_t nRF24L01::strobe(uint8_t state)
{
    CS_LO();
    uint8_t res = PROTOSPI_xfer(state);
    CS_HI();
    return res;
}
예제 #20
0
static u8 Strobe(u8 state)
{
    CS_LO();
    u8 res = PROTOSPI_xfer(state);
    CS_HI();
    return res;
}
예제 #21
0
void A7105_WriteData(u8 *dpbuffer, u8 len, u8 channel)
{
    int i;
    CS_LO();
    PROTOSPI_xfer(A7105_RST_WRPTR);
    PROTOSPI_xfer(0x05);
    for (i = 0; i < len; i++)
        PROTOSPI_xfer(dpbuffer[i]);
    CS_HI();

    A7105_WriteReg(0x0F, channel);

    CS_LO();
    PROTOSPI_xfer(A7105_TX);
    CS_HI();
}
예제 #22
0
void A7105_WriteID(u32 id)
{
    CS_LO();
    PROTOSPI_xfer(0x06);
    PROTOSPI_xfer((id >> 24) & 0xFF);
    PROTOSPI_xfer((id >> 16) & 0xFF);
    PROTOSPI_xfer((id >> 8) & 0xFF);
    PROTOSPI_xfer((id >> 0) & 0xFF);
    CS_HI();
}
예제 #23
0
u8 A7105_ReadReg(u8 address)
{
    u8 data;
    CS_LO();
    PROTOSPI_xfer(0x40 | address);
    /* Wait for tx completion before spi shutdown */
    data = PROTOSPI_read3wire();
    CS_HI();
    return data;
}
예제 #24
0
void CC2500_Strobe(u8 state)
{
    CS_LO();
    PROTOSPI_xfer(state);
    CS_HI();
}
예제 #25
0
void A7105_Strobe(enum A7105_State state)
{
    CS_LO();
    PROTOSPI_xfer(state);
    CS_HI();
}