kopia lustrzana https://github.com/micropython/micropython
mimxrt: Adapt for the changed pin file creation of PR 12211.
Signed-off-by: robert-hh <robert@hammelrath.com>
rodzic
f7232e96b9
commit
445e1f003d
|
@ -13,7 +13,7 @@ Example usage::
|
||||||
|
|
||||||
from machine import Pin, Encoder
|
from machine import Pin, Encoder
|
||||||
|
|
||||||
qe = Encoder(0, Pin(0), Pin(1)) # create Quadrature Encoder object
|
qe = Encoder(0, Pin("D0"), Pin("D1")) # create Quadrature Encoder object
|
||||||
qe.value() # get current counter values
|
qe.value() # get current counter values
|
||||||
qe.value(0) # Set value and cycles to 0
|
qe.value(0) # Set value and cycles to 0
|
||||||
qe.init(cpc=128) # Specify 128 counts/cycle
|
qe.init(cpc=128) # Specify 128 counts/cycle
|
||||||
|
@ -177,7 +177,7 @@ Example usage::
|
||||||
|
|
||||||
from machine import Pin, Counter
|
from machine import Pin, Counter
|
||||||
|
|
||||||
counter = Counter(0, Pin(0)) # create Counter object
|
counter = Counter(0, Pin("D0")) # create Counter object
|
||||||
counter.value() # get current counter value
|
counter.value() # get current counter value
|
||||||
counter.value(0) # Set the counter to 0
|
counter.value(0) # Set the counter to 0
|
||||||
counter.init(cpc=128) # Specify 128 counts/cycle
|
counter.init(cpc=128) # Specify 128 counts/cycle
|
||||||
|
@ -352,20 +352,21 @@ assignment to the Encoder or Counter are:
|
||||||
|
|
||||||
**Teensy 4.0**:
|
**Teensy 4.0**:
|
||||||
|
|
||||||
Pins 0, 1, 2, 3, 4, 5, 7, 8, 26, 27, 30, 31, 32, 33. Pin 0 and 5 share the
|
Pins D0, D1, D2, D3, D4, D5, D7, D8, D26, D27, D30, D31, D32, D33.
|
||||||
same signal and cannot be used independently.
|
Pin D0 and D5 share the same signal and cannot be used independently.
|
||||||
Pins 26, 27, 30 and 31 cannot be used for the match output.
|
Pins D26, D27, D30 and D31 cannot be used for the match output.
|
||||||
|
|
||||||
**Teensy 4.1**:
|
**Teensy 4.1**:
|
||||||
|
|
||||||
Pins 0, 1, 2, 3, 4, 5, 7, 8, 26, 27, 30, 31, 32, 33, 37, 42, 43, 44, 45, 46 and 47.
|
Pins D0, D1, D2, D3, D4, D5, D7, D8, D26, D27, D30, D31, D32, D33,
|
||||||
Pins 26, 27, 30 and 31 cannot be used for the match output.
|
D37, D42, D43, D44, D45, D46 and D47.
|
||||||
|
Pins D26, D27, D30 and D31 cannot be used for the match output.
|
||||||
Some pins are assigned to the same signal and cannot be used independently. These are:
|
Some pins are assigned to the same signal and cannot be used independently. These are:
|
||||||
|
|
||||||
- Pin 0, 5 and 37,
|
- Pins D0, D5 and D37,
|
||||||
- Pin 2 and 43,
|
- Pins D2 and D43,
|
||||||
- Pin 3 and 42, and
|
- Pins D3 and D42, and
|
||||||
- Pin 4 and 47.
|
- Pins D4 and D47.
|
||||||
|
|
||||||
**Seeed ARCH MIX**
|
**Seeed ARCH MIX**
|
||||||
|
|
||||||
|
|
|
@ -552,7 +552,7 @@ Example usage::
|
||||||
|
|
||||||
from machine import Pin, Encoder
|
from machine import Pin, Encoder
|
||||||
|
|
||||||
qe = Encoder(0, Pin(0), Pin(1)) # create Quadrature Encoder object
|
qe = Encoder(0, Pin("D0"), Pin("D1")) # create Quadrature Encoder object
|
||||||
qe.value() # get current counter values
|
qe.value() # get current counter values
|
||||||
qe.value(0) # set value and cycles to 0
|
qe.value(0) # set value and cycles to 0
|
||||||
qe.init(cpc=128) # specify 128 counts/cycle
|
qe.init(cpc=128) # specify 128 counts/cycle
|
||||||
|
@ -581,7 +581,7 @@ Example usage::
|
||||||
|
|
||||||
from machine import Pin, Counter
|
from machine import Pin, Counter
|
||||||
|
|
||||||
counter = Counter(0, Pin(0)) # create Counter object
|
counter = Counter(0, Pin("D0")) # create Counter object
|
||||||
counter.value() # get current counter value
|
counter.value() # get current counter value
|
||||||
counter.value(0) # set the counter to 0
|
counter.value(0) # set the counter to 0
|
||||||
counter.init(cpc=128) # specify 128 counts/cycle
|
counter.init(cpc=128) # specify 128 counts/cycle
|
||||||
|
|
|
@ -26,7 +26,7 @@ IOMUX_REGEXS = [
|
||||||
r"IOMUXC_(?P<pin>GPIO_SNVS_\d\d_DIG)_(?P<function>\w+) (?P<muxRegister>\w+), (?P<muxMode>\w+), (?P<inputRegister>\w+), (?P<inputDaisy>\w+), (?P<configRegister>\w+)",
|
r"IOMUXC_(?P<pin>GPIO_SNVS_\d\d_DIG)_(?P<function>\w+) (?P<muxRegister>\w+), (?P<muxMode>\w+), (?P<inputRegister>\w+), (?P<inputDaisy>\w+), (?P<configRegister>\w+)",
|
||||||
]
|
]
|
||||||
|
|
||||||
SUPPORTED_AF_FNS = {"GPIO", "USDHC", "FLEXPWM", "TMR"}
|
SUPPORTED_AF_FNS = {"GPIO", "USDHC", "FLEXPWM", "TMR", "XBAR"}
|
||||||
|
|
||||||
|
|
||||||
class MimxrtPin(boardgen.Pin):
|
class MimxrtPin(boardgen.Pin):
|
||||||
|
@ -183,7 +183,7 @@ class MimxrtPinGenerator(boardgen.PinGenerator):
|
||||||
# the CMD pin of the USDHC1 function on the GPIO_SD_B0_00 pin.
|
# the CMD pin of the USDHC1 function on the GPIO_SD_B0_00 pin.
|
||||||
def print_module_instances(self, out_header):
|
def print_module_instances(self, out_header):
|
||||||
print(file=out_header)
|
print(file=out_header)
|
||||||
for match_fn in ("USDHC", "FLEXPWM", "TMR"):
|
for match_fn in ("USDHC", "FLEXPWM", "TMR", "XBAR"):
|
||||||
module_instances = defaultdict(list)
|
module_instances = defaultdict(list)
|
||||||
for pin in self.available_pins():
|
for pin in self.available_pins():
|
||||||
for i, (_af_idx, _input_reg, _input_daisy, instance, fn, af) in enumerate(
|
for i, (_af_idx, _input_reg, _input_daisy, instance, fn, af) in enumerate(
|
||||||
|
@ -200,6 +200,8 @@ class MimxrtPinGenerator(boardgen.PinGenerator):
|
||||||
print("#define {:s}_AVAIL (1)".format(k), file=out_header)
|
print("#define {:s}_AVAIL (1)".format(k), file=out_header)
|
||||||
if match_fn == "FLEXPWM":
|
if match_fn == "FLEXPWM":
|
||||||
print("#define {:s} {:s}".format(k, k[-4:]), file=out_header)
|
print("#define {:s} {:s}".format(k, k[-4:]), file=out_header)
|
||||||
|
if match_fn == "XBAR":
|
||||||
|
print("#define {:s} {:s}A1".format(k, k[:4]), file=out_header)
|
||||||
for i in v:
|
for i in v:
|
||||||
print(i, file=out_header)
|
print(i, file=out_header)
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
#include "py/mphal.h"
|
#include "py/mphal.h"
|
||||||
#include "py/objint.h"
|
#include "py/objint.h"
|
||||||
#include "shared/runtime/mpirq.h"
|
#include "shared/runtime/mpirq.h"
|
||||||
|
#include "extmod/modmachine.h"
|
||||||
#include "modmachine.h"
|
#include "modmachine.h"
|
||||||
#include "fsl_clock.h"
|
#include "fsl_clock.h"
|
||||||
#include "fsl_enc.h"
|
#include "fsl_enc.h"
|
||||||
|
|
Ładowanie…
Reference in New Issue