void NRF_TransmitPacket(uint8_t bytes, uint8_t *data) { NRF_WriteRegister(NRF_CONFIG, 0x0E); // Power Up, Transmitter NRF_SendPayload(NRF_W_TX_PAYLOAD_NOACK, bytes, data); NRF_CE_hi; }
void net_send_packet(uint8_t *packet) { if (status != SENDER) { // while (action == READING) {} sender_enable(); } action = WRITING; printf("Sending packet %p %d %d %d %d\n", packet, packet[0],packet[1],packet[2], packet[3]); int aux = ID; while (aux > 0) { aux--;} // send payload NRF_SendPayload(NRF_W_TX_PAYLOAD,NET_PACKET_SIZE,packet); // enable the chip to send the packet NRF_CE_hi; NRF_Delay(); NRF_CE_lo; action = WAITING; }
void NRF_WriteRegisterMulti(uint8_t reg, uint8_t bytes, uint8_t *data) { NRF_SendPayload((NRF_W_REGISTER | reg), bytes, data); }