A
alkid
Guest
Už c8051F320 raštu kodą gali naudoti c8051F120? tuščia Test_TX (void) {LED1 = Led2 = Led3 = Led4 = 1; / / Atviras statuso LED "SPI_RW_Reg (WRITE_REG + SETUP_AW, (TX_AW-2)); / / sąranka RX / TX adresas plotis SPI_Write_Buf (WRITE_REG + TX_ADDR, TX_ADDRESS_, TX_AW) / / Rašo TX_Addr SPI_Write_Buf (WRITE_REG + RX_ADDR_P0, RX_ADDRESS_, RX_AW) / / Rašo RX_Addr, Pipe0 auto.ack SPI_Write_Buf (WR_TX_PLOAD, TX_PAYLOAD_, TX_PL_W); / / Rašo TX naudingoji apkrova SPI_RW_Reg (WRITE_REG + Būsena, 0x70) ; / / Skaityti statusą ir aiškiai IRQ vėliava "SPI_RW_Reg (WRITE_REG + EN_AA, 0x01); / / Įjungti auto ACK pipe0 SPI_RW_Reg (WRITE_REG + EN_RXADDR, 0x01); / / Įjungti pipe0 SPI_RW_Reg (WRITE_REG + SETUP_RETR, 0x0a); / / 250μs + 86μs, 10 retrans ... SPI_RW_Reg (WRITE_REG + RF_CH, 40); / / Kanalo 40 SPI_RW_Reg (WRITE_REG + CONFIG 0x0e); / / PWR_UP, VTK (2bytes) & Prim: TX. o (SW1!) / / laukti, kol SW1 išleido LED1 = 0; / / LED1 rodo TX režimu EX0 = 1 / / Įjungti Išorės Interrupt0}