Pins 34-39 are input only, and also do not have internal pull-up resistors Pins 6, 7, 8, 11, 16, and 17 are used for connecting the embedded flash, Pins 1 and 3 are REPL UART TX and RX respectively Using hold=True while a pin is already held will applyĪny configuration changes and then immediately reapply the hold. Hold=False will immediately apply any outstanding pin configuration changesĪnd release the pin. (direction, pull resistors and output value) will be held and any furtherĬhanges (including changing the output level) will not be applied. The hold= keyword argument to Pin() and Pin.init() will enable theĮSP32 “pad hold” feature. Pin.DRIVE_2: 20mA / 30 ohm (default strength if not configured) Safe maximum source/sink currents and approximate internal driver resistances: Pin() constructor or Pin.init() method, with different corresponding D0, D1, …).įor mapping between board logical pins and physical chip pins consult your boardįour drive strengths are supported, using the drive keyword argument to the Note that manyĮnd-user boards use their own adhoc pin numbering (marked e.g. These correspond to the actual GPIO pin numbers of ESP32 chip. DRIVE_3 ) # set maximum drive strengthĪvailable Pins are from the following ranges (inclusive): 0-19, 21-23, 25-27, 32-39. OUT, value = 1 ) # set pin high on creation p6 = Pin ( 6, Pin. PULL_UP ) # enable internal pull-up resistor p5 = Pin ( 5, Pin. value ()) # get value, 0 or 1 p4 = Pin ( 4, Pin. IN ) # create input pin on GPIO2 print ( p2. value ( 1 ) # set pin to on/high p2 = Pin ( 2, Pin. off () # set pin to "off" (low) level p0. These are working configurations for LAN interfaces of popular boards:įrom machine import Pin p0 = Pin ( 0, Pin. ForĮarlier esp-idf versions, these parameters must be defined by kconfig board options. ![]() The options ref_clk_mode and ref_clk require at least esp-idf version 4.4. Ref_clk=pin-object # defines the Pin used for ref_clk. Ref_clk_mode=mode # Defines, whether the ref_clk at the ESP32 is an input Phy_addr=number # The address number of the PHY device. Power=pin-object # set the pin which switches the power of the PHY device. Mdc=pin-object # set the mdc and mdio pins. The keyword arguments for the constructor defining the PHY type and interface are: ifconfig () # get the interface's IP/netmask/gw/DNS addresses ![]() active ( True ) # activate the interface lan. ) # Set the pin and mode configuration lan.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |