Skip to content

Commit 0efce32

Browse files
examples: fix typos, grammar, punctuation
1 parent 949caad commit 0efce32

File tree

9 files changed

+45
-45
lines changed

9 files changed

+45
-45
lines changed

examples/blink.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@
88
"""
99
Example for: ESP32
1010
11-
Simple example showing how to control a GPIO pin from the ULP coprocessor.
11+
Simple example showing how to control a GPIO pin from the ULP co-processor.
1212
1313
The GPIO port is configured to be attached to the RTC module, and then set
14-
to OUTPUT mode. To avoid re-initializing the GPIO on every wakeup, a magic
14+
to OUTPUT mode. To avoid re-initializing the GPIO on every wake-up, a magic
1515
token gets set in memory.
1616
1717
After every change of state, the ULP is put back to sleep again until the
18-
next wakeup. The ULP wakes up every 500ms to change the state of the GPIO
19-
pin. An LED attached to the GPIO pin would toggle on and off every 500ms.
18+
next wake-up. The ULP wakes up every 500 ms to change the state of the GPIO
19+
pin. An LED attached to the GPIO pin would toggle on and off every 500 ms.
2020
21-
The end of the python script has a loop to show the value of the magic token
21+
The end of the Python script has a loop to show the value of the magic token
2222
and the current state, so you can confirm the magic token gets set and watch
2323
the state value changing. If the loop is stopped (Ctrl-C), the LED attached
24-
to the GPIO pin continues to blink, because the ULP runs independently from
24+
to the GPIO pin continues to blink, because the ULP runs independently of
2525
the main processor.
2626
"""
2727

@@ -61,7 +61,7 @@
6161
move r0, magic
6262
ld r1, r0, 0
6363
64-
# test if we have initialised already
64+
# test if we have initialized already
6565
sub r1, r1, token
6666
jump after_init, eq # jump if magic == token (note: "eq" means the last instruction (sub) resulted in 0)
6767
@@ -72,7 +72,7 @@
7272
# GPIO shall be output, not input (this also enables a pull-down by default)
7373
WRITE_RTC_REG(RTC_GPIO_ENABLE_REG, RTC_GPIO_ENABLE_S + gpio, 1, 1)
7474
75-
# store that we're done with initialisation
75+
# store that we're done with initialization
7676
move r0, magic
7777
move r1, token
7878
st r1, r0, 0
@@ -89,17 +89,17 @@
8989
jump off # else jump to 'off'
9090
9191
on:
92-
# turn on led (set GPIO)
92+
# turn on LED (set GPIO)
9393
WRITE_RTC_REG(RTC_GPIO_OUT_REG, RTC_GPIO_OUT_DATA_S + gpio, 1, 1)
9494
jump exit
9595
9696
off:
97-
# turn off led (clear GPIO)
97+
# turn off LED (clear GPIO)
9898
WRITE_RTC_REG(RTC_GPIO_OUT_REG, RTC_GPIO_OUT_DATA_S + gpio, 1, 0)
9999
jump exit
100100
101101
exit:
102-
halt # go back to sleep until next wakeup period
102+
halt # go back to sleep until the next wake-up period
103103
"""
104104

105105
binary = src_to_binary(source, cpu="esp32") # cpu is esp32 or esp32s2
@@ -110,7 +110,7 @@
110110
ULP_DATA_MASK = 0xffff # ULP data is only in lower 16 bits
111111

112112
ulp = ULP()
113-
ulp.set_wakeup_period(0, 500000) # use timer0, wakeup after 500000usec (0.5s)
113+
ulp.set_wakeup_period(0, 500000) # use timer0; wake up after 500000 usec (0.5 s)
114114
ulp.load_binary(load_addr, binary)
115115

116116
ulp.run(entry_addr)

examples/blink_s2.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@
99
Example for: ESP32-S2 and ESP32-S3
1010
1111
The GPIO port is configured to be attached to the RTC module, and then set
12-
to OUTPUT mode. To avoid re-initializing the GPIO on every wakeup, a magic
12+
to OUTPUT mode. To avoid re-initializing the GPIO on every wake-up, a magic
1313
token gets set in memory.
1414
1515
After every change of state, the ULP is put back to sleep again until the
16-
next wakeup. The ULP wakes up every 500ms to change the state of the GPIO
17-
pin. An LED attached to the GPIO pin would toggle on and off every 500ms.
16+
next wake-up. The ULP wakes up every 500 ms to change the state of the GPIO
17+
pin. An LED attached to the GPIO pin would toggle on and off every 500 ms.
1818
19-
The end of the python script has a loop to show the value of the magic token
19+
The end of the Python script has a loop to show the value of the magic token
2020
and the current state, so you can confirm the magic token gets set and watch
2121
the state value changing. If the loop is stopped (Ctrl-C), the LED attached
22-
to the GPIO pin continues to blink, because the ULP runs independently from
22+
to the GPIO pin continues to blink, because the ULP runs independently of
2323
the main processor.
2424
"""
2525

@@ -59,7 +59,7 @@
5959
move r0, magic
6060
ld r1, r0, 0
6161
62-
# test if we have initialised already
62+
# test if we have initialized already
6363
sub r1, r1, token
6464
jump after_init, eq # jump if magic == token (note: "eq" means the last instruction (sub) resulted in 0)
6565
@@ -87,17 +87,17 @@
8787
jump off # else jump to 'off'
8888
8989
on:
90-
# turn on led (set GPIO)
90+
# turn on LED (set GPIO)
9191
WRITE_RTC_REG(RTC_GPIO_OUT_REG, RTC_GPIO_OUT_DATA_S + gpio, 1, 1)
9292
jump exit
9393
9494
off:
95-
# turn off led (clear GPIO)
95+
# turn off LED (clear GPIO)
9696
WRITE_RTC_REG(RTC_GPIO_OUT_REG, RTC_GPIO_OUT_DATA_S + gpio, 1, 0)
9797
jump exit
9898
9999
exit:
100-
halt # go back to sleep until next wakeup period
100+
halt # go back to sleep until the next wake-up period
101101
"""
102102

103103
binary = src_to_binary(source, cpu="esp32s2") # cpu is esp32 or esp32s2
@@ -108,7 +108,7 @@
108108
ULP_DATA_MASK = 0xffff # ULP data is only in lower 16 bits
109109

110110
ulp = ULP()
111-
ulp.set_wakeup_period(0, 500000) # use timer0, wakeup after 500000usec (0.5s)
111+
ulp.set_wakeup_period(0, 500000) # use timer0; wake up after 500000 usec (0.5 s)
112112
ulp.load_binary(load_addr, binary)
113113

114114
ulp.run(entry_addr)

examples/counter.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
"""
99
Example for: ESP32
1010
11-
Very basic example showing data exchange main CPU <--> ULP coprocessor.
11+
Very basic example showing data exchange between the main CPU and the ULP co-processor.
1212
1313
To show that the ULP is doing something, it just increments the value <data>.
14-
It does that once per ulp timer wakeup (and then the ULP halts until it gets
15-
waked up via the timer again).
14+
It does that once per ULP timer wake-up (and then the ULP halts until it gets
15+
woken up via the timer again).
1616
1717
The timer is set to a rather long period, so you can watch the data value
1818
incrementing (see loop at the end).
@@ -31,7 +31,7 @@
3131
add r2, r2, 1 # increment r2
3232
st r2, r3, 0 # store r2 contents into data ([r3+0])
3333
34-
halt # halt ULP co-prozessor (until it gets waked up again)
34+
halt # halt ULP co-processor (until it gets woken up again)
3535
"""
3636

3737
binary = src_to_binary(source, cpu="esp32") # cpu is esp32 or esp32s2
@@ -42,7 +42,7 @@
4242
ULP_DATA_MASK = 0xffff # ULP data is only in lower 16 bits
4343

4444
ulp = ULP()
45-
ulp.set_wakeup_period(0, 50000) # use timer0, wakeup after 50.000 cycles
45+
ulp.set_wakeup_period(0, 50000) # use timer0; wake up after 50,000 cycles
4646
ulp.load_binary(load_addr, binary)
4747

4848
mem32[ULP_MEM_BASE + load_addr] = 0x1000

examples/counter_s2.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
"""
99
Example for: ESP32-S2 and ESP32-S3
1010
11-
Very basic example showing data exchange main CPU <--> ULP coprocessor.
11+
Very basic example showing data exchange between the main CPU and the ULP co-processor.
1212
1313
To show that the ULP is doing something, it just increments the value <data>.
14-
It does that once per ulp timer wakeup (and then the ULP halts until it gets
15-
waked up via the timer again).
14+
It does that once per ULP timer wake-up (and then the ULP halts until it gets
15+
woken up via the timer again).
1616
1717
The timer is set to a rather long period, so you can watch the data value
1818
incrementing (see loop at the end).
@@ -31,7 +31,7 @@
3131
add r2, r2, 1 # increment r2
3232
st r2, r3, 0 # store r2 contents into data ([r3+0])
3333
34-
halt # halt ULP co-prozessor (until it gets waked up again)
34+
halt # halt ULP co-processor (until it gets woken up again)
3535
"""
3636

3737
binary = src_to_binary(source, cpu="esp32s2") # cpu is esp32 or esp32s2
@@ -42,7 +42,7 @@
4242
ULP_DATA_MASK = 0xffff # ULP data is only in lower 16 bits
4343

4444
ulp = ULP()
45-
ulp.set_wakeup_period(0, 50000) # use timer0, wakeup after 50.000 cycles
45+
ulp.set_wakeup_period(0, 50000) # use timer0; wake up after 50,000 cycles
4646
ulp.load_binary(load_addr, binary)
4747

4848
mem32[ULP_MEM_BASE + load_addr] = 0x1000

examples/fade_s2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@
5959
move r3, wait_on
6060
st r1, r3, 0 # Overwrite wait_on with new value
6161
62-
WRITE_RTC_REG(RTC_GPIO_OUT_REG, RTC_GPIO_OUT_DATA_S + led_pin, 1, 0) # turn off led (clear GPIO)
62+
WRITE_RTC_REG(RTC_GPIO_OUT_REG, RTC_GPIO_OUT_DATA_S + led_pin, 1, 0) # turn off LED (clear GPIO)
6363
wait_off: wait 0 # Placeholder; value overwritten dynamically
64-
WRITE_RTC_REG(RTC_GPIO_OUT_REG, RTC_GPIO_OUT_DATA_S + led_pin, 1, 1) # turn on led (set GPIO)
64+
WRITE_RTC_REG(RTC_GPIO_OUT_REG, RTC_GPIO_OUT_DATA_S + led_pin, 1, 1) # turn on LED (set GPIO)
6565
wait_on: wait 0 # Placeholder; value overwritten dynamically
6666
6767
jump set_waits # Loop program

examples/readgpio.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@
6969
ULP_DATA_MASK = 0xffff # ULP data is only in lower 16 bits
7070

7171
ulp = ULP()
72-
ulp.set_wakeup_period(0, 50000) # use timer0, wakeup after 50.000 cycles
72+
ulp.set_wakeup_period(0, 50000) # use timer0; wake up after 50,000 cycles
7373
ulp.load_binary(load_addr, binary)
7474

75-
mem32[ULP_MEM_BASE + load_addr] = 0x0 # initialise state to 0
75+
mem32[ULP_MEM_BASE + load_addr] = 0x0 # initialize state to 0
7676
ulp.run(entry_addr)
7777

7878
while True:

examples/readgpio_s2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@
7575
ULP_DATA_MASK = 0xffff # ULP data is only in lower 16 bits
7676

7777
ulp = ULP()
78-
ulp.set_wakeup_period(0, 50000) # use timer0, wakeup after 50.000 cycles
78+
ulp.set_wakeup_period(0, 50000) # use timer0; wake up after 50,000 cycles
7979
ulp.load_binary(load_addr, binary)
8080

81-
mem32[ULP_MEM_BASE + load_addr] = 0x0 # initialise state to 0
81+
mem32[ULP_MEM_BASE + load_addr] = 0x0 # initialize state to 0
8282
ulp.run(entry_addr)
8383

8484
while True:

examples/readgpio_s3.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@
7575
ULP_DATA_MASK = 0xffff # ULP data is only in lower 16 bits
7676

7777
ulp = ULP()
78-
ulp.set_wakeup_period(0, 50000) # use timer0, wakeup after 50.000 cycles
78+
ulp.set_wakeup_period(0, 50000) # use timer0; wake up after 50,000 cycles
7979
ulp.load_binary(load_addr, binary)
8080

81-
mem32[ULP_MEM_BASE + load_addr] = 0x0 # initialise state to 0
81+
mem32[ULP_MEM_BASE + load_addr] = 0x0 # initialize state to 0
8282
ulp.run(entry_addr)
8383

8484
while True:

examples/tsens_s2.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
entry:
4242
move r3, magic
4343
ld r0, r3, 0
44-
jumpr start, token, eq #check if we have already initialized
44+
jumpr start, token, eq # check if we have already initialized
4545
4646
init:
4747
# Set SENS_TSENS_CLKGATE_EN to enable temperature sensor clock.
@@ -50,14 +50,14 @@
5050
# Store temperature_data memory location in r2
5151
move r2, temperature_data
5252
53-
# store that we're done with initialisation
53+
# store that we're done with initialization
5454
move r0, token
5555
st r0, r3, 0
5656
5757
start:
58-
tsens r0, 1000 # make measurement for 1000 clock cycles
59-
st r0, r2, 0 # store the temperature in memory to be read by main CPU
60-
halt # go back to sleep until next wakeup period
58+
tsens r0, 1000 # make a measurement for 1000 clock cycles
59+
st r0, r2, 0 # store the temperature in memory to be read by the main CPU
60+
halt # go back to sleep until the next wake-up period
6161
"""
6262

6363
binary = src_to_binary(source, cpu="esp32s2") # cpu is esp32 or esp32s2

0 commit comments

Comments
 (0)