diff options
| author | Jim Mussared <jim.mussared@gmail.com> | 2023-05-31 16:41:07 +1000 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2023-06-02 11:49:13 +1000 |
| commit | aac8744671b690e22088a2960339b43c0bd45d88 (patch) | |
| tree | 64615232e6f7b41c83ccc378d9bdbb7275f0125c | |
| parent | 1d4b4f0ce27a44be132971ed690189e470af28ce (diff) | |
stm32/help: Don't include unavailable features in help().
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
| -rw-r--r-- | ports/stm32/help.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/ports/stm32/help.c b/ports/stm32/help.c index 0b824e7b3..7bdb8e67a 100644 --- a/ports/stm32/help.c +++ b/ports/stm32/help.c @@ -35,24 +35,38 @@ const char stm32_help_text[] = " pyb.info() -- print some general information\n" " pyb.delay(n) -- wait for n milliseconds\n" " pyb.millis() -- get number of milliseconds since hard reset\n" + #if MICROPY_HW_HAS_SWITCH " pyb.Switch() -- create a switch object\n" " Switch methods: (), callback(f)\n" + #endif " pyb.LED(n) -- create an LED object for LED n (n=1,2,3,4)\n" " LED methods: on(), off(), toggle(), intensity(<n>)\n" " pyb.Pin(pin) -- get a pin, eg pyb.Pin('X1')\n" " pyb.Pin(pin, m, [p]) -- get a pin and configure it for IO mode m, pull mode p\n" " Pin methods: init(..), value([v]), high(), low()\n" " pyb.ExtInt(pin, m, p, callback) -- create an external interrupt object\n" + #if MICROPY_HW_ENABLE_ADC " pyb.ADC(pin) -- make an analog object from a pin\n" " ADC methods: read(), read_timed(buf, freq)\n" + #endif + #if MICROPY_HW_ENABLE_DAC " pyb.DAC(port) -- make a DAC object\n" " DAC methods: triangle(freq), write(n), write_timed(buf, freq)\n" + #endif + #if MICROPY_HW_ENABLE_RTC " pyb.RTC() -- make an RTC object; methods: datetime([val])\n" + #endif + #if MICROPY_HW_ENABLE_RNG " pyb.rng() -- get a 30-bit hardware random number\n" + #endif + #if MICROPY_HW_ENABLE_SERVO " pyb.Servo(n) -- create Servo object for servo n (n=1,2,3,4)\n" " Servo methods: calibration(..), angle([x, [t]]), speed([x, [t]])\n" + #endif + #if MICROPY_HW_HAS_MMA7660 " pyb.Accel() -- create an Accelerometer object\n" " Accelerometer methods: x(), y(), z(), tilt(), filtered_xyz()\n" + #endif "\n" "Pins are numbered X1-X12, X17-X22, Y1-Y12, or by their MCU name\n" "Pin IO modes are: pyb.Pin.IN, pyb.Pin.OUT_PP, pyb.Pin.OUT_OD\n" |
