Skip to content

Commit

Permalink
docs/psoc6/quickref.rst: Minor fix in machine.freq args call.
Browse files Browse the repository at this point in the history
Signed-off-by: enriquezgarc <enriquezgarcia.external@infineon.com>
  • Loading branch information
jaenrig-ifx committed Dec 2, 2024
1 parent dd2fed7 commit 77cc273
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions docs/psoc6/quickref.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ The :mod:`machine` module::

import machine

machine.freq() # get the current frequency of the Core M4
machine.freq(CM4, freq) # set the frequency of the Core M4 sourced by PLL to freq. Value of freq can be upto 150 MHz
machine.freq(CM4_FLL, freq) # set the frequency of the Core M4 sourced by FLL to freq. Value of freq can be upto 48 MHz
machine.freq(AUDIO_I2S_98_MHZ) # set the frequency of the I2S clock to 98 MHz
machine.freq(AUDIO_I2S_90_MHZ) # set the frequency of the I2S clock to 90 MHz
machine.freq(AUDIO_PDM_24_576_000_HZ) # set the frequency of the I2S clock to 24576000 HZ
machine.freq(AUDIO_PDM_22_579_200_HZ) # set the frequency of the I2S clock to 22579200 HZ
machine.freq() # get the current frequency of the Core M4
machine.freq(machine.CM4, freq) # set the frequency of the Core M4 sourced by PLL to freq. Value of freq can be upto 150 MHz
machine.freq(machine.CM4_FLL, freq) # set the frequency of the Core M4 sourced by FLL to freq. Value of freq can be upto 48 MHz
machine.freq(machine.AUDIO_I2S_98_MHZ) # set the frequency of the I2S clock to 98 MHz
machine.freq(machine.AUDIO_I2S_90_MHZ) # set the frequency of the I2S clock to 90 MHz
machine.freq(machine.AUDIO_PDM_24_576_000_HZ) # set the frequency of the I2S clock to 24576000 HZ
machine.freq(machine.AUDIO_PDM_22_579_200_HZ) # set the frequency of the I2S clock to 22579200 HZ

Delay and timing
----------------
Expand Down Expand Up @@ -558,8 +558,8 @@ Before using the I2S bus, the I2S clock frequency needs to be set. The I2S clock

::

machine.freq(AUDIO_I2S_98_MHZ) # set the frequency of the I2S clock to 98 MHz. For sample rates: 8KHz / 16 KHz / 32 KHz / 48 KHz
machine.freq(AUDIO_I2S_90_MHZ) # set the frequency of the I2S clock to 90 MHz. For sample rates: 22.05 KHz / 44.1 KHz
machine.freq(machine.AUDIO_I2S_98_MHZ) # set the frequency of the I2S clock to 98 MHz. For sample rates: 8KHz / 16 KHz / 32 KHz / 48 KHz
machine.freq(machine.AUDIO_I2S_90_MHZ) # set the frequency of the I2S clock to 90 MHz. For sample rates: 22.05 KHz / 44.1 KHz

Constructor
^^^^^^^^^^^^
Expand All @@ -581,15 +581,15 @@ Constructor

::

from machine import I2S, Pin
from machine import I2S, Pin, AUDIO_I2S_90_MHZ
import array
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
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
num_read = audio_in.readinto(buf)# fill buffer with audio samples from I2S device

Expand All @@ -609,14 +609,13 @@ Before using the PDM-PCM bus, the clock frequency needs to be set. The PDM-PCM c

::

machine.freq(AUDIO_PDM_24_576_000_HZ) # set the frequency of the clock to 24.576 MHz. For sample rates: 8 / 16 / 48 kHz
machine.freq(AUDIO_PDM_22_579_000_HZ) # set the frequency of the clock to 22.579 MHz. For sample rates: 22.05 / 44.1 KHz
machine.freq(machine.AUDIO_PDM_24_576_000_HZ) # set the frequency of the clock to 24.576 MHz. For sample rates: 8 / 16 / 48 kHz
machine.freq(machine.AUDIO_PDM_22_579_000_HZ) # set the frequency of the clock to 22.579 MHz. For sample rates: 22.05 / 44.1 KHz


PDM-PCM objects can be created and initialized using::

from machine import PDM_PCM
from machine import Pin
from machine import PDM_PCM, Pin, AUDIO_PDM_24_576_000_HZ

clk_pin = "P10_4"
data_pin = "P10_5"
Expand Down

0 comments on commit 77cc273

Please sign in to comment.