forked from VK6TT/stm8ef-nRF24L01-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
TxTest
30 lines (27 loc) · 731 Bytes
/
TxTest
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
\ Basic transmit test with stm8ef-nRF24L01 VK6TT 2017
: $HW
mybuff P0_WIDTH $0 FILL \ erase buffer
$" Hello World" count ( --- a1 n1 )
mybuff SWAP CMOVE
;
: PAYLOAD.TX \ send n bytes as set by P0_width
SET.TX
W_TX_PAYLOAD (NRF@!) \ Send Loading tx buffer, drop status reply
P0_WIDTH 0 DO \ Loading tx buffer
mybuff I + c@
SPI DROP
LOOP \ tx n bytes from mybuff
_CSN.High
_CE.HD \ 10us minimum, using 130uS
_CE.LOW
40 ms \ allow time for packet to be sent and processed.
\ Timing depends on what Rx is doing with payload
CLR_INT
;
: TestTX \ send "Hello World" 20 times
(TX)
$HW
20 0 DO
PAYLOAD.TX
LOOP
;