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>
This commit is contained in:
Jim Mussared 2023-05-31 16:41:07 +10:00 committed by Damien George
parent 1d4b4f0ce2
commit aac8744671
1 changed files with 14 additions and 0 deletions

View File

@ -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"