From 1f9a76bc0baba78090d98783894e6f1b4dcdb73e Mon Sep 17 00:00:00 2001 From: NikhitaR-IFX Date: Mon, 2 Nov 2026 11:52:15 +0000 Subject: [PATCH 1/6] docs/psoc6/quickref: Update that docs examples are board-specific. Signed-off-by: NikhitaR-IFX --- docs/psoc6/quickref.rst | 54 ++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/docs/psoc6/quickref.rst b/docs/psoc6/quickref.rst index d411972ce7d..a75c96befec 100644 --- a/docs/psoc6/quickref.rst +++ b/docs/psoc6/quickref.rst @@ -90,7 +90,7 @@ An instance of the :mod:`machine.Pin` class can be created by invoking the const from machine import Pin - p0 = Pin('P13_7', Pin.OUT, value=0) # create output pin on pin P13_7, + p0 = Pin('P13_7', Pin.OUT, value=0) # create output pin on pin P13_7 (LED pin for CY8CPROTO-062-4343W), # with initial value 0 (low) @@ -103,7 +103,7 @@ Moreover, a pre-configured pin object can be repurposed by calling the :meth:`Pi from machine import Pin - p0 = Pin('P13_7') # create pin object for pin P13_7. + p0 = Pin('P13_7') # create pin object for pin P13_7 (LED pin for CY8CPROTO-062-4343W). p0.init(Pin.OUT) # set pin as output. p0.low() # set value low. @@ -117,11 +117,11 @@ Similar to CPython, the parameters can be passed in any order if keywords are us from machine import Pin - p0 = Pin('P13_7', value=0, mode=Pin.OUT) # create output pin on pin P13_7, + p0 = Pin('P13_7', value=0, mode=Pin.OUT) # create output pin on pin P13_7 (LED pin for CY8CPROTO-062-4343W), # with initial value 0 (low) - p1 = Pin('P0_2', Pin.OUT, None, value=1) # create output pin on pin P0_0, + p1 = Pin('P0_2', Pin.OUT, None, value=1) # create output pin on pin P0_0 (GPIO pin for CY8CPROTO-062-4343W), # with pull as NONE, # with initial value 1 (high) @@ -146,8 +146,8 @@ Trigger can be ``Pin.IRQ_FALLING`` or ``Pin.IRQ_RISING`` or ``PIN.IRQ_FALLING | from machine import Pin - p0 = Pin('P0_4', mode=Pin.IN, pull=Pin.PULL_UP) - p1 = Pin('P13_7', mode=Pin.OUT, value=0) + p0 = Pin('P0_4', mode=Pin.IN, pull=Pin.PULL_UP) # GPIO pin for CY8CPROTO-062-4343W + p1 = Pin('P13_7', mode=Pin.OUT, value=0) # LED pin for CY8CPROTO-062-4343W p0.irq(handler=lambda t:p1.high(),trigger=Pin.IRQ_RISING) #configure an IRQ callback function P1.high() when there is a rising edge on pin object p0. @@ -268,8 +268,8 @@ The constructor can be called by passing the required arguments. All initialisat :: - pwm = PWM('P9_0', freq=50, duty_u16=8192) # PWM is initialised for the given pin with respective frequency & duty cycle given as raw value. - pwm1 = PWM('P9_1', freq=50, duty_ns=1000) # PWM is initialised for the given pin with respective frequency & duty cycle given in nanoseconds. + pwm = PWM('P9_0', freq=50, duty_u16=8192) # PWM is initialised for the given pin on CY8CPROTO-062-4343W with respective frequency & duty cycle given as raw value. + pwm1 = PWM('P9_1', freq=50, duty_ns=1000) # PWM is initialised for the given pin on CY8CPROTO-062-4343W with respective frequency & duty cycle given in nanoseconds. All four arguments have to be passed mandatorily to create a PWM object. duty_u16 or duty_ns should be specified at a time. @@ -277,7 +277,7 @@ The constructor can be called by passing the required arguments. All initialisat from machine import PWM - pwm = PWM('P9_0', freq=50, duty_u16=8192) + pwm = PWM('P9_0', freq=50, duty_u16=8192) # PWM is initialised for the given pin on CY8CPROTO-062-4343W with respective frequency & duty cycle given as raw value. print(pwm) # view PWM settings pwm.freq() # get current frequency @@ -303,7 +303,7 @@ accessed via :ref:`machine.SoftI2C `. :: from machine import Pin, SoftI2C - i2c = SoftI2C(scl='P5_0', sda='P5_1', freq=100000) + i2c = SoftI2C(scl='P5_0', sda='P5_1', freq=100000) # SoftI2C is initialised for the given pins on CY8CPROTO-062-4343W with respective frequency. i2c.scan() # scan for devices @@ -327,7 +327,7 @@ initialised and configured to work in master mode. The maximum supported frequen :: from machine import I2C - i2c = I2C(scl='P6_0', sda='P6_1', freq=400000) + i2c = I2C(scl='P6_0', sda='P6_1', freq=400000) # I2C is initialised for the given pins on CY8CPROTO-062-4343W with respective frequency. The ``scl`` and ``sda`` pins are the only mandatory arguments. Refer board-specific datasheets `here `_ for details regarding all the I2C-capable pins. The frequency argument is optional, and if not passed will be set to 400KHz by default. @@ -338,12 +338,12 @@ for details regarding all the I2C-capable pins. The frequency argument is option :: from machine import I2C - i2c = I2C(scl='P6_0', sda='P6_1') #I2C is initialised & configured with default frequency + i2c = I2C(scl='P6_0', sda='P6_1') #I2C is initialised & configured with default frequency on CY8CPROTO-062-4343W :: from machine import I2C - i2c = I2C(scl='P9_0', sda='P9_1', freq=400000) #I2C is initialised & configured with given scl, sda pins & frequency + i2c = I2C(scl='P9_0', sda='P9_1', freq=400000) #I2C is initialised & configured with given scl, sda pins & frequency on CY8CPROTO-062-4343W Methods ^^^^^^^ @@ -387,7 +387,7 @@ The constructor from machine import I2CSlave - i2c_slave = I2CSlave(scl="P6_0", sda="P6_1", addr=0x45) + i2c_slave = I2CSlave(scl="P6_0", sda="P6_1", addr=0x45) # I2C slave is initialised for the given pins on CY8CPROTO-062-4343W with respective address. Methods ^^^^^^^ @@ -463,7 +463,7 @@ SPI object is created with default settings or settings of previous initialisati :: from machine import SPI - spi = SPI(baudrate=1000000, polarity=0, phase=0, bits=8, firstbit=SPI.MSB, sck='P9_2', mosi='P9_0', miso='P9_1') + spi = SPI(baudrate=1000000, polarity=0, phase=0, bits=8, firstbit=SPI.MSB, sck='P9_2', mosi='P9_0', miso='P9_1') # SPI is initialised for the given pins on CY8CPROTO-062-4343W with respective settings. Methods ^^^^^^^ @@ -502,7 +502,7 @@ The constructor from machine import SPISlave - spi_slave = SPISlave(baudrate=1000000, polarity=0, phase=0, bits=8, firstbit=SPISlave.MSB, ssel="P6_3", sck='P6_2', mosi='P6_0', miso='P6_1') + spi_slave = SPISlave(baudrate=1000000, polarity=0, phase=0, bits=8, firstbit=SPISlave.MSB, ssel="P6_3", sck='P6_2', mosi='P6_0', miso='P6_1') # SPI slave is initialised for the given pins on CY8CPROTO-062-4343W with respective settings. Methods ^^^^^^^ @@ -541,7 +541,7 @@ Use the :ref:`machine.ADC ` class:: from machine import ADC - adc = ADC("P10_0") # create an ADC object on ADC pin + adc = ADC("P10_0") # create an ADC object on ADC pin on CY8CPROTO-062-4343W val = adc.read_u16() # read a raw analog value in the range 0-65535 val = adc.read_uv() # read an analog value in microvolts @@ -557,8 +557,8 @@ To use the APIs: from machine import ADCBlock - adcBlock = ADCBlock(0) # create an ADCBlock 0 object - adc = adcBlock.connect(0, "P10_0") # connect channel 0 to pin P10_0 + adcBlock = ADCBlock(0) # create an ADCBlock 0 object on CY8CPROTO-062-4343W + adc = adcBlock.connect(0, "P10_0") # connect channel 0 to pin P10_0 on CY8CPROTO-062-4343W val = adc.read_uv() # read an analog value in microvolts .. note:: @@ -604,10 +604,10 @@ Constructor buf=bytearray(10) #Initialise buffer with required values for transmission & as empty buffer for reception machine.freq(AUDIO_I2S_90_MHZ) #set the frequency of the I2S clock to 90 MHz. - audio_out = I2S(0, sck="P13_1", ws="P13_2", sd="P13_3", mode=I2S.TX, bits=16, format=I2S.STEREO, rate=22050, ibuf=20000) #create I2S object + audio_out = I2S(0, sck="P13_1", ws="P13_2", sd="P13_3", mode=I2S.TX, bits=16, format=I2S.STEREO, rate=22050, ibuf=20000) #create I2S object with pins on CY8CPROTO-062-4343W num_written = audio_out.write(buf) # write buffer of audio samples to I2S device - audio_in = I2S(0, sck="P5_4", ws="P5_5", sd="P5_6", mode=I2S.RX, bits=16, format=I2S.STEREO, rate=22050, ibuf=20000) # create I2S object + audio_in = I2S(0, sck="P5_4", ws="P5_5", sd="P5_6", mode=I2S.RX, bits=16, format=I2S.STEREO, rate=22050, ibuf=20000) # create I2S object with pins on CY8CPROTO-062-4343W num_read = audio_in.readinto(buf)# fill buffer with audio samples from I2S device PDM - PCM bus @@ -634,8 +634,8 @@ PDM-PCM objects can be created and initialized using:: from machine import PDM_PCM, Pin, AUDIO_PDM_24_576_000_HZ - clk_pin = "P10_4" - data_pin = "P10_5" + clk_pin = "P10_4" # PDM-PCM clock pin on CY8CPROTO-062-4343W + data_pin = "P10_5" # PDM-PCM data pin on CY8CPROTO-062-4343W machine.freq(AUDIO_PDM_24_576_000_HZ) @@ -846,7 +846,7 @@ Methods import machine import os - bdev = machine.SDCard(slot=0, width=4, cd="P13_5", cmd="P12_4", clk="P12_5", dat0="P13_0", dat1="P13_1", dat2="P13_2", dat3="P13_3") + bdev = machine.SDCard(slot=0, width=4, cd="P13_5", cmd="P12_4", clk="P12_5", dat0="P13_0", dat1="P13_1", dat2="P13_2", dat3="P13_3") # SD Card pins on CY8CPROTO-062-4343W # Define constants TEST_STRING = "This is a test string." @@ -900,7 +900,7 @@ Bitstream timing = [1000, 7000, 5000, 2500] # timing (high_time_0, low_time_0, high_time_1, low_time_1)in ns buf = bytearray([0xAB]) # buffer data - bitstream('P13_6', 0, timing, buf) # bitstrem buffer data with timing through pin P13_6 + bitstream('P13_6', 0, timing, buf) # bitstrem buffer data with timing through pin P13_6 on CY8CPROTO-062-4343W .. note:: Bitstream is set for the CPU frequency of 100MHz. At other clock frequencies, the timing will not fit. @@ -1017,8 +1017,8 @@ The NeoPixel driver can be used as follows (see the :mod:`neopixel` for more det import neopixel from machine import Pin - data = Pin('P9_1', Pin.OUT, value=0) # set P9_1 to output to control NeoPixels - np = neopixel.NeoPixel(data, 8, bpp=3) # create NeoPixel object on pin P9_1 with 8 pixels and 3 bytes per pixel with default timing=1 + data = Pin('P9_1', Pin.OUT, value=0) # set P9_1 on CY8CPROTO-062-4343W to output to control NeoPixels + np = neopixel.NeoPixel(data, 8, bpp=3) # create NeoPixel object on pin P9_1 on CY8CPROTO-062-4343W with 8 pixels and 3 bytes per pixel with default timing=1 np[0] = (255, 255, 255) # set the first pixel to white np.write() # write data to all pixels From 94b855f87844658758f9f7b48213a3c5306cc963 Mon Sep 17 00:00:00 2001 From: NikhitaR-IFX Date: Mon, 2 Nov 2026 12:21:07 +0000 Subject: [PATCH 2/6] docs/psoc6/mpy-usage: Update safe boot section for more clarity. Signed-off-by: NikhitaR-IFX --- docs/psoc6/mpy-usage.rst | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/docs/psoc6/mpy-usage.rst b/docs/psoc6/mpy-usage.rst index 2494d1c00c7..a771ded50de 100644 --- a/docs/psoc6/mpy-usage.rst +++ b/docs/psoc6/mpy-usage.rst @@ -158,6 +158,28 @@ The first way is to press CTRL-D at the MicroPython prompt, which performs a sof If that does not work, you can perform a hard reset by pressing the RESET button. This will end your session, disconnecting whatever program (PuTTY, Thonny, etc.) you used to connect to the board. +.. _psoc6_safe_mode_recovery: + +Safe Mode Recovery +~~~~~~~~~~~~~~~~~~ + +If ``main.py`` contains code that prevents normal access to the REPL, it will +run again after every normal reset and can make the board appear unresponsive. +Use Safe Mode to regain access without running the startup scripts. + +To start in Safe Mode, hold the USER button, press and release RESET, and keep +holding USER until the board's LED flashes twice. Then release USER. In Safe +Mode, MicroPython skips both ``boot.py`` and ``main.py``, so you can connect to +the serial REPL and fix or remove the script. For example, to remove ``main.py`` +from the filesystem, run:: + + import os + os.remove('main.py') + +You can then reset the board normally. If you want to keep the script, edit it +instead of removing it. Safe Mode also skips ``boot.py``; if that script is +causing the problem, repair or remove it in the same way. + Boot modes ---------- @@ -170,18 +192,10 @@ There are 2 boot modes: ``boot.py`` and ``main.py`` are **not** executed in "Safe boot mode". -Changing boot mode: - - * For normal boot mode, just press and release the RESET button on the board. - - * For safe boot mode, press and release the RESET button while pressing the USER button on the board. Release the USER button after the LED on the board flashes twice. - - -If you change the boot mode to safe boot mode, the MicroPython starts without -the execution of ``main.py``. Then you can remove the ``main.py`` by following command: :: - - import os - os.remove('main.py') +For the Safe Mode Recovery procedure, including how to enter Safe Mode and +restore access after a startup-script problem, see :ref:`Safe Mode Recovery +` above. To boot normally, press and release the +RESET button. Using third-party IDEs for filesystem operations ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From d8a8c6198c5923e20b82f36212667afe55e128c3 Mon Sep 17 00:00:00 2001 From: NikhitaR-IFX Date: Wed, 4 Nov 2026 07:59:19 +0000 Subject: [PATCH 3/6] docs/psoc6/quickref: Point to pin diagram. Signed-off-by: NikhitaR-IFX --- docs/psoc6/quickref.rst | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/docs/psoc6/quickref.rst b/docs/psoc6/quickref.rst index a75c96befec..ff9e4a3ae5d 100644 --- a/docs/psoc6/quickref.rst +++ b/docs/psoc6/quickref.rst @@ -259,7 +259,7 @@ PWM (pulse width modulation) ---------------------------- PWM can be enabled on all output-capable pins. The frequency can range from 1Hz to 100MHz. As the frequency -increases the PWM resolution decreases. Refer to datasheets `here `_ +increases the PWM resolution decreases. Refer to datasheets :ref:`here ` for additional details regarding board-specific PWM. Use the :ref:`machine.PWM ` class: @@ -329,7 +329,7 @@ initialised and configured to work in master mode. The maximum supported frequen from machine import I2C i2c = I2C(scl='P6_0', sda='P6_1', freq=400000) # I2C is initialised for the given pins on CY8CPROTO-062-4343W with respective frequency. -The ``scl`` and ``sda`` pins are the only mandatory arguments. Refer board-specific datasheets `here `_ +The ``scl`` and ``sda`` pins are the only mandatory arguments. Refer board-specific datasheets :ref:`here ` for details regarding all the I2C-capable pins. The frequency argument is optional, and if not passed will be set to 400KHz by default. .. note:: @@ -445,7 +445,7 @@ The :ref:`machine.SoftSPI ` class is **disabled** in this port. Hardware SPI bus ---------------- -Refer to board-specific datasheets `here `_ +Refer to board-specific datasheets :ref:`here ` for details regarding all the SPI-capable pins. The pins ``sck``, ``mosi`` and ``miso`` *must* be specified when initialising SPI. @@ -463,7 +463,7 @@ SPI object is created with default settings or settings of previous initialisati :: from machine import SPI - spi = SPI(baudrate=1000000, polarity=0, phase=0, bits=8, firstbit=SPI.MSB, sck='P9_2', mosi='P9_0', miso='P9_1') # SPI is initialised for the given pins on CY8CPROTO-062-4343W with respective settings. + spi = SPI(baudrate=1000000, polarity=0, phase=0, bits=8, firstbit=SPI.MSB, sck='P9_2', mosi='P9_0', miso='P9_1') # SPI is initialised with respective settings. Methods ^^^^^^^ @@ -534,8 +534,7 @@ Methods ADC (analog to digital conversion) ---------------------------------- -On the PSoC6, a single ADC block with id - '0' is available. The ADC functionality is available on the -following pins : "P10_0" - "P10_5". +On the PSoC6, a single ADC block with id - '0' is available. Refer to board-specific datasheets :ref:`here ` to identify the ADC capable pins for your board. Use the :ref:`machine.ADC ` class:: @@ -604,12 +603,14 @@ Constructor buf=bytearray(10) #Initialise buffer with required values for transmission & as empty buffer for reception machine.freq(AUDIO_I2S_90_MHZ) #set the frequency of the I2S clock to 90 MHz. - audio_out = I2S(0, sck="P13_1", ws="P13_2", sd="P13_3", mode=I2S.TX, bits=16, format=I2S.STEREO, rate=22050, ibuf=20000) #create I2S object with pins on CY8CPROTO-062-4343W + audio_out = I2S(0, sck="P13_1", ws="P13_2", sd="P13_3", mode=I2S.TX, bits=16, format=I2S.STEREO, rate=22050, ibuf=20000) #create I2S object num_written = audio_out.write(buf) # write buffer of audio samples to I2S device - audio_in = I2S(0, sck="P5_4", ws="P5_5", sd="P5_6", mode=I2S.RX, bits=16, format=I2S.STEREO, rate=22050, ibuf=20000) # create I2S object with pins on CY8CPROTO-062-4343W + audio_in = I2S(0, sck="P5_4", ws="P5_5", sd="P5_6", mode=I2S.RX, bits=16, format=I2S.STEREO, rate=22050, ibuf=20000) # create I2S object num_read = audio_in.readinto(buf)# fill buffer with audio samples from I2S device +Refer to board-specific datasheets :ref:`here ` for capable pin details. + PDM - PCM bus -------------- @@ -732,7 +733,7 @@ Constants UART ---- -See :ref:`machine.UART `. +See :ref:`machine.UART `. Refer to board-specific datasheets :ref:`here ` for capable pin details. The following specialization applies to this port: @@ -1018,7 +1019,7 @@ The NeoPixel driver can be used as follows (see the :mod:`neopixel` for more det import neopixel from machine import Pin data = Pin('P9_1', Pin.OUT, value=0) # set P9_1 on CY8CPROTO-062-4343W to output to control NeoPixels - np = neopixel.NeoPixel(data, 8, bpp=3) # create NeoPixel object on pin P9_1 on CY8CPROTO-062-4343W with 8 pixels and 3 bytes per pixel with default timing=1 + np = neopixel.NeoPixel(data, 8, bpp=3) # create NeoPixel object with 8 pixels and 3 bytes per pixel with default timing=1 np[0] = (255, 255, 255) # set the first pixel to white np.write() # write data to all pixels From ae5ed0d10e5624a8c089590a3bbb859a85c910d4 Mon Sep 17 00:00:00 2001 From: NikhitaR-IFX Date: Wed, 4 Nov 2026 08:06:21 +0000 Subject: [PATCH 4/6] docs/psoc6/quickref: Point to pin diagram. Signed-off-by: NikhitaR-IFX --- docs/psoc6/quickref.rst | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/psoc6/quickref.rst b/docs/psoc6/quickref.rst index ff9e4a3ae5d..dd41ffacac1 100644 --- a/docs/psoc6/quickref.rst +++ b/docs/psoc6/quickref.rst @@ -90,7 +90,7 @@ An instance of the :mod:`machine.Pin` class can be created by invoking the const from machine import Pin - p0 = Pin('P13_7', Pin.OUT, value=0) # create output pin on pin P13_7 (LED pin for CY8CPROTO-062-4343W), + p0 = Pin('P13_7', Pin.OUT, value=0) # create output pin on P13_7 (LED pin for CY8CPROTO-062-4343W), # with initial value 0 (low) @@ -268,8 +268,8 @@ The constructor can be called by passing the required arguments. All initialisat :: - pwm = PWM('P9_0', freq=50, duty_u16=8192) # PWM is initialised for the given pin on CY8CPROTO-062-4343W with respective frequency & duty cycle given as raw value. - pwm1 = PWM('P9_1', freq=50, duty_ns=1000) # PWM is initialised for the given pin on CY8CPROTO-062-4343W with respective frequency & duty cycle given in nanoseconds. + pwm = PWM('P9_0', freq=50, duty_u16=8192) # PWM is initialised with respective frequency & duty cycle given as raw value. + pwm1 = PWM('P9_1', freq=50, duty_ns=1000) # PWM is initialised with respective frequency & duty cycle given in nanoseconds. All four arguments have to be passed mandatorily to create a PWM object. duty_u16 or duty_ns should be specified at a time. @@ -277,7 +277,7 @@ The constructor can be called by passing the required arguments. All initialisat from machine import PWM - pwm = PWM('P9_0', freq=50, duty_u16=8192) # PWM is initialised for the given pin on CY8CPROTO-062-4343W with respective frequency & duty cycle given as raw value. + pwm = PWM('P9_0', freq=50, duty_u16=8192) # PWM is initialised with respective frequency & duty cycle given as raw value. print(pwm) # view PWM settings pwm.freq() # get current frequency @@ -540,7 +540,7 @@ Use the :ref:`machine.ADC ` class:: from machine import ADC - adc = ADC("P10_0") # create an ADC object on ADC pin on CY8CPROTO-062-4343W + adc = ADC("P10_0") # create an ADC object on ADC pin val = adc.read_u16() # read a raw analog value in the range 0-65535 val = adc.read_uv() # read an analog value in microvolts @@ -656,6 +656,7 @@ PDM-PCM objects can be created and initialized using:: - blocking - non-blocking + Refer to board-specific datasheets :ref:`here ` for capable pin details. Constructor ^^^^^^^^^^^^ From f29740c9c36f9b04036607d02fd691dc14bea2d0 Mon Sep 17 00:00:00 2001 From: NikhitaR-IFX Date: Wed, 4 Nov 2026 08:09:25 +0000 Subject: [PATCH 5/6] docs/psoc6/quickref: Point to pin diagram. Signed-off-by: NikhitaR-IFX --- docs/psoc6/quickref.rst | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/docs/psoc6/quickref.rst b/docs/psoc6/quickref.rst index dd41ffacac1..c5fcf0c6ab5 100644 --- a/docs/psoc6/quickref.rst +++ b/docs/psoc6/quickref.rst @@ -545,8 +545,7 @@ Use the :ref:`machine.ADC ` class:: val = adc.read_uv() # read an analog value in microvolts The PSoC6 port also supports :ref:`machine.ADCBlock ` API to have control over the ADC configuration. Currently -PSoC6 supports only 1 SAR ADC with the channel-to-pin mapping available in respective pinout diagrams. - +PSoC6 supports only 1 SAR ADC with the channel-to-pin mapping available in respective pinout diagrams. Refer to board-specific datasheets :ref:`here ` for capable pin details. .. note:: Arbitrary connection of ADC channels to GPIO is not supported. Specifying a pin that is not connected to this block, or specifying a mismatched channel and pin will raise an exception. @@ -556,8 +555,8 @@ To use the APIs: from machine import ADCBlock - adcBlock = ADCBlock(0) # create an ADCBlock 0 object on CY8CPROTO-062-4343W - adc = adcBlock.connect(0, "P10_0") # connect channel 0 to pin P10_0 on CY8CPROTO-062-4343W + adcBlock = ADCBlock(0) # create an ADCBlock object + adc = adcBlock.connect(0, "P10_0") # connect channel 0 to physical pin on board val = adc.read_uv() # read an analog value in microvolts .. note:: @@ -635,8 +634,8 @@ PDM-PCM objects can be created and initialized using:: from machine import PDM_PCM, Pin, AUDIO_PDM_24_576_000_HZ - clk_pin = "P10_4" # PDM-PCM clock pin on CY8CPROTO-062-4343W - data_pin = "P10_5" # PDM-PCM data pin on CY8CPROTO-062-4343W + clk_pin = "P10_4" + data_pin = "P10_5" machine.freq(AUDIO_PDM_24_576_000_HZ) From 188be0344678d401e044128dc7203a7358ec170b Mon Sep 17 00:00:00 2001 From: NikhitaR-IFX Date: Thu, 5 Nov 2026 09:46:40 +0000 Subject: [PATCH 6/6] docs/psoc6/quickref: Fix indentation error. Signed-off-by: NikhitaR-IFX --- docs/psoc6/quickref.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/psoc6/quickref.rst b/docs/psoc6/quickref.rst index c5fcf0c6ab5..30ee824b4b5 100644 --- a/docs/psoc6/quickref.rst +++ b/docs/psoc6/quickref.rst @@ -546,6 +546,7 @@ Use the :ref:`machine.ADC ` class:: The PSoC6 port also supports :ref:`machine.ADCBlock ` API to have control over the ADC configuration. Currently PSoC6 supports only 1 SAR ADC with the channel-to-pin mapping available in respective pinout diagrams. Refer to board-specific datasheets :ref:`here ` for capable pin details. + .. note:: Arbitrary connection of ADC channels to GPIO is not supported. Specifying a pin that is not connected to this block, or specifying a mismatched channel and pin will raise an exception.