|
| 1 | +/* |
| 2 | + * This file is part of the MicroPython project, http://micropython.org/ |
| 3 | + * |
| 4 | + * The MIT License (MIT) |
| 5 | + * |
| 6 | + * Copyright (c) 2023 Damien P. George |
| 7 | + * |
| 8 | + * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 9 | + * of this software and associated documentation files (the "Software"), to deal |
| 10 | + * in the Software without restriction, including without limitation the rights |
| 11 | + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 12 | + * copies of the Software, and to permit persons to whom the Software is |
| 13 | + * furnished to do so, subject to the following conditions: |
| 14 | + * |
| 15 | + * The above copyright notice and this permission notice shall be included in |
| 16 | + * all copies or substantial portions of the Software. |
| 17 | + * |
| 18 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 19 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 20 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 21 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 22 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 23 | + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 24 | + * THE SOFTWARE. |
| 25 | + */ |
| 26 | + |
| 27 | +#include "py/builtin.h" |
| 28 | + |
| 29 | +const char mimxrt_help_text[] = |
| 30 | + "Welcome to MicroPython!\n" |
| 31 | + "\n" |
| 32 | + "For online docs please visit http://docs.micropython.org/\n" |
| 33 | + "\n" |
| 34 | + "For access to the hardware use the 'machine' module. \n" |
| 35 | + "\n" |
| 36 | + "Quick overview of some objects:\n" |
| 37 | + " machine.Pin(pin) -- get a pin, eg machine.Pin(0)\n" |
| 38 | + " machine.Pin(pin, m, [p]) -- get a pin and configure it for IO mode m, pull mode p\n" |
| 39 | + " methods: init(..), value([v]), high(), low())\n" |
| 40 | + "\n" |
| 41 | + " Pins are numbered board specific, either 0-n, or 'D0'-'Dn', or 'A0' - 'An',\n" |
| 42 | + " according to the boards's pinout sheet.\n" |
| 43 | + " Pin IO modes are: Pin.IN, Pin.OUT, Pin.OPEN_DRAIN\n" |
| 44 | + " Pin pull modes are: Pin.PULL_UP, Pin.PULL_UP_47K, Pin.PULL_UP_22K, Pin.PULL_DOWN, Pin.PULL_HOLD\n" |
| 45 | + " machine.ADC(pin) -- make an analog object from a pin\n" |
| 46 | + " methods: read_u16()\n" |
| 47 | + " machine.UART(id, baudrate=115200) -- create an UART object (id=1 - 8, board-specific)\n" |
| 48 | + " methods: init(), write(buf), any()\n" |
| 49 | + " buf=read(n), readinto(buf), buf=readline()\n" |
| 50 | + " The RX and TX pins are fixed and board-specific.\n" |
| 51 | + " machine.SoftI2C() -- create a Soft I2C object\n" |
| 52 | + " machine.I2C(id) -- create a HW I2C object\n" |
| 53 | + " methods: readfrom(addr, buf, stop=True), writeto(addr, buf, stop=True)\n" |
| 54 | + " readfrom_mem(addr, memaddr, arg), writeto_mem(addr, memaddr, arg)\n" |
| 55 | + " SoftI2C allows to use any pin for sda and scl, HW I2C id's and pins are fixed\n" |
| 56 | + " machine.SoftSPI(baudrate=1000000) -- create a Soft SPI object\n" |
| 57 | + " machine.SPI(id, baudrate=1000000) -- create a HW SPI object\n" |
| 58 | + " methods: read(nbytes, write=0x00), write(buf), write_readinto(wr_buf, rd_buf)\n" |
| 59 | + " SoftSPI allows to use any pin for SPI, HW SPI id's and pins are fixed\n" |
| 60 | + " machine.Timer(id, freq, callback) -- create a hardware timer object (id=0,1,2)\n" |
| 61 | + " eg: machine.Timer(freq=1, callback=lambda t:print(t))\n" |
| 62 | + " machine.RTC() -- create a Real Time Clock object\n" |
| 63 | + " methods: init(), datetime([dateime_tuple]), now()\n" |
| 64 | + " machine.PWM(pin, freq, duty_u16[, kw_opts]) -- create a PWM object\n" |
| 65 | + " methods: init(), duty_u16([value]), duty_ns([value]), freq([value])\n" |
| 66 | + "\n" |
| 67 | + "Useful control commands:\n" |
| 68 | + " CTRL-C -- interrupt a running program\n" |
| 69 | + " CTRL-D -- on a blank line, do a soft reset of the board\n" |
| 70 | + " CTRL-E -- on a blank line, enter paste mode\n" |
| 71 | + "\n" |
| 72 | + "For further help on a specific object, type help(obj)\n" |
| 73 | + "For a list of available modules, type help('modules')\n" |
| 74 | +; |
0 commit comments