merge from upstream; re-alphabetize
This commit is contained in:
commit
67406488d1
@ -14,6 +14,7 @@
|
||||
|
||||
/*************************** HEADER FILES ***************************/
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "sha256.h"
|
||||
|
||||
/****************************** MACROS ******************************/
|
||||
|
@ -1092,6 +1092,11 @@ msgstr ""
|
||||
msgid "Initialization failed due to lack of memory"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bitops/__init__.c
|
||||
#, c-format
|
||||
msgid "Input buffer length (%d) must be a multiple of the strand count (%d)"
|
||||
msgstr ""
|
||||
|
||||
#: ports/atmel-samd/common-hal/pulseio/PulseIn.c
|
||||
msgid "Input taking too long"
|
||||
msgstr ""
|
||||
@ -1659,6 +1664,11 @@ msgstr ""
|
||||
msgid "Out of sockets"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bitops/__init__.c
|
||||
#, c-format
|
||||
msgid "Output buffer must be at least %d bytes"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/audiobusio/PDMIn.c
|
||||
msgid "Oversample must be multiple of 8."
|
||||
msgstr ""
|
||||
@ -4101,6 +4111,11 @@ msgstr ""
|
||||
msgid "watchdog timeout must be greater than 0"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bitops/__init__.c
|
||||
#, c-format
|
||||
msgid "width must be from 2 to 8 (inclusive), not %d"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/rgbmatrix/RGBMatrix.c
|
||||
msgid "width must be greater than zero"
|
||||
msgstr ""
|
||||
|
181
locale/it_IT.po
181
locale/it_IT.po
@ -7,25 +7,31 @@ msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-01-04 12:55-0600\n"
|
||||
"PO-Revision-Date: 2018-10-02 16:27+0200\n"
|
||||
"Last-Translator: Enrico Paganin <enrico.paganin@mail.com>\n"
|
||||
"PO-Revision-Date: 2021-02-18 15:50+0000\n"
|
||||
"Last-Translator: Luca De Filippo <luca.defilippo@translationcommons.org>\n"
|
||||
"Language-Team: \n"
|
||||
"Language: it_IT\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||
"X-Generator: Weblate 4.5\n"
|
||||
|
||||
#: main.c
|
||||
msgid ""
|
||||
"\n"
|
||||
"Code done running.\n"
|
||||
msgstr ""
|
||||
"\n"
|
||||
"Caricamento codice pronto.\n"
|
||||
|
||||
#: main.c
|
||||
msgid ""
|
||||
"\n"
|
||||
"Code stopped by auto-reload.\n"
|
||||
msgstr ""
|
||||
"\n"
|
||||
"Codice fermato dall'auto-ricarica.\n"
|
||||
|
||||
#: supervisor/shared/safe_mode.c
|
||||
msgid ""
|
||||
@ -33,6 +39,9 @@ msgid ""
|
||||
"Please file an issue with the contents of your CIRCUITPY drive at \n"
|
||||
"https://github.com/adafruit/circuitpython/issues\n"
|
||||
msgstr ""
|
||||
"\n"
|
||||
"Per favore, segnala il problema con il contenuto del tuo CIRCUITPY a\n"
|
||||
"https://github.com/adafruit/circuitpython/issues\n"
|
||||
|
||||
#: py/obj.c
|
||||
msgid " File \"%q\""
|
||||
@ -44,7 +53,7 @@ msgstr " File \"%q\", riga %d"
|
||||
|
||||
#: py/builtinhelp.c
|
||||
msgid " is of type %q\n"
|
||||
msgstr ""
|
||||
msgstr " è di tipo %q\n"
|
||||
|
||||
#: main.c
|
||||
msgid " output:\n"
|
||||
@ -60,10 +69,11 @@ msgstr "%%c necessita di int o char"
|
||||
msgid ""
|
||||
"%d address pins, %d rgb pins and %d tiles indicate a height of %d, not %d"
|
||||
msgstr ""
|
||||
"%d pin indirizzo, %d pin rgb e %d tessere indicano l'altezza di %d, non %d"
|
||||
|
||||
#: ports/atmel-samd/common-hal/sdioio/SDCard.c
|
||||
msgid "%q failure: %d"
|
||||
msgstr ""
|
||||
msgstr "%q fallito: %d"
|
||||
|
||||
#: shared-bindings/microcontroller/Pin.c
|
||||
msgid "%q in use"
|
||||
@ -79,15 +89,15 @@ msgstr "indice %q fuori intervallo"
|
||||
|
||||
#: py/obj.c
|
||||
msgid "%q indices must be integers, not %q"
|
||||
msgstr ""
|
||||
msgstr "%q gli indici devono essere interi, non %q"
|
||||
|
||||
#: shared-bindings/vectorio/Polygon.c
|
||||
msgid "%q list must be a list"
|
||||
msgstr ""
|
||||
msgstr "lista %q deve essere una lista"
|
||||
|
||||
#: shared-bindings/memorymonitor/AllocationAlarm.c
|
||||
msgid "%q must be >= 0"
|
||||
msgstr ""
|
||||
msgstr "%q deve essere >= 0"
|
||||
|
||||
#: shared-bindings/_bleio/CharacteristicBuffer.c
|
||||
#: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c
|
||||
@ -100,20 +110,19 @@ msgstr "slice del buffer devono essere della stessa lunghezza"
|
||||
|
||||
#: shared-module/vectorio/Polygon.c
|
||||
msgid "%q must be a tuple of length 2"
|
||||
msgstr ""
|
||||
msgstr "%q deve essere una tupla di lunghezza 2"
|
||||
|
||||
#: shared-bindings/canio/Match.c
|
||||
msgid "%q out of range"
|
||||
msgstr ""
|
||||
msgstr "%q oltre il limite"
|
||||
|
||||
#: ports/atmel-samd/common-hal/microcontroller/Pin.c
|
||||
msgid "%q pin invalid"
|
||||
msgstr ""
|
||||
msgstr "%q pin non valido"
|
||||
|
||||
#: shared-bindings/fontio/BuiltinFont.c
|
||||
#, fuzzy
|
||||
msgid "%q should be an int"
|
||||
msgstr "y dovrebbe essere un int"
|
||||
msgstr "%q dovrebbe essere un int"
|
||||
|
||||
#: py/bc.c py/objnamedtuple.c
|
||||
msgid "%q() takes %d positional arguments but %d were given"
|
||||
@ -122,7 +131,7 @@ msgstr "%q() prende %d argomenti posizionali ma ne sono stati forniti %d"
|
||||
#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c
|
||||
#, c-format
|
||||
msgid "%s error 0x%x"
|
||||
msgstr ""
|
||||
msgstr "%s errore 0x%x"
|
||||
|
||||
#: py/argcheck.c
|
||||
msgid "'%q' argument required"
|
||||
@ -130,93 +139,93 @@ msgstr "'%q' argomento richiesto"
|
||||
|
||||
#: py/runtime.c
|
||||
msgid "'%q' object cannot assign attribute '%q'"
|
||||
msgstr ""
|
||||
msgstr "L'oggetto '%q' non può assegnare l'attributo '%q'"
|
||||
|
||||
#: py/proto.c
|
||||
msgid "'%q' object does not support '%q'"
|
||||
msgstr ""
|
||||
msgstr "L'oggetto '%q' non supporta '%q'"
|
||||
|
||||
#: py/obj.c
|
||||
msgid "'%q' object does not support item assignment"
|
||||
msgstr ""
|
||||
msgstr "L'oggetto '%q' non supporta l'assegnazione dell'elemento"
|
||||
|
||||
#: py/obj.c
|
||||
msgid "'%q' object does not support item deletion"
|
||||
msgstr ""
|
||||
msgstr "L'oggetto '%q' non supporta la rimozione dell'elemento"
|
||||
|
||||
#: py/runtime.c
|
||||
msgid "'%q' object has no attribute '%q'"
|
||||
msgstr ""
|
||||
msgstr "L'oggetto '%q' non ha attributi '%q'"
|
||||
|
||||
#: py/runtime.c
|
||||
msgid "'%q' object is not an iterator"
|
||||
msgstr ""
|
||||
msgstr "L'oggetto '%q' non è un iteratore"
|
||||
|
||||
#: py/objtype.c py/runtime.c
|
||||
msgid "'%q' object is not callable"
|
||||
msgstr ""
|
||||
msgstr "L'oggetto '%q' non è richiamabile"
|
||||
|
||||
#: py/runtime.c
|
||||
msgid "'%q' object is not iterable"
|
||||
msgstr ""
|
||||
msgstr "L'oggetto '%q' non è iterabile"
|
||||
|
||||
#: py/obj.c
|
||||
msgid "'%q' object is not subscriptable"
|
||||
msgstr ""
|
||||
msgstr "l'oggetto '%q' non è riscrivibile"
|
||||
|
||||
#: py/emitinlinethumb.c py/emitinlinextensa.c
|
||||
#, c-format
|
||||
msgid "'%s' expects a label"
|
||||
msgstr "'%s' aspetta una etichetta"
|
||||
msgstr "'%s' richiede una etichetta"
|
||||
|
||||
#: py/emitinlinethumb.c py/emitinlinextensa.c
|
||||
#, c-format
|
||||
msgid "'%s' expects a register"
|
||||
msgstr "'%s' aspetta un registro"
|
||||
msgstr "'%s' richiede un registro"
|
||||
|
||||
#: py/emitinlinethumb.c
|
||||
#, fuzzy, c-format
|
||||
#, c-format
|
||||
msgid "'%s' expects a special register"
|
||||
msgstr "'%s' aspetta un registro"
|
||||
msgstr "'%s' richiede un registro speciale"
|
||||
|
||||
#: py/emitinlinethumb.c
|
||||
#, fuzzy, c-format
|
||||
#, c-format
|
||||
msgid "'%s' expects an FPU register"
|
||||
msgstr "'%s' aspetta un registro"
|
||||
msgstr "'%s' richiede un registro FPU"
|
||||
|
||||
#: py/emitinlinethumb.c
|
||||
#, fuzzy, c-format
|
||||
#, c-format
|
||||
msgid "'%s' expects an address of the form [a, b]"
|
||||
msgstr "'%s' aspetta un registro"
|
||||
msgstr "'%s' richiede un indirizzo dal modulo [a, b]"
|
||||
|
||||
#: py/emitinlinethumb.c py/emitinlinextensa.c
|
||||
#, c-format
|
||||
msgid "'%s' expects an integer"
|
||||
msgstr "'%s' aspetta un intero"
|
||||
msgstr "'%s' richiede un valore intero"
|
||||
|
||||
#: py/emitinlinethumb.c
|
||||
#, fuzzy, c-format
|
||||
#, c-format
|
||||
msgid "'%s' expects at most r%d"
|
||||
msgstr "'%s' aspetta un registro"
|
||||
msgstr "'%s' richiede almeno r%d"
|
||||
|
||||
#: py/emitinlinethumb.c
|
||||
#, fuzzy, c-format
|
||||
#, c-format
|
||||
msgid "'%s' expects {r0, r1, ...}"
|
||||
msgstr "'%s' aspetta un registro"
|
||||
msgstr "'%s' richiede {r0, r1, ...}"
|
||||
|
||||
#: py/emitinlinextensa.c
|
||||
#, fuzzy, c-format
|
||||
#, c-format
|
||||
msgid "'%s' integer %d is not within range %d..%d"
|
||||
msgstr "intero '%s' non è nell'intervallo %d..%d"
|
||||
msgstr "Valore intero '%s' %d non è nell'intervallo %d..%d"
|
||||
|
||||
#: py/emitinlinethumb.c
|
||||
#, fuzzy, c-format
|
||||
#, c-format
|
||||
msgid "'%s' integer 0x%x does not fit in mask 0x%x"
|
||||
msgstr "intero '%s' non è nell'intervallo %d..%d"
|
||||
msgstr "Valore intero '%s' 0x%x non rientra nella maschera 0x%x"
|
||||
|
||||
#: py/objstr.c
|
||||
msgid "'=' alignment not allowed in string format specifier"
|
||||
msgstr "aligniamento '=' non è permesso per il specificatore formato string"
|
||||
msgstr "Allineamento'=' non è permesso per lo specificatore formato stringa"
|
||||
|
||||
#: shared-module/struct/__init__.c
|
||||
msgid "'S' and 'O' are not supported format types"
|
||||
@ -233,22 +242,23 @@ msgstr "'await' al di fuori della funzione"
|
||||
#: py/compile.c
|
||||
msgid "'await', 'async for' or 'async with' outside async function"
|
||||
msgstr ""
|
||||
"'await', 'async for' o 'async with' fuori della funzione sincronizzazione"
|
||||
|
||||
#: py/compile.c
|
||||
msgid "'break' outside loop"
|
||||
msgstr "'break' al di fuori del ciclo"
|
||||
msgstr "'break' fuori del ciclo"
|
||||
|
||||
#: py/compile.c
|
||||
msgid "'continue' outside loop"
|
||||
msgstr "'continue' al di fuori del ciclo"
|
||||
msgstr "'continue' fuori del ciclo"
|
||||
|
||||
#: py/objgenerator.c
|
||||
msgid "'coroutine' object is not an iterator"
|
||||
msgstr ""
|
||||
msgstr "L'oggetto 'coroutine' non è un iteratore"
|
||||
|
||||
#: py/compile.c
|
||||
msgid "'data' requires at least 2 arguments"
|
||||
msgstr "'data' richiede almeno 2 argomento"
|
||||
msgstr "'data' richiede almeno 2 argomenti"
|
||||
|
||||
#: py/compile.c
|
||||
msgid "'data' requires integer arguments"
|
||||
@ -264,7 +274,7 @@ msgstr "'return' al di fuori della funzione"
|
||||
|
||||
#: py/compile.c
|
||||
msgid "'yield from' inside async function"
|
||||
msgstr ""
|
||||
msgstr "'yield from' è nella funzione sincronizzazione"
|
||||
|
||||
#: py/compile.c
|
||||
msgid "'yield' outside function"
|
||||
@ -288,29 +298,29 @@ msgstr "pow() con tre argmomenti non supportata"
|
||||
|
||||
#: shared-module/msgpack/__init__.c
|
||||
msgid "64 bit types"
|
||||
msgstr ""
|
||||
msgstr "Tipo 64 bits"
|
||||
|
||||
#: ports/atmel-samd/common-hal/countio/Counter.c
|
||||
#: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c
|
||||
msgid "A hardware interrupt channel is already in use"
|
||||
msgstr "Un canale di interrupt hardware è già in uso"
|
||||
msgstr "Un canale di interruzione hardware è già in uso"
|
||||
|
||||
#: ports/esp32s2/common-hal/analogio/AnalogIn.c
|
||||
msgid "ADC2 is being used by WiFi"
|
||||
msgstr ""
|
||||
msgstr "ADC2 sta usando il WiFi"
|
||||
|
||||
#: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c
|
||||
#, fuzzy, c-format
|
||||
#, c-format
|
||||
msgid "Address must be %d bytes long"
|
||||
msgstr "la palette deve essere lunga 32 byte"
|
||||
msgstr "L'indirizzo deve essere lungo %d byte"
|
||||
|
||||
#: shared-bindings/_bleio/Address.c
|
||||
msgid "Address type out of range"
|
||||
msgstr ""
|
||||
msgstr "Tipo di indirizzo fuori intervallo"
|
||||
|
||||
#: ports/esp32s2/common-hal/canio/CAN.c
|
||||
msgid "All CAN peripherals are in use"
|
||||
msgstr ""
|
||||
msgstr "Tutte le periferiche CAN sono in uso"
|
||||
|
||||
#: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c
|
||||
msgid "All I2C peripherals are in use"
|
||||
@ -320,13 +330,13 @@ msgstr "Tutte le periferiche I2C sono in uso"
|
||||
#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c
|
||||
#: ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c
|
||||
msgid "All PCNT units in use"
|
||||
msgstr ""
|
||||
msgstr "Tutte le unità PCNT sono in uso"
|
||||
|
||||
#: ports/atmel-samd/common-hal/canio/Listener.c
|
||||
#: ports/esp32s2/common-hal/canio/Listener.c
|
||||
#: ports/stm/common-hal/canio/Listener.c
|
||||
msgid "All RX FIFOs in use"
|
||||
msgstr ""
|
||||
msgstr "Tutte le RX FIFO sono in uso"
|
||||
|
||||
#: ports/esp32s2/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c
|
||||
msgid "All SPI peripherals are in use"
|
||||
@ -343,7 +353,7 @@ msgstr "Tutti i canali eventi utilizati"
|
||||
|
||||
#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
|
||||
msgid "All state machines in use"
|
||||
msgstr ""
|
||||
msgstr "Tutte le state machines sono in uso"
|
||||
|
||||
#: ports/atmel-samd/audio_dma.c ports/atmel-samd/common-hal/audiobusio/PDMIn.c
|
||||
msgid "All sync event channels in use"
|
||||
@ -376,16 +386,16 @@ msgstr ""
|
||||
|
||||
#: ports/atmel-samd/common-hal/canio/Listener.c
|
||||
msgid "Already have all-matches listener"
|
||||
msgstr ""
|
||||
msgstr "Già in possesso di tutti i listener abbinati"
|
||||
|
||||
#: shared-module/memorymonitor/AllocationAlarm.c
|
||||
#: shared-module/memorymonitor/AllocationSize.c
|
||||
msgid "Already running"
|
||||
msgstr ""
|
||||
msgstr "Già in funzione"
|
||||
|
||||
#: ports/esp32s2/common-hal/wifi/Radio.c
|
||||
msgid "Already scanning for wifi networks"
|
||||
msgstr ""
|
||||
msgstr "Già in ricerca di collegamenti WiFi"
|
||||
|
||||
#: ports/cxd56/common-hal/analogio/AnalogIn.c
|
||||
msgid "AnalogIn not supported on given pin"
|
||||
@ -417,24 +427,24 @@ msgstr "Array deve avere mezzoparole (typo 'H')"
|
||||
|
||||
#: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c
|
||||
msgid "Array values should be single bytes."
|
||||
msgstr "Valori di Array dovrebbero essere bytes singulari"
|
||||
msgstr "I valori dell'Array dovrebbero essere bytes singoli."
|
||||
|
||||
#: shared-bindings/microcontroller/Pin.c
|
||||
msgid "At most %d %q may be specified (not %d)"
|
||||
msgstr ""
|
||||
msgstr "Almeno %d %q devono essere specificati (non %d)"
|
||||
|
||||
#: shared-module/memorymonitor/AllocationAlarm.c
|
||||
#, c-format
|
||||
msgid "Attempt to allocate %d blocks"
|
||||
msgstr ""
|
||||
msgstr "Provo ad allocare %d blocchi"
|
||||
|
||||
#: supervisor/shared/safe_mode.c
|
||||
msgid "Attempted heap allocation when MicroPython VM not running."
|
||||
msgstr ""
|
||||
msgstr "Provo l'allocazione quando MicroPython VM non è attivo."
|
||||
|
||||
#: shared-bindings/wifi/Radio.c
|
||||
msgid "Authentication failure"
|
||||
msgstr ""
|
||||
msgstr "Autenticazione Fallita"
|
||||
|
||||
#: main.c
|
||||
msgid "Auto-reload is off.\n"
|
||||
@ -455,7 +465,7 @@ msgstr ""
|
||||
#: shared-module/displayio/Display.c
|
||||
#: shared-module/framebufferio/FramebufferDisplay.c
|
||||
msgid "Below minimum frame rate"
|
||||
msgstr ""
|
||||
msgstr "Al di sotto del frame rate minimo"
|
||||
|
||||
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
|
||||
msgid "Bit clock and word select must share a clock unit"
|
||||
@ -465,15 +475,15 @@ msgstr ""
|
||||
#: shared-bindings/rgbmatrix/RGBMatrix.c
|
||||
#, c-format
|
||||
msgid "Bit depth must be from 1 to 6 inclusive, not %d"
|
||||
msgstr ""
|
||||
msgstr "La profondità dei bit deve essere inclusiva da 1 a 6, non %d"
|
||||
|
||||
#: shared-bindings/audiobusio/PDMIn.c
|
||||
msgid "Bit depth must be multiple of 8."
|
||||
msgstr "La profondità di bit deve essere multipla di 8."
|
||||
msgstr "La profondità di bit deve essere un multiplo di 8."
|
||||
|
||||
#: ports/mimxrt10xx/common-hal/busio/UART.c
|
||||
msgid "Both RX and TX required for flow control"
|
||||
msgstr ""
|
||||
msgstr "Sia RX che TX richiedono il controllo del flow"
|
||||
|
||||
#: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c
|
||||
msgid "Both pins must support hardware interrupts"
|
||||
@ -483,21 +493,21 @@ msgstr "Entrambi i pin devono supportare gli interrupt hardware"
|
||||
#: shared-bindings/framebufferio/FramebufferDisplay.c
|
||||
#: shared-bindings/rgbmatrix/RGBMatrix.c
|
||||
msgid "Brightness must be 0-1.0"
|
||||
msgstr ""
|
||||
msgstr "La luminosità deve essere tra 0-1.0"
|
||||
|
||||
#: shared-bindings/supervisor/__init__.c
|
||||
msgid "Brightness must be between 0 and 255"
|
||||
msgstr "La luminosità deve essere compreso tra 0 e 255"
|
||||
msgstr "La luminosità deve essere compresa tra 0 e 255"
|
||||
|
||||
#: shared-bindings/displayio/Display.c
|
||||
#: shared-bindings/framebufferio/FramebufferDisplay.c
|
||||
msgid "Brightness not adjustable"
|
||||
msgstr "Illiminazione non è regolabile"
|
||||
msgstr "Luminosità non è regolabile"
|
||||
|
||||
#: shared-bindings/_bleio/UUID.c
|
||||
#, c-format
|
||||
msgid "Buffer + offset too small %d %d %d"
|
||||
msgstr ""
|
||||
msgstr "Buffer + offset troppo piccolo %d %d %d"
|
||||
|
||||
#: shared-module/usb_hid/Device.c
|
||||
#, c-format
|
||||
@ -507,26 +517,26 @@ msgstr "Buffer di lunghezza non valida. Dovrebbe essere di %d bytes."
|
||||
#: shared-bindings/displayio/Display.c
|
||||
#: shared-bindings/framebufferio/FramebufferDisplay.c
|
||||
msgid "Buffer is not a bytearray."
|
||||
msgstr ""
|
||||
msgstr "Buffer non è un array di bites."
|
||||
|
||||
#: ports/cxd56/common-hal/camera/Camera.c shared-bindings/displayio/Display.c
|
||||
#: shared-bindings/framebufferio/FramebufferDisplay.c
|
||||
msgid "Buffer is too small"
|
||||
msgstr ""
|
||||
msgstr "Buffer troppo piccolo"
|
||||
|
||||
#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c
|
||||
#, c-format
|
||||
msgid "Buffer length %d too big. It must be less than %d"
|
||||
msgstr ""
|
||||
msgstr "Lunghezza Buffer %d troppo grande. Deve essere meno di %d"
|
||||
|
||||
#: ports/atmel-samd/common-hal/sdioio/SDCard.c
|
||||
#: ports/cxd56/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c
|
||||
msgid "Buffer length must be a multiple of 512"
|
||||
msgstr ""
|
||||
msgstr "La lunghezza del buffer deve essere un multiplo di 512"
|
||||
|
||||
#: ports/stm/common-hal/sdioio/SDCard.c
|
||||
msgid "Buffer must be a multiple of 512 bytes"
|
||||
msgstr ""
|
||||
msgstr "Il buffer deve essere un multiplo di 512 bytes"
|
||||
|
||||
#: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c
|
||||
msgid "Buffer must be at least length 1"
|
||||
@ -534,40 +544,39 @@ msgstr "Il buffer deve essere lungo almeno 1"
|
||||
|
||||
#: ports/nrf/common-hal/_bleio/PacketBuffer.c
|
||||
msgid "Buffer too large and unable to allocate"
|
||||
msgstr ""
|
||||
msgstr "Buffer troppo grande ed impossibile allocare"
|
||||
|
||||
#: shared-bindings/_bleio/PacketBuffer.c
|
||||
#, c-format
|
||||
msgid "Buffer too short by %d bytes"
|
||||
msgstr ""
|
||||
msgstr "Buffer troppo piccolo di %d bytes"
|
||||
|
||||
#: ports/atmel-samd/common-hal/displayio/ParallelBus.c
|
||||
#: ports/esp32s2/common-hal/displayio/ParallelBus.c
|
||||
#: ports/nrf/common-hal/displayio/ParallelBus.c
|
||||
#, fuzzy, c-format
|
||||
#, c-format
|
||||
msgid "Bus pin %d is already in use"
|
||||
msgstr "DAC già in uso"
|
||||
msgstr "Bus pin %d è già in uso"
|
||||
|
||||
#: shared-bindings/_bleio/UUID.c
|
||||
#, fuzzy
|
||||
msgid "Byte buffer must be 16 bytes."
|
||||
msgstr "i buffer devono essere della stessa lunghezza"
|
||||
msgstr "I buffer byte devono essere di almeno 16 bytes."
|
||||
|
||||
#: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c
|
||||
msgid "Bytes must be between 0 and 255."
|
||||
msgstr "I byte devono essere compresi tra 0 e 255"
|
||||
msgstr "I byte devono essere compresi tra 0 e 255."
|
||||
|
||||
#: shared-bindings/aesio/aes.c
|
||||
msgid "CBC blocks must be multiples of 16 bytes"
|
||||
msgstr ""
|
||||
msgstr "I blocchi CBC devono essere multipli di 16 bytes"
|
||||
|
||||
#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c
|
||||
msgid "CRC or checksum was invalid"
|
||||
msgstr ""
|
||||
msgstr "CRC o controllo totale è risultato non valido"
|
||||
|
||||
#: py/objtype.c
|
||||
msgid "Call super().__init__() before accessing native object."
|
||||
msgstr ""
|
||||
msgstr "Chiama super().__init__() prima di accedere ad un oggetto nativo."
|
||||
|
||||
#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c
|
||||
msgid "Can only alarm on RTC IO from deep sleep."
|
||||
|
12
locale/sv.po
12
locale/sv.po
@ -6,7 +6,7 @@ msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-01-04 12:55-0600\n"
|
||||
"PO-Revision-Date: 2021-02-05 19:47+0000\n"
|
||||
"PO-Revision-Date: 2021-02-15 00:33+0000\n"
|
||||
"Last-Translator: Jonny Bergdahl <jonny@bergdahl.it>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"Language: sv\n"
|
||||
@ -1473,7 +1473,7 @@ msgstr "Ingen DMA-kanal hittades"
|
||||
|
||||
#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
|
||||
msgid "No DMA pacing timer found"
|
||||
msgstr ""
|
||||
msgstr "Ingen DMA pacing timer hittades"
|
||||
|
||||
#: shared-module/adafruit_bus_device/I2CDevice.c
|
||||
#, c-format
|
||||
@ -1762,7 +1762,7 @@ msgstr ""
|
||||
|
||||
#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
|
||||
msgid "Pins must share PWM slice"
|
||||
msgstr ""
|
||||
msgstr "Pinnar måste dela PWM-segment"
|
||||
|
||||
#: py/builtinhelp.c
|
||||
msgid "Plus any modules on the filesystem\n"
|
||||
@ -2011,11 +2011,11 @@ msgstr "Stackstorleken måste vara minst 256"
|
||||
|
||||
#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
|
||||
msgid "Stereo left must be on PWM channel A"
|
||||
msgstr ""
|
||||
msgstr "Vänster stereokanal måste använda PWM kanal A"
|
||||
|
||||
#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
|
||||
msgid "Stereo right must be on PWM channel B"
|
||||
msgstr ""
|
||||
msgstr "Höger stereokanal måste använda PWM kanal B"
|
||||
|
||||
#: shared-bindings/multiterminal/__init__.c
|
||||
msgid "Stream missing readinto() or write() method."
|
||||
@ -3706,7 +3706,7 @@ msgstr "pop från tom %q"
|
||||
|
||||
#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
|
||||
msgid "port must be >= 0"
|
||||
msgstr ""
|
||||
msgstr "port måste vara >= 0"
|
||||
|
||||
#: py/objint_mpz.c
|
||||
msgid "pow() 3rd argument cannot be 0"
|
||||
|
@ -199,6 +199,7 @@ SRC_C += \
|
||||
audio_dma.c \
|
||||
background.c \
|
||||
peripherals/pins.c \
|
||||
extmod/crypto-algorithms/sha256.c \
|
||||
fatfs_port.c \
|
||||
lib/libc/string0.c \
|
||||
lib/mp-readline/readline.c \
|
||||
|
@ -30,6 +30,11 @@
|
||||
#include "py/objtuple.h"
|
||||
#include "py/qstr.h"
|
||||
|
||||
#include "extmod/crypto-algorithms/sha256.h"
|
||||
|
||||
#include "hardware/structs/rosc.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
STATIC const qstr os_uname_info_fields[] = {
|
||||
MP_QSTR_sysname, MP_QSTR_nodename,
|
||||
@ -57,6 +62,64 @@ mp_obj_t common_hal_os_uname(void) {
|
||||
return (mp_obj_t)&os_uname_info_obj;
|
||||
}
|
||||
|
||||
bool common_hal_os_urandom(uint8_t* buffer, uint32_t length) {
|
||||
return false;
|
||||
// NIST Special Publication 800-90B (draft) recommends several extractors,
|
||||
// including the SHA hash family and states that if the amount of entropy input
|
||||
// is twice the number of bits output from them, that output can be considered
|
||||
// essentially fully random. If every RANDOM_SAFETY_MARGIN bits from
|
||||
// `rosc_hw->randombit` have at least 1 bit of entropy, then this criterion is met.
|
||||
//
|
||||
// This works by seeding the `random_state` with plenty of random bits (SHA256
|
||||
// as entropy harvesting function), then using that state it as a counter input
|
||||
// (SHA256 as a CSPRNG), re-seeding at least every 256 blocks (8kB).
|
||||
//
|
||||
// In practice, `PractRand` doesn't detect any gross problems with the output
|
||||
// random numbers on samples of 1 to 8 megabytes, no matter the setting of
|
||||
// RANDOM_SAFETY_MARGIN. (it does detect "unusual" results from time to time,
|
||||
// as it will with any RNG)
|
||||
#define RANDOM_SAFETY_MARGIN (4)
|
||||
|
||||
static BYTE random_state[SHA256_BLOCK_SIZE];
|
||||
static void seed_random_bits(BYTE out[SHA256_BLOCK_SIZE]) {
|
||||
CRYAL_SHA256_CTX context;
|
||||
sha256_init(&context);
|
||||
for (int i=0; i<2*RANDOM_SAFETY_MARGIN; i++) {
|
||||
for(int j=0; j<SHA256_BLOCK_SIZE; j++) {
|
||||
out[j] = rosc_hw->randombit & 1;
|
||||
for(int k=0; k<8; k++) {
|
||||
out[j] = (out[j] << 1) ^ (rosc_hw->randombit & 1);
|
||||
}
|
||||
}
|
||||
sha256_update(&context, out, SHA256_BLOCK_SIZE);
|
||||
}
|
||||
sha256_final(&context, out);
|
||||
}
|
||||
|
||||
static void get_random_bits(BYTE out[SHA256_BLOCK_SIZE]) {
|
||||
if (!random_state[0]++) {
|
||||
seed_random_bits(random_state);
|
||||
}
|
||||
CRYAL_SHA256_CTX context;
|
||||
sha256_init(&context);
|
||||
sha256_update(&context, random_state, SHA256_BLOCK_SIZE);
|
||||
sha256_final(&context, out);
|
||||
}
|
||||
|
||||
bool common_hal_os_urandom(uint8_t* buffer, uint32_t length) {
|
||||
#define ROSC_POWER_SAVE (1) // assume ROSC is not necessarily active all the time
|
||||
#if ROSC_POWER_SAVE
|
||||
uint32_t old_rosc_ctrl = rosc_hw->ctrl;
|
||||
rosc_hw->ctrl = (old_rosc_ctrl & ~ROSC_CTRL_ENABLE_BITS) | (ROSC_CTRL_ENABLE_VALUE_ENABLE << 12);
|
||||
#endif
|
||||
while (length) {
|
||||
size_t n = MIN(length, SHA256_BLOCK_SIZE);
|
||||
BYTE sha_buf[SHA256_BLOCK_SIZE];
|
||||
get_random_bits(sha_buf);
|
||||
memcpy(buffer, sha_buf, n);
|
||||
buffer += n;
|
||||
length -= n;
|
||||
}
|
||||
#if ROSC_POWER_SAVE
|
||||
rosc_hw->ctrl = old_rosc_ctrl;
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
@ -45,6 +45,18 @@ uint32_t slice_variable_frequency;
|
||||
static uint32_t channel_use;
|
||||
static uint32_t never_reset_channel;
|
||||
|
||||
// Per the RP2040 datasheet:
|
||||
//
|
||||
// "A CC value of 0 will produce a 0% output, i.e. the output signal
|
||||
// is always low. A CC value of TOP + 1 (i.e. equal to the period, in
|
||||
// non-phase-correct mode) will produce a 100% output. For example, if
|
||||
// TOP is programmed to 254, the counter will have a period of 255
|
||||
// cycles, and CC values in the range of 0 to 255 inclusive will
|
||||
// produce duty cycles in the range 0% to 100% inclusive."
|
||||
//
|
||||
// So 65534 should be the maximum top value, and we'll set CC to be TOP+1 as appropriate.
|
||||
#define MAX_TOP 65534
|
||||
|
||||
static uint32_t _mask(uint8_t slice, uint8_t channel) {
|
||||
return 1 << (slice * CHANNELS_PER_SLICE + channel);
|
||||
}
|
||||
@ -164,19 +176,28 @@ void common_hal_pwmio_pwmout_deinit(pwmio_pwmout_obj_t* self) {
|
||||
|
||||
extern void common_hal_pwmio_pwmout_set_duty_cycle(pwmio_pwmout_obj_t* self, uint16_t duty) {
|
||||
self->duty_cycle = duty;
|
||||
uint16_t actual_duty = duty * self->top / ((1 << 16) - 1);
|
||||
pwm_set_chan_level(self->slice, self->channel, actual_duty);
|
||||
// Do arithmetic in 32 bits to prevent overflow.
|
||||
uint16_t compare_count;
|
||||
if (duty == 65535) {
|
||||
// Ensure that 100% duty cycle is 100% full on and not rounded down,
|
||||
// but do MIN() to keep value in range, just in case.
|
||||
compare_count = MIN(UINT16_MAX, (uint32_t) self->top + 1);
|
||||
} else {
|
||||
compare_count= ((uint32_t) duty * self->top + MAX_TOP / 2) / MAX_TOP;
|
||||
}
|
||||
// compare_count is the CC register value, which should be TOP+1 for 100% duty cycle.
|
||||
pwm_set_chan_level(self->slice, self->channel, compare_count);
|
||||
}
|
||||
|
||||
uint16_t common_hal_pwmio_pwmout_get_duty_cycle(pwmio_pwmout_obj_t* self) {
|
||||
return self->duty_cycle;
|
||||
}
|
||||
|
||||
void pwmio_pwmout_set_top(pwmio_pwmout_obj_t* self, uint32_t top) {
|
||||
void pwmio_pwmout_set_top(pwmio_pwmout_obj_t* self, uint16_t top) {
|
||||
self->actual_frequency = common_hal_mcu_processor_get_frequency() / top;
|
||||
self->top = top;
|
||||
pwm_set_clkdiv_int_frac(self->slice, 1, 0);
|
||||
pwm_set_wrap(self->slice, self->top - 1);
|
||||
pwm_set_wrap(self->slice, self->top);
|
||||
}
|
||||
|
||||
void common_hal_pwmio_pwmout_set_frequency(pwmio_pwmout_obj_t* self, uint32_t frequency) {
|
||||
@ -187,7 +208,7 @@ void common_hal_pwmio_pwmout_set_frequency(pwmio_pwmout_obj_t* self, uint32_t fr
|
||||
target_slice_frequencies[self->slice] = frequency;
|
||||
|
||||
// For low frequencies use the divider to give us full resolution duty_cycle.
|
||||
if (frequency < (common_hal_mcu_processor_get_frequency() / (1 << 16))) {
|
||||
if (frequency <= (common_hal_mcu_processor_get_frequency() / (1 << 16))) {
|
||||
// Compute the divisor. It's an 8 bit integer and 4 bit fraction. Therefore,
|
||||
// we compute everything * 16 for the fractional part.
|
||||
// This is 1 << 12 because 4 bits are the * 16.
|
||||
@ -201,16 +222,17 @@ void common_hal_pwmio_pwmout_set_frequency(pwmio_pwmout_obj_t* self, uint32_t fr
|
||||
if (div16 >= (1 << 12)) {
|
||||
div16 = (1 << 12) - 1;
|
||||
}
|
||||
self->actual_frequency = frequency16 / div16;
|
||||
self->top = 1 << 16;
|
||||
self->actual_frequency = (frequency16 + (div16 / 2)) / div16;
|
||||
self->top = MAX_TOP;
|
||||
pwm_set_clkdiv_int_frac(self->slice, div16 / 16, div16 % 16);
|
||||
pwm_set_wrap(self->slice, self->top - 1);
|
||||
pwm_set_wrap(self->slice, self->top);
|
||||
} else {
|
||||
uint32_t top = common_hal_mcu_processor_get_frequency() / frequency;
|
||||
self->actual_frequency = common_hal_mcu_processor_get_frequency() / top;
|
||||
self->top = top;
|
||||
self->top = MIN(MAX_TOP, top);
|
||||
pwm_set_clkdiv_int_frac(self->slice, 1, 0);
|
||||
pwm_set_wrap(self->slice, self->top - 1);
|
||||
// Set TOP register. For 100% duty cycle, CC must be set to TOP+1.
|
||||
pwm_set_wrap(self->slice, self->top);
|
||||
}
|
||||
common_hal_pwmio_pwmout_set_duty_cycle(self, self->duty_cycle);
|
||||
}
|
||||
|
@ -39,11 +39,11 @@ typedef struct {
|
||||
bool variable_frequency;
|
||||
uint16_t duty_cycle;
|
||||
uint32_t actual_frequency;
|
||||
uint32_t top;
|
||||
uint16_t top;
|
||||
} pwmio_pwmout_obj_t;
|
||||
|
||||
void pwmout_reset(void);
|
||||
// Private API for AudioPWMOut.
|
||||
void pwmio_pwmout_set_top(pwmio_pwmout_obj_t* self, uint32_t top);
|
||||
void pwmio_pwmout_set_top(pwmio_pwmout_obj_t* self, uint16_t top);
|
||||
|
||||
#endif // MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_PWMIO_PWMOUT_H
|
||||
|
@ -24,6 +24,7 @@ CIRCUITPY_NEOPIXEL_WRITE = 0
|
||||
endif
|
||||
|
||||
CIRCUITPY_FULL_BUILD = 1
|
||||
CIRCUITPY_BITOPS = 1
|
||||
CIRCUITPY_PWMIO = 1
|
||||
|
||||
# Things that need to be implemented.
|
||||
|
@ -21,5 +21,6 @@ LD_FILE = boards/STM32F401xd_fs.ld
|
||||
# meantime
|
||||
CIRCUITPY_ULAB = 0
|
||||
CIRCUITPY_BUSDEVICE = 0
|
||||
CIRCUITPY_FRAMEBUFFERIO = 0
|
||||
|
||||
SUPEROPT_GC = 0
|
||||
|
@ -61,6 +61,7 @@ STATIC bool never_reset_i2c[MAX_I2C];
|
||||
#define ALL_CLOCKS 0xFF
|
||||
STATIC void i2c_clock_enable(uint8_t mask);
|
||||
STATIC void i2c_clock_disable(uint8_t mask);
|
||||
STATIC void i2c_assign_irq(busio_i2c_obj_t *self, I2C_TypeDef * I2Cx);
|
||||
|
||||
void i2c_reset(void) {
|
||||
uint16_t never_reset_mask = 0x00;
|
||||
@ -136,6 +137,10 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self,
|
||||
i2c_clock_enable(1 << (self->sda->periph_index - 1));
|
||||
reserved_i2c[self->sda->periph_index - 1] = true;
|
||||
|
||||
// Create root pointer and assign IRQ
|
||||
MP_STATE_PORT(cpy_i2c_obj_all)[self->sda->periph_index - 1] = self;
|
||||
i2c_assign_irq(self, I2Cx);
|
||||
|
||||
// Handle the HAL handle differences
|
||||
#if (CPY_STM32H7 || CPY_STM32F7)
|
||||
if (frequency == 400000) {
|
||||
@ -163,6 +168,13 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self,
|
||||
}
|
||||
common_hal_mcu_pin_claim(sda);
|
||||
common_hal_mcu_pin_claim(scl);
|
||||
|
||||
self->frame_in_prog = false;
|
||||
|
||||
//start the receive interrupt chain
|
||||
HAL_NVIC_DisableIRQ(self->irq); //prevent handle lock contention
|
||||
HAL_NVIC_SetPriority(self->irq, 1, 0);
|
||||
HAL_NVIC_EnableIRQ(self->irq);
|
||||
}
|
||||
|
||||
void common_hal_busio_i2c_never_reset(busio_i2c_obj_t *self) {
|
||||
@ -229,15 +241,46 @@ void common_hal_busio_i2c_unlock(busio_i2c_obj_t *self) {
|
||||
|
||||
uint8_t common_hal_busio_i2c_write(busio_i2c_obj_t *self, uint16_t addr,
|
||||
const uint8_t *data, size_t len, bool transmit_stop_bit) {
|
||||
HAL_StatusTypeDef result = HAL_I2C_Master_Transmit(&(self->handle), (uint16_t)(addr << 1),
|
||||
HAL_StatusTypeDef result;
|
||||
if (!transmit_stop_bit) {
|
||||
uint32_t xfer_opt;
|
||||
if (!self->frame_in_prog) {
|
||||
xfer_opt = I2C_FIRST_FRAME;
|
||||
} else {
|
||||
// handle rare possibility of multiple restart writes in a row
|
||||
xfer_opt = I2C_NEXT_FRAME;
|
||||
}
|
||||
result = HAL_I2C_Master_Seq_Transmit_IT(&(self->handle),
|
||||
(uint16_t)(addr << 1), (uint8_t *)data,
|
||||
(uint16_t)len, xfer_opt);
|
||||
while (HAL_I2C_GetState(&(self->handle)) != HAL_I2C_STATE_READY)
|
||||
{
|
||||
RUN_BACKGROUND_TASKS;
|
||||
}
|
||||
self->frame_in_prog = true;
|
||||
} else {
|
||||
result = HAL_I2C_Master_Transmit(&(self->handle), (uint16_t)(addr << 1),
|
||||
(uint8_t *)data, (uint16_t)len, 500);
|
||||
}
|
||||
return result == HAL_OK ? 0 : MP_EIO;
|
||||
}
|
||||
|
||||
uint8_t common_hal_busio_i2c_read(busio_i2c_obj_t *self, uint16_t addr,
|
||||
uint8_t *data, size_t len) {
|
||||
if (!self->frame_in_prog) {
|
||||
return HAL_I2C_Master_Receive(&(self->handle), (uint16_t)(addr<<1), data, (uint16_t)len, 500)
|
||||
== HAL_OK ? 0 : MP_EIO;
|
||||
} else {
|
||||
HAL_StatusTypeDef result = HAL_I2C_Master_Seq_Receive_IT(&(self->handle),
|
||||
(uint16_t)(addr << 1), (uint8_t *)data,
|
||||
(uint16_t)len, I2C_LAST_FRAME);
|
||||
while (HAL_I2C_GetState(&(self->handle)) != HAL_I2C_STATE_READY)
|
||||
{
|
||||
RUN_BACKGROUND_TASKS;
|
||||
}
|
||||
self->frame_in_prog = false;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
STATIC void i2c_clock_enable(uint8_t mask) {
|
||||
@ -294,3 +337,48 @@ STATIC void i2c_clock_disable(uint8_t mask) {
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
STATIC void i2c_assign_irq(busio_i2c_obj_t *self, I2C_TypeDef * I2Cx) {
|
||||
#ifdef I2C1
|
||||
if (I2Cx == I2C1) {
|
||||
self->irq = I2C1_EV_IRQn;
|
||||
}
|
||||
#endif
|
||||
#ifdef I2C2
|
||||
if (I2Cx == I2C2) {
|
||||
self->irq = I2C2_EV_IRQn;
|
||||
}
|
||||
#endif
|
||||
#ifdef I2C3
|
||||
if (I2Cx == I2C3) {
|
||||
self->irq = I2C3_EV_IRQn;
|
||||
}
|
||||
#endif
|
||||
#ifdef I2C4
|
||||
if (I2Cx == I2C4) {
|
||||
self->irq = I2C4_EV_IRQn;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
STATIC void call_hal_irq(int i2c_num) {
|
||||
//Create casted context pointer
|
||||
busio_i2c_obj_t * context = (busio_i2c_obj_t*)MP_STATE_PORT(cpy_i2c_obj_all)[i2c_num - 1];
|
||||
if (context != NULL) {
|
||||
HAL_NVIC_ClearPendingIRQ(context->irq);
|
||||
HAL_I2C_EV_IRQHandler(&context->handle);
|
||||
}
|
||||
}
|
||||
|
||||
void I2C1_EV_IRQHandler(void) {
|
||||
call_hal_irq(1);
|
||||
}
|
||||
void I2C2_EV_IRQHandler(void) {
|
||||
call_hal_irq(2);
|
||||
}
|
||||
void I2C3_EV_IRQHandler(void) {
|
||||
call_hal_irq(3);
|
||||
}
|
||||
void I2C4_EV_IRQHandler(void) {
|
||||
call_hal_irq(4);
|
||||
}
|
||||
|
@ -37,6 +37,8 @@
|
||||
typedef struct {
|
||||
mp_obj_base_t base;
|
||||
I2C_HandleTypeDef handle;
|
||||
IRQn_Type irq;
|
||||
bool frame_in_prog;
|
||||
bool has_lock;
|
||||
const mcu_periph_obj_t *scl;
|
||||
const mcu_periph_obj_t *sda;
|
||||
|
@ -52,10 +52,14 @@ extern uint8_t _ld_default_stack_size;
|
||||
#define BOARD_NO_VBUS_SENSE (0)
|
||||
#endif
|
||||
|
||||
#define MAX_UART 10 //how many UART are implemented
|
||||
// Peripheral implementation counts
|
||||
#define MAX_UART 10
|
||||
#define MAX_I2C 4
|
||||
#define MAX_SPI 6
|
||||
|
||||
#define MICROPY_PORT_ROOT_POINTERS \
|
||||
void *cpy_uart_obj_all[MAX_UART]; \
|
||||
void *cpy_i2c_obj_all[MAX_I2C]; \
|
||||
CIRCUITPY_COMMON_ROOT_POINTERS
|
||||
|
||||
#endif // __INCLUDED_MPCONFIGPORT_H
|
||||
|
@ -139,6 +139,9 @@ endif
|
||||
ifeq ($(CIRCUITPY_BITBANG_APA102),1)
|
||||
SRC_PATTERNS += bitbangio/SPI%
|
||||
endif
|
||||
ifeq ($(CIRCUITPY_BITOPS),1)
|
||||
SRC_PATTERNS += bitops/%
|
||||
endif
|
||||
ifeq ($(CIRCUITPY_BLEIO),1)
|
||||
SRC_PATTERNS += _bleio/%
|
||||
endif
|
||||
@ -469,6 +472,7 @@ SRC_SHARED_MODULE_ALL = \
|
||||
bitbangio/OneWire.c \
|
||||
bitbangio/SPI.c \
|
||||
bitbangio/__init__.c \
|
||||
bitops/__init__.c \
|
||||
board/__init__.c \
|
||||
adafruit_bus_device/__init__.c \
|
||||
adafruit_bus_device/I2CDevice.c \
|
||||
|
@ -306,6 +306,14 @@ extern const struct _mp_obj_module_t bitbangio_module;
|
||||
#define BITBANGIO_MODULE
|
||||
#endif
|
||||
|
||||
#if CIRCUITPY_BITOPS
|
||||
extern const struct _mp_obj_module_t bitops_module;
|
||||
#define BITOPS_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_bitops),(mp_obj_t)&bitops_module },
|
||||
#else
|
||||
#define BITOPS_MODULE
|
||||
#endif
|
||||
|
||||
|
||||
#if CIRCUITPY_BLEIO
|
||||
#define BLEIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR__bleio), (mp_obj_t)&bleio_module },
|
||||
extern const struct _mp_obj_module_t bleio_module;
|
||||
@ -827,6 +835,7 @@ extern const struct _mp_obj_module_t msgpack_module;
|
||||
AUDIOPWMIO_MODULE \
|
||||
BINASCII_MODULE \
|
||||
BITBANGIO_MODULE \
|
||||
BITOPS_MODULE \
|
||||
BLEIO_MODULE \
|
||||
BOARD_MODULE \
|
||||
BUSDEVICE_MODULE \
|
||||
|
@ -346,6 +346,9 @@ CFLAGS += -DCIRCUITPY_USB_MIDI=$(CIRCUITPY_USB_MIDI)
|
||||
CIRCUITPY_USB_MSC ?= 1
|
||||
CFLAGS += -DCIRCUITPY_USB_MSC=$(CIRCUITPY_USB_MSC)
|
||||
|
||||
# Defaulting this to OFF initially because it has only been tested on a
|
||||
# limited number of platforms, and the other platforms do not have this
|
||||
# setting in their mpconfigport.mk and/or mpconfigboard.mk files yet.
|
||||
CIRCUITPY_USB_VENDOR ?= 0
|
||||
CFLAGS += -DCIRCUITPY_USB_VENDOR=$(CIRCUITPY_USB_VENDOR)
|
||||
|
||||
|
@ -34,7 +34,6 @@
|
||||
|
||||
#include "lib/utils/buffer_helper.h"
|
||||
#include "lib/utils/context_manager_helpers.h"
|
||||
#include "py/objproperty.h"
|
||||
#include "py/runtime.h"
|
||||
#include "supervisor/shared/translate.h"
|
||||
|
||||
|
101
shared-bindings/bitops/__init__.c
Normal file
101
shared-bindings/bitops/__init__.c
Normal file
@ -0,0 +1,101 @@
|
||||
/*
|
||||
* This file is part of the Circuit Python project, https://github.com/adafruit/circuitpython
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2021 Jeff Epler for Adafruit Industries
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "py/obj.h"
|
||||
#include "py/runtime.h"
|
||||
|
||||
#include "shared-bindings/bitops/__init__.h"
|
||||
|
||||
//| """Routines for low-level manipulation of binary data"""
|
||||
//|
|
||||
//|
|
||||
|
||||
//| def bit_transpose(input: ReadableBuffer, output: WriteableBuffer, width:int = 8) -> WriteableBuffer:
|
||||
//| """"Transpose" a buffer by assembling each output byte with bits taken from each of ``width`` different input bytes.
|
||||
//|
|
||||
//| This can be useful to convert a sequence of pixel values into a single
|
||||
//| stream of bytes suitable for sending via a parallel conversion method.
|
||||
//|
|
||||
//| The number of bytes in the input buffer must be a multiple of the width,
|
||||
//| and the width can be any value from 2 to 8. If the width is fewer than 8,
|
||||
//| then the remaining (less significant) bits of the output are set to zero.
|
||||
//|
|
||||
//| Let ``stride = len(input)//width``. Then the first byte is made out of the
|
||||
//| most significant bits of ``[input[0], input[stride], input[2*stride], ...]``.
|
||||
//| The second byte is made out of the second bits, and so on until the 8th output
|
||||
//| byte which is made of the first bits of ``input[1], input[1+stride,
|
||||
//| input[2*stride], ...]``.
|
||||
//|
|
||||
//| The required output buffer size is ``len(input) * 8 // width``.
|
||||
//|
|
||||
//| Returns the output buffer."""
|
||||
//| ...
|
||||
|
||||
STATIC mp_obj_t bit_transpose(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
|
||||
enum { ARG_input, ARG_output, ARG_width };
|
||||
static const mp_arg_t allowed_args[] = {
|
||||
{ MP_QSTR_input, MP_ARG_OBJ | MP_ARG_REQUIRED },
|
||||
{ MP_QSTR_output, MP_ARG_OBJ | MP_ARG_REQUIRED },
|
||||
{ MP_QSTR_width, MP_ARG_INT, { .u_int = 8 } },
|
||||
};
|
||||
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
|
||||
mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
|
||||
|
||||
int width = args[ARG_width].u_int;
|
||||
if (width < 2 || width > 8) {
|
||||
mp_raise_ValueError_varg(translate("width must be from 2 to 8 (inclusive), not %d"), width);
|
||||
}
|
||||
|
||||
mp_buffer_info_t input_bufinfo;
|
||||
mp_get_buffer_raise(args[ARG_input].u_obj, &input_bufinfo, MP_BUFFER_READ);
|
||||
int inlen = input_bufinfo.len;
|
||||
if (inlen % width != 0) {
|
||||
mp_raise_ValueError_varg(translate("Input buffer length (%d) must be a multiple of the strand count (%d)"), inlen, width);
|
||||
}
|
||||
|
||||
mp_buffer_info_t output_bufinfo;
|
||||
mp_get_buffer_raise(args[ARG_output].u_obj, &output_bufinfo, MP_BUFFER_WRITE);
|
||||
int avail = output_bufinfo.len;
|
||||
int outlen = 8 * (inlen / width);
|
||||
if (avail < outlen) {
|
||||
mp_raise_ValueError_varg(translate("Output buffer must be at least %d bytes"), outlen);
|
||||
}
|
||||
common_hal_bitops_bit_transpose(output_bufinfo.buf, input_bufinfo.buf, inlen, width);
|
||||
return args[ARG_output].u_obj;
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bitops_bit_transpose_obj, 1, bit_transpose);
|
||||
|
||||
STATIC const mp_rom_map_elem_t bitops_module_globals_table[] = {
|
||||
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_bitops) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_bit_transpose), MP_ROM_PTR(&bitops_bit_transpose_obj) },
|
||||
};
|
||||
|
||||
STATIC MP_DEFINE_CONST_DICT(bitops_module_globals, bitops_module_globals_table);
|
||||
|
||||
const mp_obj_module_t bitops_module = {
|
||||
.base = { &mp_type_module },
|
||||
.globals = (mp_obj_dict_t*)&bitops_module_globals,
|
||||
};
|
32
shared-bindings/bitops/__init__.h
Normal file
32
shared-bindings/bitops/__init__.h
Normal file
@ -0,0 +1,32 @@
|
||||
/*
|
||||
* This file is part of the Circuit Python project, https://github.com/adafruit/circuitpython
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2021 Jeff Epler
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
void common_hal_bitops_bit_transpose(uint8_t *result, const uint8_t *src, size_t inlen, size_t num_strands);
|
151
shared-module/bitops/__init__.c
Normal file
151
shared-module/bitops/__init__.c
Normal file
@ -0,0 +1,151 @@
|
||||
/*
|
||||
* This file is part of the Circuit Python project, https://github.com/adafruit/circuitpython
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2021 Jeff Epler for Adafruit Industries
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "shared-bindings/bitops/__init__.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define FALLTHROUGH __attribute__((fallthrough))
|
||||
#else
|
||||
#define FALLTHROUGH ((void)0) /* FALLTHROUGH */
|
||||
#endif
|
||||
|
||||
// adapted from "Hacker's Delight" - Figure 7-2 Transposing an 8x8-bit matrix
|
||||
// basic idea is:
|
||||
// > First, treat the 8x8-bit matrix as 16 2x2-bit matrices, and transpose each
|
||||
// > of the 16 2x2-bit matrices. Second, treat the matrix as four 2x2 submatrices
|
||||
// > whose elements are 2x2-bit matrices and transpose each of the four 2x2
|
||||
// > submatrices. Finally, treat the matrix as a 2x2 matrix whose elements are
|
||||
// > 4x4-bit matrices, and transpose the 2x2 matrix. These transformations are
|
||||
// > illustrated below.
|
||||
// We want a different definition of bit/byte order, deal with strides differently, etc.
|
||||
// so the code is heavily re-worked compared to the original.
|
||||
static void transpose_var(uint32_t *result, const uint8_t *src, int src_stride, int num_strands) {
|
||||
uint32_t x = 0, y = 0, t;
|
||||
|
||||
src += (num_strands-1) * src_stride;
|
||||
|
||||
switch(num_strands) {
|
||||
case 7:
|
||||
x |= *src << 16;
|
||||
src -= src_stride;
|
||||
FALLTHROUGH;
|
||||
case 6:
|
||||
x |= *src << 8;
|
||||
src -= src_stride;
|
||||
FALLTHROUGH;
|
||||
case 5:
|
||||
x |= *src;
|
||||
src -= src_stride;
|
||||
FALLTHROUGH;
|
||||
case 4:
|
||||
y |= *src << 24;
|
||||
src -= src_stride;
|
||||
FALLTHROUGH;
|
||||
case 3:
|
||||
y |= *src << 16;
|
||||
src -= src_stride;
|
||||
FALLTHROUGH;
|
||||
case 2:
|
||||
y |= *src << 8;
|
||||
src -= src_stride;
|
||||
y |= *src;
|
||||
}
|
||||
|
||||
t = (x ^ (x >> 7)) & 0x00AA00AA; x = x ^ t ^ (t << 7);
|
||||
t = (y ^ (y >> 7)) & 0x00AA00AA; y = y ^ t ^ (t << 7);
|
||||
|
||||
t = (x ^ (x >>14)) & 0x0000CCCC; x = x ^ t ^ (t <<14);
|
||||
t = (y ^ (y >>14)) & 0x0000CCCC; y = y ^ t ^ (t <<14);
|
||||
|
||||
t = (x & 0xF0F0F0F0) | ((y >> 4) & 0x0F0F0F0F);
|
||||
y = ((x << 4) & 0xF0F0F0F0) | (y & 0x0F0F0F0F);
|
||||
x = t;
|
||||
|
||||
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
|
||||
x = __builtin_bswap32(x);
|
||||
y = __builtin_bswap32(y);
|
||||
#endif
|
||||
result[0] = x;
|
||||
result[1] = y;
|
||||
}
|
||||
|
||||
static void transpose_8(uint32_t *result, const uint8_t *src, int src_stride) {
|
||||
uint32_t x, y, t;
|
||||
|
||||
y = *src; src += src_stride;
|
||||
y |= (*src << 8); src += src_stride;
|
||||
y |= (*src << 16); src += src_stride;
|
||||
y |= (*src << 24); src += src_stride;
|
||||
x = *src; src += src_stride;
|
||||
x |= (*src << 8); src += src_stride;
|
||||
x |= (*src << 16); src += src_stride;
|
||||
x |= (*src << 24); src += src_stride;
|
||||
|
||||
t = (x ^ (x >> 7)) & 0x00AA00AA; x = x ^ t ^ (t << 7);
|
||||
t = (y ^ (y >> 7)) & 0x00AA00AA; y = y ^ t ^ (t << 7);
|
||||
|
||||
t = (x ^ (x >>14)) & 0x0000CCCC; x = x ^ t ^ (t <<14);
|
||||
t = (y ^ (y >>14)) & 0x0000CCCC; y = y ^ t ^ (t <<14);
|
||||
|
||||
t = (x & 0xF0F0F0F0) | ((y >> 4) & 0x0F0F0F0F);
|
||||
y = ((x << 4) & 0xF0F0F0F0) | (y & 0x0F0F0F0F);
|
||||
x = t;
|
||||
|
||||
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
|
||||
x = __builtin_bswap32(x);
|
||||
y = __builtin_bswap32(y);
|
||||
#endif
|
||||
result[0] = x;
|
||||
result[1] = y;
|
||||
}
|
||||
|
||||
static void bit_transpose_8(uint32_t *result, const uint8_t *src, size_t src_stride, size_t n) {
|
||||
for(size_t i=0; i<n; i++) {
|
||||
transpose_8(result, src, src_stride);
|
||||
result += 2;
|
||||
src += 1;
|
||||
}
|
||||
}
|
||||
|
||||
static void bit_transpose_var(uint32_t *result, const uint8_t *src, size_t src_stride, size_t n, int num_strands) {
|
||||
for(size_t i=0; i<n; i++) {
|
||||
transpose_var(result, src, src_stride, num_strands);
|
||||
result += 2;
|
||||
src += 1;
|
||||
}
|
||||
}
|
||||
|
||||
void common_hal_bitops_bit_transpose(uint8_t *result, const uint8_t *src, size_t inlen, size_t num_strands) {
|
||||
if(num_strands == 8) {
|
||||
bit_transpose_8((uint32_t*)(void*)result, src, inlen/8, inlen/8);
|
||||
} else {
|
||||
bit_transpose_var((uint32_t*)(void*)result, src, inlen/num_strands, inlen/num_strands, num_strands);
|
||||
}
|
||||
}
|
27
shared-module/bitops/__init__.h
Normal file
27
shared-module/bitops/__init__.h
Normal file
@ -0,0 +1,27 @@
|
||||
/*
|
||||
* This file is part of the Circuit Python project, https://github.com/adafruit/circuitpython
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2021 Jeff Epler
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#pragma once
|
Loading…
x
Reference in New Issue
Block a user