merge from main

This commit is contained in:
Dan Halbert 2021-04-25 10:27:52 -04:00
commit 9d1fcc3b14
553 changed files with 10539 additions and 18234 deletions

View File

@ -178,8 +178,13 @@ jobs:
- "TG-Watch"
- "adafruit_feather_rp2040"
- "adafruit_itsybitsy_rp2040"
- "adafruit_neokey_trinkey_m0"
- "adafruit_proxlight_trinkey_m0"
- "adafruit_qtpy_rp2040"
- "adafruit_rotary_trinkey_m0"
- "adafruit_slide_trinkey_m0"
- "aloriumtech_evo_m51"
- "aramcon2_badge"
- "aramcon_badge_2019"
- "arduino_mkr1300"
- "arduino_mkrzero"
@ -190,6 +195,7 @@ jobs:
- "bastble"
- "bdmicro_vina_d21"
- "bdmicro_vina_d51"
- "bdmicro_vina_d51_pcb7"
- "bless_dev_board_multi_sensor"
- "blm_badge"
- "capablerobot_usbhub"
@ -284,6 +290,8 @@ jobs:
- "pewpew_m4"
- "picoplanet"
- "pimoroni_keybow2040"
- "pimoroni_picolipo_16mb"
- "pimoroni_picolipo_4mb"
- "pimoroni_picosystem"
- "pimoroni_tiny2040"
- "pirkey_m0"
@ -304,17 +312,18 @@ jobs:
- "raspberry_pi_pico"
- "raytac_mdbt50q-db-40"
- "robohatmm1_m4"
- "rotary_trinkey_m0"
- "sam32"
- "same54_xplained"
- "seeeduino_wio_terminal"
- "seeeduino_xiao"
- "sensebox_mcu"
- "serpente"
- "shirtty"
- "silicognition-m4-shim"
- "simmel"
- "snekboard"
- "sparkfun_lumidrive"
- "sparkfun_micromod_rp2040"
- "sparkfun_nrf52840_micromod"
- "sparkfun_nrf52840_mini"
- "sparkfun_pro_micro_rp2040"
@ -374,6 +383,8 @@ jobs:
python3 --version
- name: mpy-cross
run: make -C mpy-cross -j2
- name: Setup build failure matcher
run: echo "::add-matcher::$GITHUB_WORKSPACE/.github/workflows/match-build-fail.json"
- name: build
run: python3 -u build_release_files.py
working-directory: tools
@ -423,6 +434,8 @@ jobs:
python3 --version
- name: mpy-cross
run: make -C mpy-cross -j2
- name: Setup build failure matcher
run: echo "::add-matcher::$GITHUB_WORKSPACE/.github/workflows/match-build-fail.json"
- name: build
run: python3 -u build_release_files.py
working-directory: tools
@ -452,6 +465,7 @@ jobs:
- "adafruit_magtag_2.9_grayscale"
- "adafruit_metro_esp32s2"
- "artisense_rd00"
- "atmegazero_esp32s2"
- "electroniccats_bastwifi"
- "espressif_kaluga_1"
- "espressif_saola_1_wroom"
@ -484,7 +498,7 @@ jobs:
id: idf-cache
with:
path: ${{ github.workspace }}/.idf_tools
key: ${{ runner.os }}-idf-tools-${{ hashFiles('.git/modules/ports/esp32s2/esp-idf/HEAD') }}-20210304
key: ${{ runner.os }}-idf-tools-${{ hashFiles('.git/modules/ports/esp32s2/esp-idf/HEAD') }}-20210422
- name: Clone IDF submodules
run: |
(cd $IDF_PATH && git submodule update --init)
@ -521,6 +535,8 @@ jobs:
IDF_TOOLS_PATH: ${{ github.workspace }}/.idf_tools
- name: mpy-cross
run: make -C mpy-cross -j2
- name: Setup build failure matcher
run: echo "::add-matcher::$GITHUB_WORKSPACE/.github/workflows/match-build-fail.json"
- name: build
run: |
source $IDF_PATH/export.sh

14
.github/workflows/match-build-fail.json vendored Normal file
View File

@ -0,0 +1,14 @@
{
"problemMatcher": [
{
"severity": "error",
"pattern": [
{
"regexp": "^(Build .+ and \\x1b\\[31mfailed\\x1b\\[0m)$",
"message": 1
}
],
"owner": "build-failed"
}
]
}

6
.gitmodules vendored
View File

@ -171,6 +171,9 @@
[submodule "frozen/Adafruit_CircuitPython_LC709203F"]
path = frozen/Adafruit_CircuitPython_LC709203F
url = https://github.com/adafruit/Adafruit_CircuitPython_LC709203F
[submodule "frozen/Adafruit_CircuitPython_SimpleMath"]
path = frozen/Adafruit_CircuitPython_SimpleMath
url = https://github.com/adafruit/Adafruit_CircuitPython_SimpleMath
[submodule "ports/raspberrypi/sdk"]
path = ports/raspberrypi/sdk
url = https://github.com/adafruit/pico-sdk.git
@ -178,3 +181,6 @@
path = data/nvm.toml
url = https://github.com/adafruit/nvm.toml.git
branch = main
[submodule "frozen/Adafruit_CircuitPython_MIDI"]
path = frozen/Adafruit_CircuitPython_MIDI
url = https://github.com/adafruit/Adafruit_CircuitPython_MIDI

View File

@ -284,7 +284,7 @@ html_static_path = ['docs/static']
# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
# directly to the root of the documentation.
html_extra_path = ["docs/robots.txt"]
#html_extra_path = []
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
@ -489,6 +489,8 @@ class CoreModuleTransform(SphinxTransform):
def setup(app):
app.add_css_file("customstyle.css")
app.add_css_file("filter.css")
app.add_js_file("filter.js")
app.add_config_value('redirects_file', 'redirects', 'env')
app.connect('builder-inited', generate_redirects)
app.add_transform(CoreModuleTransform)

View File

@ -78,6 +78,10 @@ bleio_service_obj_t *common_hal_bleio_characteristic_get_service(bleio_character
return self->service;
}
size_t common_hal_bleio_characteristic_get_max_length(bleio_characteristic_obj_t *self) {
return self->max_length;
}
size_t common_hal_bleio_characteristic_get_value(bleio_characteristic_obj_t *self, uint8_t *buf, size_t len) {
// Do GATT operations only if this characteristic has been added to a registered service.
if (self->handle != BLE_GATT_HANDLE_INVALID) {

View File

@ -81,7 +81,7 @@ void bleio_packet_buffer_update(bleio_packet_buffer_obj_t *self, mp_buffer_info_
void common_hal_bleio_packet_buffer_construct(
bleio_packet_buffer_obj_t *self, bleio_characteristic_obj_t *characteristic,
size_t buffer_size) {
size_t buffer_size, size_t max_packet_size) {
self->characteristic = characteristic;
self->client = self->characteristic->service->is_remote;
@ -101,7 +101,7 @@ void common_hal_bleio_packet_buffer_construct(
}
if (incoming) {
if (!ringbuf_alloc(&self->ringbuf, buffer_size * (sizeof(uint16_t) + characteristic->max_length), false)) {
if (!ringbuf_alloc(&self->ringbuf, buffer_size * (sizeof(uint16_t) + max_packet_size), false)) {
mp_raise_ValueError(translate("Buffer too large and unable to allocate"));
}
}
@ -110,12 +110,13 @@ void common_hal_bleio_packet_buffer_construct(
self->packet_queued = false;
self->pending_index = 0;
self->pending_size = 0;
self->outgoing[0] = m_malloc(characteristic->max_length, false);
self->outgoing[1] = m_malloc(characteristic->max_length, false);
self->outgoing[0] = m_malloc(max_packet_size, false);
self->outgoing[1] = m_malloc(max_packet_size, false);
} else {
self->outgoing[0] = NULL;
self->outgoing[1] = NULL;
}
self->max_packet_size = max_packet_size;
bleio_characteristic_set_observer(self->characteristic, self);
}
@ -243,15 +244,16 @@ mp_int_t common_hal_bleio_packet_buffer_get_outgoing_packet_length(bleio_packet_
if (self->conn_handle != BLE_CONN_HANDLE_INVALID) {
bleio_connection_internal_t *connection = bleio_conn_handle_to_connection(self->conn_handle);
if (connection) {
return MIN(common_hal_bleio_connection_get_max_packet_length(connection),
self->characteristic->max_length);
return MIN(MIN(common_hal_bleio_connection_get_max_packet_length(connection),
self->max_packet_size),
self->characteristic->max_length);
}
}
// There's no current connection, so we don't know the MTU, and
// we can't tell what the largest outgoing packet length would be.
return -1;
}
return self->characteristic->max_length;
return MIN(self->characteristic->max_length, self->max_packet_size);
}
bool common_hal_bleio_packet_buffer_deinited(bleio_packet_buffer_obj_t *self) {

View File

@ -42,6 +42,7 @@ typedef struct {
// We remember the conn_handle so we can do a NOTIFY/INDICATE to a client.
// We can find out the conn_handle on a Characteristic write or a CCCD write (but not a read).
volatile uint16_t conn_handle;
uint16_t max_packet_size;
uint8_t pending_index;
uint8_t write_type;
bool client;

View File

@ -18,7 +18,7 @@ Start libraries with the cookiecutter
Cookiecutter is a tool that lets you bootstrap a new repo based on another repo.
We've made one `here <https://github.com/adafruit/cookiecutter-adafruit-circuitpython>`_
for CircuitPython libraries that include configs for Travis CI and ReadTheDocs
along with a setup.py, license, code of conduct and readme.
along with a setup.py, license, code of conduct, readme among other files.
.. code-block::sh
@ -252,7 +252,7 @@ At the class level document what class does and how to initialize it::
"""DS3231 real-time clock.
:param ~busio.I2C i2c_bus: The I2C bus the DS3231 is connected to.
:param int address: The I2C address of the device.
:param int address: The I2C address of the device. Defaults to :const:`0x40`
"""
def __init__(self, i2c_bus, address=0x40):
@ -267,7 +267,7 @@ Renders as:
DS3231 real-time clock.
:param ~busio.I2C i2c_bus: The I2C bus the DS3231 is connected to.
:param int address: The I2C address of the device.
:param int address: The I2C address of the device. Defaults to :const:`0x40`
Attributes
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -516,6 +516,15 @@ when using ``const()``, keep in mind these general guide lines:
- If user will not need access to variable, prefix name with a leading
underscore, ex: ``_SOME_CONST``.
Libraries Examples
------------------
When adding examples, cookiecutter will add a ``<name>_simpletest.py`` file in the examples directory for you.
Be sure to include code with the library minimal functionalities to work on a device.
You could other examples if needed featuring different
functionalities of the library.
If you add additional examples, be sure to include them in the ``examples.rst``. Naming of the examples
files should use the name of the library followed by a description, using underscore to separate them.
Sensor properties and units
--------------------------------------------------------------------------------
@ -536,7 +545,7 @@ properties.
+-----------------------+-----------------------+-------------------------------------------------------------------------+
| ``gyro`` | (float, float, float) | x, y, z radians per second |
+-----------------------+-----------------------+-------------------------------------------------------------------------+
| ``temperature`` | float | degrees centigrade |
| ``temperature`` | float | degrees Celsius |
+-----------------------+-----------------------+-------------------------------------------------------------------------+
| ``CO2`` | float | measured CO2 in ppm |
+-----------------------+-----------------------+-------------------------------------------------------------------------+
@ -544,9 +553,9 @@ properties.
+-----------------------+-----------------------+-------------------------------------------------------------------------+
| ``TVOC`` | float | Total Volatile Organic Compounds in ppb |
+-----------------------+-----------------------+-------------------------------------------------------------------------+
| ``distance`` | float | centimeters |
| ``distance`` | float | centimeters (cm) |
+-----------------------+-----------------------+-------------------------------------------------------------------------+
| ``proximity`` | int | non-unit-specifc proximity values (monotonic but not actual distance) |
| ``proximity`` | int | non-unit-specific proximity values (monotonic but not actual distance) |
+-----------------------+-----------------------+-------------------------------------------------------------------------+
| ``light`` | float | non-unit-specific light levels (should be monotonic but is not lux) |
+-----------------------+-----------------------+-------------------------------------------------------------------------+
@ -568,7 +577,7 @@ properties.
+-----------------------+-----------------------+-------------------------------------------------------------------------+
| ``duty_cycle`` | int | 16-bit PWM duty cycle (regardless of output resolution) |
+-----------------------+-----------------------+-------------------------------------------------------------------------+
| ``frequency`` | int | Hertz |
| ``frequency`` | int | Hertz (Hz) |
+-----------------------+-----------------------+-------------------------------------------------------------------------+
| ``value`` | bool | Digital logic |
+-----------------------+-----------------------+-------------------------------------------------------------------------+
@ -592,9 +601,8 @@ mimic the structure in ``shared-bindings``.
To test your native modules or core enhancements, follow these Adafruit Learning Guides
for building local firmware to flash onto your device(s):
`SAMD21 - Build Firmware Learning Guide <https://learn.adafruit.com/micropython-for-samd21/build-firmware>`_
`Build CircuitPython <https://learn.adafruit.com/building-circuitpython>`_
`ESP8266 - Build Firmware Learning Guide <https://learn.adafruit.com/building-and-running-micropython-on-the-esp8266/overview>`_
MicroPython compatibility
--------------------------------------------------------------------------------

View File

@ -14,6 +14,33 @@ hold/accumulate various objects.
Classes
-------
.. function:: deque(iterable, maxlen[, flags])
Deques (double-ended queues) are a list-like container that support O(1)
appends and pops from either side of the deque. New deques are created
using the following arguments:
- *iterable* must be the empty tuple, and the new deque is created empty.
- *maxlen* must be specified and the deque will be bounded to this
maximum length. Once the deque is full, any new items added will
discard items from the opposite end.
- The optional *flags* can be 1 to check for overflow when adding items.
As well as supporting `bool` and `len`, deque objects have the following
methods:
.. method:: deque.append(x)
Add *x* to the right side of the deque.
Raises IndexError if overflow checking is enabled and there is no more room left.
.. method:: deque.popleft()
Remove and return an item from the left side of the deque.
Raises IndexError if no items are present.
.. function:: namedtuple(name, fields)
This is factory function to create a new namedtuple type with a specific

View File

@ -39,8 +39,6 @@ with the ``u`` prefix dropped:
sys.rst
uctypes.rst
uselect.rst
usocket.rst
ussl.rst
uzlib.rst
Omitted functions in the ``string`` library

View File

@ -81,6 +81,9 @@ Functions
in a row and the lock-depth will increase, and then `heap_unlock()` must be
called the same number of times to make the heap available again.
If the REPL becomes active with the heap locked then it will be forcefully
unlocked.
.. function:: kbd_intr(chr)
Set the character that will raise a `KeyboardInterrupt` exception. By

View File

@ -10,41 +10,101 @@ This module implements regular expression operations. Regular expression
syntax supported is a subset of CPython ``re`` module (and actually is
a subset of POSIX extended regular expressions).
Supported operators are:
Supported operators and special sequences are:
``'.'``
``.``
Match any character.
``'[...]'``
``[...]``
Match set of characters. Individual characters and ranges are supported,
including negated sets (e.g. ``[^a-c]``).
``'^'``
``^``
Match the start of the string.
``'$'``
``$``
Match the end of the string.
``'?'``
``?``
Match zero or one of the previous sub-pattern.
``'*'``
``*``
Match zero or more of the previous sub-pattern.
``'+'``
``+``
Match one or more of the previous sub-pattern.
``'??'``
``??``
Non-greedy version of ``?``, match zero or one, with the preference
for zero.
``'*?'``
``*?``
Non-greedy version of ``*``, match zero or more, with the preference
for the shortest match.
``'+?'``
``+?``
Non-greedy version of ``+``, match one or more, with the preference
for the shortest match.
``'|'``
``|``
Match either the left-hand side or the right-hand side sub-patterns of
this operator.
``'(...)'``
``(...)``
Grouping. Each group is capturing (a substring it captures can be accessed
with `match.group()` method).
**NOT SUPPORTED**: Counted repetitions (``{m,n}``), more advanced assertions
(``\b``, ``\B``), named groups (``(?P<name>...)``), non-capturing groups
(``(?:...)``), etc.
``\d``
Matches digit. Equivalent to ``[0-9]``.
``\D``
Matches non-digit. Equivalent to ``[^0-9]``.
``\s``
Matches whitespace. Equivalent to ``[ \t-\r]``.
``\S``
Matches non-whitespace. Equivalent to ``[^ \t-\r]``.
``\w``
Matches "word characters" (ASCII only). Equivalent to ``[A-Za-z0-9_]``.
``\W``
Matches non "word characters" (ASCII only). Equivalent to ``[^A-Za-z0-9_]``.
``\``
Escape character. Any other character following the backslash, except
for those listed above, is taken literally. For example, ``\*`` is
equivalent to literal ``*`` (not treated as the ``*`` operator).
Note that ``\r``, ``\n``, etc. are not handled specially, and will be
equivalent to literal letters ``r``, ``n``, etc. Due to this, it's
not recommended to use raw Python strings (``r""``) for regular
expressions. For example, ``r"\r\n"`` when used as the regular
expression is equivalent to ``"rn"``. To match CR character followed
by LF, use ``"\r\n"``.
**NOT SUPPORTED**:
* counted repetitions (``{m,n}``)
* named groups (``(?P<name>...)``)
* non-capturing groups (``(?:...)``)
* more advanced assertions (``\b``, ``\B``)
* special character escapes like ``\r``, ``\n`` - use Python's own escaping
instead
* etc.
Example::
import ure
# As ure doesn't support escapes itself, use of r"" strings is not
# recommended.
regex = ure.compile("[\r\n]")
regex.split("line1\rline2\nline3\r\n")
# Result:
# ['line1', 'line2', 'line3', '', '']
Functions
---------
@ -64,6 +124,22 @@ Functions
string for first position which matches regex (which still may be
0 if regex is anchored).
.. function:: sub(regex_str, replace, string, count=0, flags=0)
Compile *regex_str* and search for it in *string*, replacing all matches
with *replace*, and returning the new string.
*replace* can be a string or a function. If it is a string then escape
sequences of the form ``\<number>`` and ``\g<number>`` can be used to
expand to the corresponding group (or an empty string for unmatched groups).
If *replace* is a function then it must take a single argument (the match)
and should return a replacement string.
If *count* is specified and non-zero then substitution will stop after
this many substitutions are made. The *flags* argument is ignored.
Note: availability of this function depends on MicroPython port.
.. data:: DEBUG
Flag value, display debug information about compiled expression.
@ -79,8 +155,10 @@ Compiled regular expression. Instances of this class are created using
.. method:: regex.match(string)
regex.search(string)
regex.sub(replace, string, count=0, flags=0)
Similar to the module-level functions :meth:`match` and :meth:`search`.
Similar to the module-level functions :meth:`match`, :meth:`search`
and :meth:`sub`.
Using methods is (much) more efficient if the same regex is applied to
multiple strings.
@ -93,9 +171,31 @@ Compiled regular expression. Instances of this class are created using
Match objects
-------------
Match objects as returned by `match()` and `search()` methods.
Match objects as returned by `match()` and `search()` methods, and passed
to the replacement function in `sub()`.
.. method:: match.group([index])
Return matching (sub)string. *index* is 0 for entire match,
1 and above for each capturing group. Only numeric groups are supported.
.. method:: match.groups()
Return a tuple containing all the substrings of the groups of the match.
Note: availability of this method depends on MicroPython port.
.. method:: match.start([index])
match.end([index])
Return the index in the original string of the start or end of the
substring group that was matched. *index* defaults to the entire
group, otherwise it will select a group.
Note: availability of these methods depends on MicroPython port.
.. method:: match.span([index])
Returns the 2-tuple ``(match.start(index), match.end(index))``.
Note: availability of this method depends on MicroPython port.

View File

@ -13,19 +13,91 @@ module is to define data structure layout with about the same power as the
C language allows, and then access it using familiar dot-syntax to reference
sub-fields.
.. warning::
``uctypes`` module allows access to arbitrary memory addresses of the
machine (including I/O and control registers). Uncareful usage of it
may lead to crashes, data loss, and even hardware malfunction.
.. seealso::
Module :mod:`struct`
Standard Python way to access binary data structures (doesn't scale
well to large and complex structures).
Usage examples::
import uctypes
# Example 1: Subset of ELF file header
# https://wikipedia.org/wiki/Executable_and_Linkable_Format#File_header
ELF_HEADER = {
"EI_MAG": (0x0 | uctypes.ARRAY, 4 | uctypes.UINT8),
"EI_DATA": 0x5 | uctypes.UINT8,
"e_machine": 0x12 | uctypes.UINT16,
}
# "f" is an ELF file opened in binary mode
buf = f.read(uctypes.sizeof(ELF_HEADER, uctypes.LITTLE_ENDIAN))
header = uctypes.struct(uctypes.addressof(buf), ELF_HEADER, uctypes.LITTLE_ENDIAN)
assert header.EI_MAG == b"\x7fELF"
assert header.EI_DATA == 1, "Oops, wrong endianness. Could retry with uctypes.BIG_ENDIAN."
print("machine:", hex(header.e_machine))
# Example 2: In-memory data structure, with pointers
COORD = {
"x": 0 | uctypes.FLOAT32,
"y": 4 | uctypes.FLOAT32,
}
STRUCT1 = {
"data1": 0 | uctypes.UINT8,
"data2": 4 | uctypes.UINT32,
"ptr": (8 | uctypes.PTR, COORD),
}
# Suppose you have address of a structure of type STRUCT1 in "addr"
# uctypes.NATIVE is optional (used by default)
struct1 = uctypes.struct(addr, STRUCT1, uctypes.NATIVE)
print("x:", struct1.ptr[0].x)
# Example 3: Access to CPU registers. Subset of STM32F4xx WWDG block
WWDG_LAYOUT = {
"WWDG_CR": (0, {
# BFUINT32 here means size of the WWDG_CR register
"WDGA": 7 << uctypes.BF_POS | 1 << uctypes.BF_LEN | uctypes.BFUINT32,
"T": 0 << uctypes.BF_POS | 7 << uctypes.BF_LEN | uctypes.BFUINT32,
}),
"WWDG_CFR": (4, {
"EWI": 9 << uctypes.BF_POS | 1 << uctypes.BF_LEN | uctypes.BFUINT32,
"WDGTB": 7 << uctypes.BF_POS | 2 << uctypes.BF_LEN | uctypes.BFUINT32,
"W": 0 << uctypes.BF_POS | 7 << uctypes.BF_LEN | uctypes.BFUINT32,
}),
}
WWDG = uctypes.struct(0x40002c00, WWDG_LAYOUT)
WWDG.WWDG_CFR.WDGTB = 0b10
WWDG.WWDG_CR.WDGA = 1
print("Current counter:", WWDG.WWDG_CR.T)
Defining structure layout
-------------------------
Structure layout is defined by a "descriptor" - a Python dictionary which
encodes field names as keys and other properties required to access them as
associated values. Currently, uctypes requires explicit specification of
offsets for each field. Offset are given in bytes from a structure start.
associated values::
{
"field1": <properties>,
"field2": <properties>,
...
}
Currently, ``uctypes`` requires explicit specification of offsets for each
field. Offset are given in bytes from the structure start.
Following are encoding examples for various field types:
@ -33,7 +105,7 @@ Following are encoding examples for various field types:
"field_name": offset | uctypes.UINT32
in other words, value is scalar type identifier ORed with field offset
in other words, the value is a scalar type identifier ORed with a field offset
(in bytes) from the start of the structure.
* Recursive structures::
@ -43,9 +115,11 @@ Following are encoding examples for various field types:
"b1": 1 | uctypes.UINT8,
})
i.e. value is a 2-tuple, first element of which is offset, and second is
i.e. value is a 2-tuple, first element of which is an offset, and second is
a structure descriptor dictionary (note: offsets in recursive descriptors
are relative to the structure it defines).
are relative to the structure it defines). Of course, recursive structures
can be specified not just by a literal dictionary, but by referring to a
structure descriptor dictionary (defined earlier) by name.
* Arrays of primitive types::
@ -53,42 +127,42 @@ Following are encoding examples for various field types:
i.e. value is a 2-tuple, first element of which is ARRAY flag ORed
with offset, and second is scalar element type ORed number of elements
in array.
in the array.
* Arrays of aggregate types::
"arr2": (offset | uctypes.ARRAY, size, {"b": 0 | uctypes.UINT8}),
i.e. value is a 3-tuple, first element of which is ARRAY flag ORed
with offset, second is a number of elements in array, and third is
descriptor of element type.
with offset, second is a number of elements in the array, and third is
a descriptor of element type.
* Pointer to a primitive type::
"ptr": (offset | uctypes.PTR, uctypes.UINT8),
i.e. value is a 2-tuple, first element of which is PTR flag ORed
with offset, and second is scalar element type.
with offset, and second is a scalar element type.
* Pointer to an aggregate type::
"ptr2": (offset | uctypes.PTR, {"b": 0 | uctypes.UINT8}),
i.e. value is a 2-tuple, first element of which is PTR flag ORed
with offset, second is descriptor of type pointed to.
with offset, second is a descriptor of type pointed to.
* Bitfields::
"bitf0": offset | uctypes.BFUINT16 | lsbit << uctypes.BF_POS | bitsize << uctypes.BF_LEN,
i.e. value is type of scalar value containing given bitfield (typenames are
similar to scalar types, but prefixes with "BF"), ORed with offset for
i.e. value is a type of scalar value containing given bitfield (typenames are
similar to scalar types, but prefixes with ``BF``), ORed with offset for
scalar value containing the bitfield, and further ORed with values for
bit offset and bit length of the bitfield within scalar value, shifted by
BF_POS and BF_LEN positions, respectively. Bitfield position is counted
from the least significant bit, and is the number of right-most bit of a
field (in other words, it's a number of bits a scalar needs to be shifted
right to extract the bitfield).
bit position and bit length of the bitfield within the scalar value, shifted by
BF_POS and BF_LEN bits, respectively. A bitfield position is counted
from the least significant bit of the scalar (having position of 0), and
is the number of right-most bit of a field (in other words, it's a number
of bits a scalar needs to be shifted right to extract the bitfield).
In the example above, first a UINT16 value will be extracted at offset 0
(this detail may be important when accessing hardware registers, where
@ -128,10 +202,11 @@ Module contents
Layout type for a native structure - with data endianness and alignment
conforming to the ABI of the system on which MicroPython runs.
.. function:: sizeof(struct)
.. function:: sizeof(struct, layout_type=NATIVE)
Return size of data structure in bytes. Argument can be either structure
class or specific instantiated structure object (or its aggregate field).
Return size of data structure in bytes. The *struct* argument can be
either a structure class or a specific instantiated structure object
(or its aggregate field).
.. function:: addressof(obj)
@ -153,6 +228,35 @@ Module contents
so it can be both written too, and you will access current value
at the given memory address.
.. data:: UINT8
INT8
UINT16
INT16
UINT32
INT32
UINT64
INT64
Integer types for structure descriptors. Constants for 8, 16, 32,
and 64 bit types are provided, both signed and unsigned.
.. data:: FLOAT32
FLOAT64
Floating-point types for structure descriptors.
.. data:: VOID
``VOID`` is an alias for ``UINT8``, and is provided to conviniently define
C's void pointers: ``(uctypes.PTR, uctypes.VOID)``.
.. data:: PTR
ARRAY
Type constants for pointers and arrays. Note that there is no explicit
constant for structures, it's implicit: an aggregate type without ``PTR``
or ``ARRAY`` flags is a structure.
Structure descriptors and instantiating structure objects
---------------------------------------------------------
@ -165,7 +269,7 @@ following sources:
system. Lookup these addresses in datasheet for a particular MCU/SoC.
* As a return value from a call to some FFI (Foreign Function Interface)
function.
* From uctypes.addressof(), when you want to pass arguments to an FFI
* From `uctypes.addressof()`, when you want to pass arguments to an FFI
function, or alternatively, to access some data for I/O (for example,
data read from a file or network socket).
@ -183,30 +287,41 @@ the standard subscript operator ``[]`` - both read and assigned to.
If a field is a pointer, it can be dereferenced using ``[0]`` syntax
(corresponding to C ``*`` operator, though ``[0]`` works in C too).
Subscripting a pointer with other integer values but 0 are supported too,
Subscripting a pointer with other integer values but 0 are also supported,
with the same semantics as in C.
Summing up, accessing structure fields generally follows C syntax,
Summing up, accessing structure fields generally follows the C syntax,
except for pointer dereference, when you need to use ``[0]`` operator
instead of ``*``.
Limitations
-----------
Accessing non-scalar fields leads to allocation of intermediate objects
1. Accessing non-scalar fields leads to allocation of intermediate objects
to represent them. This means that special care should be taken to
layout a structure which needs to be accessed when memory allocation
is disabled (e.g. from an interrupt). The recommendations are:
* Avoid nested structures. For example, instead of
* Avoid accessing nested structures. For example, instead of
``mcu_registers.peripheral_a.register1``, define separate layout
descriptors for each peripheral, to be accessed as
``peripheral_a.register1``.
* Avoid other non-scalar data, like array. For example, instead of
``peripheral_a.register[0]`` use ``peripheral_a.register0``.
``peripheral_a.register1``. Or just cache a particular peripheral:
``peripheral_a = mcu_registers.peripheral_a``. If a register
consists of multiple bitfields, you would need to cache references
to a particular register: ``reg_a = mcu_registers.peripheral_a.reg_a``.
* Avoid other non-scalar data, like arrays. For example, instead of
``peripheral_a.register[0]`` use ``peripheral_a.register0``. Again,
an alternative is to cache intermediate values, e.g.
``register0 = peripheral_a.register[0]``.
Note that these recommendations will lead to decreased readability
and conciseness of layouts, so they should be used only if the need
to access structure fields without allocation is anticipated (it's
even possible to define 2 parallel layouts - one for normal usage,
and a restricted one to use when memory allocation is prohibited).
2. Range of offsets supported by the ``uctypes`` module is limited.
The exact range supported is considered an implementation detail,
and the general suggestion is to split structure definitions to
cover from a few kilobytes to a few dozen of kilobytes maximum.
In most cases, this is a natural situation anyway, e.g. it doesn't make
sense to define all registers of an MCU (spread over 32-bit address
space) in one structure, but rather a peripheral block by peripheral
block. In some extreme cases, you may need to split a structure in
several parts artificially (e.g. if accessing native data structure
with multi-megabyte array in the middle, though that would be a very
synthetic case).

View File

@ -47,13 +47,18 @@ Methods
*eventmask* defaults to ``uselect.POLLIN | uselect.POLLOUT``.
It is OK to call this function multiple times for the same *obj*.
Successive calls will update *obj*'s eventmask to the value of
*eventmask* (i.e. will behave as `modify()`).
.. method:: poll.unregister(obj)
Unregister *obj* from polling.
.. method:: poll.modify(obj, eventmask)
Modify the *eventmask* for *obj*.
Modify the *eventmask* for *obj*. If *obj* is not registered, `OSError`
is raised with error of ENOENT.
.. method:: poll.poll(timeout=-1)

View File

@ -1,336 +0,0 @@
*******************************
:mod:`usocket` -- socket module
*******************************
.. include:: ../templates/unsupported_in_circuitpython.inc
.. module:: usocket
:synopsis: socket module
|see_cpython_module| :mod:`cpython:socket`.
This module provides access to the BSD socket interface.
.. admonition:: Difference to CPython
:class: attention
For efficiency and consistency, socket objects in MicroPython implement a ``stream``
(file-like) interface directly. In CPython, you need to convert a socket to
a file-like object using `makefile()` method. This method is still supported
by MicroPython (but is a no-op), so where compatibility with CPython matters,
be sure to use it.
Socket address format(s)
------------------------
The native socket address format of the ``usocket`` module is an opaque data type
returned by `getaddrinfo` function, which must be used to resolve textual address
(including numeric addresses)::
sockaddr = usocket.getaddrinfo('www.micropython.org', 80)[0][-1]
# You must use getaddrinfo() even for numeric addresses
sockaddr = usocket.getaddrinfo('127.0.0.1', 80)[0][-1]
# Now you can use that address
sock.connect(addr)
Using `getaddrinfo` is the most efficient (both in terms of memory and processing
power) and portable way to work with addresses.
However, ``socket`` module (note the difference with native MicroPython
``usocket`` module described here) provides CPython-compatible way to specify
addresses using tuples, as described below.
Summing up:
* Always use `getaddrinfo` when writing portable applications.
* Tuple addresses described below can be used as a shortcut for
quick hacks and interactive use, if your port supports them.
Tuple address format for ``socket`` module:
* IPv4: *(ipv4_address, port)*, where *ipv4_address* is a string with
dot-notation numeric IPv4 address, e.g. ``"8.8.8.8"``, and *port* is and
integer port number in the range 1-65535. Note the domain names are not
accepted as *ipv4_address*, they should be resolved first using
`usocket.getaddrinfo()`.
* IPv6: *(ipv6_address, port, flowinfo, scopeid)*, where *ipv6_address*
is a string with colon-notation numeric IPv6 address, e.g. ``"2001:db8::1"``,
and *port* is an integer port number in the range 1-65535. *flowinfo*
must be 0. *scopeid* is the interface scope identifier for link-local
addresses. Note the domain names are not accepted as *ipv6_address*,
they should be resolved first using `usocket.getaddrinfo()`.
Functions
---------
.. function:: socket(af=AF_INET, type=SOCK_STREAM, proto=IPPROTO_TCP)
Create a new socket using the given address family, socket type and
protocol number. Note that specifying *proto* in most cases is not
required (and not recommended, as some MicroPython ports may omit
``IPPROTO_*`` constants). Instead, *type* argument will select needed
protocol automatically::
# Create STREAM TCP socket
socket(AF_INET, SOCK_STREAM)
# Create DGRAM UDP socket
socket(AF_INET, SOCK_DGRAM)
.. function:: getaddrinfo(host, port)
Translate the host/port argument into a sequence of 5-tuples that contain all the
necessary arguments for creating a socket connected to that service. The list of
5-tuples has following structure::
(family, type, proto, canonname, sockaddr)
The following example shows how to connect to a given url::
s = usocket.socket()
s.connect(usocket.getaddrinfo('www.micropython.org', 80)[0][-1])
.. admonition:: Difference to CPython
:class: attention
CPython raises a ``socket.gaierror`` exception (`OSError` subclass) in case
of error in this function. MicroPython doesn't have ``socket.gaierror``
and raises OSError directly. Note that error numbers of `getaddrinfo()`
form a separate namespace and may not match error numbers from
:py:mod:`uerrno` module. To distinguish `getaddrinfo()` errors, they are
represented by negative numbers, whereas standard system errors are
positive numbers (error numbers are accessible using ``e.args[0]`` property
from an exception object). The use of negative values is a provisional
detail which may change in the future.
.. function:: inet_ntop(af, bin_addr)
Convert a binary network address *bin_addr* of the given address family *af*
to a textual representation::
>>> usocket.inet_ntop(usocket.AF_INET, b"\x7f\0\0\1")
'127.0.0.1'
.. function:: inet_pton(af, txt_addr)
Convert a textual network address *txt_addr* of the given address family *af*
to a binary representation::
>>> usocket.inet_pton(usocket.AF_INET, "1.2.3.4")
b'\x01\x02\x03\x04'
Constants
---------
.. data:: AF_INET
AF_INET6
Address family types. Availability depends on a particular ``MicroPython port``.
.. data:: SOCK_STREAM
SOCK_DGRAM
Socket types.
.. data:: IPPROTO_UDP
IPPROTO_TCP
IP protocol numbers. Availability depends on a particular ``MicroPython port``.
Note that you don't need to specify these in a call to `usocket.socket()`,
because `SOCK_STREAM` socket type automatically selects `IPPROTO_TCP`, and
`SOCK_DGRAM` - `IPPROTO_UDP`. Thus, the only real use of these constants
is as an argument to `usocket.socket.setsockopt()`.
.. data:: usocket.SOL_*
Socket option levels (an argument to `usocket.socket.setsockopt()`). The exact
inventory depends on a ``MicroPython port``.
.. data:: usocket.SO_*
Socket options (an argument to `usocket.socket.setsockopt()`). The exact
inventory depends on a ``MicroPython port``.
Constants specific to WiPy:
.. data:: IPPROTO_SEC
Special protocol value to create SSL-compatible socket.
class socket
============
Methods
-------
.. method:: socket.close()
Mark the socket closed and release all resources. Once that happens, all future operations
on the socket object will fail. The remote end will receive EOF indication if
supported by protocol.
Sockets are automatically closed when they are garbage-collected, but it is recommended
to `close()` them explicitly as soon you finished working with them.
.. method:: socket.bind(address)
Bind the socket to *address*. The socket must not already be bound.
.. method:: socket.listen([backlog])
Enable a server to accept connections. If *backlog* is specified, it must be at least 0
(if it's lower, it will be set to 0); and specifies the number of unaccepted connections
that the system will allow before refusing new connections. If not specified, a default
reasonable value is chosen.
.. method:: socket.accept()
Accept a connection. The socket must be bound to an address and listening for connections.
The return value is a pair (conn, address) where conn is a new socket object usable to send
and receive data on the connection, and address is the address bound to the socket on the
other end of the connection.
.. method:: socket.connect(address)
Connect to a remote socket at *address*.
.. method:: socket.send(bytes)
Send data to the socket. The socket must be connected to a remote socket.
Returns number of bytes sent, which may be smaller than the length of data
("short write").
.. method:: socket.sendall(bytes)
Send all data to the socket. The socket must be connected to a remote socket.
Unlike `send()`, this method will try to send all of data, by sending data
chunk by chunk consecutively.
The behavior of this method on non-blocking sockets is undefined. Due to this,
on MicroPython, it's recommended to use `write()` method instead, which
has the same "no short writes" policy for blocking sockets, and will return
number of bytes sent on non-blocking sockets.
.. method:: socket.recv(bufsize)
Receive data from the socket. The return value is a bytes object representing the data
received. The maximum amount of data to be received at once is specified by bufsize.
.. method:: socket.sendto(bytes, address)
Send data to the socket. The socket should not be connected to a remote socket, since the
destination socket is specified by *address*.
.. method:: socket.recvfrom(bufsize)
Receive data from the socket. The return value is a pair *(bytes, address)* where *bytes* is a
bytes object representing the data received and *address* is the address of the socket sending
the data.
.. method:: socket.setsockopt(level, optname, value)
Set the value of the given socket option. The needed symbolic constants are defined in the
socket module (SO_* etc.). The *value* can be an integer or a bytes-like object representing
a buffer.
.. method:: socket.settimeout(value)
**Note**: Not every port supports this method, see below.
Set a timeout on blocking socket operations. The value argument can be a nonnegative floating
point number expressing seconds, or None. If a non-zero value is given, subsequent socket operations
will raise an `OSError` exception if the timeout period value has elapsed before the operation has
completed. If zero is given, the socket is put in non-blocking mode. If None is given, the socket
is put in blocking mode.
Not every ``MicroPython port`` supports this method. A more portable and
generic solution is to use `uselect.poll` object. This allows to wait on
multiple objects at the same time (and not just on sockets, but on generic
``stream`` objects which support polling). Example::
# Instead of:
s.settimeout(1.0) # time in seconds
s.read(10) # may timeout
# Use:
poller = uselect.poll()
poller.register(s, uselect.POLLIN)
res = poller.poll(1000) # time in milliseconds
if not res:
# s is still not ready for input, i.e. operation timed out
.. admonition:: Difference to CPython
:class: attention
CPython raises a ``socket.timeout`` exception in case of timeout,
which is an `OSError` subclass. MicroPython raises an OSError directly
instead. If you use ``except OSError:`` to catch the exception,
your code will work both in MicroPython and CPython.
.. method:: socket.setblocking(flag)
Set blocking or non-blocking mode of the socket: if flag is false, the socket is set to non-blocking,
else to blocking mode.
This method is a shorthand for certain `settimeout()` calls:
* ``sock.setblocking(True)`` is equivalent to ``sock.settimeout(None)``
* ``sock.setblocking(False)`` is equivalent to ``sock.settimeout(0)``
.. method:: socket.makefile(mode='rb', buffering=0)
Return a file object associated with the socket. The exact returned type depends on the arguments
given to makefile(). The support is limited to binary modes only ('rb', 'wb', and 'rwb').
CPython's arguments: *encoding*, *errors* and *newline* are not supported.
.. admonition:: Difference to CPython
:class: attention
As MicroPython doesn't support buffered streams, values of *buffering*
parameter is ignored and treated as if it was 0 (unbuffered).
.. admonition:: Difference to CPython
:class: attention
Closing the file object returned by makefile() WILL close the
original socket as well.
.. method:: socket.read([size])
Read up to size bytes from the socket. Return a bytes object. If *size* is not given, it
reads all data available from the socket until EOF; as such the method will not return until
the socket is closed. This function tries to read as much data as
requested (no "short reads"). This may be not possible with
non-blocking socket though, and then less data will be returned.
.. method:: socket.readinto(buf[, nbytes])
Read bytes into the *buf*. If *nbytes* is specified then read at most
that many bytes. Otherwise, read at most *len(buf)* bytes. Just as
`read()`, this method follows "no short reads" policy.
Return value: number of bytes read and stored into *buf*.
.. method:: socket.readline()
Read a line, ending in a newline character.
Return value: the line read.
.. method:: socket.write(buf)
Write the buffer of bytes to the socket. This function will try to
write all data to a socket (no "short writes"). This may be not possible
with a non-blocking socket though, and returned value will be less than
the length of *buf*.
Return value: number of bytes written.
.. exception:: usocket.error
MicroPython does NOT have this exception.
.. admonition:: Difference to CPython
:class: attention
CPython used to have a ``socket.error`` exception which is now deprecated,
and is an alias of `OSError`. In MicroPython, use `OSError` directly.

View File

@ -1,50 +0,0 @@
:mod:`ussl` -- SSL/TLS module
=============================
.. include:: ../templates/unsupported_in_circuitpython.inc
.. module:: ussl
:synopsis: TLS/SSL wrapper for socket objects
|see_cpython_module| :mod:`cpython:ssl`.
This module provides access to Transport Layer Security (previously and
widely known as “Secure Sockets Layer”) encryption and peer authentication
facilities for network sockets, both client-side and server-side.
Functions
---------
.. function:: ussl.wrap_socket(sock, server_side=False, keyfile=None, certfile=None, cert_reqs=CERT_NONE, ca_certs=None)
Takes a ``stream`` *sock* (usually usocket.socket instance of ``SOCK_STREAM`` type),
and returns an instance of ssl.SSLSocket, which wraps the underlying stream in
an SSL context. Returned object has the usual ``stream`` interface methods like
``read()``, ``write()``, etc. In MicroPython, the returned object does not expose
socket interface and methods like ``recv()``, ``send()``. In particular, a
server-side SSL socket should be created from a normal socket returned from
:meth:`~usocket.socket.accept()` on a non-SSL listening server socket.
Depending on the underlying module implementation in a particular
``MicroPython port``, some or all keyword arguments above may be not supported.
.. warning::
Some implementations of ``ussl`` module do NOT validate server certificates,
which makes an SSL connection established prone to man-in-the-middle attacks.
Exceptions
----------
.. data:: ssl.SSLError
This exception does NOT exist. Instead its base class, OSError, is used.
Constants
---------
.. data:: ussl.CERT_NONE
ussl.CERT_OPTIONAL
ussl.CERT_REQUIRED
Supported values for *cert_reqs* parameter.

View File

@ -1,6 +0,0 @@
User-agent: *
Allow: /*/latest/
Allow: /en/latest/ # Fallback for bots that don't understand wildcards
Allow: /*/6.0.x/
Allow: /en/6.0.x/ # Fallback for bots that don't understand wildcards
Disallow: /

17
docs/static/filter.css vendored Normal file
View File

@ -0,0 +1,17 @@
#support-matrix-filter-block { position: relative; }
#support-matrix-filter {
width: 100%;
}
#support-matrix-filter-num {
position: absolute;
right: 10px;
top: 4px;
}
.support-matrix-table .this_module code,
.support-matrix-table .this_module span {
background: black;
color: white;
}
.support-matrix-table .board_hidden {
display: none;
}

86
docs/static/filter.js vendored Normal file
View File

@ -0,0 +1,86 @@
$(() => {
var urlTimeout = null;
function setURL(query, value) {
clearTimeout(urlTimeout);
urlTimeout = setTimeout(function() {
var url = new URL(window.location.href);
console.log(query,value,value.length,!value.length);
if (!value.length) {
console.log
url.searchParams.delete(query);
} else if (Array.isArray(value)) {
url.searchParams.delete(query);
value.forEach(function(v) {
url.searchParams.append(query, v);
})
} else {
url.searchParams.set(query, value);
}
window.history.pushState(null, document.title, url.href);
}, 1000);
}
function handlePageLoad() {
var url = new URL(window.location.href);
//get values from URL
var filters = url.searchParams.getAll('filter');
search_terms = filters.join(" ");
$("#support-matrix-filter").val(search_terms);
run_filter();
}
function filter_boards(search_string) {
$(".board_hidden").removeClass("board_hidden");
$(".this_module").removeClass("this_module");
var nboards = $(".support-matrix-table tbody tr").length;
if(search_string.trim() == "") {
$("#support-matrix-filter-num").html("(all)");
setURL("filter",[]);
return;
}
var list_search = search_string.split(" ").filter(i => i);
var nvisible = 0;
$(".support-matrix-table tbody tr").each( (index,item) => {
var name = $(item).find("td:first-child p").html();
var modules = $(item).find("a.reference.internal");
var matching_all = true;
//
list_search.forEach((sstring) => {
var matching = (sstring[0] == "-");
for(var modi = 0; modi < modules.length; ++modi) {
module = modules[modi];
var mod_name = module.firstChild.firstChild.textContent;
if(sstring[0] == "-") {
if(mod_name.match(sstring.substr(1))) {
matching = false;
break;
}
} else {
if(mod_name.match(sstring)) {
$(module).addClass("this_module");
matching = true;
}
}
}
matching_all = matching_all && matching;
});
if(!matching_all) {
$(item).addClass("board_hidden");
} else {
nvisible += 1;
}
});
$("#support-matrix-filter-num").html(`(${nvisible}/${nboards})`);
setURL("filter",list_search);
}
function run_filter() {
var search_string = $("#support-matrix-filter").val();
filter_boards(search_string);
}
$("#support-matrix-filter").on("keyup", run_filter);
// $(document).on("keyup", "#support-matrix-filter", run_filter);
handlePageLoad();
});

View File

@ -1,203 +0,0 @@
/*
* This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
* SPDX-FileCopyrightText: Copyright (c) 2017-2018 Damien P. George
*
* 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 "drivers/bus/qspi.h"
#define CS_LOW(self) mp_hal_pin_write(self->cs, 0)
#define CS_HIGH(self) mp_hal_pin_write(self->cs, 1)
#ifdef MICROPY_HW_SOFTQSPI_SCK_LOW
// Use externally provided functions for SCK control and IO reading
#define SCK_LOW(self) MICROPY_HW_SOFTQSPI_SCK_LOW(self)
#define SCK_HIGH(self) MICROPY_HW_SOFTQSPI_SCK_HIGH(self)
#define NIBBLE_READ(self) MICROPY_HW_SOFTQSPI_NIBBLE_READ(self)
#else
// Use generic pin functions for SCK control and IO reading
#define SCK_LOW(self) mp_hal_pin_write(self->clk, 0)
#define SCK_HIGH(self) mp_hal_pin_write(self->clk, 1)
#define NIBBLE_READ(self) ( \
mp_hal_pin_read(self->io0) \
| (mp_hal_pin_read(self->io1) << 1) \
| (mp_hal_pin_read(self->io2) << 2) \
| (mp_hal_pin_read(self->io3) << 3))
#endif
STATIC void nibble_write(mp_soft_qspi_obj_t *self, uint8_t v) {
mp_hal_pin_write(self->io0, v & 1);
mp_hal_pin_write(self->io1, (v >> 1) & 1);
mp_hal_pin_write(self->io2, (v >> 2) & 1);
mp_hal_pin_write(self->io3, (v >> 3) & 1);
}
STATIC int mp_soft_qspi_ioctl(void *self_in, uint32_t cmd) {
mp_soft_qspi_obj_t *self = (mp_soft_qspi_obj_t *)self_in;
switch (cmd) {
case MP_QSPI_IOCTL_INIT:
mp_hal_pin_high(self->cs);
mp_hal_pin_output(self->cs);
// Configure pins
mp_hal_pin_write(self->clk, 0);
mp_hal_pin_output(self->clk);
// mp_hal_pin_write(self->clk, 1);
mp_hal_pin_output(self->io0);
mp_hal_pin_input(self->io1);
mp_hal_pin_write(self->io2, 1);
mp_hal_pin_output(self->io2);
mp_hal_pin_write(self->io3, 1);
mp_hal_pin_output(self->io3);
break;
}
return 0; // success
}
STATIC void mp_soft_qspi_transfer(mp_soft_qspi_obj_t *self, size_t len, const uint8_t *src, uint8_t *dest) {
// Will run as fast as possible, limited only by CPU speed and GPIO time
mp_hal_pin_input(self->io1);
mp_hal_pin_output(self->io0);
if (self->io3) {
mp_hal_pin_write(self->io2, 1);
mp_hal_pin_output(self->io2);
mp_hal_pin_write(self->io3, 1);
mp_hal_pin_output(self->io3);
}
if (src) {
for (size_t i = 0; i < len; ++i) {
uint8_t data_out = src[i];
uint8_t data_in = 0;
for (int j = 0; j < 8; ++j, data_out <<= 1) {
mp_hal_pin_write(self->io0, (data_out >> 7) & 1);
mp_hal_pin_write(self->clk, 1);
data_in = (data_in << 1) | mp_hal_pin_read(self->io1);
mp_hal_pin_write(self->clk, 0);
}
if (dest != NULL) {
dest[i] = data_in;
}
}
} else {
for (size_t i = 0; i < len; ++i) {
uint8_t data_in = 0;
for (int j = 0; j < 8; ++j) {
mp_hal_pin_write(self->clk, 1);
data_in = (data_in << 1) | mp_hal_pin_read(self->io1);
mp_hal_pin_write(self->clk, 0);
}
if (dest != NULL) {
dest[i] = data_in;
}
}
}
}
STATIC void mp_soft_qspi_qread(mp_soft_qspi_obj_t *self, size_t len, uint8_t *buf) {
// Make all IO lines input
mp_hal_pin_input(self->io2);
mp_hal_pin_input(self->io3);
mp_hal_pin_input(self->io0);
mp_hal_pin_input(self->io1);
// Will run as fast as possible, limited only by CPU speed and GPIO time
while (len--) {
SCK_HIGH(self);
uint8_t data_in = NIBBLE_READ(self);
SCK_LOW(self);
SCK_HIGH(self);
*buf++ = (data_in << 4) | NIBBLE_READ(self);
SCK_LOW(self);
}
}
STATIC void mp_soft_qspi_qwrite(mp_soft_qspi_obj_t *self, size_t len, const uint8_t *buf) {
// Make all IO lines output
mp_hal_pin_output(self->io2);
mp_hal_pin_output(self->io3);
mp_hal_pin_output(self->io0);
mp_hal_pin_output(self->io1);
// Will run as fast as possible, limited only by CPU speed and GPIO time
for (size_t i = 0; i < len; ++i) {
nibble_write(self, buf[i] >> 4);
SCK_HIGH(self);
SCK_LOW(self);
nibble_write(self, buf[i]);
SCK_HIGH(self);
SCK_LOW(self);
}
// mp_hal_pin_input(self->io1);
}
STATIC void mp_soft_qspi_write_cmd_data(void *self_in, uint8_t cmd, size_t len, uint32_t data) {
mp_soft_qspi_obj_t *self = (mp_soft_qspi_obj_t *)self_in;
uint32_t cmd_buf = cmd | data << 8;
CS_LOW(self);
mp_soft_qspi_transfer(self, 1 + len, (uint8_t *)&cmd_buf, NULL);
CS_HIGH(self);
}
STATIC void mp_soft_qspi_write_cmd_addr_data(void *self_in, uint8_t cmd, uint32_t addr, size_t len, const uint8_t *src) {
mp_soft_qspi_obj_t *self = (mp_soft_qspi_obj_t *)self_in;
uint8_t cmd_buf[4] = {cmd, addr >> 16, addr >> 8, addr};
CS_LOW(self);
mp_soft_qspi_transfer(self, 4, cmd_buf, NULL);
mp_soft_qspi_transfer(self, len, src, NULL);
CS_HIGH(self);
}
STATIC uint32_t mp_soft_qspi_read_cmd(void *self_in, uint8_t cmd, size_t len) {
mp_soft_qspi_obj_t *self = (mp_soft_qspi_obj_t *)self_in;
uint32_t cmd_buf = cmd;
CS_LOW(self);
mp_soft_qspi_transfer(self, 1 + len, (uint8_t *)&cmd_buf, (uint8_t *)&cmd_buf);
CS_HIGH(self);
return cmd_buf >> 8;
}
STATIC void mp_soft_qspi_read_cmd_qaddr_qdata(void *self_in, uint8_t cmd, uint32_t addr, size_t len, uint8_t *dest) {
mp_soft_qspi_obj_t *self = (mp_soft_qspi_obj_t *)self_in;
uint8_t cmd_buf[7] = {cmd, addr >> 16, addr >> 8, addr};
CS_LOW(self);
mp_soft_qspi_transfer(self, 1, cmd_buf, NULL);
mp_soft_qspi_qwrite(self, 6, &cmd_buf[1]); // 3 addr bytes, 1 extra byte (0), 2 dummy bytes (4 dummy cycles)
mp_soft_qspi_qread(self, len, dest);
CS_HIGH(self);
}
const mp_qspi_proto_t mp_soft_qspi_proto = {
.ioctl = mp_soft_qspi_ioctl,
.write_cmd_data = mp_soft_qspi_write_cmd_data,
.write_cmd_addr_data = mp_soft_qspi_write_cmd_addr_data,
.read_cmd = mp_soft_qspi_read_cmd,
.read_cmd_qaddr_qdata = mp_soft_qspi_read_cmd_qaddr_qdata,
};

View File

@ -1,105 +0,0 @@
/*
* This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
* SPDX-FileCopyrightText: Copyright (c) 2016-2018 Damien P. George
*
* 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 "drivers/bus/spi.h"
int mp_soft_spi_ioctl(void *self_in, uint32_t cmd) {
mp_soft_spi_obj_t *self = (mp_soft_spi_obj_t *)self_in;
switch (cmd) {
case MP_SPI_IOCTL_INIT:
mp_hal_pin_write(self->sck, self->polarity);
mp_hal_pin_output(self->sck);
mp_hal_pin_output(self->mosi);
mp_hal_pin_input(self->miso);
break;
case MP_SPI_IOCTL_DEINIT:
break;
}
return 0;
}
void mp_soft_spi_transfer(void *self_in, size_t len, const uint8_t *src, uint8_t *dest) {
mp_soft_spi_obj_t *self = (mp_soft_spi_obj_t *)self_in;
uint32_t delay_half = self->delay_half;
// only MSB transfer is implemented
// If a port defines MICROPY_HW_SOFTSPI_MIN_DELAY, and the configured
// delay_half is equal to this value, then the software SPI implementation
// will run as fast as possible, limited only by CPU speed and GPIO time.
#ifdef MICROPY_HW_SOFTSPI_MIN_DELAY
if (delay_half == MICROPY_HW_SOFTSPI_MIN_DELAY) {
for (size_t i = 0; i < len; ++i) {
uint8_t data_out = src[i];
uint8_t data_in = 0;
for (int j = 0; j < 8; ++j, data_out <<= 1) {
mp_hal_pin_write(self->mosi, (data_out >> 7) & 1);
mp_hal_pin_write(self->sck, 1 - self->polarity);
data_in = (data_in << 1) | mp_hal_pin_read(self->miso);
mp_hal_pin_write(self->sck, self->polarity);
}
if (dest != NULL) {
dest[i] = data_in;
}
}
return;
}
#endif
for (size_t i = 0; i < len; ++i) {
uint8_t data_out = src[i];
uint8_t data_in = 0;
for (int j = 0; j < 8; ++j, data_out <<= 1) {
mp_hal_pin_write(self->mosi, (data_out >> 7) & 1);
if (self->phase == 0) {
mp_hal_delay_us_fast(delay_half);
mp_hal_pin_write(self->sck, 1 - self->polarity);
} else {
mp_hal_pin_write(self->sck, 1 - self->polarity);
mp_hal_delay_us_fast(delay_half);
}
data_in = (data_in << 1) | mp_hal_pin_read(self->miso);
if (self->phase == 0) {
mp_hal_delay_us_fast(delay_half);
mp_hal_pin_write(self->sck, self->polarity);
} else {
mp_hal_pin_write(self->sck, self->polarity);
mp_hal_delay_us_fast(delay_half);
}
}
if (dest != NULL) {
dest[i] = data_in;
}
}
}
const mp_spi_proto_t mp_soft_spi_proto = {
.ioctl = mp_soft_spi_ioctl,
.transfer = mp_soft_spi_transfer,
};

View File

@ -1,6 +0,0 @@
This is the driver for the WIZnet5x00 series of Ethernet controllers.
Adapted for MicroPython.
Original source: https://github.com/Wiznet/W5500_EVB/tree/master/ioLibrary
Taken on: 30 August 2014

View File

@ -1,718 +0,0 @@
//*****************************************************************************
//
//! \file socket.c
//! \brief SOCKET APIs Implements file.
//! \details SOCKET APIs like as Berkeley Socket APIs.
//! \version 1.0.3
//! \date 2013/10/21
//! \par Revision history
//! <2018/10/09> Nick Moore fixes for CircuitPython
//! <2014/05/01> V1.0.3. Refer to M20140501
//! 1. Implicit type casting -> Explicit type casting.
//! 2. replace 0x01 with PACK_REMAINED in recvfrom()
//! 3. Validation a destination ip in connect() & sendto():
//! It occurs a fatal error on converting unint32 address if uint8* addr parameter is not aligned by 4byte address.
//! Copy 4 byte addr value into temporary uint32 variable and then compares it.
//! <2013/12/20> V1.0.2 Refer to M20131220
//! Remove Warning.
//! <2013/11/04> V1.0.1 2nd Release. Refer to "20131104".
//! In sendto(), Add to clear timeout interrupt status (Sn_IR_TIMEOUT)
//! <2013/10/21> 1st Release
//! \author MidnightCow
//! \copyright
//!
//! Copyright (c) 2013, WIZnet Co., LTD.
//! All rights reserved.
//!
//! Redistribution and use in source and binary forms, with or without
//! modification, are permitted provided that the following conditions
//! are met:
//!
//! * Redistributions of source code must retain the above copyright
//! notice, this list of conditions and the following disclaimer.
//! * Redistributions in binary form must reproduce the above copyright
//! notice, this list of conditions and the following disclaimer in the
//! documentation and/or other materials provided with the distribution.
//! * Neither the name of the <ORGANIZATION> nor the names of its
//! contributors may be used to endorse or promote products derived
//! from this software without specific prior written permission.
//!
//! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
//! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
//! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
//! THE POSSIBILITY OF SUCH DAMAGE.
//
//*****************************************************************************
#include <string.h>
#include "py/mpthread.h"
#include "socket.h"
#define SOCK_ANY_PORT_NUM 0xC000;
static uint16_t sock_any_port = SOCK_ANY_PORT_NUM;
static uint16_t sock_io_mode = 0;
static uint16_t sock_is_sending = 0;
static uint16_t sock_remained_size[_WIZCHIP_SOCK_NUM_] = {0,0,};
static uint8_t sock_pack_info[_WIZCHIP_SOCK_NUM_] = {0,};
#if _WIZCHIP_ == 5200
static uint16_t sock_next_rd[_WIZCHIP_SOCK_NUM_] ={0,};
#endif
#define CHECK_SOCKNUM() \
do{ \
if(sn > _WIZCHIP_SOCK_NUM_) return SOCKERR_SOCKNUM; \
}while(0); \
#define CHECK_SOCKMODE(mode) \
do{ \
if((getSn_MR(sn) & 0x0F) != mode) return SOCKERR_SOCKMODE; \
}while(0); \
#define CHECK_SOCKINIT() \
do{ \
if((getSn_SR(sn) != SOCK_INIT)) return SOCKERR_SOCKINIT; \
}while(0); \
#define CHECK_SOCKDATA() \
do{ \
if(len == 0) return SOCKERR_DATALEN; \
}while(0); \
void WIZCHIP_EXPORT(socket_reset)(void) {
sock_any_port = SOCK_ANY_PORT_NUM;
sock_io_mode = 0;
sock_is_sending = 0;
/*
memset(sock_remained_size, 0, _WIZCHIP_SOCK_NUM_ * sizeof(uint16_t));
memset(sock_pack_info, 0, _WIZCHIP_SOCK_NUM_ * sizeof(uint8_t));
*/
#if _WIZCHIP_ == 5200
memset(sock_next_rd, 0, _WIZCHIP_SOCK_NUM_ * sizeof(uint16_t));
#endif
}
int8_t WIZCHIP_EXPORT(socket)(uint8_t sn, uint8_t protocol, uint16_t port, uint8_t flag)
{
CHECK_SOCKNUM();
switch(protocol)
{
case Sn_MR_TCP :
case Sn_MR_UDP :
case Sn_MR_MACRAW :
break;
#if ( _WIZCHIP_ < 5200 )
case Sn_MR_IPRAW :
case Sn_MR_PPPoE :
break;
#endif
default :
return SOCKERR_SOCKMODE;
}
if((flag & 0x06) != 0) return SOCKERR_SOCKFLAG;
#if _WIZCHIP_ == 5200
if(flag & 0x10) return SOCKERR_SOCKFLAG;
#endif
if(flag != 0)
{
switch(protocol)
{
case Sn_MR_TCP:
if((flag & (SF_TCP_NODELAY|SF_IO_NONBLOCK))==0) return SOCKERR_SOCKFLAG;
break;
case Sn_MR_UDP:
if(flag & SF_IGMP_VER2)
{
if((flag & SF_MULTI_ENABLE)==0) return SOCKERR_SOCKFLAG;
}
#if _WIZCHIP_ == 5500
if(flag & SF_UNI_BLOCK)
{
if((flag & SF_MULTI_ENABLE) == 0) return SOCKERR_SOCKFLAG;
}
#endif
break;
default:
break;
}
}
WIZCHIP_EXPORT(close)(sn);
setSn_MR(sn, (protocol | (flag & 0xF0)));
if(!port)
{
port = sock_any_port++;
if(sock_any_port == 0xFFF0) sock_any_port = SOCK_ANY_PORT_NUM;
}
setSn_PORT(sn,port);
setSn_CR(sn,Sn_CR_OPEN);
while(getSn_CR(sn));
sock_io_mode |= ((flag & SF_IO_NONBLOCK) << sn);
sock_is_sending &= ~(1<<sn);
sock_remained_size[sn] = 0;
sock_pack_info[sn] = 0;
while(getSn_SR(sn) == SOCK_CLOSED);
return (int8_t)sn;
}
int8_t WIZCHIP_EXPORT(close)(uint8_t sn)
{
CHECK_SOCKNUM();
setSn_CR(sn,Sn_CR_CLOSE);
/* wait to process the command... */
while( getSn_CR(sn) );
/* clear all interrupt of the socket. */
setSn_IR(sn, 0xFF);
sock_is_sending &= ~(1<<sn);
sock_remained_size[sn] = 0;
sock_pack_info[sn] = 0;
while(getSn_SR(sn) != SOCK_CLOSED);
return SOCK_OK;
}
int8_t WIZCHIP_EXPORT(listen)(uint8_t sn)
{
CHECK_SOCKNUM();
CHECK_SOCKMODE(Sn_MR_TCP);
CHECK_SOCKINIT();
setSn_CR(sn,Sn_CR_LISTEN);
while(getSn_CR(sn));
while(getSn_SR(sn) != SOCK_LISTEN)
{
if(getSn_CR(sn) == SOCK_CLOSED)
{
WIZCHIP_EXPORT(close)(sn);
return SOCKERR_SOCKCLOSED;
}
}
return SOCK_OK;
}
int8_t WIZCHIP_EXPORT(connect)(uint8_t sn, uint8_t * addr, uint16_t port)
{
CHECK_SOCKNUM();
CHECK_SOCKMODE(Sn_MR_TCP);
CHECK_SOCKINIT();
//M20140501 : For avoiding fatal error on memory align mismatched
//if( *((uint32_t*)addr) == 0xFFFFFFFF || *((uint32_t*)addr) == 0) return SOCKERR_IPINVALID;
{
uint32_t taddr;
taddr = ((uint32_t)addr[0] & 0x000000FF);
taddr = (taddr << 8) + ((uint32_t)addr[1] & 0x000000FF);
taddr = (taddr << 8) + ((uint32_t)addr[2] & 0x000000FF);
taddr = (taddr << 8) + ((uint32_t)addr[3] & 0x000000FF);
if (taddr == 0xFFFFFFFF || taddr == 0) return SOCKERR_IPINVALID;
}
//
if(port == 0) return SOCKERR_PORTZERO;
setSn_DIPR(sn,addr);
setSn_DPORT(sn,port);
#if _WIZCHIP_ == 5200 // for W5200 ARP errata
setSUBR(wizchip_getsubn());
#endif
setSn_CR(sn,Sn_CR_CONNECT);
while(getSn_CR(sn));
if(sock_io_mode & (1<<sn)) return SOCK_BUSY;
while(getSn_SR(sn) != SOCK_ESTABLISHED)
{
if (getSn_SR(sn) == SOCK_CLOSED) {
#if _WIZCHIP_ == 5200 // for W5200 ARP errata
setSUBR((uint8_t*)"\x00\x00\x00\x00");
#endif
return SOCKERR_SOCKCLOSED;
}
if (getSn_IR(sn) & Sn_IR_TIMEOUT)
{
setSn_IR(sn, Sn_IR_TIMEOUT);
#if _WIZCHIP_ == 5200 // for W5200 ARP errata
setSUBR((uint8_t*)"\x00\x00\x00\x00");
#endif
return SOCKERR_TIMEOUT;
}
MICROPY_THREAD_YIELD();
}
#if _WIZCHIP_ == 5200 // for W5200 ARP errata
setSUBR((uint8_t*)"\x00\x00\x00\x00");
#endif
return SOCK_OK;
}
int8_t WIZCHIP_EXPORT(disconnect)(uint8_t sn)
{
CHECK_SOCKNUM();
CHECK_SOCKMODE(Sn_MR_TCP);
setSn_CR(sn,Sn_CR_DISCON);
/* wait to process the command... */
while(getSn_CR(sn));
sock_is_sending &= ~(1<<sn);
if(sock_io_mode & (1<<sn)) return SOCK_BUSY;
while(getSn_SR(sn) != SOCK_CLOSED)
{
if(getSn_IR(sn) & Sn_IR_TIMEOUT)
{
WIZCHIP_EXPORT(close)(sn);
return SOCKERR_TIMEOUT;
}
}
return SOCK_OK;
}
int32_t WIZCHIP_EXPORT(send)(uint8_t sn, uint8_t * buf, uint16_t len)
{
uint8_t tmp=0;
uint16_t freesize=0;
CHECK_SOCKNUM();
CHECK_SOCKMODE(Sn_MR_TCP);
CHECK_SOCKDATA();
tmp = getSn_SR(sn);
if(tmp != SOCK_ESTABLISHED && tmp != SOCK_CLOSE_WAIT) return SOCKERR_SOCKSTATUS;
if( sock_is_sending & (1<<sn) )
{
tmp = getSn_IR(sn);
if(tmp & Sn_IR_SENDOK)
{
setSn_IR(sn, Sn_IR_SENDOK);
#if _WIZCHIP_ == 5200
if(getSn_TX_RD(sn) != sock_next_rd[sn])
{
setSn_CR(sn,Sn_CR_SEND);
while(getSn_CR(sn));
return SOCKERR_BUSY;
}
#endif
sock_is_sending &= ~(1<<sn);
}
else if(tmp & Sn_IR_TIMEOUT)
{
WIZCHIP_EXPORT(close)(sn);
return SOCKERR_TIMEOUT;
}
else return SOCK_BUSY;
}
freesize = getSn_TxMAX(sn);
if (len > freesize) len = freesize; // check size not to exceed MAX size.
while(1)
{
freesize = getSn_TX_FSR(sn);
tmp = getSn_SR(sn);
if ((tmp != SOCK_ESTABLISHED) && (tmp != SOCK_CLOSE_WAIT))
{
WIZCHIP_EXPORT(close)(sn);
return SOCKERR_SOCKSTATUS;
}
if( (sock_io_mode & (1<<sn)) && (len > freesize) ) return SOCK_BUSY;
if(len <= freesize) break;
MICROPY_THREAD_YIELD();
}
wiz_send_data(sn, buf, len);
#if _WIZCHIP_ == 5200
sock_next_rd[sn] = getSn_TX_RD(sn) + len;
#endif
setSn_CR(sn,Sn_CR_SEND);
/* wait to process the command... */
while(getSn_CR(sn));
sock_is_sending |= (1 << sn);
return len;
}
int32_t WIZCHIP_EXPORT(recv)(uint8_t sn, uint8_t * buf, uint16_t len)
{
uint8_t tmp = 0;
uint16_t recvsize = 0;
CHECK_SOCKNUM();
CHECK_SOCKMODE(Sn_MR_TCP);
CHECK_SOCKDATA();
recvsize = getSn_RxMAX(sn);
if(recvsize < len) len = recvsize;
while(1)
{
recvsize = getSn_RX_RSR(sn);
tmp = getSn_SR(sn);
if (tmp != SOCK_ESTABLISHED)
{
if(tmp == SOCK_CLOSE_WAIT)
{
if(recvsize != 0) break;
else if(getSn_TX_FSR(sn) == getSn_TxMAX(sn))
{
// dpgeorge: Getting here seems to be an orderly shutdown of the
// socket, and trying to get POSIX behaviour we return 0 because:
// "If no messages are available to be received and the peer has per
// formed an orderly shutdown, recv() shall return 0".
// TODO this return value clashes with SOCK_BUSY in non-blocking mode.
WIZCHIP_EXPORT(close)(sn);
return 0;
}
}
else
{
WIZCHIP_EXPORT(close)(sn);
return SOCKERR_SOCKSTATUS;
}
}
if((sock_io_mode & (1<<sn)) && (recvsize == 0)) return SOCK_BUSY;
if(recvsize != 0) break;
MICROPY_THREAD_YIELD();
};
if(recvsize < len) len = recvsize;
wiz_recv_data(sn, buf, len);
setSn_CR(sn,Sn_CR_RECV);
while(getSn_CR(sn));
return len;
}
int32_t WIZCHIP_EXPORT(sendto)(uint8_t sn, uint8_t * buf, uint16_t len, uint8_t * addr, uint16_t port)
{
uint8_t tmp = 0;
uint16_t freesize = 0;
CHECK_SOCKNUM();
switch(getSn_MR(sn) & 0x0F)
{
case Sn_MR_UDP:
case Sn_MR_MACRAW:
break;
default:
return SOCKERR_SOCKMODE;
}
CHECK_SOCKDATA();
//M20140501 : For avoiding fatal error on memory align mismatched
//if(*((uint32_t*)addr) == 0) return SOCKERR_IPINVALID;
if ((addr[0] | addr[1] | addr[2] | addr[3]) == 0) return SOCKERR_IPINVALID;
if(port == 0) return SOCKERR_PORTZERO;
tmp = getSn_SR(sn);
if(tmp != SOCK_MACRAW && tmp != SOCK_UDP) return SOCKERR_SOCKSTATUS;
setSn_DIPR(sn,addr);
setSn_DPORT(sn,port);
freesize = getSn_TxMAX(sn);
if (len > freesize) len = freesize; // check size not to exceed MAX size.
while(1)
{
freesize = getSn_TX_FSR(sn);
if(getSn_SR(sn) == SOCK_CLOSED) return SOCKERR_SOCKCLOSED;
if( (sock_io_mode & (1<<sn)) && (len > freesize) ) return SOCK_BUSY;
if(len <= freesize) break;
MICROPY_THREAD_YIELD();
};
wiz_send_data(sn, buf, len);
#if _WIZCHIP_ == 5200 // for W5200 ARP errata
setSUBR(wizchip_getsubn());
#endif
setSn_CR(sn,Sn_CR_SEND);
/* wait to process the command... */
while(getSn_CR(sn));
while(1)
{
tmp = getSn_IR(sn);
if(tmp & Sn_IR_SENDOK)
{
setSn_IR(sn, Sn_IR_SENDOK);
break;
}
//M:20131104
//else if(tmp & Sn_IR_TIMEOUT) return SOCKERR_TIMEOUT;
else if(tmp & Sn_IR_TIMEOUT)
{
setSn_IR(sn, Sn_IR_TIMEOUT);
#if _WIZCHIP_ == 5200 // for W5200 ARP errata
setSUBR((uint8_t*)"\x00\x00\x00\x00");
#endif
return SOCKERR_TIMEOUT;
}
////////////
MICROPY_THREAD_YIELD();
}
#if _WIZCHIP_ == 5200 // for W5200 ARP errata
setSUBR((uint8_t*)"\x00\x00\x00\x00");
#endif
return len;
}
int32_t WIZCHIP_EXPORT(recvfrom)(uint8_t sn, uint8_t * buf, uint16_t len, uint8_t * addr, uint16_t *port)
{
uint8_t mr;
uint8_t head[8];
uint16_t pack_len=0;
CHECK_SOCKNUM();
//CHECK_SOCKMODE(Sn_MR_UDP);
switch((mr=getSn_MR(sn)) & 0x0F)
{
case Sn_MR_UDP:
case Sn_MR_MACRAW:
break;
#if ( _WIZCHIP_ < 5200 )
case Sn_MR_IPRAW:
case Sn_MR_PPPoE:
break;
#endif
default:
return SOCKERR_SOCKMODE;
}
CHECK_SOCKDATA();
if(sock_remained_size[sn] == 0)
{
while(1)
{
pack_len = getSn_RX_RSR(sn);
if(getSn_SR(sn) == SOCK_CLOSED) return SOCKERR_SOCKCLOSED;
if( (sock_io_mode & (1<<sn)) && (pack_len == 0) ) return SOCK_BUSY;
if(pack_len != 0) break;
MICROPY_THREAD_YIELD();
};
}
sock_pack_info[sn] = PACK_COMPLETED;
switch (mr & 0x07)
{
case Sn_MR_UDP :
if(sock_remained_size[sn] == 0)
{
wiz_recv_data(sn, head, 8);
setSn_CR(sn,Sn_CR_RECV);
while(getSn_CR(sn));
// read peer's IP address, port number & packet length
addr[0] = head[0];
addr[1] = head[1];
addr[2] = head[2];
addr[3] = head[3];
*port = head[4];
*port = (*port << 8) + head[5];
sock_remained_size[sn] = head[6];
sock_remained_size[sn] = (sock_remained_size[sn] << 8) + head[7];
sock_pack_info[sn] = PACK_FIRST;
}
if(len < sock_remained_size[sn]) pack_len = len;
else pack_len = sock_remained_size[sn];
//
// Need to packet length check (default 1472)
//
wiz_recv_data(sn, buf, pack_len); // data copy.
break;
case Sn_MR_MACRAW :
if(sock_remained_size[sn] == 0)
{
wiz_recv_data(sn, head, 2);
setSn_CR(sn,Sn_CR_RECV);
while(getSn_CR(sn));
// read peer's IP address, port number & packet length
sock_remained_size[sn] = head[0];
sock_remained_size[sn] = (sock_remained_size[sn] <<8) + head[1];
sock_remained_size[sn] -= 2; // len includes 2 len bytes
if(sock_remained_size[sn] > 1514)
{
WIZCHIP_EXPORT(close)(sn);
return SOCKFATAL_PACKLEN;
}
sock_pack_info[sn] = PACK_FIRST;
}
if(len < sock_remained_size[sn]) pack_len = len;
else pack_len = sock_remained_size[sn];
wiz_recv_data(sn,buf,pack_len);
break;
#if ( _WIZCHIP_ < 5200 )
case Sn_MR_IPRAW:
if(sock_remained_size[sn] == 0)
{
wiz_recv_data(sn, head, 6);
setSn_CR(sn,Sn_CR_RECV);
while(getSn_CR(sn));
addr[0] = head[0];
addr[1] = head[1];
addr[2] = head[2];
addr[3] = head[3];
sock_remained_size[sn] = head[4];
sock_remaiend_size[sn] = (sock_remained_size[sn] << 8) + head[5];
sock_pack_info[sn] = PACK_FIRST;
}
//
// Need to packet length check
//
if(len < sock_remained_size[sn]) pack_len = len;
else pack_len = sock_remained_size[sn];
wiz_recv_data(sn, buf, pack_len); // data copy.
break;
#endif
default:
wiz_recv_ignore(sn, pack_len); // data copy.
sock_remained_size[sn] = pack_len;
break;
}
setSn_CR(sn,Sn_CR_RECV);
/* wait to process the command... */
while(getSn_CR(sn)) ;
sock_remained_size[sn] -= pack_len;
//M20140501 : replace 0x01 with PACK_REMAINED
//if(sock_remained_size[sn] != 0) sock_pack_info[sn] |= 0x01;
if(sock_remained_size[sn] != 0) sock_pack_info[sn] |= PACK_REMAINED;
//
return pack_len;
}
int8_t WIZCHIP_EXPORT(ctlsocket)(uint8_t sn, ctlsock_type cstype, void* arg)
{
uint8_t tmp = 0;
CHECK_SOCKNUM();
switch(cstype)
{
case CS_SET_IOMODE:
tmp = *((uint8_t*)arg);
if(tmp == SOCK_IO_NONBLOCK) sock_io_mode |= (1<<sn);
else if(tmp == SOCK_IO_BLOCK) sock_io_mode &= ~(1<<sn);
else return SOCKERR_ARG;
break;
case CS_GET_IOMODE:
//M20140501 : implict type casting -> explict type casting
//*((uint8_t*)arg) = (sock_io_mode >> sn) & 0x0001;
*((uint8_t*)arg) = (uint8_t)((sock_io_mode >> sn) & 0x0001);
//
break;
case CS_GET_MAXTXBUF:
*((uint16_t*)arg) = getSn_TxMAX(sn);
break;
case CS_GET_MAXRXBUF:
*((uint16_t*)arg) = getSn_RxMAX(sn);
break;
case CS_CLR_INTERRUPT:
if( (*(uint8_t*)arg) > SIK_ALL) return SOCKERR_ARG;
setSn_IR(sn,*(uint8_t*)arg);
break;
case CS_GET_INTERRUPT:
*((uint8_t*)arg) = getSn_IR(sn);
break;
case CS_SET_INTMASK:
if( (*(uint8_t*)arg) > SIK_ALL) return SOCKERR_ARG;
setSn_IMR(sn,*(uint8_t*)arg);
break;
case CS_GET_INTMASK:
*((uint8_t*)arg) = getSn_IMR(sn);
default:
return SOCKERR_ARG;
}
return SOCK_OK;
}
int8_t WIZCHIP_EXPORT(setsockopt)(uint8_t sn, sockopt_type sotype, void* arg)
{
// M20131220 : Remove warning
//uint8_t tmp;
CHECK_SOCKNUM();
switch(sotype)
{
case SO_TTL:
setSn_TTL(sn,*(uint8_t*)arg);
break;
case SO_TOS:
setSn_TOS(sn,*(uint8_t*)arg);
break;
case SO_MSS:
setSn_MSSR(sn,*(uint16_t*)arg);
break;
case SO_DESTIP:
setSn_DIPR(sn, (uint8_t*)arg);
break;
case SO_DESTPORT:
setSn_DPORT(sn, *(uint16_t*)arg);
break;
#if _WIZCHIP_ != 5100
case SO_KEEPALIVESEND:
CHECK_SOCKMODE(Sn_MR_TCP);
#if _WIZCHIP_ > 5200
if(getSn_KPALVTR(sn) != 0) return SOCKERR_SOCKOPT;
#endif
setSn_CR(sn,Sn_CR_SEND_KEEP);
while(getSn_CR(sn) != 0)
{
// M20131220
//if ((tmp = getSn_IR(sn)) & Sn_IR_TIMEOUT)
if (getSn_IR(sn) & Sn_IR_TIMEOUT)
{
setSn_IR(sn, Sn_IR_TIMEOUT);
return SOCKERR_TIMEOUT;
}
}
break;
#if _WIZCHIP_ > 5200
case SO_KEEPALIVEAUTO:
CHECK_SOCKMODE(Sn_MR_TCP);
setSn_KPALVTR(sn,*(uint8_t*)arg);
break;
#endif
#endif
default:
return SOCKERR_ARG;
}
return SOCK_OK;
}
int8_t WIZCHIP_EXPORT(getsockopt)(uint8_t sn, sockopt_type sotype, void* arg)
{
CHECK_SOCKNUM();
switch(sotype)
{
case SO_FLAG:
*(uint8_t*)arg = getSn_MR(sn) & 0xF0;
break;
case SO_TTL:
*(uint8_t*) arg = getSn_TTL(sn);
break;
case SO_TOS:
*(uint8_t*) arg = getSn_TOS(sn);
break;
case SO_MSS:
*(uint8_t*) arg = getSn_MSSR(sn);
case SO_DESTIP:
getSn_DIPR(sn, (uint8_t*)arg);
break;
case SO_DESTPORT:
*(uint16_t*) arg = getSn_DPORT(sn);
break;
#if _WIZCHIP_ > 5200
case SO_KEEPALIVEAUTO:
CHECK_SOCKMODE(Sn_MR_TCP);
*(uint16_t*) arg = getSn_KPALVTR(sn);
break;
#endif
case SO_SENDBUF:
*(uint16_t*) arg = getSn_TX_FSR(sn);
case SO_RECVBUF:
*(uint16_t*) arg = getSn_RX_RSR(sn);
case SO_STATUS:
*(uint8_t*) arg = getSn_SR(sn);
break;
case SO_REMAINSIZE:
if(getSn_MR(sn) == Sn_MR_TCP)
*(uint16_t*)arg = getSn_RX_RSR(sn);
else
*(uint16_t*)arg = sock_remained_size[sn];
break;
case SO_PACKINFO:
CHECK_SOCKMODE(Sn_MR_TCP);
*(uint8_t*)arg = sock_pack_info[sn];
break;
default:
return SOCKERR_SOCKOPT;
}
return SOCK_OK;
}

View File

@ -1,472 +0,0 @@
//*****************************************************************************
//
//! \file socket.h
//! \brief SOCKET APIs Header file.
//! \details SOCKET APIs like as berkeley socket api.
//! \version 1.0.2
//! \date 2013/10/21
//! \par Revision history
//! <2014/05/01> V1.0.2. Refer to M20140501
//! 1. Modify the comment : SO_REMAINED -> PACK_REMAINED
//! 2. Add the comment as zero byte udp data reception in getsockopt().
//! <2013/10/21> 1st Release
//! \author MidnightCow
//! \copyright
//!
//! Copyright (c) 2013, WIZnet Co., LTD.
//! All rights reserved.
//!
//! Redistribution and use in source and binary forms, with or without
//! modification, are permitted provided that the following conditions
//! are met:
//!
//! * Redistributions of source code must retain the above copyright
//! notice, this list of conditions and the following disclaimer.
//! * Redistributions in binary form must reproduce the above copyright
//! notice, this list of conditions and the following disclaimer in the
//! documentation and/or other materials provided with the distribution.
//! * Neither the name of the <ORGANIZATION> nor the names of its
//! contributors may be used to endorse or promote products derived
//! from this software without specific prior written permission.
//!
//! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
//! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
//! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
//! THE POSSIBILITY OF SUCH DAMAGE.
//
//*****************************************************************************
/**
* @defgroup WIZnet_socket_APIs 1. WIZnet socket APIs
* @brief WIZnet socket APIs are based on Berkeley socket APIs, thus it has much similar name and interface.
* But there is a little bit of difference.
* @details
* <b> Comparison between WIZnet and Berkeley SOCKET APIs </b>
* <table>
* <tr> <td><b>API</b></td> <td><b>WIZnet</b></td> <td><b>Berkeley</b></td> </tr>
* <tr> <td>socket()</td> <td>O</td> <td>O</td> </tr>
* <tr> <td><b>bind()</b></td> <td>X</td> <td>O</td> </tr>
* <tr> <td><b>listen()</b></td> <td>O</td> <td>O</td> </tr>
* <tr> <td><b>connect()</b></td> <td>O</td> <td>O</td> </tr>
* <tr> <td><b>accept()</b></td> <td>X</td> <td>O</td> </tr>
* <tr> <td><b>recv()</b></td> <td>O</td> <td>O</td> </tr>
* <tr> <td><b>send()</b></td> <td>O</td> <td>O</td> </tr>
* <tr> <td><b>recvfrom()</b></td> <td>O</td> <td>O</td> </tr>
* <tr> <td><b>sendto()</b></td> <td>O</td> <td>O</td> </tr>
* <tr> <td><b>closesocket()</b></td> <td>O<br>close() & disconnect()</td> <td>O</td> </tr>
* </table>
* There are @b bind() and @b accept() functions in @b Berkeley SOCKET API but,
* not in @b WIZnet SOCKET API. Because socket() of WIZnet is not only creating a SOCKET but also binding a local port number,
* and listen() of WIZnet is not only listening to connection request from client but also accepting the connection request. \n
* When you program "TCP SERVER" with Berkeley SOCKET API, you can use only one listen port.
* When the listen SOCKET accepts a connection request from a client, it keeps listening.
* After accepting the connection request, a new SOCKET is created and the new SOCKET is used in communication with the client. \n
* Following figure shows network flow diagram by Berkeley SOCKET API.
* @image html Berkeley_SOCKET.jpg "<Berkeley SOCKET API>"
* But, When you program "TCP SERVER" with WIZnet SOCKET API, you can use as many as 8 listen SOCKET with same port number. \n
* Because there's no accept() in WIZnet SOCKET APIs, when the listen SOCKET accepts a connection request from a client,
* it is changed in order to communicate with the client.
* And the changed SOCKET is not listening any more and is dedicated for communicating with the client. \n
* If there're many listen SOCKET with same listen port number and a client requests a connection,
* the SOCKET which has the smallest SOCKET number accepts the request and is changed as communication SOCKET. \n
* Following figure shows network flow diagram by WIZnet SOCKET API.
* @image html WIZnet_SOCKET.jpg "<WIZnet SOCKET API>"
*/
#ifndef _WIZCHIP_SOCKET_H_
#define _WIZCHIP_SOCKET_H_
// use this macro for exported names to avoid name clashes
#define WIZCHIP_EXPORT(name) wizchip_ ## name
#include "wizchip_conf.h"
#define SOCKET uint8_t ///< SOCKET type define for legacy driver
#define SOCK_OK 1 ///< Result is OK about socket process.
#define SOCK_BUSY 0 ///< Socket is busy on processing the operation. Valid only Non-block IO Mode.
#define SOCK_FATAL -1000 ///< Result is fatal error about socket process.
#define SOCK_ERROR 0
#define SOCKERR_SOCKNUM (SOCK_ERROR - 1) ///< Invalid socket number
#define SOCKERR_SOCKOPT (SOCK_ERROR - 2) ///< Invalid socket option
#define SOCKERR_SOCKINIT (SOCK_ERROR - 3) ///< Socket is not initialized
#define SOCKERR_SOCKCLOSED (SOCK_ERROR - 4) ///< Socket unexpectedly closed.
#define SOCKERR_SOCKMODE (SOCK_ERROR - 5) ///< Invalid socket mode for socket operation.
#define SOCKERR_SOCKFLAG (SOCK_ERROR - 6) ///< Invalid socket flag
#define SOCKERR_SOCKSTATUS (SOCK_ERROR - 7) ///< Invalid socket status for socket operation.
#define SOCKERR_ARG (SOCK_ERROR - 10) ///< Invalid argument.
#define SOCKERR_PORTZERO (SOCK_ERROR - 11) ///< Port number is zero
#define SOCKERR_IPINVALID (SOCK_ERROR - 12) ///< Invalid IP address
#define SOCKERR_TIMEOUT (SOCK_ERROR - 13) ///< Timeout occurred
#define SOCKERR_DATALEN (SOCK_ERROR - 14) ///< Data length is zero or greater than buffer max size.
#define SOCKERR_BUFFER (SOCK_ERROR - 15) ///< Socket buffer is not enough for data communication.
#define SOCKFATAL_PACKLEN (SOCK_FATAL - 1) ///< Invalid packet length. Fatal Error.
/*
* SOCKET FLAG
*/
#define SF_ETHER_OWN (Sn_MR_MFEN) ///< In \ref Sn_MR_MACRAW, Receive only the packet as broadcast, multicast and own packet
#define SF_IGMP_VER2 (Sn_MR_MC) ///< In \ref Sn_MR_UDP with \ref SF_MULTI_ENABLE, Select IGMP version 2.
#define SF_TCP_NODELAY (Sn_MR_ND) ///< In \ref Sn_MR_TCP, Use to nodelayed ack.
#define SF_MULTI_ENABLE (Sn_MR_MULTI) ///< In \ref Sn_MR_UDP, Enable multicast mode.
#if _WIZCHIP_ == 5500
#define SF_BROAD_BLOCK (Sn_MR_BCASTB) ///< In \ref Sn_MR_UDP or \ref Sn_MR_MACRAW, Block broadcast packet. Valid only in W5500
#define SF_MULTI_BLOCK (Sn_MR_MMB) ///< In \ref Sn_MR_MACRAW, Block multicast packet. Valid only in W5500
#define SF_IPv6_BLOCK (Sn_MR_MIP6B) ///< In \ref Sn_MR_MACRAW, Block IPv6 packet. Valid only in W5500
#define SF_UNI_BLOCK (Sn_MR_UCASTB) ///< In \ref Sn_MR_UDP with \ref SF_MULTI_ENABLE. Valid only in W5500
#endif
#define SF_IO_NONBLOCK 0x01 ///< Socket nonblock io mode. It used parameter in \ref socket().
/*
* UDP & MACRAW Packet Infomation
*/
#define PACK_FIRST 0x80 ///< In Non-TCP packet, It indicates to start receiving a packet.
#define PACK_REMAINED 0x01 ///< In Non-TCP packet, It indicates to remain a packet to be received.
#define PACK_COMPLETED 0x00 ///< In Non-TCP packet, It indicates to complete to receive a packet.
// resets all global state associated with the socket interface
void WIZCHIP_EXPORT(socket_reset)(void);
/**
* @ingroup WIZnet_socket_APIs
* @brief Open a socket.
* @details Initializes the socket with 'sn' passed as parameter and open.
*
* @param sn Socket number. It should be <b>0 ~ @ref \_WIZCHIP_SOCK_NUM_</b>.
* @param protocol Protocol type to operate such as TCP, UDP and MACRAW.
* @param port Port number to be bined.
* @param flag Socket flags as \ref SF_ETHER_OWN, \ref SF_IGMP_VER2, \ref SF_TCP_NODELAY, \ref SF_MULTI_ENABLE, \ref SF_IO_NONBLOCK and so on.\n
* Valid flags only in W5500 : @ref SF_BROAD_BLOCK, @ref SF_MULTI_BLOCK, @ref SF_IPv6_BLOCK, and @ref SF_UNI_BLOCK.
* @sa Sn_MR
*
* @return @b Success : The socket number @b 'sn' passed as parameter\n
* @b Fail :\n @ref SOCKERR_SOCKNUM - Invalid socket number\n
* @ref SOCKERR_SOCKMODE - Not support socket mode as TCP, UDP, and so on. \n
* @ref SOCKERR_SOCKFLAG - Invaild socket flag.
*/
int8_t WIZCHIP_EXPORT(socket)(uint8_t sn, uint8_t protocol, uint16_t port, uint8_t flag);
/**
* @ingroup WIZnet_socket_APIs
* @brief Close a socket.
* @details It closes the socket with @b'sn' passed as parameter.
*
* @param sn Socket number. It should be <b>0 ~ @ref \_WIZCHIP_SOCK_NUM_</b>.
*
* @return @b Success : @ref SOCK_OK \n
* @b Fail : @ref SOCKERR_SOCKNUM - Invalid socket number
*/
int8_t WIZCHIP_EXPORT(close)(uint8_t sn);
/**
* @ingroup WIZnet_socket_APIs
* @brief Listen to a connection request from a client.
* @details It is listening to a connection request from a client.
* If connection request is accepted successfully, the connection is established. Socket sn is used in passive(server) mode.
*
* @param sn Socket number. It should be <b>0 ~ @ref \_WIZCHIP_SOCK_NUM_</b>.
* @return @b Success : @ref SOCK_OK \n
* @b Fail :\n @ref SOCKERR_SOCKINIT - Socket is not initialized \n
* @ref SOCKERR_SOCKCLOSED - Socket closed unexpectedly.
*/
int8_t WIZCHIP_EXPORT(listen)(uint8_t sn);
/**
* @ingroup WIZnet_socket_APIs
* @brief Try to connect a server.
* @details It requests connection to the server with destination IP address and port number passed as parameter.\n
* @note It is valid only in TCP client mode.
* In block io mode, it does not return until connection is completed.
* In Non-block io mode, it return @ref SOCK_BUSY immediately.
*
* @param sn Socket number. It should be <b>0 ~ @ref \_WIZCHIP_SOCK_NUM_</b>.
* @param addr Pointer variable of destination IP address. It should be allocated 4 bytes.
* @param port Destination port number.
*
* @return @b Success : @ref SOCK_OK \n
* @b Fail :\n @ref SOCKERR_SOCKNUM - Invalid socket number\n
* @ref SOCKERR_SOCKMODE - Invalid socket mode\n
* @ref SOCKERR_SOCKINIT - Socket is not initialized\n
* @ref SOCKERR_IPINVALID - Wrong server IP address\n
* @ref SOCKERR_PORTZERO - Server port zero\n
* @ref SOCKERR_TIMEOUT - Timeout occurred during request connection\n
* @ref SOCK_BUSY - In non-block io mode, it returned immediately\n
*/
int8_t WIZCHIP_EXPORT(connect)(uint8_t sn, uint8_t * addr, uint16_t port);
/**
* @ingroup WIZnet_socket_APIs
* @brief Try to disconnect a connection socket.
* @details It sends request message to disconnect the TCP socket 'sn' passed as parameter to the server or client.
* @note It is valid only in TCP server or client mode. \n
* In block io mode, it does not return until disconnection is completed. \n
* In Non-block io mode, it return @ref SOCK_BUSY immediately. \n
* @param sn Socket number. It should be <b>0 ~ @ref \_WIZCHIP_SOCK_NUM_</b>.
* @return @b Success : @ref SOCK_OK \n
* @b Fail :\n @ref SOCKERR_SOCKNUM - Invalid socket number \n
* @ref SOCKERR_SOCKMODE - Invalid operation in the socket \n
* @ref SOCKERR_TIMEOUT - Timeout occurred \n
* @ref SOCK_BUSY - Socket is busy.
*/
int8_t WIZCHIP_EXPORT(disconnect)(uint8_t sn);
/**
* @ingroup WIZnet_socket_APIs
* @brief Send data to the connected peer in TCP socket.
* @details It is used to send outgoing data to the connected socket.
* @note It is valid only in TCP server or client mode. It can't send data greater than socket buffer size. \n
* In block io mode, It doesn't return until data send is completed - socket buffer size is greater than data. \n
* In non-block io mode, It return @ref SOCK_BUSY immediately when socket buffer is not enough. \n
* @param sn Socket number. It should be <b>0 ~ @ref \_WIZCHIP_SOCK_NUM_</b>.
* @param buf Pointer buffer containing data to be sent.
* @param len The byte length of data in buf.
* @return @b Success : The sent data size \n
* @b Fail : \n @ref SOCKERR_SOCKSTATUS - Invalid socket status for socket operation \n
* @ref SOCKERR_TIMEOUT - Timeout occurred \n
* @ref SOCKERR_SOCKMODE - Invalid operation in the socket \n
* @ref SOCKERR_SOCKNUM - Invalid socket number \n
* @ref SOCKERR_DATALEN - zero data length \n
* @ref SOCK_BUSY - Socket is busy.
*/
int32_t WIZCHIP_EXPORT(send)(uint8_t sn, uint8_t * buf, uint16_t len);
/**
* @ingroup WIZnet_socket_APIs
* @brief Receive data from the connected peer.
* @details It is used to read incoming data from the connected socket.\n
* It waits for data as much as the application wants to receive.
* @note It is valid only in TCP server or client mode. It can't receive data greater than socket buffer size. \n
* In block io mode, it doesn't return until data reception is completed - data is filled as <I>len</I> in socket buffer. \n
* In non-block io mode, it return @ref SOCK_BUSY immediately when <I>len</I> is greater than data size in socket buffer. \n
*
* @param sn Socket number. It should be <b>0 ~ @ref \_WIZCHIP_SOCK_NUM_</b>.
* @param buf Pointer buffer to read incoming data.
* @param len The max data length of data in buf.
* @return @b Success : The real received data size \n
* @b Fail :\n
* @ref SOCKERR_SOCKSTATUS - Invalid socket status for socket operation \n
* @ref SOCKERR_SOCKMODE - Invalid operation in the socket \n
* @ref SOCKERR_SOCKNUM - Invalid socket number \n
* @ref SOCKERR_DATALEN - zero data length \n
* @ref SOCK_BUSY - Socket is busy.
*/
int32_t WIZCHIP_EXPORT(recv)(uint8_t sn, uint8_t * buf, uint16_t len);
/**
* @ingroup WIZnet_socket_APIs
* @brief Sends datagram to the peer with destination IP address and port number passed as parameter.
* @details It sends datagram of UDP or MACRAW to the peer with destination IP address and port number passed as parameter.\n
* Even if the connectionless socket has been previously connected to a specific address,
* the address and port number parameters override the destination address for that particular datagram only.
* @note In block io mode, It doesn't return until data send is completed - socket buffer size is greater than <I>len</I>.
* In non-block io mode, It return @ref SOCK_BUSY immediately when socket buffer is not enough.
*
* @param sn Socket number. It should be <b>0 ~ @ref \_WIZCHIP_SOCK_NUM_</b>.
* @param buf Pointer buffer to send outgoing data.
* @param len The byte length of data in buf.
* @param addr Pointer variable of destination IP address. It should be allocated 4 bytes.
* @param port Destination port number.
*
* @return @b Success : The sent data size \n
* @b Fail :\n @ref SOCKERR_SOCKNUM - Invalid socket number \n
* @ref SOCKERR_SOCKMODE - Invalid operation in the socket \n
* @ref SOCKERR_SOCKSTATUS - Invalid socket status for socket operation \n
* @ref SOCKERR_DATALEN - zero data length \n
* @ref SOCKERR_IPINVALID - Wrong server IP address\n
* @ref SOCKERR_PORTZERO - Server port zero\n
* @ref SOCKERR_SOCKCLOSED - Socket unexpectedly closed \n
* @ref SOCKERR_TIMEOUT - Timeout occurred \n
* @ref SOCK_BUSY - Socket is busy.
*/
int32_t WIZCHIP_EXPORT(sendto)(uint8_t sn, uint8_t * buf, uint16_t len, uint8_t * addr, uint16_t port);
/**
* @ingroup WIZnet_socket_APIs
* @brief Receive datagram of UDP or MACRAW
* @details This function is an application I/F function which is used to receive the data in other then TCP mode. \n
* This function is used to receive UDP and MAC_RAW mode, and handle the header as well.
* This function can divide to received the packet data.
* On the MACRAW SOCKET, the addr and port parameters are ignored.
* @note In block io mode, it doesn't return until data reception is completed - data is filled as <I>len</I> in socket buffer
* In non-block io mode, it return @ref SOCK_BUSY immediately when <I>len</I> is greater than data size in socket buffer.
*
* @param sn Socket number. It should be <b>0 ~ @ref \_WIZCHIP_SOCK_NUM_</b>.
* @param buf Pointer buffer to read incoming data.
* @param len The max data length of data in buf.
* When the received packet size <= len, receives data as packet sized.
* When others, receives data as len.
* @param addr Pointer variable of destination IP address. It should be allocated 4 bytes.
* It is valid only when the first call recvfrom for receiving the packet.
* When it is valid, @ref packinfo[7] should be set as '1' after call @ref getsockopt(sn, SO_PACKINFO, &packinfo).
* @param port Pointer variable of destination port number.
* It is valid only when the first call recvform for receiving the packet.
* When it is valid, @ref packinfo[7] should be set as '1' after call @ref getsockopt(sn, SO_PACKINFO, &packinfo).
*
* @return @b Success : This function return real received data size for success.\n
* @b Fail : @ref SOCKERR_DATALEN - zero data length \n
* @ref SOCKERR_SOCKMODE - Invalid operation in the socket \n
* @ref SOCKERR_SOCKNUM - Invalid socket number \n
* @ref SOCKBUSY - Socket is busy.
*/
int32_t WIZCHIP_EXPORT(recvfrom)(uint8_t sn, uint8_t * buf, uint16_t len, uint8_t * addr, uint16_t *port);
/////////////////////////////
// SOCKET CONTROL & OPTION //
/////////////////////////////
#define SOCK_IO_BLOCK 0 ///< Socket Block IO Mode in @ref setsockopt().
#define SOCK_IO_NONBLOCK 1 ///< Socket Non-block IO Mode in @ref setsockopt().
/**
* @defgroup DATA_TYPE DATA TYPE
*/
/**
* @ingroup DATA_TYPE
* @brief The kind of Socket Interrupt.
* @sa Sn_IR, Sn_IMR, setSn_IR(), getSn_IR(), setSn_IMR(), getSn_IMR()
*/
typedef enum
{
SIK_CONNECTED = (1 << 0), ///< connected
SIK_DISCONNECTED = (1 << 1), ///< disconnected
SIK_RECEIVED = (1 << 2), ///< data received
SIK_TIMEOUT = (1 << 3), ///< timeout occurred
SIK_SENT = (1 << 4), ///< send ok
SIK_ALL = 0x1F, ///< all interrupt
}sockint_kind;
/**
* @ingroup DATA_TYPE
* @brief The type of @ref ctlsocket().
*/
typedef enum
{
CS_SET_IOMODE, ///< set socket IO mode with @ref SOCK_IO_BLOCK or @ref SOCK_IO_NONBLOCK
CS_GET_IOMODE, ///< get socket IO mode
CS_GET_MAXTXBUF, ///< get the size of socket buffer allocated in TX memory
CS_GET_MAXRXBUF, ///< get the size of socket buffer allocated in RX memory
CS_CLR_INTERRUPT, ///< clear the interrupt of socket with @ref sockint_kind
CS_GET_INTERRUPT, ///< get the socket interrupt. refer to @ref sockint_kind
CS_SET_INTMASK, ///< set the interrupt mask of socket with @ref sockint_kind
CS_GET_INTMASK ///< get the masked interrupt of socket. refer to @ref sockint_kind
}ctlsock_type;
/**
* @ingroup DATA_TYPE
* @brief The type of socket option in @ref setsockopt() or @ref getsockopt()
*/
typedef enum
{
SO_FLAG, ///< Valid only in getsockopt(), For set flag of socket refer to <I>flag</I> in @ref socket().
SO_TTL, ///< Set/Get TTL. @ref Sn_TTL ( @ref setSn_TTL(), @ref getSn_TTL() )
SO_TOS, ///< Set/Get TOS. @ref Sn_TOS ( @ref setSn_TOS(), @ref getSn_TOS() )
SO_MSS, ///< Set/Get MSS. @ref Sn_MSSR ( @ref setSn_MSSR(), @ref getSn_MSSR() )
SO_DESTIP, ///< Set/Get the destination IP address. @ref Sn_DIPR ( @ref setSn_DIPR(), @ref getSn_DIPR() )
SO_DESTPORT, ///< Set/Get the destination Port number. @ref Sn_DPORT ( @ref setSn_DPORT(), @ref getSn_DPORT() )
#if _WIZCHIP_ != 5100
SO_KEEPALIVESEND, ///< Valid only in setsockopt. Manually send keep-alive packet in TCP mode
#if _WIZCHIP_ > 5200
SO_KEEPALIVEAUTO, ///< Set/Get keep-alive auto transmission timer in TCP mode
#endif
#endif
SO_SENDBUF, ///< Valid only in getsockopt. Get the free data size of Socekt TX buffer. @ref Sn_TX_FSR, @ref getSn_TX_FSR()
SO_RECVBUF, ///< Valid only in getsockopt. Get the received data size in socket RX buffer. @ref Sn_RX_RSR, @ref getSn_RX_RSR()
SO_STATUS, ///< Valid only in getsockopt. Get the socket status. @ref Sn_SR, @ref getSn_SR()
SO_REMAINSIZE, ///< Valid only in getsockopt. Get the remained packet size in other then TCP mode.
SO_PACKINFO ///< Valid only in getsockopt. Get the packet information as @ref PACK_FIRST, @ref PACK_REMAINED, and @ref PACK_COMPLETED in other then TCP mode.
}sockopt_type;
/**
* @ingroup WIZnet_socket_APIs
* @brief Control socket.
* @details Control IO mode, Interrupt & Mask of socket and get the socket buffer information.
* Refer to @ref ctlsock_type.
* @param sn socket number
* @param cstype type of control socket. refer to @ref ctlsock_type.
* @param arg Data type and value is determined according to @ref ctlsock_type. \n
* <table>
* <tr> <td> @b cstype </td> <td> @b data type</td><td>@b value</td></tr>
* <tr> <td> @ref CS_SET_IOMODE \n @ref CS_GET_IOMODE </td> <td> uint8_t </td><td>@ref SOCK_IO_BLOCK @ref SOCK_IO_NONBLOCK</td></tr>
* <tr> <td> @ref CS_GET_MAXTXBUF \n @ref CS_GET_MAXRXBUF </td> <td> uint16_t </td><td> 0 ~ 16K </td></tr>
* <tr> <td> @ref CS_CLR_INTERRUPT \n @ref CS_GET_INTERRUPT \n @ref CS_SET_INTMASK \n @ref CS_GET_INTMASK </td> <td> @ref sockint_kind </td><td> @ref SIK_CONNECTED, etc. </td></tr>
* </table>
* @return @b Success @ref SOCK_OK \n
* @b fail @ref SOCKERR_ARG - Invalid argument\n
*/
int8_t WIZCHIP_EXPORT(ctlsocket)(uint8_t sn, ctlsock_type cstype, void* arg);
/**
* @ingroup WIZnet_socket_APIs
* @brief set socket options
* @details Set socket option like as TTL, MSS, TOS, and so on. Refer to @ref sockopt_type.
*
* @param sn socket number
* @param sotype socket option type. refer to @ref sockopt_type
* @param arg Data type and value is determined according to <I>sotype</I>. \n
* <table>
* <tr> <td> @b sotype </td> <td> @b data type</td><td>@b value</td></tr>
* <tr> <td> @ref SO_TTL </td> <td> uint8_t </td><td> 0 ~ 255 </td> </tr>
* <tr> <td> @ref SO_TOS </td> <td> uint8_t </td><td> 0 ~ 255 </td> </tr>
* <tr> <td> @ref SO_MSS </td> <td> uint16_t </td><td> 0 ~ 65535 </td> </tr>
* <tr> <td> @ref SO_DESTIP </td> <td> uint8_t[4] </td><td> </td></tr>
* <tr> <td> @ref SO_DESTPORT </td> <td> uint16_t </td><td> 0 ~ 65535 </td></tr>
* <tr> <td> @ref SO_KEEPALIVESEND </td> <td> null </td><td> null </td></tr>
* <tr> <td> @ref SO_KEEPALIVEAUTO </td> <td> uint8_t </td><td> 0 ~ 255 </td></tr>
* </table>
* @return
* - @b Success : @ref SOCK_OK \n
* - @b Fail
* - @ref SOCKERR_SOCKNUM - Invalid Socket number \n
* - @ref SOCKERR_SOCKMODE - Invalid socket mode \n
* - @ref SOCKERR_SOCKOPT - Invalid socket option or its value \n
* - @ref SOCKERR_TIMEOUT - Timeout occurred when sending keep-alive packet \n
*/
int8_t WIZCHIP_EXPORT(setsockopt)(uint8_t sn, sockopt_type sotype, void* arg);
/**
* @ingroup WIZnet_socket_APIs
* @brief get socket options
* @details Get socket option like as FLAG, TTL, MSS, and so on. Refer to @ref sockopt_type
* @param sn socket number
* @param sotype socket option type. refer to @ref sockopt_type
* @param arg Data type and value is determined according to <I>sotype</I>. \n
* <table>
* <tr> <td> @b sotype </td> <td>@b data type</td><td>@b value</td></tr>
* <tr> <td> @ref SO_FLAG </td> <td> uint8_t </td><td> @ref SF_ETHER_OWN, etc... </td> </tr>
* <tr> <td> @ref SO_TOS </td> <td> uint8_t </td><td> 0 ~ 255 </td> </tr>
* <tr> <td> @ref SO_MSS </td> <td> uint16_t </td><td> 0 ~ 65535 </td> </tr>
* <tr> <td> @ref SO_DESTIP </td> <td> uint8_t[4] </td><td> </td></tr>
* <tr> <td> @ref SO_DESTPORT </td> <td> uint16_t </td><td> </td></tr>
* <tr> <td> @ref SO_KEEPALIVEAUTO </td> <td> uint8_t </td><td> 0 ~ 255 </td></tr>
* <tr> <td> @ref SO_SENDBUF </td> <td> uint16_t </td><td> 0 ~ 65535 </td></tr>
* <tr> <td> @ref SO_RECVBUF </td> <td> uint16_t </td><td> 0 ~ 65535 </td></tr>
* <tr> <td> @ref SO_STATUS </td> <td> uint8_t </td><td> @ref SOCK_ESTABLISHED, etc.. </td></tr>
* <tr> <td> @ref SO_REMAINSIZE </td> <td> uint16_t </td><td> 0~ 65535 </td></tr>
* <tr> <td> @ref SO_PACKINFO </td> <td> uint8_t </td><td> @ref PACK_FIRST, etc... </td></tr>
* </table>
* @return
* - @b Success : @ref SOCK_OK \n
* - @b Fail
* - @ref SOCKERR_SOCKNUM - Invalid Socket number \n
* - @ref SOCKERR_SOCKOPT - Invalid socket option or its value \n
* - @ref SOCKERR_SOCKMODE - Invalid socket mode \n
* @note
* The option as PACK_REMAINED and SO_PACKINFO is valid only in NON-TCP mode and after call @ref recvfrom(). \n
* When SO_PACKINFO value is PACK_FIRST and the return value of recvfrom() is zero,
* This means the zero byte UDP data(UDP Header only) received.
*/
int8_t WIZCHIP_EXPORT(getsockopt)(uint8_t sn, sockopt_type sotype, void* arg);
#endif // _WIZCHIP_SOCKET_H_

View File

@ -1,206 +0,0 @@
// dpgeorge: this file taken from w5500/w5500.c and adapted to W5200
//*****************************************************************************
//
//! \file w5500.c
//! \brief W5500 HAL Interface.
//! \version 1.0.1
//! \date 2013/10/21
//! \par Revision history
//! <2014/05/01> V1.0.2
//! 1. Implicit type casting -> Explicit type casting. Refer to M20140501
//! Fixed the problem on porting into under 32bit MCU
//! Issued by Mathias ClauBen, wizwiki forum ID Think01 and bobh
//! Thank for your interesting and serious advices.
//! <2013/10/21> 1st Release
//! <2013/12/20> V1.0.1
//! 1. Remove warning
//! 2. WIZCHIP_READ_BUF WIZCHIP_WRITE_BUF in case _WIZCHIP_IO_MODE_SPI_FDM_
//! for loop optimized(removed). refer to M20131220
//! \author MidnightCow
//! \copyright
//!
//! Copyright (c) 2013, WIZnet Co., LTD.
//! All rights reserved.
//!
//! Redistribution and use in source and binary forms, with or without
//! modification, are permitted provided that the following conditions
//! are met:
//!
//! * Redistributions of source code must retain the above copyright
//! notice, this list of conditions and the following disclaimer.
//! * Redistributions in binary form must reproduce the above copyright
//! notice, this list of conditions and the following disclaimer in the
//! documentation and/or other materials provided with the distribution.
//! * Neither the name of the <ORGANIZATION> nor the names of its
//! contributors may be used to endorse or promote products derived
//! from this software without specific prior written permission.
//!
//! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
//! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
//! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
//! THE POSSIBILITY OF SUCH DAMAGE.
//
//*****************************************************************************
#include "w5200.h"
#define SMASK (0x7ff) /* tx buffer mask */
#define RMASK (0x7ff) /* rx buffer mask */
#define SSIZE (2048) /* max tx buffer size */
#define RSIZE (2048) /* max rx buffer size */
#define TXBUF_BASE (0x8000)
#define RXBUF_BASE (0xc000)
#define SBASE(sn) (TXBUF_BASE + SSIZE * (sn)) /* tx buffer base for socket sn */
#define RBASE(sn) (RXBUF_BASE + RSIZE * (sn)) /* rx buffer base for socket sn */
uint8_t WIZCHIP_READ(uint32_t AddrSel) {
WIZCHIP_CRITICAL_ENTER();
WIZCHIP.CS._select();
uint8_t spi_data[4] = {
AddrSel >> 8,
AddrSel,
0x00,
0x01,
};
WIZCHIP.IF.SPI._write_bytes(spi_data, 4);
uint8_t ret;
WIZCHIP.IF.SPI._read_bytes(&ret, 1);
WIZCHIP.CS._deselect();
WIZCHIP_CRITICAL_EXIT();
return ret;
}
void WIZCHIP_WRITE(uint32_t AddrSel, uint8_t wb) {
WIZCHIP_CRITICAL_ENTER();
WIZCHIP.CS._select();
uint8_t spi_data[5] = {
AddrSel >> 8,
AddrSel,
0x80,
0x01,
wb,
};
WIZCHIP.IF.SPI._write_bytes(spi_data, 5);
WIZCHIP.CS._deselect();
WIZCHIP_CRITICAL_EXIT();
}
void WIZCHIP_READ_BUF(uint32_t AddrSel, uint8_t* pBuf, uint16_t len) {
WIZCHIP_CRITICAL_ENTER();
WIZCHIP.CS._select();
uint8_t spi_data[4] = {
AddrSel >> 8,
AddrSel,
0x00 | ((len >> 8) & 0x7f),
len & 0xff,
};
WIZCHIP.IF.SPI._write_bytes(spi_data, 4);
WIZCHIP.IF.SPI._read_bytes(pBuf, len);
WIZCHIP.CS._deselect();
WIZCHIP_CRITICAL_EXIT();
}
void WIZCHIP_WRITE_BUF(uint32_t AddrSel, uint8_t* pBuf, uint16_t len) {
WIZCHIP_CRITICAL_ENTER();
WIZCHIP.CS._select();
uint8_t spi_data[4] = {
AddrSel >> 8,
AddrSel,
0x80 | ((len >> 8) & 0x7f),
len & 0xff,
};
WIZCHIP.IF.SPI._write_bytes(spi_data, 4);
WIZCHIP.IF.SPI._write_bytes(pBuf, len);
WIZCHIP.CS._deselect();
WIZCHIP_CRITICAL_EXIT();
}
uint16_t getSn_TX_FSR(uint8_t sn) {
uint16_t val = 0, val1 = 0;
do {
val1 = (WIZCHIP_READ(Sn_TX_FSR(sn)) << 8) | WIZCHIP_READ(Sn_TX_FSR(sn) + 1);
if (val1 != 0) {
val = (WIZCHIP_READ(Sn_TX_FSR(sn)) << 8) | WIZCHIP_READ(Sn_TX_FSR(sn) + 1);
}
} while (val != val1);
return val;
}
uint16_t getSn_RX_RSR(uint8_t sn) {
uint16_t val = 0, val1 = 0;
do {
val1 = (WIZCHIP_READ(Sn_RX_RSR(sn)) << 8) | WIZCHIP_READ(Sn_RX_RSR(sn) + 1);
if (val1 != 0) {
val = (WIZCHIP_READ(Sn_RX_RSR(sn)) << 8) | WIZCHIP_READ(Sn_RX_RSR(sn) + 1);
}
} while (val != val1);
return val;
}
void wiz_send_data(uint8_t sn, uint8_t *wizdata, uint16_t len) {
if (len == 0) {
return;
}
uint16_t ptr = getSn_TX_WR(sn);
uint16_t offset = ptr & SMASK;
uint32_t addr = offset + SBASE(sn);
if (offset + len > SSIZE) {
// implement wrap-around circular buffer
uint16_t size = SSIZE - offset;
WIZCHIP_WRITE_BUF(addr, wizdata, size);
WIZCHIP_WRITE_BUF(SBASE(sn), wizdata + size, len - size);
} else {
WIZCHIP_WRITE_BUF(addr, wizdata, len);
}
ptr += len;
setSn_TX_WR(sn, ptr);
}
void wiz_recv_data(uint8_t sn, uint8_t *wizdata, uint16_t len) {
if (len == 0) {
return;
}
uint16_t ptr = getSn_RX_RD(sn);
uint16_t offset = ptr & RMASK;
uint16_t addr = RBASE(sn) + offset;
if (offset + len > RSIZE) {
// implement wrap-around circular buffer
uint16_t size = RSIZE - offset;
WIZCHIP_READ_BUF(addr, wizdata, size);
WIZCHIP_READ_BUF(RBASE(sn), wizdata + size, len - size);
} else {
WIZCHIP_READ_BUF(addr, wizdata, len);
}
ptr += len;
setSn_RX_RD(sn, ptr);
}
void wiz_recv_ignore(uint8_t sn, uint16_t len) {
uint16_t ptr = getSn_RX_RD(sn);
ptr += len;
setSn_RX_RD(sn, ptr);
}

File diff suppressed because it is too large Load Diff

View File

@ -1,246 +0,0 @@
//*****************************************************************************
//
//! \file w5500.c
//! \brief W5500 HAL Interface.
//! \version 1.0.1
//! \date 2013/10/21
//! \par Revision history
//! <2014/05/01> V1.0.2
//! 1. Implicit type casting -> Explicit type casting. Refer to M20140501
//! Fixed the problem on porting into under 32bit MCU
//! Issued by Mathias ClauBen, wizwiki forum ID Think01 and bobh
//! Thank for your interesting and serious advices.
//! <2013/10/21> 1st Release
//! <2013/12/20> V1.0.1
//! 1. Remove warning
//! 2. WIZCHIP_READ_BUF WIZCHIP_WRITE_BUF in case _WIZCHIP_IO_MODE_SPI_FDM_
//! for loop optimized(removed). refer to M20131220
//! \author MidnightCow
//! \copyright
//!
//! Copyright (c) 2013, WIZnet Co., LTD.
//! All rights reserved.
//!
//! Redistribution and use in source and binary forms, with or without
//! modification, are permitted provided that the following conditions
//! are met:
//!
//! * Redistributions of source code must retain the above copyright
//! notice, this list of conditions and the following disclaimer.
//! * Redistributions in binary form must reproduce the above copyright
//! notice, this list of conditions and the following disclaimer in the
//! documentation and/or other materials provided with the distribution.
//! * Neither the name of the <ORGANIZATION> nor the names of its
//! contributors may be used to endorse or promote products derived
//! from this software without specific prior written permission.
//!
//! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
//! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
//! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
//! THE POSSIBILITY OF SUCH DAMAGE.
//
//*****************************************************************************
//#include <stdio.h>
#include "w5500.h"
#define _W5500_SPI_VDM_OP_ 0x00
#define _W5500_SPI_FDM_OP_LEN1_ 0x01
#define _W5500_SPI_FDM_OP_LEN2_ 0x02
#define _W5500_SPI_FDM_OP_LEN4_ 0x03
////////////////////////////////////////////////////
#define LPC_SSP0 (0)
static void Chip_SSP_ReadFrames_Blocking(int dummy, uint8_t *buf, uint32_t len) {
WIZCHIP.IF.SPI._read_bytes(buf, len);
}
static void Chip_SSP_WriteFrames_Blocking(int dummy, const uint8_t *buf, uint32_t len) {
WIZCHIP.IF.SPI._write_bytes(buf, len);
}
uint8_t WIZCHIP_READ(uint32_t AddrSel)
{
uint8_t ret;
uint8_t spi_data[3];
WIZCHIP_CRITICAL_ENTER();
WIZCHIP.CS._select();
AddrSel |= (_W5500_SPI_READ_ | _W5500_SPI_VDM_OP_);
//WIZCHIP.IF.SPI._write_byte((AddrSel & 0x00FF0000) >> 16);
//WIZCHIP.IF.SPI._write_byte((AddrSel & 0x0000FF00) >> 8);
//WIZCHIP.IF.SPI._write_byte((AddrSel & 0x000000FF) >> 0);
//ret = WIZCHIP.IF.SPI._read_byte();
spi_data[0] = (AddrSel & 0x00FF0000) >> 16;
spi_data[1] = (AddrSel & 0x0000FF00) >> 8;
spi_data[2] = (AddrSel & 0x000000FF) >> 0;
Chip_SSP_WriteFrames_Blocking(LPC_SSP0, spi_data, 3);
Chip_SSP_ReadFrames_Blocking(LPC_SSP0, &ret, 1);
WIZCHIP.CS._deselect();
WIZCHIP_CRITICAL_EXIT();
return ret;
}
void WIZCHIP_WRITE(uint32_t AddrSel, uint8_t wb )
{
uint8_t spi_data[4];
WIZCHIP_CRITICAL_ENTER();
WIZCHIP.CS._select();
AddrSel |= (_W5500_SPI_WRITE_ | _W5500_SPI_VDM_OP_);
//WIZCHIP.IF.SPI._write_byte((AddrSel & 0x00FF0000) >> 16);
//WIZCHIP.IF.SPI._write_byte((AddrSel & 0x0000FF00) >> 8);
//WIZCHIP.IF.SPI._write_byte((AddrSel & 0x000000FF) >> 0);
//WIZCHIP.IF.SPI._write_byte(wb);
spi_data[0] = (AddrSel & 0x00FF0000) >> 16;
spi_data[1] = (AddrSel & 0x0000FF00) >> 8;
spi_data[2] = (AddrSel & 0x000000FF) >> 0;
spi_data[3] = wb;
Chip_SSP_WriteFrames_Blocking(LPC_SSP0, spi_data, 4);
WIZCHIP.CS._deselect();
WIZCHIP_CRITICAL_EXIT();
}
void WIZCHIP_READ_BUF (uint32_t AddrSel, uint8_t* pBuf, uint16_t len)
{
uint8_t spi_data[3];
//uint16_t i;
WIZCHIP_CRITICAL_ENTER();
WIZCHIP.CS._select();
AddrSel |= (_W5500_SPI_READ_ | _W5500_SPI_VDM_OP_);
//WIZCHIP.IF.SPI._write_byte((AddrSel & 0x00FF0000) >> 16);
//WIZCHIP.IF.SPI._write_byte((AddrSel & 0x0000FF00) >> 8);
//WIZCHIP.IF.SPI._write_byte((AddrSel & 0x000000FF) >> 0);
//for(i = 0; i < len; i++)
// pBuf[i] = WIZCHIP.IF.SPI._read_byte();
spi_data[0] = (AddrSel & 0x00FF0000) >> 16;
spi_data[1] = (AddrSel & 0x0000FF00) >> 8;
spi_data[2] = (AddrSel & 0x000000FF) >> 0;
Chip_SSP_WriteFrames_Blocking(LPC_SSP0, spi_data, 3);
Chip_SSP_ReadFrames_Blocking(LPC_SSP0, pBuf, len);
WIZCHIP.CS._deselect();
WIZCHIP_CRITICAL_EXIT();
}
void WIZCHIP_WRITE_BUF(uint32_t AddrSel, uint8_t* pBuf, uint16_t len)
{
uint8_t spi_data[3];
//uint16_t i;
WIZCHIP_CRITICAL_ENTER();
WIZCHIP.CS._select();
AddrSel |= (_W5500_SPI_WRITE_ | _W5500_SPI_VDM_OP_);
//WIZCHIP.IF.SPI._write_byte((AddrSel & 0x00FF0000) >> 16);
//WIZCHIP.IF.SPI._write_byte((AddrSel & 0x0000FF00) >> 8);
//WIZCHIP.IF.SPI._write_byte((AddrSel & 0x000000FF) >> 0);
//for(i = 0; i < len; i++)
// WIZCHIP.IF.SPI._write_byte(pBuf[i]);
spi_data[0] = (AddrSel & 0x00FF0000) >> 16;
spi_data[1] = (AddrSel & 0x0000FF00) >> 8;
spi_data[2] = (AddrSel & 0x000000FF) >> 0;
Chip_SSP_WriteFrames_Blocking(LPC_SSP0, spi_data, 3);
Chip_SSP_WriteFrames_Blocking(LPC_SSP0, pBuf, len);
WIZCHIP.CS._deselect();
WIZCHIP_CRITICAL_EXIT();
}
uint16_t getSn_TX_FSR(uint8_t sn)
{
uint16_t val=0,val1=0;
do
{
val1 = WIZCHIP_READ(Sn_TX_FSR(sn));
val1 = (val1 << 8) + WIZCHIP_READ(WIZCHIP_OFFSET_INC(Sn_TX_FSR(sn),1));
if (val1 != 0)
{
val = WIZCHIP_READ(Sn_TX_FSR(sn));
val = (val << 8) + WIZCHIP_READ(WIZCHIP_OFFSET_INC(Sn_TX_FSR(sn),1));
}
}while (val != val1);
return val;
}
uint16_t getSn_RX_RSR(uint8_t sn)
{
uint16_t val=0,val1=0;
do
{
val1 = WIZCHIP_READ(Sn_RX_RSR(sn));
val1 = (val1 << 8) + WIZCHIP_READ(WIZCHIP_OFFSET_INC(Sn_RX_RSR(sn),1));
if (val1 != 0)
{
val = WIZCHIP_READ(Sn_RX_RSR(sn));
val = (val << 8) + WIZCHIP_READ(WIZCHIP_OFFSET_INC(Sn_RX_RSR(sn),1));
}
}while (val != val1);
return val;
}
void wiz_send_data(uint8_t sn, uint8_t *wizdata, uint16_t len)
{
uint16_t ptr = 0;
uint32_t addrsel = 0;
if(len == 0) return;
ptr = getSn_TX_WR(sn);
//M20140501 : implict type casting -> explict type casting
//addrsel = (ptr << 8) + (WIZCHIP_TXBUF_BLOCK(sn) << 3);
addrsel = ((uint32_t)ptr << 8) + (WIZCHIP_TXBUF_BLOCK(sn) << 3);
//
WIZCHIP_WRITE_BUF(addrsel,wizdata, len);
ptr += len;
setSn_TX_WR(sn,ptr);
}
void wiz_recv_data(uint8_t sn, uint8_t *wizdata, uint16_t len)
{
uint16_t ptr = 0;
uint32_t addrsel = 0;
if(len == 0) return;
ptr = getSn_RX_RD(sn);
//M20140501 : implict type casting -> explict type casting
//addrsel = ((ptr << 8) + (WIZCHIP_RXBUF_BLOCK(sn) << 3);
addrsel = ((uint32_t)ptr << 8) + (WIZCHIP_RXBUF_BLOCK(sn) << 3);
//
WIZCHIP_READ_BUF(addrsel, wizdata, len);
ptr += len;
setSn_RX_RD(sn,ptr);
}
void wiz_recv_ignore(uint8_t sn, uint16_t len)
{
uint16_t ptr = 0;
ptr = getSn_RX_RD(sn);
ptr += len;
setSn_RX_RD(sn,ptr);
}

File diff suppressed because it is too large Load Diff

View File

@ -1,662 +0,0 @@
//****************************************************************************/
//!
//! \file wizchip_conf.c
//! \brief WIZCHIP Config Header File.
//! \version 1.0.1
//! \date 2013/10/21
//! \par Revision history
//! <2014/05/01> V1.0.1 Refer to M20140501
//! 1. Explicit type casting in wizchip_bus_readbyte() & wizchip_bus_writebyte()
// Issued by Mathias ClauBen.
//! uint32_t type converts into ptrdiff_t first. And then recoverting it into uint8_t*
//! For remove the warning when pointer type size is not 32bit.
//! If ptrdiff_t doesn't support in your complier, You should must replace ptrdiff_t into your suitable pointer type.
//! <2013/10/21> 1st Release
//! \author MidnightCow
//! \copyright
//!
//! Copyright (c) 2013, WIZnet Co., LTD.
//! All rights reserved.
//!
//! Redistribution and use in source and binary forms, with or without
//! modification, are permitted provided that the following conditions
//! are met:
//!
//! * Redistributions of source code must retain the above copyright
//! notice, this list of conditions and the following disclaimer.
//! * Redistributions in binary form must reproduce the above copyright
//! notice, this list of conditions and the following disclaimer in the
//! documentation and/or other materials provided with the distribution.
//! * Neither the name of the <ORGANIZATION> nor the names of its
//! contributors may be used to endorse or promote products derived
//! from this software without specific prior written permission.
//!
//! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
//! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
//! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
//! THE POSSIBILITY OF SUCH DAMAGE.
//
//*****************************************************************************/
//A20140501 : for use the type - ptrdiff_t
#include <stddef.h>
//
#include "wizchip_conf.h"
#include "socket.h"
/**
* @brief Default function to enable interrupt.
* @note This function help not to access wrong address. If you do not describe this function or register any functions,
* null function is called.
*/
void wizchip_cris_enter(void) {};
/**
* @brief Default function to disable interrupt.
* @note This function help not to access wrong address. If you do not describe this function or register any functions,
* null function is called.
*/
void wizchip_cris_exit(void) {};
/**
* @brief Default function to select chip.
* @note This function help not to access wrong address. If you do not describe this function or register any functions,
* null function is called.
*/
void wizchip_cs_select(void) {};
/**
* @brief Default function to deselect chip.
* @note This function help not to access wrong address. If you do not describe this function or register any functions,
* null function is called.
*/
void wizchip_cs_deselect(void) {};
/**
* @brief Default function to read in direct or indirect interface.
* @note This function help not to access wrong address. If you do not describe this function or register any functions,
* null function is called.
*/
//M20140501 : Explict pointer type casting
//uint8_t wizchip_bus_readbyte(uint32_t AddrSel) { return * ((volatile uint8_t *) AddrSel); };
uint8_t wizchip_bus_readbyte(uint32_t AddrSel) { return * ((volatile uint8_t *)((ptrdiff_t) AddrSel)); };
/**
* @brief Default function to write in direct or indirect interface.
* @note This function help not to access wrong address. If you do not describe this function or register any functions,
* null function is called.
*/
//M20140501 : Explict pointer type casting
//void wizchip_bus_writebyte(uint32_t AddrSel, uint8_t wb) { *((volatile uint8_t*) AddrSel) = wb; };
void wizchip_bus_writebyte(uint32_t AddrSel, uint8_t wb) { *((volatile uint8_t*)((ptrdiff_t)AddrSel)) = wb; };
/**
* @brief Default function to read in SPI interface.
* @note This function help not to access wrong address. If you do not describe this function or register any functions,
* null function is called.
*/
void wizchip_spi_readbytes(uint8_t *buf, uint32_t len) {}
/**
* @brief Default function to write in SPI interface.
* @note This function help not to access wrong address. If you do not describe this function or register any functions,
* null function is called.
*/
void wizchip_spi_writebytes(const uint8_t *buf, uint32_t len) {}
/**
* @\ref _WIZCHIP instance
*/
_WIZCHIP WIZCHIP =
{
.id = _WIZCHIP_ID_,
.if_mode = _WIZCHIP_IO_MODE_,
.CRIS._enter = wizchip_cris_enter,
.CRIS._exit = wizchip_cris_exit,
.CS._select = wizchip_cs_select,
.CS._deselect = wizchip_cs_deselect,
.IF.BUS._read_byte = wizchip_bus_readbyte,
.IF.BUS._write_byte = wizchip_bus_writebyte
// .IF.SPI._read_byte = wizchip_spi_readbyte,
// .IF.SPI._write_byte = wizchip_spi_writebyte
};
#if _WIZCHIP_ == 5200 // for W5200 ARP errata
static uint8_t _SUBN_[4]; // subnet
#endif
static uint8_t _DNS_[4]; // DNS server ip address
static dhcp_mode _DHCP_; // DHCP mode
void reg_wizchip_cris_cbfunc(void(*cris_en)(void), void(*cris_ex)(void))
{
if(!cris_en || !cris_ex)
{
WIZCHIP.CRIS._enter = wizchip_cris_enter;
WIZCHIP.CRIS._exit = wizchip_cris_exit;
}
else
{
WIZCHIP.CRIS._enter = cris_en;
WIZCHIP.CRIS._exit = cris_ex;
}
}
void reg_wizchip_cs_cbfunc(void(*cs_sel)(void), void(*cs_desel)(void))
{
if(!cs_sel || !cs_desel)
{
WIZCHIP.CS._select = wizchip_cs_select;
WIZCHIP.CS._deselect = wizchip_cs_deselect;
}
else
{
WIZCHIP.CS._select = cs_sel;
WIZCHIP.CS._deselect = cs_desel;
}
}
void reg_wizchip_bus_cbfunc(uint8_t(*bus_rb)(uint32_t addr), void (*bus_wb)(uint32_t addr, uint8_t wb))
{
while(!(WIZCHIP.if_mode & _WIZCHIP_IO_MODE_BUS_));
if(!bus_rb || !bus_wb)
{
WIZCHIP.IF.BUS._read_byte = wizchip_bus_readbyte;
WIZCHIP.IF.BUS._write_byte = wizchip_bus_writebyte;
}
else
{
WIZCHIP.IF.BUS._read_byte = bus_rb;
WIZCHIP.IF.BUS._write_byte = bus_wb;
}
}
void reg_wizchip_spi_cbfunc(void (*spi_rb)(uint8_t *, uint32_t), void (*spi_wb)(const uint8_t *, uint32_t))
{
while(!(WIZCHIP.if_mode & _WIZCHIP_IO_MODE_SPI_));
if(!spi_rb || !spi_wb)
{
WIZCHIP.IF.SPI._read_bytes = wizchip_spi_readbytes;
WIZCHIP.IF.SPI._write_bytes = wizchip_spi_writebytes;
}
else
{
WIZCHIP.IF.SPI._read_bytes = spi_rb;
WIZCHIP.IF.SPI._write_bytes = spi_wb;
}
}
int8_t ctlwizchip(ctlwizchip_type cwtype, void* arg)
{
uint8_t tmp = 0;
uint8_t* ptmp[2] = {0,0};
switch(cwtype)
{
case CW_RESET_WIZCHIP:
wizchip_sw_reset();
break;
case CW_INIT_WIZCHIP:
if(arg != 0)
{
ptmp[0] = (uint8_t*)arg;
ptmp[1] = ptmp[0] + _WIZCHIP_SOCK_NUM_;
}
return wizchip_init(ptmp[0], ptmp[1]);
case CW_CLR_INTERRUPT:
wizchip_clrinterrupt(*((intr_kind*)arg));
break;
case CW_GET_INTERRUPT:
*((intr_kind*)arg) = wizchip_getinterrupt();
break;
case CW_SET_INTRMASK:
wizchip_setinterruptmask(*((intr_kind*)arg));
break;
case CW_GET_INTRMASK:
*((intr_kind*)arg) = wizchip_getinterruptmask();
break;
#if _WIZCHIP_ > 5100
case CW_SET_INTRTIME:
setINTLEVEL(*(uint16_t*)arg);
break;
case CW_GET_INTRTIME:
*(uint16_t*)arg = getINTLEVEL();
break;
#endif
case CW_GET_ID:
((uint8_t*)arg)[0] = WIZCHIP.id[0];
((uint8_t*)arg)[1] = WIZCHIP.id[1];
((uint8_t*)arg)[2] = WIZCHIP.id[2];
((uint8_t*)arg)[3] = WIZCHIP.id[3];
((uint8_t*)arg)[4] = WIZCHIP.id[4];
((uint8_t*)arg)[5] = 0;
break;
#if _WIZCHIP_ == 5500
case CW_RESET_PHY:
wizphy_reset();
break;
case CW_SET_PHYCONF:
wizphy_setphyconf((wiz_PhyConf*)arg);
break;
case CW_GET_PHYCONF:
wizphy_getphyconf((wiz_PhyConf*)arg);
break;
case CW_GET_PHYSTATUS:
break;
case CW_SET_PHYPOWMODE:
return wizphy_setphypmode(*(uint8_t*)arg);
#endif
case CW_GET_PHYPOWMODE:
tmp = wizphy_getphypmode();
if((int8_t)tmp == -1) return -1;
*(uint8_t*)arg = tmp;
break;
case CW_GET_PHYLINK:
tmp = wizphy_getphylink();
if((int8_t)tmp == -1) return -1;
*(uint8_t*)arg = tmp;
break;
default:
return -1;
}
return 0;
}
int8_t ctlnetwork(ctlnetwork_type cntype, void* arg)
{
switch(cntype)
{
case CN_SET_NETINFO:
wizchip_setnetinfo((wiz_NetInfo*)arg);
break;
case CN_GET_NETINFO:
wizchip_getnetinfo((wiz_NetInfo*)arg);
break;
case CN_SET_NETMODE:
return wizchip_setnetmode(*(netmode_type*)arg);
case CN_GET_NETMODE:
*(netmode_type*)arg = wizchip_getnetmode();
break;
case CN_SET_TIMEOUT:
wizchip_settimeout((wiz_NetTimeout*)arg);
break;
case CN_GET_TIMEOUT:
wizchip_gettimeout((wiz_NetTimeout*)arg);
break;
default:
return -1;
}
return 0;
}
void wizchip_sw_reset(void)
{
uint8_t gw[4], sn[4], sip[4];
uint8_t mac[6];
getSHAR(mac);
getGAR(gw); getSUBR(sn); getSIPR(sip);
setMR(MR_RST);
getMR(); // for delay
setSHAR(mac);
setGAR(gw);
setSUBR(sn);
setSIPR(sip);
}
int8_t wizchip_init(uint8_t* txsize, uint8_t* rxsize)
{
int8_t i;
int8_t tmp = 0;
wizchip_sw_reset();
if(txsize)
{
tmp = 0;
for(i = 0 ; i < _WIZCHIP_SOCK_NUM_; i++)
tmp += txsize[i];
if(tmp > 16) return -1;
for(i = 0 ; i < _WIZCHIP_SOCK_NUM_; i++)
setSn_TXBUF_SIZE(i, txsize[i]);
}
if(rxsize)
{
tmp = 0;
for(i = 0 ; i < _WIZCHIP_SOCK_NUM_; i++)
tmp += rxsize[i];
if(tmp > 16) return -1;
for(i = 0 ; i < _WIZCHIP_SOCK_NUM_; i++)
setSn_RXBUF_SIZE(i, rxsize[i]);
}
WIZCHIP_EXPORT(socket_reset)();
return 0;
}
void wizchip_clrinterrupt(intr_kind intr)
{
uint8_t ir = (uint8_t)intr;
uint8_t sir = (uint8_t)((uint16_t)intr >> 8);
#if _WIZCHIP_ < 5500
ir |= (1<<4); // IK_WOL
#endif
#if _WIZCHIP_ == 5200
ir |= (1 << 6);
#endif
#if _WIZCHIP_ < 5200
sir &= 0x0F;
#endif
#if _WIZCHIP_ == 5100
ir |= sir;
setIR(ir);
#else
setIR(ir);
setSIR(sir);
#endif
}
intr_kind wizchip_getinterrupt(void)
{
uint8_t ir = 0;
uint8_t sir = 0;
uint16_t ret = 0;
#if _WIZCHIP_ == 5100
ir = getIR();
sir = ir 0x0F;
#else
ir = getIR();
sir = getSIR();
#endif
#if _WIZCHIP_ < 5500
ir &= ~(1<<4); // IK_WOL
#endif
#if _WIZCHIP_ == 5200
ir &= ~(1 << 6);
#endif
ret = sir;
ret = (ret << 8) + ir;
return (intr_kind)ret;
}
void wizchip_setinterruptmask(intr_kind intr)
{
uint8_t imr = (uint8_t)intr;
uint8_t simr = (uint8_t)((uint16_t)intr >> 8);
#if _WIZCHIP_ < 5500
imr &= ~(1<<4); // IK_WOL
#endif
#if _WIZCHIP_ == 5200
imr &= ~(1 << 6);
#endif
#if _WIZCHIP_ < 5200
simr &= 0x0F;
#endif
#if _WIZCHIP_ == 5100
imr |= simr;
setIMR(imr);
#else
setIMR(imr);
setSIMR(simr);
#endif
}
intr_kind wizchip_getinterruptmask(void)
{
uint8_t imr = 0;
uint8_t simr = 0;
uint16_t ret = 0;
#if _WIZCHIP_ == 5100
imr = getIMR();
simr = imr 0x0F;
#else
imr = getIMR();
simr = getSIMR();
#endif
#if _WIZCHIP_ < 5500
imr &= ~(1<<4); // IK_WOL
#endif
#if _WIZCHIP_ == 5200
imr &= ~(1 << 6); // IK_DEST_UNREACH
#endif
ret = simr;
ret = (ret << 8) + imr;
return (intr_kind)ret;
}
int8_t wizphy_getphylink(void)
{
int8_t tmp;
#if _WIZCHIP_ == 5200
if(getPHYSTATUS() & PHYSTATUS_LINK)
tmp = PHY_LINK_ON;
else
tmp = PHY_LINK_OFF;
#elif _WIZCHIP_ == 5500
if(getPHYCFGR() & PHYCFGR_LNK_ON)
tmp = PHY_LINK_ON;
else
tmp = PHY_LINK_OFF;
#else
tmp = -1;
#endif
return tmp;
}
#if _WIZCHIP_ > 5100
int8_t wizphy_getphypmode(void)
{
int8_t tmp = 0;
#if _WIZCHIP_ == 5200
if(getPHYSTATUS() & PHYSTATUS_POWERDOWN)
tmp = PHY_POWER_DOWN;
else
tmp = PHY_POWER_NORM;
#elif _WIZCHIP_ == 5500
if(getPHYCFGR() & PHYCFGR_OPMDC_PDOWN)
tmp = PHY_POWER_DOWN;
else
tmp = PHY_POWER_NORM;
#else
tmp = -1;
#endif
return tmp;
}
#endif
#if _WIZCHIP_ == 5500
void wizphy_reset(void)
{
uint8_t tmp = getPHYCFGR();
tmp &= PHYCFGR_RST;
setPHYCFGR(tmp);
tmp = getPHYCFGR();
tmp |= ~PHYCFGR_RST;
setPHYCFGR(tmp);
}
void wizphy_setphyconf(wiz_PhyConf* phyconf)
{
uint8_t tmp = 0;
if(phyconf->by == PHY_CONFBY_SW)
tmp |= PHYCFGR_OPMD;
else
tmp &= ~PHYCFGR_OPMD;
if(phyconf->mode == PHY_MODE_AUTONEGO)
tmp |= PHYCFGR_OPMDC_ALLA;
else
{
if(phyconf->duplex == PHY_DUPLEX_FULL)
{
if(phyconf->speed == PHY_SPEED_100)
tmp |= PHYCFGR_OPMDC_100F;
else
tmp |= PHYCFGR_OPMDC_10F;
}
else
{
if(phyconf->speed == PHY_SPEED_100)
tmp |= PHYCFGR_OPMDC_100H;
else
tmp |= PHYCFGR_OPMDC_10H;
}
}
setPHYCFGR(tmp);
wizphy_reset();
}
void wizphy_getphyconf(wiz_PhyConf* phyconf)
{
uint8_t tmp = 0;
tmp = getPHYCFGR();
phyconf->by = (tmp & PHYCFGR_OPMD) ? PHY_CONFBY_SW : PHY_CONFBY_HW;
switch(tmp & PHYCFGR_OPMDC_ALLA)
{
case PHYCFGR_OPMDC_ALLA:
case PHYCFGR_OPMDC_100FA:
phyconf->mode = PHY_MODE_AUTONEGO;
break;
default:
phyconf->mode = PHY_MODE_MANUAL;
break;
}
switch(tmp & PHYCFGR_OPMDC_ALLA)
{
case PHYCFGR_OPMDC_100FA:
case PHYCFGR_OPMDC_100F:
case PHYCFGR_OPMDC_100H:
phyconf->speed = PHY_SPEED_100;
break;
default:
phyconf->speed = PHY_SPEED_10;
break;
}
switch(tmp & PHYCFGR_OPMDC_ALLA)
{
case PHYCFGR_OPMDC_100FA:
case PHYCFGR_OPMDC_100F:
case PHYCFGR_OPMDC_10F:
phyconf->duplex = PHY_DUPLEX_FULL;
break;
default:
phyconf->duplex = PHY_DUPLEX_HALF;
break;
}
}
void wizphy_getphystat(wiz_PhyConf* phyconf)
{
uint8_t tmp = getPHYCFGR();
phyconf->duplex = (tmp & PHYCFGR_DPX_FULL) ? PHY_DUPLEX_FULL : PHY_DUPLEX_HALF;
phyconf->speed = (tmp & PHYCFGR_SPD_100) ? PHY_SPEED_100 : PHY_SPEED_10;
}
int8_t wizphy_setphypmode(uint8_t pmode)
{
uint8_t tmp = 0;
tmp = getPHYCFGR();
if((tmp & PHYCFGR_OPMD)== 0) return -1;
tmp &= ~PHYCFGR_OPMDC_ALLA;
if( pmode == PHY_POWER_DOWN)
tmp |= PHYCFGR_OPMDC_PDOWN;
else
tmp |= PHYCFGR_OPMDC_ALLA;
setPHYCFGR(tmp);
wizphy_reset();
tmp = getPHYCFGR();
if( pmode == PHY_POWER_DOWN)
{
if(tmp & PHYCFGR_OPMDC_PDOWN) return 0;
}
else
{
if(tmp & PHYCFGR_OPMDC_ALLA) return 0;
}
return -1;
}
#endif
void wizchip_setnetinfo(wiz_NetInfo* pnetinfo)
{
setSHAR(pnetinfo->mac);
setGAR(pnetinfo->gw);
setSUBR(pnetinfo->sn);
setSIPR(pnetinfo->ip);
#if _WIZCHIP_ == 5200 // for W5200 ARP errata
_SUBN_[0] = pnetinfo->sn[0];
_SUBN_[1] = pnetinfo->sn[1];
_SUBN_[2] = pnetinfo->sn[2];
_SUBN_[3] = pnetinfo->sn[3];
#endif
_DNS_[0] = pnetinfo->dns[0];
_DNS_[1] = pnetinfo->dns[1];
_DNS_[2] = pnetinfo->dns[2];
_DNS_[3] = pnetinfo->dns[3];
_DHCP_ = pnetinfo->dhcp;
}
void wizchip_getnetinfo(wiz_NetInfo* pnetinfo)
{
getSHAR(pnetinfo->mac);
getGAR(pnetinfo->gw);
getSUBR(pnetinfo->sn);
getSIPR(pnetinfo->ip);
#if _WIZCHIP_ == 5200 // for W5200 ARP errata
pnetinfo->sn[0] = _SUBN_[0];
pnetinfo->sn[1] = _SUBN_[1];
pnetinfo->sn[2] = _SUBN_[2];
pnetinfo->sn[3] = _SUBN_[3];
#endif
pnetinfo->dns[0]= _DNS_[0];
pnetinfo->dns[1]= _DNS_[1];
pnetinfo->dns[2]= _DNS_[2];
pnetinfo->dns[3]= _DNS_[3];
pnetinfo->dhcp = _DHCP_;
}
#if _WIZCHIP_ == 5200 // for W5200 ARP errata
uint8_t *wizchip_getsubn(void) {
return _SUBN_;
}
#endif
int8_t wizchip_setnetmode(netmode_type netmode)
{
uint8_t tmp = 0;
#if _WIZCHIP_ != 5500
if(netmode & ~(NM_WAKEONLAN | NM_PPPOE | NM_PINGBLOCK)) return -1;
#else
if(netmode & ~(NM_WAKEONLAN | NM_PPPOE | NM_PINGBLOCK | NM_FORCEARP)) return -1;
#endif
tmp = getMR();
tmp |= (uint8_t)netmode;
setMR(tmp);
return 0;
}
netmode_type wizchip_getnetmode(void)
{
return (netmode_type) getMR();
}
void wizchip_settimeout(wiz_NetTimeout* nettime)
{
setRCR(nettime->retry_cnt);
setRTR(nettime->time_100us);
}
void wizchip_gettimeout(wiz_NetTimeout* nettime)
{
nettime->retry_cnt = getRCR();
nettime->time_100us = getRTR();
}

View File

@ -1,554 +0,0 @@
//*****************************************************************************
//
//! \file wizchip_conf.h
//! \brief WIZCHIP Config Header File.
//! \version 1.0.0
//! \date 2013/10/21
//! \par Revision history
//! <2013/10/21> 1st Release
//! \author MidnightCow
//! \copyright
//!
//! Copyright (c) 2013, WIZnet Co., LTD.
//! All rights reserved.
//!
//! Redistribution and use in source and binary forms, with or without
//! modification, are permitted provided that the following conditions
//! are met:
//!
//! * Redistributions of source code must retain the above copyright
//! notice, this list of conditions and the following disclaimer.
//! * Redistributions in binary form must reproduce the above copyright
//! notice, this list of conditions and the following disclaimer in the
//! documentation and/or other materials provided with the distribution.
//! * Neither the name of the <ORGANIZATION> nor the names of its
//! contributors may be used to endorse or promote products derived
//! from this software without specific prior written permission.
//!
//! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
//! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
//! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
//! THE POSSIBILITY OF SUCH DAMAGE.
//
//*****************************************************************************
/**
* @defgroup extra_functions 2. WIZnet Extra Functions
*
* @brief These functions is optional function. It could be replaced at WIZCHIP I/O function because they were made by WIZCHIP I/O functions.
* @details There are functions of configuring WIZCHIP, network, interrupt, phy, network information and timer. \n
*
*/
#ifndef _WIZCHIP_CONF_H_
#define _WIZCHIP_CONF_H_
#include <stdint.h>
/**
* @brief Select WIZCHIP.
* @todo You should select one, \b 5100, \b 5200 ,\b 5500 or etc. \n\n
* ex> <code> #define \_WIZCHIP_ 5500 </code>
*/
#ifndef _WIZCHIP_
#define _WIZCHIP_ 5200 // 5100, 5200, 5500
#endif
#define _WIZCHIP_IO_MODE_NONE_ 0x0000
#define _WIZCHIP_IO_MODE_BUS_ 0x0100 /**< Bus interface mode */
#define _WIZCHIP_IO_MODE_SPI_ 0x0200 /**< SPI interface mode */
//#define _WIZCHIP_IO_MODE_IIC_ 0x0400
//#define _WIZCHIP_IO_MODE_SDIO_ 0x0800
// Add to
//
#define _WIZCHIP_IO_MODE_BUS_DIR_ (_WIZCHIP_IO_MODE_BUS_ + 1) /**< BUS interface mode for direct */
#define _WIZCHIP_IO_MODE_BUS_INDIR_ (_WIZCHIP_IO_MODE_BUS_ + 2) /**< BUS interface mode for indirect */
#define _WIZCHIP_IO_MODE_SPI_VDM_ (_WIZCHIP_IO_MODE_SPI_ + 1) /**< SPI interface mode for variable length data*/
#define _WIZCHIP_IO_MODE_SPI_FDM_ (_WIZCHIP_IO_MODE_SPI_ + 2) /**< SPI interface mode for fixed length data mode*/
#if (_WIZCHIP_ == 5100)
#define _WIZCHIP_ID_ "W5100\0"
/**
* @brief Define interface mode.
* @todo you should select interface mode as chip. Select one of @ref \_WIZCHIP_IO_MODE_SPI_ , @ref \_WIZCHIP_IO_MODE_BUS_DIR_ or @ref \_WIZCHIP_IO_MODE_BUS_INDIR_
*/
// #define _WIZCHIP_IO_MODE_ _WIZCHIP_IO_MODE_BUS_DIR_
// #define _WIZCHIP_IO_MODE_ _WIZCHIP_IO_MODE_BUS_INDIR_
#define _WIZCHIP_IO_MODE_ _WIZCHIP_IO_MODE_SPI_
#elif (_WIZCHIP_ == 5200)
#define _WIZCHIP_ID_ "W5200\0"
/**
* @brief Define interface mode.
* @todo you should select interface mode as chip. Select one of @ref \_WIZCHIP_IO_MODE_SPI_ or @ref \_WIZCHIP_IO_MODE_BUS_INDIR_
*/
// #define _WIZCHIP_IO_MODE_ _WIZCHIP_IO_MODE_BUS_INDIR_
#define _WIZCHIP_IO_MODE_ _WIZCHIP_IO_MODE_SPI_
#include "w5200/w5200.h"
#elif (_WIZCHIP_ == 5500)
#define _WIZCHIP_ID_ "W5500\0"
/**
* @brief Define interface mode. \n
* @todo Should select interface mode as chip.
* - @ref \_WIZCHIP_IO_MODE_SPI_ \n
* -@ref \_WIZCHIP_IO_MODE_SPI_VDM_ : Valid only in @ref \_WIZCHIP_ == 5500 \n
* -@ref \_WIZCHIP_IO_MODE_SPI_FDM_ : Valid only in @ref \_WIZCHIP_ == 5500 \n
* - @ref \_WIZCHIP_IO_MODE_BUS_ \n
* - @ref \_WIZCHIP_IO_MODE_BUS_DIR_ \n
* - @ref \_WIZCHIP_IO_MODE_BUS_INDIR_ \n
* - Others will be defined in future. \n\n
* ex> <code> #define \_WIZCHIP_IO_MODE_ \_WIZCHIP_IO_MODE_SPI_VDM_ </code>
*
*/
//#define _WIZCHIP_IO_MODE_ _WIZCHIP_IO_MODE_SPI_FDM_
#define _WIZCHIP_IO_MODE_ _WIZCHIP_IO_MODE_SPI_VDM_
#include "w5500/w5500.h"
#else
#error "Unknown defined _WIZCHIP_. You should define one of 5100, 5200, and 5500 !!!"
#endif
#ifndef _WIZCHIP_IO_MODE_
#error "Undefined _WIZCHIP_IO_MODE_. You should define it !!!"
#endif
/**
* @brief Define I/O base address when BUS IF mode.
* @todo Should re-define it to fit your system when BUS IF Mode (@ref \_WIZCHIP_IO_MODE_BUS_,
* @ref \_WIZCHIP_IO_MODE_BUS_DIR_, @ref \_WIZCHIP_IO_MODE_BUS_INDIR_). \n\n
* ex> <code> #define \_WIZCHIP_IO_BASE_ 0x00008000 </code>
*/
#define _WIZCHIP_IO_BASE_ 0x00000000 //
#if _WIZCHIP_IO_MODE_ & _WIZCHIP_IO_MODE_BUS_
#ifndef _WIZCHIP_IO_BASE_
#error "You should be define _WIZCHIP_IO_BASE to fit your system memory map."
#endif
#endif
#if _WIZCHIP_ > 5100
#define _WIZCHIP_SOCK_NUM_ 8 ///< The count of independant socket of @b WIZCHIP
#else
#define _WIZCHIP_SOCK_NUM_ 4 ///< The count of independant socket of @b WIZCHIP
#endif
/********************************************************
* WIZCHIP BASIC IF functions for SPI, SDIO, I2C , ETC.
*********************************************************/
/**
* @ingroup DATA_TYPE
* @brief The set of callback functions for W5500:@ref WIZCHIP_IO_Functions W5200:@ref WIZCHIP_IO_Functions_W5200
*/
typedef struct __WIZCHIP
{
uint16_t if_mode; ///< host interface mode
uint8_t id[6]; ///< @b WIZCHIP ID such as @b 5100, @b 5200, @b 5500, and so on.
/**
* The set of critical section callback func.
*/
struct _CRIS
{
void (*_enter) (void); ///< crtical section enter
void (*_exit) (void); ///< critial section exit
}CRIS;
/**
* The set of @ref\_WIZCHIP_ select control callback func.
*/
struct _CS
{
void (*_select) (void); ///< @ref \_WIZCHIP_ selected
void (*_deselect)(void); ///< @ref \_WIZCHIP_ deselected
}CS;
/**
* The set of interface IO callback func.
*/
union _IF
{
/**
* For BUS interface IO
*/
struct
{
uint8_t (*_read_byte) (uint32_t AddrSel);
void (*_write_byte) (uint32_t AddrSel, uint8_t wb);
}BUS;
/**
* For SPI interface IO
*/
struct
{
void (*_read_bytes) (uint8_t *buf, uint32_t len);
void (*_write_bytes) (const uint8_t *buf, uint32_t len);
}SPI;
// To be added
//
}IF;
}_WIZCHIP;
extern _WIZCHIP WIZCHIP;
/**
* @ingroup DATA_TYPE
* WIZCHIP control type enumration used in @ref ctlwizchip().
*/
typedef enum
{
CW_RESET_WIZCHIP, ///< Resets WIZCHIP by softly
CW_INIT_WIZCHIP, ///< Inializes to WIZCHIP with SOCKET buffer size 2 or 1 dimension array typed uint8_t.
CW_GET_INTERRUPT, ///< Get Interrupt status of WIZCHIP
CW_CLR_INTERRUPT, ///< Clears interrupt
CW_SET_INTRMASK, ///< Masks interrupt
CW_GET_INTRMASK, ///< Get interrupt mask
CW_SET_INTRTIME, ///< Set interval time between the current and next interrupt.
CW_GET_INTRTIME, ///< Set interval time between the current and next interrupt.
CW_GET_ID, ///< Gets WIZCHIP name.
#if _WIZCHIP_ == 5500
CW_RESET_PHY, ///< Resets internal PHY. Valid Only W5000
CW_SET_PHYCONF, ///< When PHY configured by interal register, PHY operation mode (Manual/Auto, 10/100, Half/Full). Valid Only W5000
CW_GET_PHYCONF, ///< Get PHY operation mode in interal register. Valid Only W5000
CW_GET_PHYSTATUS, ///< Get real PHY status on operating. Valid Only W5000
CW_SET_PHYPOWMODE, ///< Set PHY power mode as noraml and down when PHYSTATUS.OPMD == 1. Valid Only W5000
#endif
CW_GET_PHYPOWMODE, ///< Get PHY Power mode as down or normal
CW_GET_PHYLINK ///< Get PHY Link status
}ctlwizchip_type;
/**
* @ingroup DATA_TYPE
* Network control type enumration used in @ref ctlnetwork().
*/
typedef enum
{
CN_SET_NETINFO, ///< Set Network with @ref wiz_NetInfo
CN_GET_NETINFO, ///< Get Network with @ref wiz_NetInfo
CN_SET_NETMODE, ///< Set network mode as WOL, PPPoE, Ping Block, and Force ARP mode
CN_GET_NETMODE, ///< Get network mode as WOL, PPPoE, Ping Block, and Force ARP mode
CN_SET_TIMEOUT, ///< Set network timeout as retry count and time.
CN_GET_TIMEOUT, ///< Get network timeout as retry count and time.
}ctlnetwork_type;
/**
* @ingroup DATA_TYPE
* Interrupt kind when CW_SET_INTRRUPT, CW_GET_INTERRUPT, CW_SET_INTRMASK
* and CW_GET_INTRMASK is used in @ref ctlnetwork().
* It can be used with OR operation.
*/
typedef enum
{
#if _WIZCHIP_ > 5200
IK_WOL = (1 << 4), ///< Wake On Lan by receiving the magic packet. Valid in W500.
#endif
IK_PPPOE_TERMINATED = (1 << 5), ///< PPPoE Disconnected
#if _WIZCHIP_ != 5200
IK_DEST_UNREACH = (1 << 6), ///< Destination IP & Port Unreable, No use in W5200
#endif
IK_IP_CONFLICT = (1 << 7), ///< IP conflict occurred
IK_SOCK_0 = (1 << 8), ///< Socket 0 interrupt
IK_SOCK_1 = (1 << 9), ///< Socket 1 interrupt
IK_SOCK_2 = (1 << 10), ///< Socket 2 interrupt
IK_SOCK_3 = (1 << 11), ///< Socket 3 interrupt
#if _WIZCHIP_ > 5100
IK_SOCK_4 = (1 << 12), ///< Socket 4 interrupt, No use in 5100
IK_SOCK_5 = (1 << 13), ///< Socket 5 interrupt, No use in 5100
IK_SOCK_6 = (1 << 14), ///< Socket 6 interrupt, No use in 5100
IK_SOCK_7 = (1 << 15), ///< Socket 7 interrupt, No use in 5100
#endif
#if _WIZCHIP_ > 5100
IK_SOCK_ALL = (0xFF << 8) ///< All Socket interrpt
#else
IK_SOCK_ALL = (0x0F << 8) ///< All Socket interrpt
#endif
}intr_kind;
#define PHY_CONFBY_HW 0 ///< Configured PHY operation mode by HW pin
#define PHY_CONFBY_SW 1 ///< Configured PHY operation mode by SW register
#define PHY_MODE_MANUAL 0 ///< Configured PHY operation mode with user setting.
#define PHY_MODE_AUTONEGO 1 ///< Configured PHY operation mode with auto-negotiation
#define PHY_SPEED_10 0 ///< Link Speed 10
#define PHY_SPEED_100 1 ///< Link Speed 100
#define PHY_DUPLEX_HALF 0 ///< Link Half-Duplex
#define PHY_DUPLEX_FULL 1 ///< Link Full-Duplex
#define PHY_LINK_OFF 0 ///< Link Off
#define PHY_LINK_ON 1 ///< Link On
#define PHY_POWER_NORM 0 ///< PHY power normal mode
#define PHY_POWER_DOWN 1 ///< PHY power down mode
#if _WIZCHIP_ == 5500
/**
* @ingroup DATA_TYPE
* It configures PHY configuration when CW_SET PHYCONF or CW_GET_PHYCONF in W5500,
* and it indicates the real PHY status configured by HW or SW in all WIZCHIP. \n
* Valid only in W5500.
*/
typedef struct wiz_PhyConf_t
{
uint8_t by; ///< set by @ref PHY_CONFBY_HW or @ref PHY_CONFBY_SW
uint8_t mode; ///< set by @ref PHY_MODE_MANUAL or @ref PHY_MODE_AUTONEGO
uint8_t speed; ///< set by @ref PHY_SPEED_10 or @ref PHY_SPEED_100
uint8_t duplex; ///< set by @ref PHY_DUPLEX_HALF @ref PHY_DUPLEX_FULL
//uint8_t power; ///< set by @ref PHY_POWER_NORM or @ref PHY_POWER_DOWN
//uint8_t link; ///< Valid only in CW_GET_PHYSTATUS. set by @ref PHY_LINK_ON or PHY_DUPLEX_OFF
}wiz_PhyConf;
#endif
/**
* @ingroup DATA_TYPE
* It used in setting dhcp_mode of @ref wiz_NetInfo.
*/
typedef enum
{
NETINFO_STATIC = 1, ///< Static IP configuration by manually.
NETINFO_DHCP ///< Dynamic IP configruation from a DHCP sever
}dhcp_mode;
/**
* @ingroup DATA_TYPE
* Network Information for WIZCHIP
*/
typedef struct wiz_NetInfo_t
{
uint8_t mac[6]; ///< Source Mac Address
uint8_t ip[4]; ///< Source IP Address
uint8_t sn[4]; ///< Subnet Mask
uint8_t gw[4]; ///< Gateway IP Address
uint8_t dns[4]; ///< DNS server IP Address
dhcp_mode dhcp; ///< 1 - Static, 2 - DHCP
}wiz_NetInfo;
/**
* @ingroup DATA_TYPE
* Network mode
*/
typedef enum
{
#if _WIZCHIP_ == 5500
NM_FORCEARP = (1<<1), ///< Force to APP send whenever udp data is sent. Valid only in W5500
#endif
NM_WAKEONLAN = (1<<5), ///< Wake On Lan
NM_PINGBLOCK = (1<<4), ///< Block ping-request
NM_PPPOE = (1<<3), ///< PPPoE mode
}netmode_type;
/**
* @ingroup DATA_TYPE
* Used in CN_SET_TIMEOUT or CN_GET_TIMEOUT of @ref ctlwizchip() for timeout configruation.
*/
typedef struct wiz_NetTimeout_t
{
uint8_t retry_cnt; ///< retry count
uint16_t time_100us; ///< time unit 100us
}wiz_NetTimeout;
/**
*@brief Registers call back function for critical section of I/O functions such as
*\ref WIZCHIP_READ, @ref WIZCHIP_WRITE, @ref WIZCHIP_READ_BUF and @ref WIZCHIP_WRITE_BUF.
*@param cris_en : callback function for critical section enter.
*@param cris_ex : callback function for critical section exit.
*@todo Describe @ref WIZCHIP_CRITICAL_ENTER and @ref WIZCHIP_CRITICAL_EXIT marco or register your functions.
*@note If you do not describe or register, default functions(@ref wizchip_cris_enter & @ref wizchip_cris_exit) is called.
*/
void reg_wizchip_cris_cbfunc(void(*cris_en)(void), void(*cris_ex)(void));
/**
*@brief Registers call back function for WIZCHIP select & deselect.
*@param cs_sel : callback function for WIZCHIP select
*@param cs_desel : callback fucntion for WIZCHIP deselect
*@todo Describe @ref wizchip_cs_select and @ref wizchip_cs_deselect function or register your functions.
*@note If you do not describe or register, null function is called.
*/
void reg_wizchip_cs_cbfunc(void(*cs_sel)(void), void(*cs_desel)(void));
/**
*@brief Registers call back function for bus interface.
*@param bus_rb : callback function to read byte data using system bus
*@param bus_wb : callback function to write byte data using system bus
*@todo Describe @ref wizchip_bus_readbyte and @ref wizchip_bus_writebyte function
*or register your functions.
*@note If you do not describe or register, null function is called.
*/
void reg_wizchip_bus_cbfunc(uint8_t (*bus_rb)(uint32_t addr), void (*bus_wb)(uint32_t addr, uint8_t wb));
/**
*@brief Registers call back function for SPI interface.
*@param spi_rb : callback function to read byte usig SPI
*@param spi_wb : callback function to write byte usig SPI
*@todo Describe \ref wizchip_spi_readbyte and \ref wizchip_spi_writebyte function
*or register your functions.
*@note If you do not describe or register, null function is called.
*/
void reg_wizchip_spi_cbfunc(void (*spi_rb)(uint8_t *, uint32_t), void (*spi_wb)(const uint8_t *, uint32_t));
/**
* @ingroup extra_functions
* @brief Controls to the WIZCHIP.
* @details Resets WIZCHIP & internal PHY, Configures PHY mode, Monitor PHY(Link,Speed,Half/Full/Auto),
* controls interrupt & mask and so on.
* @param cwtype : Decides to the control type
* @param arg : arg type is dependent on cwtype.
* @return 0 : Success \n
* -1 : Fail because of invalid \ref ctlwizchip_type or unsupported \ref ctlwizchip_type in WIZCHIP
*/
int8_t ctlwizchip(ctlwizchip_type cwtype, void* arg);
/**
* @ingroup extra_functions
* @brief Controls to network.
* @details Controls to network environment, mode, timeout and so on.
* @param cntype : Input. Decides to the control type
* @param arg : Inout. arg type is dependent on cntype.
* @return -1 : Fail because of invalid \ref ctlnetwork_type or unsupported \ref ctlnetwork_type in WIZCHIP \n
* 0 : Success
*/
int8_t ctlnetwork(ctlnetwork_type cntype, void* arg);
/*
* The following functions are implemented for internal use.
* but You can call these functions for code size reduction instead of ctlwizchip() and ctlnetwork().
*/
/**
* @ingroup extra_functions
* @brief Reset WIZCHIP by softly.
*/
void wizchip_sw_reset(void);
/**
* @ingroup extra_functions
* @brief Initializes WIZCHIP with socket buffer size
* @param txsize Socket tx buffer sizes. If null, initialized the default size 2KB.
* @param rxsize Socket rx buffer sizes. If null, initialized the default size 2KB.
* @return 0 : succcess \n
* -1 : fail. Invalid buffer size
*/
int8_t wizchip_init(uint8_t* txsize, uint8_t* rxsize);
/**
* @ingroup extra_functions
* @brief Clear Interrupt of WIZCHIP.
* @param intr : @ref intr_kind value operated OR. It can type-cast to uint16_t.
*/
void wizchip_clrinterrupt(intr_kind intr);
/**
* @ingroup extra_functions
* @brief Get Interrupt of WIZCHIP.
* @return @ref intr_kind value operated OR. It can type-cast to uint16_t.
*/
intr_kind wizchip_getinterrupt(void);
/**
* @ingroup extra_functions
* @brief Mask or Unmask Interrupt of WIZCHIP.
* @param intr : @ref intr_kind value operated OR. It can type-cast to uint16_t.
*/
void wizchip_setinterruptmask(intr_kind intr);
/**
* @ingroup extra_functions
* @brief Get Interrupt mask of WIZCHIP.
* @return : The operated OR vaule of @ref intr_kind. It can type-cast to uint16_t.
*/
intr_kind wizchip_getinterruptmask(void);
#if _WIZCHIP_ > 5100
int8_t wizphy_getphylink(void); ///< get the link status of phy in WIZCHIP. No use in W5100
int8_t wizphy_getphypmode(void); ///< get the power mode of PHY in WIZCHIP. No use in W5100
#endif
#if _WIZCHIP_ == 5500
void wizphy_reset(void); ///< Reset phy. Vailid only in W5500
/**
* @ingroup extra_functions
* @brief Set the phy information for WIZCHIP without power mode
* @param phyconf : @ref wiz_PhyConf
*/
void wizphy_setphyconf(wiz_PhyConf* phyconf);
/**
* @ingroup extra_functions
* @brief Get phy configuration information.
* @param phyconf : @ref wiz_PhyConf
*/
void wizphy_getphyconf(wiz_PhyConf* phyconf);
/**
* @ingroup extra_functions
* @brief Get phy status.
* @param phyconf : @ref wiz_PhyConf
*/
void wizphy_getphystat(wiz_PhyConf* phyconf);
/**
* @ingroup extra_functions
* @brief set the power mode of phy inside WIZCHIP. Refer to @ref PHYCFGR in W5500, @ref PHYSTATUS in W5200
* @param pmode Settig value of power down mode.
*/
int8_t wizphy_setphypmode(uint8_t pmode);
#endif
/**
* @ingroup extra_functions
* @brief Set the network information for WIZCHIP
* @param pnetinfo : @ref wizNetInfo
*/
void wizchip_setnetinfo(wiz_NetInfo* pnetinfo);
/**
* @ingroup extra_functions
* @brief Get the network information for WIZCHIP
* @param pnetinfo : @ref wizNetInfo
*/
void wizchip_getnetinfo(wiz_NetInfo* pnetinfo);
#if _WIZCHIP_ == 5200 // for W5200 ARP errata
uint8_t *wizchip_getsubn(void);
#endif
/**
* @ingroup extra_functions
* @brief Set the network mode such WOL, PPPoE, Ping Block, and etc.
* @param pnetinfo Value of network mode. Refer to @ref netmode_type.
*/
int8_t wizchip_setnetmode(netmode_type netmode);
/**
* @ingroup extra_functions
* @brief Get the network mode such WOL, PPPoE, Ping Block, and etc.
* @return Value of network mode. Refer to @ref netmode_type.
*/
netmode_type wizchip_getnetmode(void);
/**
* @ingroup extra_functions
* @brief Set retry time value(@ref RTR) and retry count(@ref RCR).
* @details @ref RTR configures the retransmission timeout period and @ref RCR configures the number of time of retransmission.
* @param nettime @ref RTR value and @ref RCR value. Refer to @ref wiz_NetTimeout.
*/
void wizchip_settimeout(wiz_NetTimeout* nettime);
/**
* @ingroup extra_functions
* @brief Get retry time value(@ref RTR) and retry count(@ref RCR).
* @details @ref RTR configures the retransmission timeout period and @ref RCR configures the number of time of retransmission.
* @param nettime @ref RTR value and @ref RCR value. Refer to @ref wiz_NetTimeout.
*/
void wizchip_gettimeout(wiz_NetTimeout* nettime);
#endif // _WIZCHIP_CONF_H_

View File

@ -1,975 +0,0 @@
//*****************************************************************************
//
//! \file dhcp.c
//! \brief DHCP APIs implement file.
//! \details Processig DHCP protocol as DISCOVER, OFFER, REQUEST, ACK, NACK and DECLINE.
//! \version 1.1.0
//! \date 2013/11/18
//! \par Revision history
//! <2018/10/09> Modified by Nick Moore for CircuitPython
//! <2013/11/18> 1st Release
//! <2012/12/20> V1.1.0
//! 1. Optimize code
//! 2. Add reg_dhcp_cbfunc()
//! 3. Add DHCP_stop()
//! 4. Integrate check_DHCP_state() & DHCP_run() to DHCP_run()
//! 5. Don't care system endian
//! 6. Add comments
//! <2012/12/26> V1.1.1
//! 1. Modify variable declaration: dhcp_tick_1s is declared volatile for code optimization
//! \author Eric Jung & MidnightCow
//! \copyright
//!
//! Copyright (c) 2013, WIZnet Co., LTD.
//! All rights reserved.
//!
//! Redistribution and use in source and binary forms, with or without
//! modification, are permitted provided that the following conditions
//! are met:
//!
//! * Redistributions of source code must retain the above copyright
//! notice, this list of conditions and the following disclaimer.
//! * Redistributions in binary form must reproduce the above copyright
//! notice, this list of conditions and the following disclaimer in the
//! documentation and/or other materials provided with the distribution.
//! * Neither the name of the <ORGANIZATION> nor the names of its
//! contributors may be used to endorse or promote products derived
//! from this software without specific prior written permission.
//!
//! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
//! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
//! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
//! THE POSSIBILITY OF SUCH DAMAGE.
//
//*****************************************************************************
//#include "Ethernet/socket.h"
//#include "Internet/DHCP/dhcp.h"
#include "../../ethernet/socket.h"
#include "dhcp.h"
/* If you want to display debug & processing message, Define _DHCP_DEBUG_ in dhcp.h */
#ifdef _DHCP_DEBUG_
#include <stdio.h>
#endif
/* DHCP state machine. */
#define STATE_DHCP_INIT 0 ///< Initialize
#define STATE_DHCP_DISCOVER 1 ///< send DISCOVER and wait OFFER
#define STATE_DHCP_REQUEST 2 ///< send REQEUST and wait ACK or NACK
#define STATE_DHCP_LEASED 3 ///< ReceiveD ACK and IP leased
#define STATE_DHCP_REREQUEST 4 ///< send REQUEST for maintaining leased IP
#define STATE_DHCP_RELEASE 5 ///< No use
#define STATE_DHCP_STOP 6 ///< Stop processing DHCP
#define DHCP_FLAGSBROADCAST 0x8000 ///< The broadcast value of flags in @ref RIP_MSG
#define DHCP_FLAGSUNICAST 0x0000 ///< The unicast value of flags in @ref RIP_MSG
/* DHCP message OP code */
#define DHCP_BOOTREQUEST 1 ///< Request Message used in op of @ref RIP_MSG
#define DHCP_BOOTREPLY 2 ///< Reply Message used i op of @ref RIP_MSG
/* DHCP message type */
#define DHCP_DISCOVER 1 ///< DISCOVER message in OPT of @ref RIP_MSG
#define DHCP_OFFER 2 ///< OFFER message in OPT of @ref RIP_MSG
#define DHCP_REQUEST 3 ///< REQUEST message in OPT of @ref RIP_MSG
#define DHCP_DECLINE 4 ///< DECLINE message in OPT of @ref RIP_MSG
#define DHCP_ACK 5 ///< ACK message in OPT of @ref RIP_MSG
#define DHCP_NAK 6 ///< NACK message in OPT of @ref RIP_MSG
#define DHCP_RELEASE 7 ///< RELEASE message in OPT of @ref RIP_MSG. No use
#define DHCP_INFORM 8 ///< INFORM message in OPT of @ref RIP_MSG. No use
#define DHCP_HTYPE10MB 1 ///< Used in type of @ref RIP_MSG
#define DHCP_HTYPE100MB 2 ///< Used in type of @ref RIP_MSG
#define DHCP_HLENETHERNET 6 ///< Used in hlen of @ref RIP_MSG
#define DHCP_HOPS 0 ///< Used in hops of @ref RIP_MSG
#define DHCP_SECS 0 ///< Used in secs of @ref RIP_MSG
#define INFINITE_LEASETIME 0xffffffff ///< Infinite lease time
#define OPT_SIZE 312 /// Max OPT size of @ref RIP_MSG
#define RIP_MSG_SIZE (236+OPT_SIZE) /// Max size of @ref RIP_MSG
/*
* @brief DHCP option and value (cf. RFC1533)
*/
enum
{
padOption = 0,
subnetMask = 1,
timerOffset = 2,
routersOnSubnet = 3,
timeServer = 4,
nameServer = 5,
dns = 6,
logServer = 7,
cookieServer = 8,
lprServer = 9,
impressServer = 10,
resourceLocationServer = 11,
hostName = 12,
bootFileSize = 13,
meritDumpFile = 14,
domainName = 15,
swapServer = 16,
rootPath = 17,
extentionsPath = 18,
IPforwarding = 19,
nonLocalSourceRouting = 20,
policyFilter = 21,
maxDgramReasmSize = 22,
defaultIPTTL = 23,
pathMTUagingTimeout = 24,
pathMTUplateauTable = 25,
ifMTU = 26,
allSubnetsLocal = 27,
broadcastAddr = 28,
performMaskDiscovery = 29,
maskSupplier = 30,
performRouterDiscovery = 31,
routerSolicitationAddr = 32,
staticRoute = 33,
trailerEncapsulation = 34,
arpCacheTimeout = 35,
ethernetEncapsulation = 36,
tcpDefaultTTL = 37,
tcpKeepaliveInterval = 38,
tcpKeepaliveGarbage = 39,
nisDomainName = 40,
nisServers = 41,
ntpServers = 42,
vendorSpecificInfo = 43,
netBIOSnameServer = 44,
netBIOSdgramDistServer = 45,
netBIOSnodeType = 46,
netBIOSscope = 47,
xFontServer = 48,
xDisplayManager = 49,
dhcpRequestedIPaddr = 50,
dhcpIPaddrLeaseTime = 51,
dhcpOptionOverload = 52,
dhcpMessageType = 53,
dhcpServerIdentifier = 54,
dhcpParamRequest = 55,
dhcpMsg = 56,
dhcpMaxMsgSize = 57,
dhcpT1value = 58,
dhcpT2value = 59,
dhcpClassIdentifier = 60,
dhcpClientIdentifier = 61,
endOption = 255
};
/*
* @brief DHCP message format
*/
typedef struct {
uint8_t op; ///< @ref DHCP_BOOTREQUEST or @ref DHCP_BOOTREPLY
uint8_t htype; ///< @ref DHCP_HTYPE10MB or @ref DHCP_HTYPE100MB
uint8_t hlen; ///< @ref DHCP_HLENETHERNET
uint8_t hops; ///< @ref DHCP_HOPS
uint32_t xid; ///< @ref DHCP_XID This increase one every DHCP transaction.
uint16_t secs; ///< @ref DHCP_SECS
uint16_t flags; ///< @ref DHCP_FLAGSBROADCAST or @ref DHCP_FLAGSUNICAST
uint8_t ciaddr[4]; ///< @ref Request IP to DHCP sever
uint8_t yiaddr[4]; ///< @ref Offered IP from DHCP server
uint8_t siaddr[4]; ///< No use
uint8_t giaddr[4]; ///< No use
uint8_t chaddr[16]; ///< DHCP client 6bytes MAC address. Others is filled to zero
uint8_t sname[64]; ///< No use
uint8_t file[128]; ///< No use
uint8_t OPT[OPT_SIZE]; ///< Option
} RIP_MSG;
uint8_t DHCP_SOCKET; // Socket number for DHCP
uint8_t DHCP_SIP[4]; // DHCP Server IP address
// Network information from DHCP Server
uint8_t OLD_allocated_ip[4] = {0, }; // Previous IP address
uint8_t DHCP_allocated_ip[4] = {0, }; // IP address from DHCP
uint8_t DHCP_allocated_gw[4] = {0, }; // Gateway address from DHCP
uint8_t DHCP_allocated_sn[4] = {0, }; // Subnet mask from DHCP
uint8_t DHCP_allocated_dns[4] = {0, }; // DNS address from DHCP
int8_t dhcp_state = STATE_DHCP_INIT; // DHCP state
int8_t dhcp_retry_count = 0;
uint32_t dhcp_lease_time = INFINITE_LEASETIME;
volatile uint32_t dhcp_tick_1s = 0; // unit 1 second
uint32_t dhcp_tick_next = DHCP_WAIT_TIME ;
uint32_t DHCP_XID; // Any number
RIP_MSG* pDHCPMSG; // Buffer pointer for DHCP processing
uint8_t HOST_NAME[] = DCHP_HOST_NAME;
uint8_t DHCP_CHADDR[6]; // DHCP Client MAC address.
/* The default callback function */
void default_ip_assign(void);
void default_ip_update(void);
void default_ip_conflict(void);
/* Callback handler */
void (*dhcp_ip_assign)(void) = default_ip_assign; /* handler to be called when the IP address from DHCP server is first assigned */
void (*dhcp_ip_update)(void) = default_ip_update; /* handler to be called when the IP address from DHCP server is updated */
void (*dhcp_ip_conflict)(void) = default_ip_conflict; /* handler to be called when the IP address from DHCP server is conflict */
void reg_dhcp_cbfunc(void(*ip_assign)(void), void(*ip_update)(void), void(*ip_conflict)(void));
/* send DISCOVER message to DHCP server */
void send_DHCP_DISCOVER(void);
/* send REQEUST message to DHCP server */
void send_DHCP_REQUEST(void);
/* send DECLINE message to DHCP server */
void send_DHCP_DECLINE(void);
/* IP conflict check by sending ARP-request to leased IP and wait ARP-response. */
int8_t check_DHCP_leasedIP(void);
/* check the timeout in DHCP process */
uint8_t check_DHCP_timeout(void);
/* Intialize to timeout process. */
void reset_DHCP_timeout(void);
/* Parse message as OFFER and ACK and NACK from DHCP server.*/
int8_t parseDHCPCMSG(void);
/* The default handler of ip assign first */
void default_ip_assign(void)
{
setSIPR(DHCP_allocated_ip);
setSUBR(DHCP_allocated_sn);
setGAR (DHCP_allocated_gw);
}
/* The default handler of ip changed */
void default_ip_update(void)
{
/* WIZchip Software Reset */
setMR(MR_RST);
getMR(); // for delay
default_ip_assign();
setSHAR(DHCP_CHADDR);
}
/* The default handler of ip changed */
void default_ip_conflict(void)
{
// WIZchip Software Reset
setMR(MR_RST);
getMR(); // for delay
setSHAR(DHCP_CHADDR);
}
/* register the call back func. */
void reg_dhcp_cbfunc(void(*ip_assign)(void), void(*ip_update)(void), void(*ip_conflict)(void))
{
dhcp_ip_assign = default_ip_assign;
dhcp_ip_update = default_ip_update;
dhcp_ip_conflict = default_ip_conflict;
if(ip_assign) dhcp_ip_assign = ip_assign;
if(ip_update) dhcp_ip_update = ip_update;
if(ip_conflict) dhcp_ip_conflict = ip_conflict;
}
/* make the common DHCP message */
void makeDHCPMSG(void)
{
uint8_t bk_mac[6];
uint8_t* ptmp;
uint8_t i;
getSHAR(bk_mac);
pDHCPMSG->op = DHCP_BOOTREQUEST;
pDHCPMSG->htype = DHCP_HTYPE10MB;
pDHCPMSG->hlen = DHCP_HLENETHERNET;
pDHCPMSG->hops = DHCP_HOPS;
ptmp = (uint8_t*)(&pDHCPMSG->xid);
*(ptmp+0) = (uint8_t)((DHCP_XID & 0xFF000000) >> 24);
*(ptmp+1) = (uint8_t)((DHCP_XID & 0x00FF0000) >> 16);
*(ptmp+2) = (uint8_t)((DHCP_XID & 0x0000FF00) >> 8);
*(ptmp+3) = (uint8_t)((DHCP_XID & 0x000000FF) >> 0);
pDHCPMSG->secs = DHCP_SECS;
ptmp = (uint8_t*)(&pDHCPMSG->flags);
*(ptmp+0) = (uint8_t)((DHCP_FLAGSBROADCAST & 0xFF00) >> 8);
*(ptmp+1) = (uint8_t)((DHCP_FLAGSBROADCAST & 0x00FF) >> 0);
pDHCPMSG->ciaddr[0] = 0;
pDHCPMSG->ciaddr[1] = 0;
pDHCPMSG->ciaddr[2] = 0;
pDHCPMSG->ciaddr[3] = 0;
pDHCPMSG->yiaddr[0] = 0;
pDHCPMSG->yiaddr[1] = 0;
pDHCPMSG->yiaddr[2] = 0;
pDHCPMSG->yiaddr[3] = 0;
pDHCPMSG->siaddr[0] = 0;
pDHCPMSG->siaddr[1] = 0;
pDHCPMSG->siaddr[2] = 0;
pDHCPMSG->siaddr[3] = 0;
pDHCPMSG->giaddr[0] = 0;
pDHCPMSG->giaddr[1] = 0;
pDHCPMSG->giaddr[2] = 0;
pDHCPMSG->giaddr[3] = 0;
pDHCPMSG->chaddr[0] = DHCP_CHADDR[0];
pDHCPMSG->chaddr[1] = DHCP_CHADDR[1];
pDHCPMSG->chaddr[2] = DHCP_CHADDR[2];
pDHCPMSG->chaddr[3] = DHCP_CHADDR[3];
pDHCPMSG->chaddr[4] = DHCP_CHADDR[4];
pDHCPMSG->chaddr[5] = DHCP_CHADDR[5];
for (i = 6; i < 16; i++) pDHCPMSG->chaddr[i] = 0;
for (i = 0; i < 64; i++) pDHCPMSG->sname[i] = 0;
for (i = 0; i < 128; i++) pDHCPMSG->file[i] = 0;
// MAGIC_COOKIE
pDHCPMSG->OPT[0] = (uint8_t)((MAGIC_COOKIE & 0xFF000000) >> 24);
pDHCPMSG->OPT[1] = (uint8_t)((MAGIC_COOKIE & 0x00FF0000) >> 16);
pDHCPMSG->OPT[2] = (uint8_t)((MAGIC_COOKIE & 0x0000FF00) >> 8);
pDHCPMSG->OPT[3] = (uint8_t) (MAGIC_COOKIE & 0x000000FF) >> 0;
}
/* SEND DHCP DISCOVER */
void send_DHCP_DISCOVER(void)
{
uint16_t i;
uint8_t ip[4];
uint16_t k = 0;
makeDHCPMSG();
k = 4; // because MAGIC_COOKIE already made by makeDHCPMSG()
// Option Request Param
pDHCPMSG->OPT[k++] = dhcpMessageType;
pDHCPMSG->OPT[k++] = 0x01;
pDHCPMSG->OPT[k++] = DHCP_DISCOVER;
// Client identifier
pDHCPMSG->OPT[k++] = dhcpClientIdentifier;
pDHCPMSG->OPT[k++] = 0x07;
pDHCPMSG->OPT[k++] = 0x01;
pDHCPMSG->OPT[k++] = DHCP_CHADDR[0];
pDHCPMSG->OPT[k++] = DHCP_CHADDR[1];
pDHCPMSG->OPT[k++] = DHCP_CHADDR[2];
pDHCPMSG->OPT[k++] = DHCP_CHADDR[3];
pDHCPMSG->OPT[k++] = DHCP_CHADDR[4];
pDHCPMSG->OPT[k++] = DHCP_CHADDR[5];
// host name
pDHCPMSG->OPT[k++] = hostName;
pDHCPMSG->OPT[k++] = 0; // fill zero length of hostname
for(i = 0 ; HOST_NAME[i] != 0; i++)
pDHCPMSG->OPT[k++] = HOST_NAME[i];
pDHCPMSG->OPT[k++] = DHCP_CHADDR[3];
pDHCPMSG->OPT[k++] = DHCP_CHADDR[4];
pDHCPMSG->OPT[k++] = DHCP_CHADDR[5];
pDHCPMSG->OPT[k - (i+3+1)] = i+3; // length of hostname
pDHCPMSG->OPT[k++] = dhcpParamRequest;
pDHCPMSG->OPT[k++] = 0x06; // length of request
pDHCPMSG->OPT[k++] = subnetMask;
pDHCPMSG->OPT[k++] = routersOnSubnet;
pDHCPMSG->OPT[k++] = dns;
pDHCPMSG->OPT[k++] = domainName;
pDHCPMSG->OPT[k++] = dhcpT1value;
pDHCPMSG->OPT[k++] = dhcpT2value;
pDHCPMSG->OPT[k++] = endOption;
for (i = k; i < OPT_SIZE; i++) pDHCPMSG->OPT[i] = 0;
// send broadcasting packet
ip[0] = 255;
ip[1] = 255;
ip[2] = 255;
ip[3] = 255;
#ifdef _DHCP_DEBUG_
printf("> Send DHCP_DISCOVER\r\n");
#endif
WIZCHIP_EXPORT(sendto)(DHCP_SOCKET, (uint8_t *)pDHCPMSG, RIP_MSG_SIZE, ip, DHCP_SERVER_PORT);
}
/* SEND DHCP REQUEST */
void send_DHCP_REQUEST(void)
{
int i;
uint8_t ip[4];
uint16_t k = 0;
makeDHCPMSG();
if(dhcp_state == STATE_DHCP_LEASED || dhcp_state == STATE_DHCP_REREQUEST)
{
*((uint8_t*)(&pDHCPMSG->flags)) = ((DHCP_FLAGSUNICAST & 0xFF00)>> 8);
*((uint8_t*)(&pDHCPMSG->flags)+1) = (DHCP_FLAGSUNICAST & 0x00FF);
pDHCPMSG->ciaddr[0] = DHCP_allocated_ip[0];
pDHCPMSG->ciaddr[1] = DHCP_allocated_ip[1];
pDHCPMSG->ciaddr[2] = DHCP_allocated_ip[2];
pDHCPMSG->ciaddr[3] = DHCP_allocated_ip[3];
ip[0] = DHCP_SIP[0];
ip[1] = DHCP_SIP[1];
ip[2] = DHCP_SIP[2];
ip[3] = DHCP_SIP[3];
}
else
{
ip[0] = 255;
ip[1] = 255;
ip[2] = 255;
ip[3] = 255;
}
k = 4; // because MAGIC_COOKIE already made by makeDHCPMSG()
// Option Request Param.
pDHCPMSG->OPT[k++] = dhcpMessageType;
pDHCPMSG->OPT[k++] = 0x01;
pDHCPMSG->OPT[k++] = DHCP_REQUEST;
pDHCPMSG->OPT[k++] = dhcpClientIdentifier;
pDHCPMSG->OPT[k++] = 0x07;
pDHCPMSG->OPT[k++] = 0x01;
pDHCPMSG->OPT[k++] = DHCP_CHADDR[0];
pDHCPMSG->OPT[k++] = DHCP_CHADDR[1];
pDHCPMSG->OPT[k++] = DHCP_CHADDR[2];
pDHCPMSG->OPT[k++] = DHCP_CHADDR[3];
pDHCPMSG->OPT[k++] = DHCP_CHADDR[4];
pDHCPMSG->OPT[k++] = DHCP_CHADDR[5];
if(ip[3] == 255) // if(dchp_state == STATE_DHCP_LEASED || dchp_state == DHCP_REREQUEST_STATE)
{
pDHCPMSG->OPT[k++] = dhcpRequestedIPaddr;
pDHCPMSG->OPT[k++] = 0x04;
pDHCPMSG->OPT[k++] = DHCP_allocated_ip[0];
pDHCPMSG->OPT[k++] = DHCP_allocated_ip[1];
pDHCPMSG->OPT[k++] = DHCP_allocated_ip[2];
pDHCPMSG->OPT[k++] = DHCP_allocated_ip[3];
pDHCPMSG->OPT[k++] = dhcpServerIdentifier;
pDHCPMSG->OPT[k++] = 0x04;
pDHCPMSG->OPT[k++] = DHCP_SIP[0];
pDHCPMSG->OPT[k++] = DHCP_SIP[1];
pDHCPMSG->OPT[k++] = DHCP_SIP[2];
pDHCPMSG->OPT[k++] = DHCP_SIP[3];
}
// host name
pDHCPMSG->OPT[k++] = hostName;
pDHCPMSG->OPT[k++] = 0; // length of hostname
for(i = 0 ; HOST_NAME[i] != 0; i++)
pDHCPMSG->OPT[k++] = HOST_NAME[i];
pDHCPMSG->OPT[k++] = DHCP_CHADDR[3];
pDHCPMSG->OPT[k++] = DHCP_CHADDR[4];
pDHCPMSG->OPT[k++] = DHCP_CHADDR[5];
pDHCPMSG->OPT[k - (i+3+1)] = i+3; // length of hostname
pDHCPMSG->OPT[k++] = dhcpParamRequest;
pDHCPMSG->OPT[k++] = 0x08;
pDHCPMSG->OPT[k++] = subnetMask;
pDHCPMSG->OPT[k++] = routersOnSubnet;
pDHCPMSG->OPT[k++] = dns;
pDHCPMSG->OPT[k++] = domainName;
pDHCPMSG->OPT[k++] = dhcpT1value;
pDHCPMSG->OPT[k++] = dhcpT2value;
pDHCPMSG->OPT[k++] = performRouterDiscovery;
pDHCPMSG->OPT[k++] = staticRoute;
pDHCPMSG->OPT[k++] = endOption;
for (i = k; i < OPT_SIZE; i++) pDHCPMSG->OPT[i] = 0;
#ifdef _DHCP_DEBUG_
printf("> Send DHCP_REQUEST\r\n");
#endif
WIZCHIP_EXPORT(sendto)(DHCP_SOCKET, (uint8_t *)pDHCPMSG, RIP_MSG_SIZE, ip, DHCP_SERVER_PORT);
}
/* SEND DHCP DHCPDECLINE */
void send_DHCP_DECLINE(void)
{
int i;
uint8_t ip[4];
uint16_t k = 0;
makeDHCPMSG();
k = 4; // because MAGIC_COOKIE already made by makeDHCPMSG()
*((uint8_t*)(&pDHCPMSG->flags)) = ((DHCP_FLAGSUNICAST & 0xFF00)>> 8);
*((uint8_t*)(&pDHCPMSG->flags)+1) = (DHCP_FLAGSUNICAST & 0x00FF);
// Option Request Param.
pDHCPMSG->OPT[k++] = dhcpMessageType;
pDHCPMSG->OPT[k++] = 0x01;
pDHCPMSG->OPT[k++] = DHCP_DECLINE;
pDHCPMSG->OPT[k++] = dhcpClientIdentifier;
pDHCPMSG->OPT[k++] = 0x07;
pDHCPMSG->OPT[k++] = 0x01;
pDHCPMSG->OPT[k++] = DHCP_CHADDR[0];
pDHCPMSG->OPT[k++] = DHCP_CHADDR[1];
pDHCPMSG->OPT[k++] = DHCP_CHADDR[2];
pDHCPMSG->OPT[k++] = DHCP_CHADDR[3];
pDHCPMSG->OPT[k++] = DHCP_CHADDR[4];
pDHCPMSG->OPT[k++] = DHCP_CHADDR[5];
pDHCPMSG->OPT[k++] = dhcpRequestedIPaddr;
pDHCPMSG->OPT[k++] = 0x04;
pDHCPMSG->OPT[k++] = DHCP_allocated_ip[0];
pDHCPMSG->OPT[k++] = DHCP_allocated_ip[1];
pDHCPMSG->OPT[k++] = DHCP_allocated_ip[2];
pDHCPMSG->OPT[k++] = DHCP_allocated_ip[3];
pDHCPMSG->OPT[k++] = dhcpServerIdentifier;
pDHCPMSG->OPT[k++] = 0x04;
pDHCPMSG->OPT[k++] = DHCP_SIP[0];
pDHCPMSG->OPT[k++] = DHCP_SIP[1];
pDHCPMSG->OPT[k++] = DHCP_SIP[2];
pDHCPMSG->OPT[k++] = DHCP_SIP[3];
pDHCPMSG->OPT[k++] = endOption;
for (i = k; i < OPT_SIZE; i++) pDHCPMSG->OPT[i] = 0;
//send broadcasting packet
ip[0] = 0xFF;
ip[1] = 0xFF;
ip[2] = 0xFF;
ip[3] = 0xFF;
#ifdef _DHCP_DEBUG_
printf("\r\n> Send DHCP_DECLINE\r\n");
#endif
WIZCHIP_EXPORT(sendto)(DHCP_SOCKET, (uint8_t *)pDHCPMSG, RIP_MSG_SIZE, ip, DHCP_SERVER_PORT);
}
/* PARSE REPLY pDHCPMSG */
int8_t parseDHCPMSG(void)
{
uint8_t svr_addr[6];
uint16_t svr_port;
uint16_t len;
uint8_t * p;
uint8_t * e;
uint8_t type = 0;
uint8_t opt_len;
if((len = getSn_RX_RSR(DHCP_SOCKET)) > 0)
{
len = WIZCHIP_EXPORT(recvfrom)(DHCP_SOCKET, (uint8_t *)pDHCPMSG, len, svr_addr, &svr_port);
#ifdef _DHCP_DEBUG_
printf("DHCP message : %d.%d.%d.%d(%d) %d received. \r\n",svr_addr[0],svr_addr[1],svr_addr[2], svr_addr[3],svr_port, len);
#endif
}
else return 0;
if (svr_port == DHCP_SERVER_PORT) {
// compare mac address
if ( (pDHCPMSG->chaddr[0] != DHCP_CHADDR[0]) || (pDHCPMSG->chaddr[1] != DHCP_CHADDR[1]) ||
(pDHCPMSG->chaddr[2] != DHCP_CHADDR[2]) || (pDHCPMSG->chaddr[3] != DHCP_CHADDR[3]) ||
(pDHCPMSG->chaddr[4] != DHCP_CHADDR[4]) || (pDHCPMSG->chaddr[5] != DHCP_CHADDR[5]) )
return 0;
type = 0;
p = (uint8_t *)(&pDHCPMSG->op);
p = p + 240; // 240 = sizeof(RIP_MSG) + MAGIC_COOKIE size in RIP_MSG.opt - sizeof(RIP_MSG.opt)
e = p + (len - 240);
while ( p < e ) {
switch ( *p ) {
case endOption :
p = e; // for break while(p < e)
break;
case padOption :
p++;
break;
case dhcpMessageType :
p++;
p++;
type = *p++;
break;
case subnetMask :
p++;
p++;
DHCP_allocated_sn[0] = *p++;
DHCP_allocated_sn[1] = *p++;
DHCP_allocated_sn[2] = *p++;
DHCP_allocated_sn[3] = *p++;
break;
case routersOnSubnet :
p++;
opt_len = *p++;
DHCP_allocated_gw[0] = *p++;
DHCP_allocated_gw[1] = *p++;
DHCP_allocated_gw[2] = *p++;
DHCP_allocated_gw[3] = *p++;
p = p + (opt_len - 4);
break;
case dns :
p++;
opt_len = *p++;
DHCP_allocated_dns[0] = *p++;
DHCP_allocated_dns[1] = *p++;
DHCP_allocated_dns[2] = *p++;
DHCP_allocated_dns[3] = *p++;
p = p + (opt_len - 4);
break;
case dhcpIPaddrLeaseTime :
p++;
opt_len = *p++;
dhcp_lease_time = *p++;
dhcp_lease_time = (dhcp_lease_time << 8) + *p++;
dhcp_lease_time = (dhcp_lease_time << 8) + *p++;
dhcp_lease_time = (dhcp_lease_time << 8) + *p++;
#ifdef _DHCP_DEBUG_
dhcp_lease_time = 10;
#endif
break;
case dhcpServerIdentifier :
p++;
opt_len = *p++;
DHCP_SIP[0] = *p++;
DHCP_SIP[1] = *p++;
DHCP_SIP[2] = *p++;
DHCP_SIP[3] = *p++;
break;
default :
p++;
opt_len = *p++;
p += opt_len;
break;
} // switch
} // while
} // if
return type;
}
uint8_t DHCP_run(void)
{
uint8_t type;
uint8_t ret;
if(dhcp_state == STATE_DHCP_STOP) return DHCP_STOPPED;
if(getSn_SR(DHCP_SOCKET) != SOCK_UDP)
WIZCHIP_EXPORT(socket)(DHCP_SOCKET, Sn_MR_UDP, DHCP_CLIENT_PORT, 0x00);
ret = DHCP_RUNNING;
type = parseDHCPMSG();
switch ( dhcp_state ) {
case STATE_DHCP_INIT :
DHCP_allocated_ip[0] = 0;
DHCP_allocated_ip[1] = 0;
DHCP_allocated_ip[2] = 0;
DHCP_allocated_ip[3] = 0;
send_DHCP_DISCOVER();
dhcp_state = STATE_DHCP_DISCOVER;
break;
case STATE_DHCP_DISCOVER :
if (type == DHCP_OFFER){
#ifdef _DHCP_DEBUG_
printf("> Receive DHCP_OFFER\r\n");
#endif
DHCP_allocated_ip[0] = pDHCPMSG->yiaddr[0];
DHCP_allocated_ip[1] = pDHCPMSG->yiaddr[1];
DHCP_allocated_ip[2] = pDHCPMSG->yiaddr[2];
DHCP_allocated_ip[3] = pDHCPMSG->yiaddr[3];
send_DHCP_REQUEST();
dhcp_state = STATE_DHCP_REQUEST;
} else ret = check_DHCP_timeout();
break;
case STATE_DHCP_REQUEST :
if (type == DHCP_ACK) {
#ifdef _DHCP_DEBUG_
printf("> Receive DHCP_ACK\r\n");
#endif
if (check_DHCP_leasedIP()) {
// Network info assignment from DHCP
dhcp_ip_assign();
reset_DHCP_timeout();
dhcp_state = STATE_DHCP_LEASED;
} else {
// IP address conflict occurred
reset_DHCP_timeout();
dhcp_ip_conflict();
dhcp_state = STATE_DHCP_INIT;
}
} else if (type == DHCP_NAK) {
#ifdef _DHCP_DEBUG_
printf("> Receive DHCP_NACK\r\n");
#endif
reset_DHCP_timeout();
dhcp_state = STATE_DHCP_DISCOVER;
} else ret = check_DHCP_timeout();
break;
case STATE_DHCP_LEASED :
ret = DHCP_IP_LEASED;
if ((dhcp_lease_time != INFINITE_LEASETIME) && ((dhcp_lease_time/2) < dhcp_tick_1s)) {
#ifdef _DHCP_DEBUG_
printf("> Maintains the IP address \r\n");
#endif
type = 0;
OLD_allocated_ip[0] = DHCP_allocated_ip[0];
OLD_allocated_ip[1] = DHCP_allocated_ip[1];
OLD_allocated_ip[2] = DHCP_allocated_ip[2];
OLD_allocated_ip[3] = DHCP_allocated_ip[3];
DHCP_XID++;
send_DHCP_REQUEST();
reset_DHCP_timeout();
dhcp_state = STATE_DHCP_REREQUEST;
}
break;
case STATE_DHCP_REREQUEST :
ret = DHCP_IP_LEASED;
if (type == DHCP_ACK) {
dhcp_retry_count = 0;
if (OLD_allocated_ip[0] != DHCP_allocated_ip[0] ||
OLD_allocated_ip[1] != DHCP_allocated_ip[1] ||
OLD_allocated_ip[2] != DHCP_allocated_ip[2] ||
OLD_allocated_ip[3] != DHCP_allocated_ip[3])
{
ret = DHCP_IP_CHANGED;
dhcp_ip_update();
#ifdef _DHCP_DEBUG_
printf(">IP changed.\r\n");
#endif
}
#ifdef _DHCP_DEBUG_
else printf(">IP is continued.\r\n");
#endif
reset_DHCP_timeout();
dhcp_state = STATE_DHCP_LEASED;
} else if (type == DHCP_NAK) {
#ifdef _DHCP_DEBUG_
printf("> Receive DHCP_NACK, Failed to maintain ip\r\n");
#endif
reset_DHCP_timeout();
dhcp_state = STATE_DHCP_DISCOVER;
} else ret = check_DHCP_timeout();
break;
default :
break;
}
return ret;
}
void DHCP_stop(void)
{
WIZCHIP_EXPORT(close)(DHCP_SOCKET);
dhcp_state = STATE_DHCP_STOP;
}
uint8_t check_DHCP_timeout(void)
{
uint8_t ret = DHCP_RUNNING;
if (dhcp_retry_count < MAX_DHCP_RETRY) {
if (dhcp_tick_next < dhcp_tick_1s) {
switch ( dhcp_state ) {
case STATE_DHCP_DISCOVER :
// printf("<<timeout>> state : STATE_DHCP_DISCOVER\r\n");
send_DHCP_DISCOVER();
break;
case STATE_DHCP_REQUEST :
// printf("<<timeout>> state : STATE_DHCP_REQUEST\r\n");
send_DHCP_REQUEST();
break;
case STATE_DHCP_REREQUEST :
// printf("<<timeout>> state : STATE_DHCP_REREQUEST\r\n");
send_DHCP_REQUEST();
break;
default :
break;
}
dhcp_tick_1s = 0;
dhcp_tick_next = dhcp_tick_1s + DHCP_WAIT_TIME;
dhcp_retry_count++;
}
} else { // timeout occurred
switch(dhcp_state) {
case STATE_DHCP_DISCOVER:
dhcp_state = STATE_DHCP_INIT;
ret = DHCP_FAILED;
break;
case STATE_DHCP_REQUEST:
case STATE_DHCP_REREQUEST:
send_DHCP_DISCOVER();
dhcp_state = STATE_DHCP_DISCOVER;
break;
default :
break;
}
reset_DHCP_timeout();
}
return ret;
}
int8_t check_DHCP_leasedIP(void)
{
uint8_t tmp;
int32_t ret;
//WIZchip RCR value changed for ARP Timeout count control
tmp = getRCR();
setRCR(0x03);
// IP conflict detection : ARP request - ARP reply
// Broadcasting ARP Request for check the IP conflict using UDP sendto() function
ret = WIZCHIP_EXPORT(sendto)(DHCP_SOCKET, (uint8_t *)"CHECK_IP_CONFLICT", 17, DHCP_allocated_ip, 5000);
// RCR value restore
setRCR(tmp);
if(ret == SOCKERR_TIMEOUT) {
// UDP send Timeout occurred : allocated IP address is unique, DHCP Success
#ifdef _DHCP_DEBUG_
printf("\r\n> Check leased IP - OK\r\n");
#endif
return 1;
} else {
// Received ARP reply or etc : IP address conflict occur, DHCP Failed
send_DHCP_DECLINE();
ret = dhcp_tick_1s;
while((dhcp_tick_1s - ret) < 2) ; // wait for 1s over; wait to complete to send DECLINE message;
return 0;
}
}
void DHCP_init(uint8_t s, DHCP_INIT_BUFFER_TYPE* buf)
{
uint8_t zeroip[4] = {0,0,0,0};
getSHAR(DHCP_CHADDR);
if((DHCP_CHADDR[0] | DHCP_CHADDR[1] | DHCP_CHADDR[2] | DHCP_CHADDR[3] | DHCP_CHADDR[4] | DHCP_CHADDR[5]) == 0x00)
{
// assign temporary mac address, you should be set SHAR before call this function.
DHCP_CHADDR[0] = 0x00;
DHCP_CHADDR[1] = 0x08;
DHCP_CHADDR[2] = 0xdc;
DHCP_CHADDR[3] = 0x00;
DHCP_CHADDR[4] = 0x00;
DHCP_CHADDR[5] = 0x00;
setSHAR(DHCP_CHADDR);
}
DHCP_SOCKET = s; // SOCK_DHCP
pDHCPMSG = (RIP_MSG*)buf;
DHCP_XID = 0x12345678;
// WIZchip Netinfo Clear
setSIPR(zeroip);
setSIPR(zeroip);
setGAR(zeroip);
reset_DHCP_timeout();
dhcp_state = STATE_DHCP_INIT;
}
/* Rset the DHCP timeout count and retry count. */
void reset_DHCP_timeout(void)
{
dhcp_tick_1s = 0;
dhcp_tick_next = DHCP_WAIT_TIME;
dhcp_retry_count = 0;
}
void DHCP_time_handler(void)
{
dhcp_tick_1s++;
}
void getIPfromDHCP(uint8_t* ip)
{
ip[0] = DHCP_allocated_ip[0];
ip[1] = DHCP_allocated_ip[1];
ip[2] = DHCP_allocated_ip[2];
ip[3] = DHCP_allocated_ip[3];
}
void getGWfromDHCP(uint8_t* ip)
{
ip[0] =DHCP_allocated_gw[0];
ip[1] =DHCP_allocated_gw[1];
ip[2] =DHCP_allocated_gw[2];
ip[3] =DHCP_allocated_gw[3];
}
void getSNfromDHCP(uint8_t* ip)
{
ip[0] = DHCP_allocated_sn[0];
ip[1] = DHCP_allocated_sn[1];
ip[2] = DHCP_allocated_sn[2];
ip[3] = DHCP_allocated_sn[3];
}
void getDNSfromDHCP(uint8_t* ip)
{
ip[0] = DHCP_allocated_dns[0];
ip[1] = DHCP_allocated_dns[1];
ip[2] = DHCP_allocated_dns[2];
ip[3] = DHCP_allocated_dns[3];
}
uint32_t getDHCPLeasetime(void)
{
return dhcp_lease_time;
}

View File

@ -1,152 +0,0 @@
//*****************************************************************************
//
//! \file dhcp.h
//! \brief DHCP APIs Header file.
//! \details Processig DHCP protocol as DISCOVER, OFFER, REQUEST, ACK, NACK and DECLINE.
//! \version 1.1.0
//! \date 2013/11/18
//! \par Revision history
//! <2013/11/18> 1st Release
//! <2012/12/20> V1.1.0
//! 1. Move unreferenced DEFINE to dhcp.c
//! <2012/12/26> V1.1.1
//! \author Eric Jung & MidnightCow
//! \copyright
//!
//! Copyright (c) 2013, WIZnet Co., LTD.
//! All rights reserved.
//!
//! Redistribution and use in source and binary forms, with or without
//! modification, are permitted provided that the following conditions
//! are met:
//!
//! * Redistributions of source code must retain the above copyright
//! notice, this list of conditions and the following disclaimer.
//! * Redistributions in binary form must reproduce the above copyright
//! notice, this list of conditions and the following disclaimer in the
//! documentation and/or other materials provided with the distribution.
//! * Neither the name of the <ORGANIZATION> nor the names of its
//! contributors may be used to endorse or promote products derived
//! from this software without specific prior written permission.
//!
//! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
//! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
//! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
//! THE POSSIBILITY OF SUCH DAMAGE.
//
//*****************************************************************************
#ifndef _DHCP_H_
#define _DHCP_H_
/*
* @brief
* @details If you want to display debug & processing message, Define _DHCP_DEBUG_
* @note If defined, it depends on <stdio.h>
*/
//#define _DHCP_DEBUG_
/* Retry to processing DHCP */
#define MAX_DHCP_RETRY 2 ///< Maximum retry count
#define DHCP_WAIT_TIME 3 ///< Wait Time 3s (was 10s)
/* UDP port numbers for DHCP */
#define DHCP_SERVER_PORT 67 ///< DHCP server port number
#define DHCP_CLIENT_PORT 68 ///< DHCP client port number
#define MAGIC_COOKIE 0x63825363 ///< Any number. You can be modified it any number
#define DCHP_HOST_NAME "WIZnet\0"
/*
* @brief return value of @ref DHCP_run()
*/
enum
{
DHCP_FAILED = 0, ///< Processing Fail
DHCP_RUNNING, ///< Processing DHCP protocol
DHCP_IP_ASSIGN, ///< First Occupy IP from DHPC server (if cbfunc == null, act as default default_ip_assign)
DHCP_IP_CHANGED, ///< Change IP address by new IP address from DHCP (if cbfunc == null, act as default default_ip_update)
DHCP_IP_LEASED, ///< Stand by
DHCP_STOPPED ///< Stop processing DHCP protocol
};
#define DHCP_INIT_BUFFER_TYPE uint32_t
#define DHCP_INIT_BUFFER_SIZE (137)
/*
* @brief DHCP client initialization (outside of the main loop)
* @param s - socket number
* @param buf - buffer for processing DHCP message
*/
void DHCP_init(uint8_t s, DHCP_INIT_BUFFER_TYPE* buf);
/*
* @brief DHCP 1s Tick Timer handler
* @note SHOULD BE register to your system 1s Tick timer handler
*/
void DHCP_time_handler(void);
/*
* @brief Register call back function
* @param ip_assign - callback func when IP is assigned from DHCP server first
* @param ip_update - callback func when IP is changed
* @prarm ip_conflict - callback func when the assigned IP is conflict with others.
*/
void reg_dhcp_cbfunc(void(*ip_assign)(void), void(*ip_update)(void), void(*ip_conflict)(void));
/*
* @brief DHCP client in the main loop
* @return The value is as the follow \n
* @ref DHCP_FAILED \n
* @ref DHCP_RUNNING \n
* @ref DHCP_IP_ASSIGN \n
* @ref DHCP_IP_CHANGED \n
* @ref DHCP_IP_LEASED \n
* @ref DHCP_STOPPED \n
*
* @note This function is always called by you main task.
*/
uint8_t DHCP_run(void);
/*
* @brief Stop DHCP processing
* @note If you want to restart. call DHCP_init() and DHCP_run()
*/
void DHCP_stop(void);
/* Get Network information assigned from DHCP server */
/*
* @brief Get IP address
* @param ip - IP address to be returned
*/
void getIPfromDHCP(uint8_t* ip);
/*
* @brief Get Gateway address
* @param ip - Gateway address to be returned
*/
void getGWfromDHCP(uint8_t* ip);
/*
* @brief Get Subnet mask value
* @param ip - Subnet mask to be returned
*/
void getSNfromDHCP(uint8_t* ip);
/*
* @brief Get DNS address
* @param ip - DNS address to be returned
*/
void getDNSfromDHCP(uint8_t* ip);
/*
* @brief Get the leased time by DHCP sever
* @return unit 1s
*/
uint32_t getDHCPLeasetime(void);
#endif /* _DHCP_H_ */

View File

@ -1,572 +0,0 @@
//*****************************************************************************
//
//! \file dns.c
//! \brief DNS APIs Implement file.
//! \details Send DNS query & Receive DNS reponse. \n
//! It depends on stdlib.h & string.h in ansi-c library
//! \version 1.1.0
//! \date 2013/11/18
//! \par Revision history
//! <2013/10/21> 1st Release
//! <2013/12/20> V1.1.0
//! 1. Remove secondary DNS server in DNS_run
//! If 1st DNS_run failed, call DNS_run with 2nd DNS again
//! 2. DNS_timerHandler -> DNS_time_handler
//! 3. Remove the unused define
//! 4. Integrated dns.h dns.c & dns_parse.h dns_parse.c into dns.h & dns.c
//! <2013/12/20> V1.1.0
//! <2018/10/04> Modified HAL_GetTick for use with CircuitPython by Nick Moore
//!
//! \author Eric Jung & MidnightCow
//! \copyright
//!
//! Copyright (c) 2013, WIZnet Co., LTD.
//! All rights reserved.
//!
//! Redistribution and use in source and binary forms, with or without
//! modification, are permitted provided that the following conditions
//! are met:
//!
//! * Redistributions of source code must retain the above copyright
//! notice, this list of conditions and the following disclaimer.
//! * Redistributions in binary form must reproduce the above copyright
//! notice, this list of conditions and the following disclaimer in the
//! documentation and/or other materials provided with the distribution.
//! * Neither the name of the <ORGANIZATION> nor the names of its
//! contributors may be used to endorse or promote products derived
//! from this software without specific prior written permission.
//!
//! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
//! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
//! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
//! THE POSSIBILITY OF SUCH DAMAGE.
//
//*****************************************************************************
#include <string.h>
#include <stdlib.h>
#include "supervisor/shared/tick.h"
//#include "Ethernet/socket.h"
//#include "Internet/DNS/dns.h"
#include "../../ethernet/socket.h"
#include "dns.h"
#ifdef _DNS_DEBUG_
#include <stdio.h>
#endif
#define INITRTT 2000L /* Initial smoothed response time */
#define MAXCNAME (MAX_DOMAIN_NAME + (MAX_DOMAIN_NAME>>1)) /* Maximum amount of cname recursion */
#define TYPE_A 1 /* Host address */
#define TYPE_NS 2 /* Name server */
#define TYPE_MD 3 /* Mail destination (obsolete) */
#define TYPE_MF 4 /* Mail forwarder (obsolete) */
#define TYPE_CNAME 5 /* Canonical name */
#define TYPE_SOA 6 /* Start of Authority */
#define TYPE_MB 7 /* Mailbox name (experimental) */
#define TYPE_MG 8 /* Mail group member (experimental) */
#define TYPE_MR 9 /* Mail rename name (experimental) */
#define TYPE_NULL 10 /* Null (experimental) */
#define TYPE_WKS 11 /* Well-known sockets */
#define TYPE_PTR 12 /* Pointer record */
#define TYPE_HINFO 13 /* Host information */
#define TYPE_MINFO 14 /* Mailbox information (experimental)*/
#define TYPE_MX 15 /* Mail exchanger */
#define TYPE_TXT 16 /* Text strings */
#define TYPE_ANY 255 /* Matches any type */
#define CLASS_IN 1 /* The ARPA Internet */
/* Round trip timing parameters */
#define AGAIN 8 /* Average RTT gain = 1/8 */
#define LAGAIN 3 /* Log2(AGAIN) */
#define DGAIN 4 /* Mean deviation gain = 1/4 */
#define LDGAIN 2 /* log2(DGAIN) */
/* Header for all domain messages */
struct dhdr
{
uint16_t id; /* Identification */
uint8_t qr; /* Query/Response */
#define QUERY 0
#define RESPONSE 1
uint8_t opcode;
#define IQUERY 1
uint8_t aa; /* Authoratative answer */
uint8_t tc; /* Truncation */
uint8_t rd; /* Recursion desired */
uint8_t ra; /* Recursion available */
uint8_t rcode; /* Response code */
#define NO_ERROR 0
#define FORMAT_ERROR 1
#define SERVER_FAIL 2
#define NAME_ERROR 3
#define NOT_IMPL 4
#define REFUSED 5
uint16_t qdcount; /* Question count */
uint16_t ancount; /* Answer count */
uint16_t nscount; /* Authority (name server) count */
uint16_t arcount; /* Additional record count */
};
uint8_t* pDNSMSG; // DNS message buffer
uint8_t DNS_SOCKET; // SOCKET number for DNS
uint16_t DNS_MSGID; // DNS message ID
uint32_t HAL_GetTick(void) {
return supervisor_ticks_ms32();
}
uint32_t hal_sys_tick;
/* converts uint16_t from network buffer to a host byte order integer. */
uint16_t get16(uint8_t * s)
{
uint16_t i;
i = *s++ << 8;
i = i + *s;
return i;
}
/* copies uint16_t to the network buffer with network byte order. */
uint8_t * put16(uint8_t * s, uint16_t i)
{
*s++ = i >> 8;
*s++ = i;
return s;
}
/*
* CONVERT A DOMAIN NAME TO THE HUMAN-READABLE FORM
*
* Description : This function converts a compressed domain name to the human-readable form
* Arguments : msg - is a pointer to the reply message
* compressed - is a pointer to the domain name in reply message.
* buf - is a pointer to the buffer for the human-readable form name.
* len - is the MAX. size of buffer.
* Returns : the length of compressed message
*/
int parse_name(uint8_t * msg, uint8_t * compressed, char * buf, int16_t len)
{
uint16_t slen; /* Length of current segment */
uint8_t * cp;
int clen = 0; /* Total length of compressed name */
int indirect = 0; /* Set if indirection encountered */
int nseg = 0; /* Total number of segments in name */
cp = compressed;
for (;;)
{
slen = *cp++; /* Length of this segment */
if (!indirect) clen++;
if ((slen & 0xc0) == 0xc0)
{
if (!indirect)
clen++;
indirect = 1;
/* Follow indirection */
cp = &msg[((slen & 0x3f)<<8) + *cp];
slen = *cp++;
}
if (slen == 0) /* zero length == all done */
break;
len -= slen + 1;
if (len < 0) return -1;
if (!indirect) clen += slen;
while (slen-- != 0) *buf++ = (char)*cp++;
*buf++ = '.';
nseg++;
}
if (nseg == 0)
{
/* Root name; represent as single dot */
*buf++ = '.';
len--;
}
*buf++ = '\0';
len--;
return clen; /* Length of compressed message */
}
/*
* PARSE QUESTION SECTION
*
* Description : This function parses the question record of the reply message.
* Arguments : msg - is a pointer to the reply message
* cp - is a pointer to the question record.
* Returns : a pointer the to next record.
*/
uint8_t * dns_question(uint8_t * msg, uint8_t * cp)
{
int len;
char name[MAXCNAME];
len = parse_name(msg, cp, name, MAXCNAME);
if (len == -1) return 0;
cp += len;
cp += 2; /* type */
cp += 2; /* class */
return cp;
}
/*
* PARSE ANSER SECTION
*
* Description : This function parses the answer record of the reply message.
* Arguments : msg - is a pointer to the reply message
* cp - is a pointer to the answer record.
* Returns : a pointer the to next record.
*/
uint8_t * dns_answer(uint8_t * msg, uint8_t * cp, uint8_t * ip_from_dns)
{
int len, type;
char name[MAXCNAME];
len = parse_name(msg, cp, name, MAXCNAME);
if (len == -1) return 0;
cp += len;
type = get16(cp);
cp += 2; /* type */
cp += 2; /* class */
cp += 4; /* ttl */
cp += 2; /* len */
switch (type)
{
case TYPE_A:
/* Just read the address directly into the structure */
ip_from_dns[0] = *cp++;
ip_from_dns[1] = *cp++;
ip_from_dns[2] = *cp++;
ip_from_dns[3] = *cp++;
break;
case TYPE_CNAME:
case TYPE_MB:
case TYPE_MG:
case TYPE_MR:
case TYPE_NS:
case TYPE_PTR:
/* These types all consist of a single domain name */
/* convert it to ASCII format */
len = parse_name(msg, cp, name, MAXCNAME);
if (len == -1) return 0;
cp += len;
break;
case TYPE_HINFO:
len = *cp++;
cp += len;
len = *cp++;
cp += len;
break;
case TYPE_MX:
cp += 2;
/* Get domain name of exchanger */
len = parse_name(msg, cp, name, MAXCNAME);
if (len == -1) return 0;
cp += len;
break;
case TYPE_SOA:
/* Get domain name of name server */
len = parse_name(msg, cp, name, MAXCNAME);
if (len == -1) return 0;
cp += len;
/* Get domain name of responsible person */
len = parse_name(msg, cp, name, MAXCNAME);
if (len == -1) return 0;
cp += len;
cp += 4;
cp += 4;
cp += 4;
cp += 4;
cp += 4;
break;
case TYPE_TXT:
/* Just stash */
break;
default:
/* Ignore */
break;
}
return cp;
}
/*
* PARSE THE DNS REPLY
*
* Description : This function parses the reply message from DNS server.
* Arguments : dhdr - is a pointer to the header for DNS message
* buf - is a pointer to the reply message.
* len - is the size of reply message.
* Returns : -1 - Domain name length is too big
* 0 - Fail (Timeout or parse error)
* 1 - Success,
*/
int8_t parseDNSMSG(struct dhdr * pdhdr, uint8_t * pbuf, uint8_t * ip_from_dns)
{
uint16_t tmp;
uint16_t i;
uint8_t * msg;
uint8_t * cp;
msg = pbuf;
memset(pdhdr, 0, sizeof(*pdhdr));
pdhdr->id = get16(&msg[0]);
tmp = get16(&msg[2]);
if (tmp & 0x8000) pdhdr->qr = 1;
pdhdr->opcode = (tmp >> 11) & 0xf;
if (tmp & 0x0400) pdhdr->aa = 1;
if (tmp & 0x0200) pdhdr->tc = 1;
if (tmp & 0x0100) pdhdr->rd = 1;
if (tmp & 0x0080) pdhdr->ra = 1;
pdhdr->rcode = tmp & 0xf;
pdhdr->qdcount = get16(&msg[4]);
pdhdr->ancount = get16(&msg[6]);
pdhdr->nscount = get16(&msg[8]);
pdhdr->arcount = get16(&msg[10]);
/* Now parse the variable length sections */
cp = &msg[12];
/* Question section */
for (i = 0; i < pdhdr->qdcount; i++)
{
cp = dns_question(msg, cp);
if(!cp)
{
#ifdef _DNS_DEBUG_
printf("MAX_DOMAIN_NAME is too small, it should be redefined in dns.h\r\n");
#endif
return -1;
}
}
/* Answer section */
for (i = 0; i < pdhdr->ancount; i++)
{
cp = dns_answer(msg, cp, ip_from_dns);
if(!cp)
{
#ifdef _DNS_DEBUG_
printf("MAX_DOMAIN_NAME is too small, it should be redefined in dns.h\r\n");
#endif
return -1;
}
}
/* Name server (authority) section */
for (i = 0; i < pdhdr->nscount; i++)
{
;
}
/* Additional section */
for (i = 0; i < pdhdr->arcount; i++)
{
;
}
if(pdhdr->rcode == 0) return 1; // No error
else return 0;
}
/*
* MAKE DNS QUERY MESSAGE
*
* Description : This function makes DNS query message.
* Arguments : op - Recursion desired
* name - is a pointer to the domain name.
* buf - is a pointer to the buffer for DNS message.
* len - is the MAX. size of buffer.
* Returns : the pointer to the DNS message.
*/
int16_t dns_makequery(uint16_t op, char * name, uint8_t * buf, uint16_t len)
{
uint8_t *cp;
char *cp1;
char sname[MAXCNAME];
char *dname;
uint16_t p;
uint16_t dlen;
cp = buf;
DNS_MSGID++;
cp = put16(cp, DNS_MSGID);
p = (op << 11) | 0x0100; /* Recursion desired */
cp = put16(cp, p);
cp = put16(cp, 1);
cp = put16(cp, 0);
cp = put16(cp, 0);
cp = put16(cp, 0);
strcpy(sname, name);
dname = sname;
dlen = strlen(dname);
for (;;)
{
/* Look for next dot */
cp1 = strchr(dname, '.');
if (cp1 != NULL) len = cp1 - dname; /* More to come */
else len = dlen; /* Last component */
*cp++ = len; /* Write length of component */
if (len == 0) break;
/* Copy component up to (but not including) dot */
memcpy(cp, dname, len);
cp += len;
if (cp1 == NULL)
{
*cp++ = 0; /* Last one; write null and finish */
break;
}
dname += len+1;
dlen -= len+1;
}
cp = put16(cp, 0x0001); /* type */
cp = put16(cp, 0x0001); /* class */
return ((int16_t)((uint32_t)(cp) - (uint32_t)(buf)));
}
/*
* CHECK DNS TIMEOUT
*
* Description : This function check the DNS timeout
* Arguments : None.
* Returns : -1 - timeout occurred, 0 - timer over, but no timeout, 1 - no timer over, no timeout occur
* Note : timeout : retry count and timer both over.
*/
int8_t check_DNS_timeout(void)
{
static uint8_t retry_count;
uint32_t tick = HAL_GetTick();
if(tick - hal_sys_tick >= DNS_WAIT_TIME * 1000)
{
hal_sys_tick = tick;
if(retry_count >= MAX_DNS_RETRY) {
retry_count = 0;
return -1; // timeout occurred
}
retry_count++;
return 0; // timer over, but no timeout
}
return 1; // no timer over, no timeout occur
}
/* DNS CLIENT INIT */
void DNS_init(uint8_t s, uint8_t * buf)
{
DNS_SOCKET = s; // SOCK_DNS
pDNSMSG = buf; // User's shared buffer
DNS_MSGID = DNS_MSG_ID;
}
/* DNS CLIENT RUN */
int8_t DNS_run(uint8_t * dns_ip, uint8_t * name, uint8_t * ip_from_dns)
{
int8_t ret;
struct dhdr dhp;
uint8_t ip[4];
uint16_t len, port;
int8_t ret_check_timeout;
hal_sys_tick = HAL_GetTick();
// Socket open
WIZCHIP_EXPORT(socket)(DNS_SOCKET, Sn_MR_UDP, 0, 0);
#ifdef _DNS_DEBUG_
printf("> DNS Query to DNS Server : %d.%d.%d.%d\r\n", dns_ip[0], dns_ip[1], dns_ip[2], dns_ip[3]);
#endif
len = dns_makequery(0, (char *)name, pDNSMSG, MAX_DNS_BUF_SIZE);
WIZCHIP_EXPORT(sendto)(DNS_SOCKET, pDNSMSG, len, dns_ip, IPPORT_DOMAIN);
while (1)
{
if ((len = getSn_RX_RSR(DNS_SOCKET)) > 0)
{
if (len > MAX_DNS_BUF_SIZE) len = MAX_DNS_BUF_SIZE;
len = WIZCHIP_EXPORT(recvfrom)(DNS_SOCKET, pDNSMSG, len, ip, &port);
#ifdef _DNS_DEBUG_
printf("> Receive DNS message from %d.%d.%d.%d(%d). len = %d\r\n", ip[0], ip[1], ip[2], ip[3],port,len);
#endif
ret = parseDNSMSG(&dhp, pDNSMSG, ip_from_dns);
break;
}
// Check Timeout
ret_check_timeout = check_DNS_timeout();
if (ret_check_timeout < 0) {
#ifdef _DNS_DEBUG_
printf("> DNS Server is not responding : %d.%d.%d.%d\r\n", dns_ip[0], dns_ip[1], dns_ip[2], dns_ip[3]);
#endif
return 0; // timeout occurred
}
else if (ret_check_timeout == 0) {
#ifdef _DNS_DEBUG_
printf("> DNS Timeout\r\n");
#endif
WIZCHIP_EXPORT(sendto)(DNS_SOCKET, pDNSMSG, len, dns_ip, IPPORT_DOMAIN);
}
}
WIZCHIP_EXPORT(close)(DNS_SOCKET);
// Return value
// 0 > : failed / 1 - success
return ret;
}

View File

@ -1,96 +0,0 @@
//*****************************************************************************
//
//! \file dns.h
//! \brief DNS APIs Header file.
//! \details Send DNS query & Receive DNS reponse.
//! \version 1.1.0
//! \date 2013/11/18
//! \par Revision history
//! <2013/10/21> 1st Release
//! <2013/12/20> V1.1.0
//! 1. Remove secondary DNS server in DNS_run
//! If 1st DNS_run failed, call DNS_run with 2nd DNS again
//! 2. DNS_timerHandler -> DNS_time_handler
//! 3. Move the no reference define to dns.c
//! 4. Integrated dns.h dns.c & dns_parse.h dns_parse.c into dns.h & dns.c
//! <2013/12/20> V1.1.0
//!
//! \author Eric Jung & MidnightCow
//! \copyright
//!
//! Copyright (c) 2013, WIZnet Co., LTD.
//! All rights reserved.
//!
//! Redistribution and use in source and binary forms, with or without
//! modification, are permitted provided that the following conditions
//! are met:
//!
//! * Redistributions of source code must retain the above copyright
//! notice, this list of conditions and the following disclaimer.
//! * Redistributions in binary form must reproduce the above copyright
//! notice, this list of conditions and the following disclaimer in the
//! documentation and/or other materials provided with the distribution.
//! * Neither the name of the <ORGANIZATION> nor the names of its
//! contributors may be used to endorse or promote products derived
//! from this software without specific prior written permission.
//!
//! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
//! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
//! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
//! THE POSSIBILITY OF SUCH DAMAGE.
//
//*****************************************************************************
#ifndef _DNS_H_
#define _DNS_H_
#include <stdint.h>
/*
* @brief Define it for Debug & Monitor DNS processing.
* @note If defined, it depends on <stdio.h>
*/
//#define _DNS_DEBUG_
#define MAX_DNS_BUF_SIZE 256 ///< maximum size of DNS buffer. */
/*
* @brief Maximum length of your queried Domain name
* @todo SHOULD BE defined it equal as or greater than your Domain name length + null character(1)
* @note SHOULD BE careful to stack overflow because it is allocated 1.5 times as MAX_DOMAIN_NAME in stack.
*/
#define MAX_DOMAIN_NAME 32 // for example "www.google.com"
#define MAX_DNS_RETRY 2 ///< Requery Count
#define DNS_WAIT_TIME 4 ///< Wait response time. unit 1s.
#define IPPORT_DOMAIN 53 ///< DNS server port number
#define DNS_MSG_ID 0x1122 ///< ID for DNS message. You can be modified it any number
/*
* @brief DNS process initialize
* @param s : Socket number for DNS
* @param buf : Buffer for DNS message
*/
void DNS_init(uint8_t s, uint8_t * buf);
/*
* @brief DNS process
* @details Send DNS query and receive DNS response
* @param dns_ip : DNS server ip address
* @param name : Domain name to be queried
* @param ip_from_dns : IP address from DNS server
* @return -1 : failed. @ref MAX_DOMIN_NAME is too small \n
* 0 : failed (Timeout or Parse error)\n
* 1 : success
* @note This function blocks until success or fail. max time = @ref MAX_DNS_RETRY * @ref DNS_WAIT_TIME
*/
int8_t DNS_run(uint8_t * dns_ip, uint8_t * name, uint8_t * ip_from_dns);
#endif /* _DNS_H_ */

View File

@ -0,0 +1,117 @@
/*
* Automatically generated header file: don't edit
*/
#define HAVE_DOT_CONFIG 1
#define CONFIG_PLATFORM_LINUX 1
#undef CONFIG_PLATFORM_CYGWIN
#undef CONFIG_PLATFORM_WIN32
/*
* General Configuration
*/
#define PREFIX "/usr/local"
#undef CONFIG_DEBUG
#undef CONFIG_STRIP_UNWANTED_SECTIONS
#undef CONFIG_VISUAL_STUDIO_7_0
#undef CONFIG_VISUAL_STUDIO_8_0
#undef CONFIG_VISUAL_STUDIO_10_0
#define CONFIG_VISUAL_STUDIO_7_0_BASE ""
#define CONFIG_VISUAL_STUDIO_8_0_BASE ""
#define CONFIG_VISUAL_STUDIO_10_0_BASE ""
#define CONFIG_EXTRA_CFLAGS_OPTIONS ""
#define CONFIG_EXTRA_LDFLAGS_OPTIONS ""
/*
* SSL Library
*/
#undef CONFIG_SSL_SERVER_ONLY
#undef CONFIG_SSL_CERT_VERIFICATION
#undef CONFIG_SSL_FULL_MODE
#define CONFIG_SSL_SKELETON_MODE 1
#define CONFIG_SSL_ENABLE_SERVER 1
#define CONFIG_SSL_ENABLE_CLIENT 1
#undef CONFIG_SSL_DIAGNOSTICS
#define CONFIG_SSL_PROT_LOW 1
#undef CONFIG_SSL_PROT_MEDIUM
#undef CONFIG_SSL_PROT_HIGH
#define CONFIG_SSL_AES 1
#define CONFIG_SSL_USE_DEFAULT_KEY 1
#define CONFIG_SSL_PRIVATE_KEY_LOCATION ""
#define CONFIG_SSL_PRIVATE_KEY_PASSWORD ""
#define CONFIG_SSL_X509_CERT_LOCATION ""
#undef CONFIG_SSL_GENERATE_X509_CERT
#define CONFIG_SSL_X509_COMMON_NAME ""
#define CONFIG_SSL_X509_ORGANIZATION_NAME ""
#define CONFIG_SSL_X509_ORGANIZATION_UNIT_NAME ""
#undef CONFIG_SSL_HAS_PEM
#undef CONFIG_SSL_USE_PKCS12
#define CONFIG_SSL_EXPIRY_TIME
#define CONFIG_X509_MAX_CA_CERTS 0
#define CONFIG_SSL_MAX_CERTS 3
#undef CONFIG_SSL_CTX_MUTEXING
#undef CONFIG_USE_DEV_URANDOM
#undef CONFIG_WIN32_USE_CRYPTO_LIB
#undef CONFIG_OPENSSL_COMPATIBLE
#undef CONFIG_PERFORMANCE_TESTING
#undef CONFIG_SSL_TEST
#undef CONFIG_AXTLSWRAP
#undef CONFIG_AXHTTPD
#undef CONFIG_HTTP_STATIC_BUILD
#define CONFIG_HTTP_PORT
#define CONFIG_HTTP_HTTPS_PORT
#define CONFIG_HTTP_SESSION_CACHE_SIZE
#define CONFIG_HTTP_WEBROOT ""
#define CONFIG_HTTP_TIMEOUT
#undef CONFIG_HTTP_HAS_CGI
#define CONFIG_HTTP_CGI_EXTENSIONS ""
#undef CONFIG_HTTP_ENABLE_LUA
#define CONFIG_HTTP_LUA_PREFIX ""
#undef CONFIG_HTTP_BUILD_LUA
#define CONFIG_HTTP_CGI_LAUNCHER ""
#undef CONFIG_HTTP_DIRECTORIES
#undef CONFIG_HTTP_HAS_AUTHORIZATION
#undef CONFIG_HTTP_HAS_IPV6
#undef CONFIG_HTTP_ENABLE_DIFFERENT_USER
#define CONFIG_HTTP_USER ""
#undef CONFIG_HTTP_VERBOSE
#undef CONFIG_HTTP_IS_DAEMON
/*
* Language Bindings
*/
#undef CONFIG_BINDINGS
#undef CONFIG_CSHARP_BINDINGS
#undef CONFIG_VBNET_BINDINGS
#define CONFIG_DOT_NET_FRAMEWORK_BASE ""
#undef CONFIG_JAVA_BINDINGS
#define CONFIG_JAVA_HOME ""
#undef CONFIG_PERL_BINDINGS
#define CONFIG_PERL_CORE ""
#define CONFIG_PERL_LIB ""
#undef CONFIG_LUA_BINDINGS
#define CONFIG_LUA_CORE ""
/*
* Samples
*/
#undef CONFIG_SAMPLES
#undef CONFIG_C_SAMPLES
#undef CONFIG_CSHARP_SAMPLES
#undef CONFIG_VBNET_SAMPLES
#undef CONFIG_JAVA_SAMPLES
#undef CONFIG_PERL_SAMPLES
#undef CONFIG_LUA_SAMPLES
#undef CONFIG_BIGINT_CLASSICAL
#undef CONFIG_BIGINT_MONTGOMERY
#undef CONFIG_BIGINT_BARRETT
#undef CONFIG_BIGINT_CRT
#undef CONFIG_BIGINT_KARATSUBA
#define MUL_KARATSUBA_THRESH
#define SQU_KARATSUBA_THRESH
#undef CONFIG_BIGINT_SLIDING_WINDOW
#undef CONFIG_BIGINT_SQUARE
#undef CONFIG_BIGINT_CHECK_ON
#undef CONFIG_INTEGER_32BIT
#undef CONFIG_INTEGER_16BIT
#undef CONFIG_INTEGER_8BIT

View File

@ -0,0 +1 @@
#define AXTLS_VERSION "(no version)"

View File

@ -1,94 +0,0 @@
// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors)
// SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George
//
// SPDX-License-Identifier: MIT
#include "py/runtime.h"
#include "extmod/machine_mem.h"
#if MICROPY_PY_MACHINE
// If you wish to override the functions for mapping the machine_mem read/write
// address, then add a #define for MICROPY_MACHINE_MEM_GET_READ_ADDR and/or
// MICROPY_MACHINE_MEM_GET_WRITE_ADDR in your mpconfigport.h. Since the
// prototypes are identical, it is allowable for both of the macros to evaluate
// the to same function.
//
// It is expected that the modmachine.c file for a given port will provide the
// implementations, if the default implementation isn't used.
#if !defined(MICROPY_MACHINE_MEM_GET_READ_ADDR) || !defined(MICROPY_MACHINE_MEM_GET_WRITE_ADDR)
STATIC uintptr_t machine_mem_get_addr(mp_obj_t addr_o, uint align) {
uintptr_t addr = mp_obj_int_get_truncated(addr_o);
if ((addr & (align - 1)) != 0) {
mp_raise_ValueError_varg(translate("address %08x is not aligned to %d bytes"), addr, align);
}
return addr;
}
#if !defined(MICROPY_MACHINE_MEM_GET_READ_ADDR)
#define MICROPY_MACHINE_MEM_GET_READ_ADDR machine_mem_get_addr
#endif
#if !defined(MICROPY_MACHINE_MEM_GET_WRITE_ADDR)
#define MICROPY_MACHINE_MEM_GET_WRITE_ADDR machine_mem_get_addr
#endif
#endif
STATIC void machine_mem_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) {
(void)kind;
machine_mem_obj_t *self = MP_OBJ_TO_PTR(self_in);
mp_printf(print, "<%u-bit memory>", 8 * self->elem_size);
}
STATIC mp_obj_t machine_mem_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t value) {
// TODO support slice index to read/write multiple values at once
machine_mem_obj_t *self = MP_OBJ_TO_PTR(self_in);
if (value == MP_OBJ_NULL) {
// delete
return MP_OBJ_NULL; // op not supported
} else if (value == MP_OBJ_SENTINEL) {
// load
uintptr_t addr = MICROPY_MACHINE_MEM_GET_READ_ADDR(index, self->elem_size);
uint32_t val;
switch (self->elem_size) {
case 1:
val = (*(uint8_t *)addr);
break;
case 2:
val = (*(uint16_t *)addr);
break;
default:
val = (*(uint32_t *)addr);
break;
}
return mp_obj_new_int(val);
} else {
// store
uintptr_t addr = MICROPY_MACHINE_MEM_GET_WRITE_ADDR(index, self->elem_size);
uint32_t val = mp_obj_get_int_truncated(value);
switch (self->elem_size) {
case 1:
(*(uint8_t *)addr) = val;
break;
case 2:
(*(uint16_t *)addr) = val;
break;
default:
(*(uint32_t *)addr) = val;
break;
}
return mp_const_none;
}
}
const mp_obj_type_t machine_mem_type = {
{ &mp_type_type },
.name = MP_QSTR_mem,
.print = machine_mem_print,
.subscr = machine_mem_subscr,
};
const machine_mem_obj_t machine_mem8_obj = {{&machine_mem_type}, 1};
const machine_mem_obj_t machine_mem16_obj = {{&machine_mem_type}, 2};
const machine_mem_obj_t machine_mem32_obj = {{&machine_mem_type}, 4};
#endif // MICROPY_PY_MACHINE

View File

@ -1,29 +0,0 @@
// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors)
// SPDX-FileCopyrightText: Copyright (c) 2015 Damien P. George
//
// SPDX-License-Identifier: MIT
#ifndef MICROPY_INCLUDED_EXTMOD_MACHINE_MEM_H
#define MICROPY_INCLUDED_EXTMOD_MACHINE_MEM_H
#include "py/obj.h"
typedef struct _machine_mem_obj_t {
mp_obj_base_t base;
unsigned elem_size; // in bytes
} machine_mem_obj_t;
extern const mp_obj_type_t machine_mem_type;
extern const machine_mem_obj_t machine_mem8_obj;
extern const machine_mem_obj_t machine_mem16_obj;
extern const machine_mem_obj_t machine_mem32_obj;
#if defined(MICROPY_MACHINE_MEM_GET_READ_ADDR)
uintptr_t MICROPY_MACHINE_MEM_GET_READ_ADDR(mp_obj_t addr_o, uint align);
#endif
#if defined(MICROPY_MACHINE_MEM_GET_WRITE_ADDR)
uintptr_t MICROPY_MACHINE_MEM_GET_WRITE_ADDR(mp_obj_t addr_o, uint align);
#endif
#endif // MICROPY_INCLUDED_EXTMOD_MACHINE_MEM_H

View File

@ -1,67 +0,0 @@
// Copyright (c) 2016 Paul Sokolovsky
// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors)
//
// SPDX-License-Identifier: MIT
#include "py/mpconfig.h"
#if MICROPY_PY_MACHINE
#include "py/obj.h"
#include "py/runtime.h"
#include "extmod/virtpin.h"
#include "extmod/machine_pinbase.h"
// PinBase class
// As this is abstract class, its instance is null.
// But there should be an instance, as the rest of instance code
// expects that there will be concrete object for inheritance.
typedef struct _mp_pinbase_t {
mp_obj_base_t base;
} mp_pinbase_t;
STATIC const mp_pinbase_t pinbase_singleton = {
.base = { &machine_pinbase_type },
};
STATIC mp_obj_t pinbase_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
(void)type;
(void)n_args;
(void)args;
(void)kw_args;
return MP_OBJ_FROM_PTR(&pinbase_singleton);
}
mp_uint_t pinbase_ioctl(mp_obj_t obj, mp_uint_t request, uintptr_t arg, int *errcode);
mp_uint_t pinbase_ioctl(mp_obj_t obj, mp_uint_t request, uintptr_t arg, int *errcode) {
(void)errcode;
switch (request) {
case MP_PIN_READ: {
mp_obj_t dest[2];
mp_load_method(obj, MP_QSTR_value, dest);
return mp_obj_get_int(mp_call_method_n_kw(0, 0, dest));
}
case MP_PIN_WRITE: {
mp_obj_t dest[3];
mp_load_method(obj, MP_QSTR_value, dest);
dest[2] = (arg == 0 ? mp_const_false : mp_const_true);
mp_call_method_n_kw(1, 0, dest);
return 0;
}
}
return -1;
}
STATIC const mp_pin_p_t pinbase_pin_p = {
MP_PROTO_IMPLEMENT(MP_QSTR_protocol_pin)
.ioctl = pinbase_ioctl,
};
const mp_obj_type_t machine_pinbase_type = {
{ &mp_type_type },
.name = MP_QSTR_PinBase,
.make_new = pinbase_make_new,
.protocol = &pinbase_pin_p,
};
#endif // MICROPY_PY_MACHINE

View File

@ -1,13 +0,0 @@
// Copyright (c) 2016 Paul Sokolovsky
// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors)
//
// SPDX-License-Identifier: MIT
#ifndef MICROPY_INCLUDED_EXTMOD_MACHINE_PINBASE_H
#define MICROPY_INCLUDED_EXTMOD_MACHINE_PINBASE_H
#include "py/obj.h"
extern const mp_obj_type_t machine_pinbase_type;
#endif // MICROPY_INCLUDED_EXTMOD_MACHINE_PINBASE_H

View File

@ -1,44 +0,0 @@
// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors)
// SPDX-FileCopyrightText: Copyright (c) 2016 Damien P. George
//
// SPDX-License-Identifier: MIT
#include "py/runtime.h"
#include "py/mperrno.h"
#include "extmod/machine_pulse.h"
#if MICROPY_PY_MACHINE_PULSE
mp_uint_t machine_time_pulse_us(mp_hal_pin_obj_t pin, int pulse_level, mp_uint_t timeout_us) {
mp_uint_t start = mp_hal_ticks_us();
while (mp_hal_pin_read(pin) != pulse_level) {
if ((mp_uint_t)(mp_hal_ticks_us() - start) >= timeout_us) {
return (mp_uint_t)-2;
}
}
start = mp_hal_ticks_us();
while (mp_hal_pin_read(pin) == pulse_level) {
if ((mp_uint_t)(mp_hal_ticks_us() - start) >= timeout_us) {
return (mp_uint_t)-1;
}
}
return mp_hal_ticks_us() - start;
}
STATIC mp_obj_t machine_time_pulse_us_(size_t n_args, const mp_obj_t *args) {
mp_hal_pin_obj_t pin = mp_hal_get_pin_obj(args[0]);
int level = 0;
if (mp_obj_is_true(args[1])) {
level = 1;
}
mp_uint_t timeout_us = 1000000;
if (n_args > 2) {
timeout_us = mp_obj_get_int(args[2]);
}
mp_uint_t us = machine_time_pulse_us(pin, level, timeout_us);
// May return -1 or -2 in case of timeout
return mp_obj_new_int(us);
}
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(machine_time_pulse_us_obj, 2, 3, machine_time_pulse_us_);
#endif

View File

@ -1,16 +0,0 @@
// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors)
// SPDX-FileCopyrightText: Copyright (c) 2016 Damien P. George
//
// SPDX-License-Identifier: MIT
#ifndef MICROPY_INCLUDED_EXTMOD_MACHINE_PULSE_H
#define MICROPY_INCLUDED_EXTMOD_MACHINE_PULSE_H
#include "py/obj.h"
#include "py/mphal.h"
mp_uint_t machine_time_pulse_us(mp_hal_pin_obj_t pin, int pulse_level, mp_uint_t timeout_us);
MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(machine_time_pulse_us_obj);
#endif // MICROPY_INCLUDED_EXTMOD_MACHINE_PULSE_H

View File

@ -1,159 +0,0 @@
// Copyright (c) 2017 Paul Sokolovsky
// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors)
//
// SPDX-License-Identifier: MIT
#include "py/mpconfig.h"
#if MICROPY_PY_MACHINE
#include <string.h>
#include "py/obj.h"
#include "py/runtime.h"
#include "extmod/virtpin.h"
#include "extmod/machine_signal.h"
// Signal class
typedef struct _machine_signal_t {
mp_obj_base_t base;
mp_obj_t pin;
bool invert;
} machine_signal_t;
STATIC mp_obj_t signal_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
mp_obj_t pin = args[0];
bool invert = false;
#if defined(MICROPY_PY_MACHINE_PIN_MAKE_NEW)
mp_pin_p_t *pin_p = (mp_pin_t *)mp_proto_get(QSTR_pin_protocol, pin);
if (pin_p == NULL) {
// If first argument isn't a Pin-like object, we filter out "invert"
// from keyword arguments and pass them all to the exported Pin
// constructor to create one.
mp_obj_t *pin_args = mp_local_alloc((n_args + n_kw * 2) * sizeof(mp_obj_t));
memcpy(pin_args, args, n_args * sizeof(mp_obj_t));
const mp_obj_t *src = args + n_args;
mp_obj_t *dst = pin_args + n_args;
mp_obj_t *sig_value = NULL;
for (size_t cnt = n_kw; cnt; cnt--) {
if (*src == MP_OBJ_NEW_QSTR(MP_QSTR_invert)) {
invert = mp_obj_is_true(src[1]);
n_kw--;
} else {
*dst++ = *src;
*dst++ = src[1];
}
if (*src == MP_OBJ_NEW_QSTR(MP_QSTR_value)) {
// Value is pertained to Signal, so we should invert
// it for Pin if needed, and we should do it only when
// inversion status is guaranteedly known.
sig_value = dst - 1;
}
src += 2;
}
if (invert && sig_value != NULL) {
*sig_value = mp_obj_is_true(*sig_value) ? MP_OBJ_NEW_SMALL_INT(0) : MP_OBJ_NEW_SMALL_INT(1);
}
// Here we pass NULL as a type, hoping that mp_pin_make_new()
// will just ignore it as set a concrete type. If not, we'd need
// to expose port's "default" pin type too.
pin = MICROPY_PY_MACHINE_PIN_MAKE_NEW(NULL, n_args, n_kw, pin_args);
mp_local_free(pin_args);
} else
#endif
// Otherwise there should be 1 or 2 args
{
if (n_args == 1) {
if (kw_args == NULL || kw_args->used == 0) {
} else if (kw_args->used == 1 && kw_args->table[0].key == MP_OBJ_NEW_QSTR(MP_QSTR_invert)) {
invert = mp_obj_is_true(kw_args->table[0].value);
} else {
goto error;
}
} else {
error:
mp_raise_TypeError(NULL);
}
}
machine_signal_t *o = m_new_obj(machine_signal_t);
o->base.type = type;
o->pin = pin;
o->invert = invert;
return MP_OBJ_FROM_PTR(o);
}
STATIC mp_uint_t signal_ioctl(mp_obj_t self_in, mp_uint_t request, uintptr_t arg, int *errcode) {
(void)errcode;
machine_signal_t *self = MP_OBJ_TO_PTR(self_in);
switch (request) {
case MP_PIN_READ: {
return mp_virtual_pin_read(self->pin) ^ self->invert;
}
case MP_PIN_WRITE: {
mp_virtual_pin_write(self->pin, arg ^ self->invert);
return 0;
}
}
return -1;
}
// fast method for getting/setting signal value
STATIC mp_obj_t signal_call(mp_obj_t self_in, size_t n_args, size_t n_kw, const mp_obj_t *args) {
mp_arg_check_num_kw_array(n_args, n_kw, 0, 1, false);
if (n_args == 0) {
// get pin
return MP_OBJ_NEW_SMALL_INT(mp_virtual_pin_read(self_in));
} else {
// set pin
mp_virtual_pin_write(self_in, mp_obj_is_true(args[0]));
return mp_const_none;
}
}
STATIC mp_obj_t signal_value(size_t n_args, const mp_obj_t *args) {
return signal_call(args[0], n_args - 1, 0, args + 1);
}
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(signal_value_obj, 1, 2, signal_value);
STATIC mp_obj_t signal_on(mp_obj_t self_in) {
mp_virtual_pin_write(self_in, 1);
return mp_const_none;
}
STATIC MP_DEFINE_CONST_FUN_OBJ_1(signal_on_obj, signal_on);
STATIC mp_obj_t signal_off(mp_obj_t self_in) {
mp_virtual_pin_write(self_in, 0);
return mp_const_none;
}
STATIC MP_DEFINE_CONST_FUN_OBJ_1(signal_off_obj, signal_off);
STATIC const mp_rom_map_elem_t signal_locals_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_value), MP_ROM_PTR(&signal_value_obj) },
{ MP_ROM_QSTR(MP_QSTR_on), MP_ROM_PTR(&signal_on_obj) },
{ MP_ROM_QSTR(MP_QSTR_off), MP_ROM_PTR(&signal_off_obj) },
};
STATIC MP_DEFINE_CONST_DICT(signal_locals_dict, signal_locals_dict_table);
STATIC const mp_pin_p_t signal_pin_p = {
MP_PROTO_IMPLEMENT(MP_QSTR_protocol_pin)
.ioctl = signal_ioctl,
};
const mp_obj_type_t machine_signal_type = {
{ &mp_type_type },
.name = MP_QSTR_Signal,
.make_new = signal_make_new,
.call = signal_call,
.protocol = &signal_pin_p,
.locals_dict = (void *)&signal_locals_dict,
};
#endif // MICROPY_PY_MACHINE

View File

@ -1,13 +0,0 @@
// Copyright (c) 2017 Paul Sokolovsky
// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors)
//
// SPDX-License-Identifier: MIT
#ifndef MICROPY_INCLUDED_EXTMOD_MACHINE_SIGNAL_H
#define MICROPY_INCLUDED_EXTMOD_MACHINE_SIGNAL_H
#include "py/obj.h"
extern const mp_obj_type_t machine_signal_type;
#endif // MICROPY_INCLUDED_EXTMOD_MACHINE_SIGNAL_H

View File

@ -331,7 +331,7 @@ STATIC mp_obj_t mod_btree_open(size_t n_args, const mp_obj_t *pos_args, mp_map_t
openinfo.psize = args.pagesize.u_int;
openinfo.minkeypage = args.minkeypage.u_int;
DB *db = __bt_open(pos_args[0], &btree_stream_fvtable, &openinfo, /*dflags*/ 0);
DB *db = __bt_open(MP_OBJ_TO_PTR(pos_args[0]), &btree_stream_fvtable, &openinfo, /*dflags*/ 0);
if (db == NULL) {
mp_raise_OSError(errno);
}

File diff suppressed because it is too large Load Diff

View File

@ -13,8 +13,8 @@
// Low-level 1-Wire routines
#define TIMING_RESET1 (480)
#define TIMING_RESET2 (40)
#define TIMING_RESET3 (420)
#define TIMING_RESET2 (70)
#define TIMING_RESET3 (410)
#define TIMING_READ1 (5)
#define TIMING_READ2 (5)
#define TIMING_READ3 (40)

View File

@ -1,4 +1,4 @@
// Copyright (c) 2014 Paul Sokolovsky
// Copyright (c) 2014-2018 Paul Sokolovsky
// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors)
//
// SPDX-License-Identifier: MIT
@ -73,7 +73,7 @@ enum {
#define AGG_TYPE_BITS 2
enum {
STRUCT, PTR, ARRAY, BITFIELD,
STRUCT, PTR, ARRAY,
};
// Here we need to set sign bit right
@ -118,7 +118,11 @@ STATIC void uctypes_struct_print(const mp_print_t *print, mp_obj_t self_in, mp_p
(void)kind;
mp_obj_uctypes_struct_t *self = MP_OBJ_TO_PTR(self_in);
const char *typen = "unk";
if (MP_OBJ_IS_TYPE(self->desc, &mp_type_dict)) {
if (MP_OBJ_IS_TYPE(self->desc, &mp_type_dict)
#if MICROPY_PY_COLLECTIONS_ORDEREDDICT
|| MP_OBJ_IS_TYPE(self->desc, &mp_type_ordereddict)
#endif
) {
typen = "STRUCT";
} else if (MP_OBJ_IS_TYPE(self->desc, &mp_type_tuple)) {
mp_obj_tuple_t *t = MP_OBJ_TO_PTR(self->desc);
@ -191,7 +195,11 @@ STATIC mp_uint_t uctypes_struct_agg_size(mp_obj_tuple_t *t, int layout_type, mp_
}
STATIC mp_uint_t uctypes_struct_size(mp_obj_t desc_in, int layout_type, mp_uint_t *max_field_size) {
if (!MP_OBJ_IS_TYPE(desc_in, &mp_type_dict)) {
if (!MP_OBJ_IS_TYPE(desc_in, &mp_type_dict)
#if MICROPY_PY_COLLECTIONS_ORDEREDDICT
&& !MP_OBJ_IS_TYPE(desc_in, &mp_type_ordereddict)
#endif
) {
if (MP_OBJ_IS_TYPE(desc_in, &mp_type_tuple)) {
return uctypes_struct_agg_size((mp_obj_tuple_t *)MP_OBJ_TO_PTR(desc_in), layout_type, max_field_size);
} else if (MP_OBJ_IS_SMALL_INT(desc_in)) {
@ -246,7 +254,8 @@ STATIC mp_uint_t uctypes_struct_size(mp_obj_t desc_in, int layout_type, mp_uint_
return total_size;
}
STATIC mp_obj_t uctypes_struct_sizeof(mp_obj_t obj_in) {
STATIC mp_obj_t uctypes_struct_sizeof(size_t n_args, const mp_obj_t *args) {
mp_obj_t obj_in = args[0];
mp_uint_t max_field_size = 0;
if (MP_OBJ_IS_TYPE(obj_in, &mp_type_bytearray)) {
return mp_obj_len(obj_in);
@ -255,15 +264,22 @@ STATIC mp_obj_t uctypes_struct_sizeof(mp_obj_t obj_in) {
// We can apply sizeof either to structure definition (a dict)
// or to instantiated structure
if (MP_OBJ_IS_TYPE(obj_in, &uctypes_struct_type)) {
if (n_args != 1) {
mp_raise_TypeError(NULL);
}
// Extract structure definition
mp_obj_uctypes_struct_t *obj = MP_OBJ_TO_PTR(obj_in);
obj_in = obj->desc;
layout_type = obj->flags;
} else {
if (n_args == 2) {
layout_type = mp_obj_get_int(args[1]);
}
}
mp_uint_t size = uctypes_struct_size(obj_in, layout_type, &max_field_size);
return MP_OBJ_NEW_SMALL_INT(size);
}
STATIC MP_DEFINE_CONST_FUN_OBJ_1(uctypes_struct_sizeof_obj, uctypes_struct_sizeof);
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(uctypes_struct_sizeof_obj, 1, 2, uctypes_struct_sizeof);
static inline mp_obj_t get_unaligned(uint val_type, byte *p, int big_endian) {
char struct_type = big_endian ? '>' : '<';
@ -325,7 +341,7 @@ STATIC mp_obj_t get_aligned(uint val_type, void *p, mp_int_t index) {
return mp_obj_new_int_from_ll(((int64_t *)p)[index]);
#if MICROPY_PY_BUILTINS_FLOAT
case FLOAT32:
return mp_obj_new_float((mp_float_t)((float *)p)[index]);
return mp_obj_new_float(((float *)p)[index]);
case FLOAT64:
return mp_obj_new_float(((double *)p)[index]);
#endif
@ -384,8 +400,11 @@ STATIC void set_aligned(uint val_type, void *p, mp_int_t index, mp_obj_t val) {
STATIC mp_obj_t uctypes_struct_attr_op(mp_obj_t self_in, qstr attr, mp_obj_t set_val) {
mp_obj_uctypes_struct_t *self = MP_OBJ_TO_PTR(self_in);
// TODO: Support at least OrderedDict in addition
if (!MP_OBJ_IS_TYPE(self->desc, &mp_type_dict)) {
if (!MP_OBJ_IS_TYPE(self->desc, &mp_type_dict)
#if MICROPY_PY_COLLECTIONS_ORDEREDDICT
&& !MP_OBJ_IS_TYPE(self->desc, &mp_type_ordereddict)
#endif
) {
mp_raise_TypeError(translate("struct: no fields"));
}
@ -589,6 +608,26 @@ STATIC mp_obj_t uctypes_struct_subscr(mp_obj_t base_in, mp_obj_t index_in, mp_ob
}
}
STATIC mp_obj_t uctypes_struct_unary_op(mp_unary_op_t op, mp_obj_t self_in) {
mp_obj_uctypes_struct_t *self = MP_OBJ_TO_PTR(self_in);
switch (op) {
case MP_UNARY_OP_INT:
if (MP_OBJ_IS_TYPE(self->desc, &mp_type_tuple)) {
mp_obj_tuple_t *t = MP_OBJ_TO_PTR(self->desc);
mp_int_t offset = MP_OBJ_SMALL_INT_VALUE(t->items[0]);
uint agg_type = GET_TYPE(offset, AGG_TYPE_BITS);
if (agg_type == PTR) {
byte *p = *(void **)self->addr;
return mp_obj_new_int((mp_int_t)(uintptr_t)p);
}
}
/* fallthru */
default:
return MP_OBJ_NULL; // op not supported
}
}
STATIC mp_int_t uctypes_get_buffer(mp_obj_t self_in, mp_buffer_info_t *bufinfo, mp_uint_t flags) {
(void)flags;
mp_obj_uctypes_struct_t *self = MP_OBJ_TO_PTR(self_in);
@ -637,6 +676,7 @@ STATIC const mp_obj_type_t uctypes_struct_type = {
.make_new = uctypes_struct_make_new,
.attr = uctypes_struct_attr,
.subscr = uctypes_struct_subscr,
.unary_op = uctypes_struct_unary_op,
.buffer_p = { .get_buffer = uctypes_get_buffer },
};
@ -695,6 +735,30 @@ STATIC const mp_rom_map_elem_t mp_module_uctypes_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_FLOAT64), MP_ROM_INT(TYPE2SMALLINT(FLOAT64, 4)) },
#endif
#if MICROPY_PY_UCTYPES_NATIVE_C_TYPES
// C native type aliases. These depend on GCC-compatible predefined
// preprocessor macros.
#if __SIZEOF_SHORT__ == 2
{ MP_ROM_QSTR(MP_QSTR_SHORT), MP_ROM_INT(TYPE2SMALLINT(INT16, 4)) },
{ MP_ROM_QSTR(MP_QSTR_USHORT), MP_ROM_INT(TYPE2SMALLINT(UINT16, 4)) },
#endif
#if __SIZEOF_INT__ == 4
{ MP_ROM_QSTR(MP_QSTR_INT), MP_ROM_INT(TYPE2SMALLINT(INT32, 4)) },
{ MP_ROM_QSTR(MP_QSTR_UINT), MP_ROM_INT(TYPE2SMALLINT(UINT32, 4)) },
#endif
#if __SIZEOF_LONG__ == 4
{ MP_ROM_QSTR(MP_QSTR_LONG), MP_ROM_INT(TYPE2SMALLINT(INT32, 4)) },
{ MP_ROM_QSTR(MP_QSTR_ULONG), MP_ROM_INT(TYPE2SMALLINT(UINT32, 4)) },
#elif __SIZEOF_LONG__ == 8
{ MP_ROM_QSTR(MP_QSTR_LONG), MP_ROM_INT(TYPE2SMALLINT(INT64, 4)) },
{ MP_ROM_QSTR(MP_QSTR_ULONG), MP_ROM_INT(TYPE2SMALLINT(UINT64, 4)) },
#endif
#if __SIZEOF_LONG_LONG__ == 8
{ MP_ROM_QSTR(MP_QSTR_LONGLONG), MP_ROM_INT(TYPE2SMALLINT(INT64, 4)) },
{ MP_ROM_QSTR(MP_QSTR_ULONGLONG), MP_ROM_INT(TYPE2SMALLINT(UINT64, 4)) },
#endif
#endif // MICROPY_PY_UCTYPES_NATIVE_C_TYPES
{ MP_ROM_QSTR(MP_QSTR_PTR), MP_ROM_INT(TYPE2SMALLINT(PTR, AGG_TYPE_BITS)) },
{ MP_ROM_QSTR(MP_QSTR_ARRAY), MP_ROM_INT(TYPE2SMALLINT(ARRAY, AGG_TYPE_BITS)) },
};

View File

@ -12,6 +12,10 @@
#if MICROPY_PY_UHASHLIB
#if MICROPY_SSL_MBEDTLS
#include "mbedtls/version.h"
#endif
#if MICROPY_PY_UHASHLIB_SHA256
#if MICROPY_SSL_MBEDTLS
@ -22,13 +26,14 @@
#endif
#if MICROPY_PY_UHASHLIB_SHA1
#if MICROPY_PY_UHASHLIB_SHA1 || MICROPY_PY_UHASHLIB_MD5
#if MICROPY_SSL_AXTLS
#include "lib/axtls/crypto/crypto.h"
#endif
#if MICROPY_SSL_MBEDTLS
#include "mbedtls/md5.h"
#include "mbedtls/sha1.h"
#endif
@ -45,12 +50,18 @@ STATIC mp_obj_t uhashlib_sha256_update(mp_obj_t self_in, mp_obj_t arg);
#if MICROPY_SSL_MBEDTLS
STATIC mp_obj_t uhashlib_sha256_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
mp_arg_check_num(n_args, kw_args, 0, 1, false);
#if MBEDTLS_VERSION_NUMBER < 0x02070000
#define mbedtls_sha256_starts_ret mbedtls_sha256_starts
#define mbedtls_sha256_update_ret mbedtls_sha256_update
#define mbedtls_sha256_finish_ret mbedtls_sha256_finish
#endif
STATIC mp_obj_t uhashlib_sha256_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {
mp_arg_check_num(n_args, n_kw, 0, 1, false);
mp_obj_hash_t *o = m_new_obj_var(mp_obj_hash_t, char, sizeof(mbedtls_sha256_context));
o->base.type = type;
mbedtls_sha256_init((mbedtls_sha256_context *)&o->state);
mbedtls_sha256_starts((mbedtls_sha256_context *)&o->state, 0);
mbedtls_sha256_starts_ret((mbedtls_sha256_context *)&o->state, 0);
if (n_args == 1) {
uhashlib_sha256_update(MP_OBJ_FROM_PTR(o), args[0]);
}
@ -61,7 +72,7 @@ STATIC mp_obj_t uhashlib_sha256_update(mp_obj_t self_in, mp_obj_t arg) {
mp_obj_hash_t *self = MP_OBJ_TO_PTR(self_in);
mp_buffer_info_t bufinfo;
mp_get_buffer_raise(arg, &bufinfo, MP_BUFFER_READ);
mbedtls_sha256_update((mbedtls_sha256_context *)&self->state, bufinfo.buf, bufinfo.len);
mbedtls_sha256_update_ret((mbedtls_sha256_context *)&self->state, bufinfo.buf, bufinfo.len);
return mp_const_none;
}
@ -69,7 +80,7 @@ STATIC mp_obj_t uhashlib_sha256_digest(mp_obj_t self_in) {
mp_obj_hash_t *self = MP_OBJ_TO_PTR(self_in);
vstr_t vstr;
vstr_init_len(&vstr, 32);
mbedtls_sha256_finish((mbedtls_sha256_context *)&self->state, (unsigned char *)vstr.buf);
mbedtls_sha256_finish_ret((mbedtls_sha256_context *)&self->state, (unsigned char *)vstr.buf);
return mp_obj_new_str_from_vstr(&mp_type_bytes, &vstr);
}
@ -164,12 +175,19 @@ STATIC mp_obj_t uhashlib_sha1_digest(mp_obj_t self_in) {
#endif
#if MICROPY_SSL_MBEDTLS
#if MBEDTLS_VERSION_NUMBER < 0x02070000
#define mbedtls_sha1_starts_ret mbedtls_sha1_starts
#define mbedtls_sha1_update_ret mbedtls_sha1_update
#define mbedtls_sha1_finish_ret mbedtls_sha1_finish
#endif
STATIC mp_obj_t uhashlib_sha1_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {
mp_arg_check_num(n_args, n_kw, 0, 1, false);
mp_obj_hash_t *o = m_new_obj_var(mp_obj_hash_t, char, sizeof(mbedtls_sha1_context));
o->base.type = type;
mbedtls_sha1_init((mbedtls_sha1_context *)o->state);
mbedtls_sha1_starts((mbedtls_sha1_context *)o->state);
mbedtls_sha1_starts_ret((mbedtls_sha1_context *)o->state);
if (n_args == 1) {
uhashlib_sha1_update(MP_OBJ_FROM_PTR(o), args[0]);
}
@ -180,7 +198,7 @@ STATIC mp_obj_t uhashlib_sha1_update(mp_obj_t self_in, mp_obj_t arg) {
mp_obj_hash_t *self = MP_OBJ_TO_PTR(self_in);
mp_buffer_info_t bufinfo;
mp_get_buffer_raise(arg, &bufinfo, MP_BUFFER_READ);
mbedtls_sha1_update((mbedtls_sha1_context *)self->state, bufinfo.buf, bufinfo.len);
mbedtls_sha1_update_ret((mbedtls_sha1_context *)self->state, bufinfo.buf, bufinfo.len);
return mp_const_none;
}
@ -188,7 +206,7 @@ STATIC mp_obj_t uhashlib_sha1_digest(mp_obj_t self_in) {
mp_obj_hash_t *self = MP_OBJ_TO_PTR(self_in);
vstr_t vstr;
vstr_init_len(&vstr, 20);
mbedtls_sha1_finish((mbedtls_sha1_context *)self->state, (byte *)vstr.buf);
mbedtls_sha1_finish_ret((mbedtls_sha1_context *)self->state, (byte *)vstr.buf);
mbedtls_sha1_free((mbedtls_sha1_context *)self->state);
return mp_obj_new_str_from_vstr(&mp_type_bytes, &vstr);
}
@ -211,6 +229,93 @@ STATIC const mp_obj_type_t uhashlib_sha1_type = {
};
#endif
#if MICROPY_PY_UHASHLIB_MD5
STATIC mp_obj_t uhashlib_md5_update(mp_obj_t self_in, mp_obj_t arg);
#if MICROPY_SSL_AXTLS
STATIC mp_obj_t uhashlib_md5_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {
mp_arg_check_num(n_args, n_kw, 0, 1, false);
mp_obj_hash_t *o = m_new_obj_var(mp_obj_hash_t, char, sizeof(MD5_CTX));
o->base.type = type;
MD5_Init((MD5_CTX *)o->state);
if (n_args == 1) {
uhashlib_md5_update(MP_OBJ_FROM_PTR(o), args[0]);
}
return MP_OBJ_FROM_PTR(o);
}
STATIC mp_obj_t uhashlib_md5_update(mp_obj_t self_in, mp_obj_t arg) {
mp_obj_hash_t *self = MP_OBJ_TO_PTR(self_in);
mp_buffer_info_t bufinfo;
mp_get_buffer_raise(arg, &bufinfo, MP_BUFFER_READ);
MD5_Update((MD5_CTX *)self->state, bufinfo.buf, bufinfo.len);
return mp_const_none;
}
STATIC mp_obj_t uhashlib_md5_digest(mp_obj_t self_in) {
mp_obj_hash_t *self = MP_OBJ_TO_PTR(self_in);
vstr_t vstr;
vstr_init_len(&vstr, MD5_SIZE);
MD5_Final((byte *)vstr.buf, (MD5_CTX *)self->state);
return mp_obj_new_str_from_vstr(&mp_type_bytes, &vstr);
}
#endif // MICROPY_SSL_AXTLS
#if MICROPY_SSL_MBEDTLS
#if MBEDTLS_VERSION_NUMBER < 0x02070000
#define mbedtls_md5_starts_ret mbedtls_md5_starts
#define mbedtls_md5_update_ret mbedtls_md5_update
#define mbedtls_md5_finish_ret mbedtls_md5_finish
#endif
STATIC mp_obj_t uhashlib_md5_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {
mp_arg_check_num(n_args, n_kw, 0, 1, false);
mp_obj_hash_t *o = m_new_obj_var(mp_obj_hash_t, char, sizeof(mbedtls_md5_context));
o->base.type = type;
mbedtls_md5_init((mbedtls_md5_context *)o->state);
mbedtls_md5_starts_ret((mbedtls_md5_context *)o->state);
if (n_args == 1) {
uhashlib_md5_update(MP_OBJ_FROM_PTR(o), args[0]);
}
return MP_OBJ_FROM_PTR(o);
}
STATIC mp_obj_t uhashlib_md5_update(mp_obj_t self_in, mp_obj_t arg) {
mp_obj_hash_t *self = MP_OBJ_TO_PTR(self_in);
mp_buffer_info_t bufinfo;
mp_get_buffer_raise(arg, &bufinfo, MP_BUFFER_READ);
mbedtls_md5_update_ret((mbedtls_md5_context *)self->state, bufinfo.buf, bufinfo.len);
return mp_const_none;
}
STATIC mp_obj_t uhashlib_md5_digest(mp_obj_t self_in) {
mp_obj_hash_t *self = MP_OBJ_TO_PTR(self_in);
vstr_t vstr;
vstr_init_len(&vstr, 16);
mbedtls_md5_finish_ret((mbedtls_md5_context *)self->state, (byte *)vstr.buf);
mbedtls_md5_free((mbedtls_md5_context *)self->state);
return mp_obj_new_str_from_vstr(&mp_type_bytes, &vstr);
}
#endif // MICROPY_SSL_MBEDTLS
STATIC MP_DEFINE_CONST_FUN_OBJ_2(uhashlib_md5_update_obj, uhashlib_md5_update);
STATIC MP_DEFINE_CONST_FUN_OBJ_1(uhashlib_md5_digest_obj, uhashlib_md5_digest);
STATIC const mp_rom_map_elem_t uhashlib_md5_locals_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_update), MP_ROM_PTR(&uhashlib_md5_update_obj) },
{ MP_ROM_QSTR(MP_QSTR_digest), MP_ROM_PTR(&uhashlib_md5_digest_obj) },
};
STATIC MP_DEFINE_CONST_DICT(uhashlib_md5_locals_dict, uhashlib_md5_locals_dict_table);
STATIC const mp_obj_type_t uhashlib_md5_type = {
{ &mp_type_type },
.name = MP_QSTR_md5,
.make_new = uhashlib_md5_make_new,
.locals_dict = (void *)&uhashlib_md5_locals_dict,
};
#endif // MICROPY_PY_UHASHLIB_MD5
STATIC const mp_rom_map_elem_t mp_module_uhashlib_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_hashlib) },
#if MICROPY_PY_UHASHLIB_SHA256
@ -219,6 +324,9 @@ STATIC const mp_rom_map_elem_t mp_module_uhashlib_globals_table[] = {
#if MICROPY_PY_UHASHLIB_SHA1
{ MP_ROM_QSTR(MP_QSTR_sha1), MP_ROM_PTR(&uhashlib_sha1_type) },
#endif
#if MICROPY_PY_UHASHLIB_MD5
{ MP_ROM_QSTR(MP_QSTR_md5), MP_ROM_PTR(&uhashlib_md5_type) },
#endif
};
STATIC MP_DEFINE_CONST_DICT(mp_module_uhashlib_globals, mp_module_uhashlib_globals_table);

View File

@ -25,7 +25,7 @@
typedef struct _poll_obj_t {
mp_obj_t obj;
mp_uint_t (*ioctl)(mp_obj_t obj, mp_uint_t request, mp_uint_t arg, int *errcode);
mp_uint_t (*ioctl)(mp_obj_t obj, mp_uint_t request, uintptr_t arg, int *errcode);
mp_uint_t flags;
mp_uint_t flags_ret;
} poll_obj_t;
@ -33,7 +33,7 @@ typedef struct _poll_obj_t {
STATIC void poll_map_add(mp_map_t *poll_map, const mp_obj_t *obj, mp_uint_t obj_len, mp_uint_t flags, bool or_flags) {
for (mp_uint_t i = 0; i < obj_len; i++) {
mp_map_elem_t *elem = mp_map_lookup(poll_map, mp_obj_id(obj[i]), MP_MAP_LOOKUP_ADD_IF_NOT_FOUND);
if (elem->value == NULL) {
if (elem->value == MP_OBJ_NULL) {
// object not found; get its ioctl and add it to the poll list
const mp_stream_p_t *stream_p = mp_get_stream_raise(obj[i], MP_STREAM_OP_IOCTL);
poll_obj_t *poll_obj = m_new_obj(poll_obj_t);
@ -41,27 +41,27 @@ STATIC void poll_map_add(mp_map_t *poll_map, const mp_obj_t *obj, mp_uint_t obj_
poll_obj->ioctl = stream_p->ioctl;
poll_obj->flags = flags;
poll_obj->flags_ret = 0;
elem->value = poll_obj;
elem->value = MP_OBJ_FROM_PTR(poll_obj);
} else {
// object exists; update its flags
if (or_flags) {
((poll_obj_t *)elem->value)->flags |= flags;
((poll_obj_t *)MP_OBJ_TO_PTR(elem->value))->flags |= flags;
} else {
((poll_obj_t *)elem->value)->flags = flags;
((poll_obj_t *)MP_OBJ_TO_PTR(elem->value))->flags = flags;
}
}
}
}
// poll each object in the map
STATIC mp_uint_t poll_map_poll(mp_map_t *poll_map, mp_uint_t *rwx_num) {
STATIC mp_uint_t poll_map_poll(mp_map_t *poll_map, size_t *rwx_num) {
mp_uint_t n_ready = 0;
for (mp_uint_t i = 0; i < poll_map->alloc; ++i) {
if (!MP_MAP_SLOT_IS_FILLED(poll_map, i)) {
continue;
}
poll_obj_t *poll_obj = (poll_obj_t *)poll_map->table[i].value;
poll_obj_t *poll_obj = MP_OBJ_TO_PTR(poll_map->table[i].value);
int errcode;
mp_int_t ret = poll_obj->ioctl(poll_obj->obj, MP_STREAM_POLL, poll_obj->flags, &errcode);
poll_obj->flags_ret = ret;
@ -138,15 +138,15 @@ STATIC mp_obj_t select_select(uint n_args, const mp_obj_t *args) {
if (!MP_MAP_SLOT_IS_FILLED(&poll_map, i)) {
continue;
}
poll_obj_t *poll_obj = (poll_obj_t *)poll_map.table[i].value;
poll_obj_t *poll_obj = MP_OBJ_TO_PTR(poll_map.table[i].value);
if (poll_obj->flags_ret & MP_STREAM_POLL_RD) {
((mp_obj_list_t *)list_array[0])->items[rwx_len[0]++] = poll_obj->obj;
((mp_obj_list_t *)MP_OBJ_TO_PTR(list_array[0]))->items[rwx_len[0]++] = poll_obj->obj;
}
if (poll_obj->flags_ret & MP_STREAM_POLL_WR) {
((mp_obj_list_t *)list_array[1])->items[rwx_len[1]++] = poll_obj->obj;
((mp_obj_list_t *)MP_OBJ_TO_PTR(list_array[1]))->items[rwx_len[1]++] = poll_obj->obj;
}
if ((poll_obj->flags_ret & ~(MP_STREAM_POLL_RD | MP_STREAM_POLL_WR)) != 0) {
((mp_obj_list_t *)list_array[2])->items[rwx_len[2]++] = poll_obj->obj;
((mp_obj_list_t *)MP_OBJ_TO_PTR(list_array[2]))->items[rwx_len[2]++] = poll_obj->obj;
}
}
mp_map_deinit(&poll_map);
@ -171,7 +171,7 @@ typedef struct _mp_obj_poll_t {
/// \method register(obj[, eventmask])
STATIC mp_obj_t poll_register(uint n_args, const mp_obj_t *args) {
mp_obj_poll_t *self = args[0];
mp_obj_poll_t *self = MP_OBJ_TO_PTR(args[0]);
mp_uint_t flags;
if (n_args == 3) {
flags = mp_obj_get_int(args[2]);
@ -185,7 +185,7 @@ MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(poll_register_obj, 2, 3, poll_register);
/// \method unregister(obj)
STATIC mp_obj_t poll_unregister(mp_obj_t self_in, mp_obj_t obj_in) {
mp_obj_poll_t *self = self_in;
mp_obj_poll_t *self = MP_OBJ_TO_PTR(self_in);
mp_map_lookup(&self->poll_map, mp_obj_id(obj_in), MP_MAP_LOOKUP_REMOVE_IF_FOUND);
// TODO raise KeyError if obj didn't exist in map
return mp_const_none;
@ -194,18 +194,18 @@ MP_DEFINE_CONST_FUN_OBJ_2(poll_unregister_obj, poll_unregister);
/// \method modify(obj, eventmask)
STATIC mp_obj_t poll_modify(mp_obj_t self_in, mp_obj_t obj_in, mp_obj_t eventmask_in) {
mp_obj_poll_t *self = self_in;
mp_obj_poll_t *self = MP_OBJ_TO_PTR(self_in);
mp_map_elem_t *elem = mp_map_lookup(&self->poll_map, mp_obj_id(obj_in), MP_MAP_LOOKUP);
if (elem == NULL) {
mp_raise_OSError(MP_ENOENT);
}
((poll_obj_t *)elem->value)->flags = mp_obj_get_int(eventmask_in);
((poll_obj_t *)MP_OBJ_TO_PTR(elem->value))->flags = mp_obj_get_int(eventmask_in);
return mp_const_none;
}
MP_DEFINE_CONST_FUN_OBJ_3(poll_modify_obj, poll_modify);
STATIC mp_uint_t poll_poll_internal(uint n_args, const mp_obj_t *args) {
mp_obj_poll_t *self = args[0];
mp_obj_poll_t *self = MP_OBJ_TO_PTR(args[0]);
// work out timeout (its given already in ms)
mp_uint_t timeout = -1;
@ -238,18 +238,18 @@ STATIC mp_uint_t poll_poll_internal(uint n_args, const mp_obj_t *args) {
return n_ready;
}
STATIC mp_obj_t poll_poll(uint n_args, const mp_obj_t *args) {
mp_obj_poll_t *self = args[0];
STATIC mp_obj_t poll_poll(size_t n_args, const mp_obj_t *args) {
mp_obj_poll_t *self = MP_OBJ_TO_PTR(args[0]);
mp_uint_t n_ready = poll_poll_internal(n_args, args);
// one or more objects are ready, or we had a timeout
mp_obj_list_t *ret_list = mp_obj_new_list(n_ready, NULL);
mp_obj_list_t *ret_list = MP_OBJ_TO_PTR(mp_obj_new_list(n_ready, NULL));
n_ready = 0;
for (mp_uint_t i = 0; i < self->poll_map.alloc; ++i) {
if (!MP_MAP_SLOT_IS_FILLED(&self->poll_map, i)) {
continue;
}
poll_obj_t *poll_obj = (poll_obj_t *)self->poll_map.table[i].value;
poll_obj_t *poll_obj = MP_OBJ_TO_PTR(self->poll_map.table[i].value);
if (poll_obj->flags_ret != 0) {
mp_obj_t tuple[2] = {poll_obj->obj, MP_OBJ_NEW_SMALL_INT(poll_obj->flags_ret)};
ret_list->items[n_ready++] = mp_obj_new_tuple(2, tuple);
@ -259,7 +259,7 @@ STATIC mp_obj_t poll_poll(uint n_args, const mp_obj_t *args) {
}
}
}
return ret_list;
return MP_OBJ_FROM_PTR(ret_list);
}
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(poll_poll_obj, 1, 3, poll_poll);
@ -292,7 +292,7 @@ STATIC mp_obj_t poll_iternext(mp_obj_t self_in) {
if (!MP_MAP_SLOT_IS_FILLED(&self->poll_map, i)) {
continue;
}
poll_obj_t *poll_obj = (poll_obj_t *)self->poll_map.table[i].value;
poll_obj_t *poll_obj = MP_OBJ_TO_PTR(self->poll_map.table[i].value);
if (poll_obj->flags_ret != 0) {
mp_obj_tuple_t *t = MP_OBJ_TO_PTR(self->ret_tuple);
t->items[0] = poll_obj->obj;
@ -334,7 +334,7 @@ STATIC mp_obj_t select_poll(void) {
mp_map_init(&poll->poll_map, 0);
poll->iter_cnt = 0;
poll->ret_tuple = MP_OBJ_NULL;
return poll;
return MP_OBJ_FROM_PTR(poll);
}
MP_DEFINE_CONST_FUN_OBJ_0(mp_select_poll_obj, select_poll);

View File

@ -158,21 +158,13 @@ STATIC mp_uint_t socket_write(mp_obj_t o_in, const void *buf, mp_uint_t size, in
STATIC mp_uint_t socket_ioctl(mp_obj_t o_in, mp_uint_t request, uintptr_t arg, int *errcode) {
mp_obj_ssl_socket_t *self = MP_OBJ_TO_PTR(o_in);
(void)arg;
switch (request) {
case MP_STREAM_CLOSE:
if (self->ssl_sock != NULL) {
ssl_free(self->ssl_sock);
ssl_ctx_free(self->ssl_ctx);
self->ssl_sock = NULL;
mp_stream_close(self->sock);
}
return 0;
default:
*errcode = MP_EINVAL;
return MP_STREAM_ERROR;
if (request == MP_STREAM_CLOSE && self->ssl_sock != NULL) {
ssl_free(self->ssl_sock);
ssl_ctx_free(self->ssl_ctx);
self->ssl_sock = NULL;
}
// Pass all requests down to the underlying socket
return mp_get_stream(self->sock)->ioctl(self->sock, request, arg, errcode);
}
STATIC mp_obj_t socket_setblocking(mp_obj_t self_in, mp_obj_t flag_in) {
@ -220,10 +212,10 @@ STATIC const mp_obj_type_t ussl_socket_type = {
STATIC mp_obj_t mod_ssl_wrap_socket(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
// TODO: Implement more args
static const mp_arg_t allowed_args[] = {
{ MP_QSTR_key, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} },
{ MP_QSTR_cert, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} },
{ MP_QSTR_key, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_rom_obj = MP_ROM_PTR(&mp_const_none_obj)} },
{ MP_QSTR_cert, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_rom_obj = MP_ROM_PTR(&mp_const_none_obj)} },
{ MP_QSTR_server_side, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = false} },
{ MP_QSTR_server_hostname, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} },
{ MP_QSTR_server_hostname, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_rom_obj = MP_ROM_PTR(&mp_const_none_obj)} },
};
// TODO: Check that sock implements stream protocol

View File

@ -249,23 +249,17 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_setblocking_obj, socket_setblocking);
STATIC mp_uint_t socket_ioctl(mp_obj_t o_in, mp_uint_t request, uintptr_t arg, int *errcode) {
mp_obj_ssl_socket_t *self = MP_OBJ_TO_PTR(o_in);
(void)arg;
switch (request) {
case MP_STREAM_CLOSE:
mbedtls_pk_free(&self->pkey);
mbedtls_x509_crt_free(&self->cert);
mbedtls_x509_crt_free(&self->cacert);
mbedtls_ssl_free(&self->ssl);
mbedtls_ssl_config_free(&self->conf);
mbedtls_ctr_drbg_free(&self->ctr_drbg);
mbedtls_entropy_free(&self->entropy);
mp_stream_close(self->sock);
return 0;
default:
*errcode = MP_EINVAL;
return MP_STREAM_ERROR;
if (request == MP_STREAM_CLOSE) {
mbedtls_pk_free(&self->pkey);
mbedtls_x509_crt_free(&self->cert);
mbedtls_x509_crt_free(&self->cacert);
mbedtls_ssl_free(&self->ssl);
mbedtls_ssl_config_free(&self->conf);
mbedtls_ctr_drbg_free(&self->ctr_drbg);
mbedtls_entropy_free(&self->entropy);
}
// Pass all requests down to the underlying socket
return mp_get_stream(self->sock)->ioctl(self->sock, request, arg, errcode);
}
STATIC const mp_rom_map_elem_t ussl_socket_locals_dict_table[] = {

View File

@ -14,7 +14,6 @@
#include "py/mphal.h"
#endif
#include "extmod/modwebsocket.h"
#include "genhdr/mpversion.h"
#if MICROPY_PY_WEBREPL

View File

@ -8,9 +8,9 @@
((code ? memmove(code + at + num, code + at, pc - at) : 0), pc += num)
#define REL(at, to) (to - at - 2)
#define EMIT(at, byte) (code ? (code[at] = byte) : (at))
#define EMIT_CHECKED(at, byte) (_emit_checked(at, code, byte, &err))
#define PC (prog->bytelen)
static char unescape(char c) {
switch (c) {
case 'a':
@ -33,9 +33,17 @@ static char unescape(char c) {
}
static void _emit_checked(int at, char *code, int val, bool *err) {
*err |= val != (int8_t)val;
if (code) {
code[at] = val;
}
}
static const char *_compilecode(const char *re, ByteProg *prog, int sizecode)
{
char *code = sizecode ? NULL : prog->insts;
bool err = false;
int start = PC;
int term = PC;
int alt_label = 0;
@ -96,7 +104,7 @@ static const char *_compilecode(const char *re, ByteProg *prog, int sizecode)
EMIT(PC++, *re);
}
}
EMIT(term + 1, cnt);
EMIT_CHECKED(term + 1, cnt);
break;
}
case '(': {
@ -107,7 +115,7 @@ static const char *_compilecode(const char *re, ByteProg *prog, int sizecode)
if (capture) {
sub = ++prog->sub;
EMIT(PC++, Save);
EMIT(PC++, 2 * sub);
EMIT_CHECKED(PC++, 2 * sub);
prog->len++;
} else {
re += 2;
@ -118,7 +126,7 @@ static const char *_compilecode(const char *re, ByteProg *prog, int sizecode)
if (capture) {
EMIT(PC++, Save);
EMIT(PC++, 2 * sub + 1);
EMIT_CHECKED(PC++, 2 * sub + 1);
prog->len++;
}
@ -133,7 +141,7 @@ static const char *_compilecode(const char *re, ByteProg *prog, int sizecode)
} else {
EMIT(term, Split);
}
EMIT(term + 1, REL(term, PC));
EMIT_CHECKED(term + 1, REL(term, PC));
prog->len++;
term = PC;
break;
@ -141,7 +149,7 @@ static const char *_compilecode(const char *re, ByteProg *prog, int sizecode)
if (PC == term) return NULL; // nothing to repeat
INSERT_CODE(term, 2, PC);
EMIT(PC, Jmp);
EMIT(PC + 1, REL(PC, term));
EMIT_CHECKED(PC + 1, REL(PC, term));
PC += 2;
if (re[1] == '?') {
EMIT(term, RSplit);
@ -149,7 +157,7 @@ static const char *_compilecode(const char *re, ByteProg *prog, int sizecode)
} else {
EMIT(term, Split);
}
EMIT(term + 1, REL(term, PC));
EMIT_CHECKED(term + 1, REL(term, PC));
prog->len += 2;
term = PC;
break;
@ -161,20 +169,20 @@ static const char *_compilecode(const char *re, ByteProg *prog, int sizecode)
} else {
EMIT(PC, RSplit);
}
EMIT(PC + 1, REL(PC, term));
EMIT_CHECKED(PC + 1, REL(PC, term));
PC += 2;
prog->len++;
term = PC;
break;
case '|':
if (alt_label) {
EMIT(alt_label, REL(alt_label, PC) + 1);
EMIT_CHECKED(alt_label, REL(alt_label, PC) + 1);
}
INSERT_CODE(start, 2, PC);
EMIT(PC++, Jmp);
alt_label = PC++;
EMIT(start, Split);
EMIT(start + 1, REL(start, PC));
EMIT_CHECKED(start + 1, REL(start, PC));
prog->len += 2;
term = PC;
break;
@ -192,9 +200,9 @@ static const char *_compilecode(const char *re, ByteProg *prog, int sizecode)
}
if (alt_label) {
EMIT(alt_label, REL(alt_label, PC) + 1);
EMIT_CHECKED(alt_label, REL(alt_label, PC) + 1);
}
return re;
return err ? NULL : re;
}
int re1_5_sizecode(const char *re)

View File

@ -66,7 +66,7 @@ int mp_uos_dupterm_rx_chr(void) {
return buf[0];
}
} else {
mp_uos_deactivate(idx, "dupterm: Exception in read() method, deactivating: ", nlr.ret_val);
mp_uos_deactivate(idx, "dupterm: Exception in read() method, deactivating: ", MP_OBJ_FROM_PTR(nlr.ret_val));
}
}
@ -84,7 +84,7 @@ void mp_uos_dupterm_tx_strn(const char *str, size_t len) {
mp_stream_write(MP_STATE_VM(dupterm_objs[idx]), str, len, MP_STREAM_RW_WRITE);
nlr_pop();
} else {
mp_uos_deactivate(idx, "dupterm: Exception in write() method, deactivating: ", nlr.ret_val);
mp_uos_deactivate(idx, "dupterm: Exception in write() method, deactivating: ", MP_OBJ_FROM_PTR(nlr.ret_val));
}
}
}

View File

@ -17,6 +17,10 @@
#include "extmod/vfs_fat.h"
#endif
#if defined(MICROPY_VFS_POSIX) && MICROPY_VFS_POSIX
#include "extmod/vfs_posix.h"
#endif
// For mp_vfs_proxy_call, the maximum number of additional args that can be passed.
// A fixed maximum size is used to avoid the need for a costly variable array.
#define PROXY_MAX_ARGS (2)
@ -244,6 +248,13 @@ mp_obj_t mp_vfs_open(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args)
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);
#if defined(MICROPY_VFS_POSIX) && MICROPY_VFS_POSIX
// If the file is an integer then delegate straight to the POSIX handler
if (MP_OBJ_IS_SMALL_INT(args[ARG_file].u_obj)) {
return mp_vfs_posix_file_open(&mp_type_textio, args[ARG_file].u_obj, args[ARG_mode].u_obj);
}
#endif
mp_vfs_mount_t *vfs = lookup_path(args[ARG_file].u_obj, &args[ARG_file].u_obj);
return mp_vfs_proxy_call(vfs, MP_QSTR_open, 2, (mp_obj_t *)&args);
}

View File

@ -172,6 +172,9 @@ STATIC mp_obj_t vfs_posix_ilistdir_it_iternext(mp_obj_t self_in) {
}
#ifdef _DIRENT_HAVE_D_TYPE
#ifdef DTTOIF
t->items[1] = MP_OBJ_NEW_SMALL_INT(DTTOIF(dirent->d_type));
#else
if (dirent->d_type == DT_DIR) {
t->items[1] = MP_OBJ_NEW_SMALL_INT(MP_S_IFDIR);
} else if (dirent->d_type == DT_REG) {
@ -179,10 +182,12 @@ STATIC mp_obj_t vfs_posix_ilistdir_it_iternext(mp_obj_t self_in) {
} else {
t->items[1] = MP_OBJ_NEW_SMALL_INT(dirent->d_type);
}
#endif
#else
// DT_UNKNOWN should have 0 value on any reasonable system
t->items[1] = MP_OBJ_NEW_SMALL_INT(0);
#endif
#ifdef _DIRENT_HAVE_D_INO
t->items[2] = MP_OBJ_NEW_SMALL_INT(dirent->d_ino);
#else
@ -200,6 +205,9 @@ STATIC mp_obj_t vfs_posix_ilistdir(mp_obj_t self_in, mp_obj_t path_in) {
iter->iternext = vfs_posix_ilistdir_it_iternext;
iter->is_str = mp_obj_get_type(path_in) == &mp_type_str;
const char *path = vfs_posix_get_path_str(self, path_in);
if (path[0] == '\0') {
path = ".";
}
iter->dir = opendir(path);
if (iter->dir == NULL) {
mp_raise_OSError(errno);

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016 Paul Sokolovsky
// SPDX-FileCopyrightText: Copyright (c) 2016 Paul Sokolovsky
// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors)
//
// SPDX-License-Identifier: MIT

@ -0,0 +1 @@
Subproject commit 669ab7b752d6c863577312560faf505656e5e603

@ -0,0 +1 @@
Subproject commit cdf99447307473080b2f2e95e7c3667247095ac0

View File

@ -30,12 +30,17 @@ typedef float float_t;
typedef union {
float f;
struct {
uint64_t m : 23;
uint64_t e : 8;
uint64_t s : 1;
uint32_t m : 23;
uint32_t e : 8;
uint32_t s : 1;
};
} float_s_t;
int __signbitf(float f) {
float_s_t u = {.f = f};
return u.s;
}
#ifndef NDEBUG
float copysignf(float x, float y) {
float_s_t fx={.f = x};
@ -55,10 +60,14 @@ static const float _M_LN2 = 0.6931472;
float log2f(float x) { return logf(x) / (float)_M_LN2; }
float tanhf(float x) {
if (isinf(x)) {
return copysignf(1, x);
int sign = 0;
if (x < 0) {
sign = 1;
x = -x;
}
return sinhf(x) / coshf(x);
x = expm1f(-2 * x);
x = x / (x + 2);
return sign ? x : -x;
}
/*****************************************************************************/

View File

@ -35,6 +35,10 @@
{
float y;
int local_signgam;
if (!isfinite(x)) {
/* special cases: tgammaf(nan)=nan, tgammaf(inf)=inf, tgammaf(-inf)=nan */
return x + INFINITY;
}
y = expf(__ieee754_lgammaf_r(x,&local_signgam));
if (local_signgam < 0) y = -y;
#ifdef _IEEE_LIBM

View File

@ -4,6 +4,10 @@ functions.
The files lgamma.c, log10.c and tanh.c are too small to have a meaningful
copyright or license.
The file copysign.c contains a double version of the float copysignf provided
in libm/math.c for use in DEBUG builds where the standard library copy is
not available.
The rest of the files in this directory are copied from the musl library,
v1.1.16, and, unless otherwise stated in the individual file, have the
following copyright and MIT license:

48
lib/libm_dbl/copysign.c Normal file
View File

@ -0,0 +1,48 @@
/*
* This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2013, 2014 Damien P. George
*
* 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 "libm.h"
#ifndef NDEBUG
typedef union {
double d;
struct {
uint64_t m : 52;
uint64_t e : 11;
uint64_t s : 1;
};
} double_s_t;
double copysign(double x, double y) {
double_s_t dx={.d = x};
double_s_t dy={.d = y};
// copy sign bit;
dx.s = dy.s;
return dx.d;
}
#endif

View File

@ -1,5 +1,12 @@
#include <math.h>
double tanh(double x) {
return sinh(x) / cosh(x);
int sign = 0;
if (x < 0) {
sign = 1;
x = -x;
}
x = expm1(-2 * x);
x = x / (x + 2);
return sign ? x : -x;
}

124
lib/utils/mpirq.c Normal file
View File

@ -0,0 +1,124 @@
/*
* This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2015 Daniel Campora
* 2018 Tobias Badertscher
*
* 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 <stdio.h>
#include "py/runtime.h"
#include "py/gc.h"
#include "lib/utils/mpirq.h"
/******************************************************************************
DECLARE PUBLIC DATA
******************************************************************************/
const mp_arg_t mp_irq_init_args[] = {
{ MP_QSTR_handler, MP_ARG_OBJ, {.u_rom_obj = MP_ROM_PTR(&mp_const_none_obj)} },
{ MP_QSTR_trigger, MP_ARG_INT, {.u_int = 0} },
{ MP_QSTR_hard, MP_ARG_BOOL, {.u_bool = false} },
};
/******************************************************************************
DECLARE PRIVATE DATA
******************************************************************************/
/******************************************************************************
DEFINE PUBLIC FUNCTIONS
******************************************************************************/
mp_irq_obj_t *mp_irq_new(const mp_irq_methods_t *methods, mp_obj_t parent) {
mp_irq_obj_t *self = m_new0(mp_irq_obj_t, 1);
self->base.type = &mp_irq_type;
self->methods = (mp_irq_methods_t *)methods;
self->parent = parent;
self->handler = mp_const_none;
self->ishard = false;
return self;
}
void mp_irq_handler(mp_irq_obj_t *self) {
if (self->handler != mp_const_none) {
if (self->ishard) {
// When executing code within a handler we must lock the GC to prevent
// any memory allocations.
gc_lock();
nlr_buf_t nlr;
if (nlr_push(&nlr) == 0) {
mp_call_function_1(self->handler, self->parent);
nlr_pop();
} else {
// Uncaught exception; disable the callback so that it doesn't run again
self->methods->trigger(self->parent, 0);
self->handler = mp_const_none;
printf("Uncaught exception in IRQ callback handler\n");
mp_obj_print_exception(&mp_plat_print, MP_OBJ_FROM_PTR(nlr.ret_val));
}
gc_unlock();
} else {
// Schedule call to user function
mp_sched_schedule(self->handler, self->parent);
}
}
}
/******************************************************************************/
// MicroPython bindings
STATIC mp_obj_t mp_irq_flags(mp_obj_t self_in) {
mp_irq_obj_t *self = MP_OBJ_TO_PTR(self_in);
return mp_obj_new_int(self->methods->info(self->parent, MP_IRQ_INFO_FLAGS));
}
STATIC MP_DEFINE_CONST_FUN_OBJ_1(mp_irq_flags_obj, mp_irq_flags);
STATIC mp_obj_t mp_irq_trigger(size_t n_args, const mp_obj_t *args) {
mp_irq_obj_t *self = MP_OBJ_TO_PTR(args[0]);
mp_obj_t ret_obj = mp_obj_new_int(self->methods->info(self->parent, MP_IRQ_INFO_TRIGGERS));
if (n_args == 2) {
// Set trigger
self->methods->trigger(self->parent, mp_obj_get_int(args[1]));
}
return ret_obj;
}
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mp_irq_trigger_obj, 1, 2, mp_irq_trigger);
STATIC mp_obj_t mp_irq_call(mp_obj_t self_in, size_t n_args, size_t n_kw, const mp_obj_t *args) {
mp_arg_check_num(n_args, n_kw, 0, 0, false);
mp_irq_handler(MP_OBJ_TO_PTR(self_in));
return mp_const_none;
}
STATIC const mp_rom_map_elem_t mp_irq_locals_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_flags), MP_ROM_PTR(&mp_irq_flags_obj) },
{ MP_ROM_QSTR(MP_QSTR_trigger), MP_ROM_PTR(&mp_irq_trigger_obj) },
};
STATIC MP_DEFINE_CONST_DICT(mp_irq_locals_dict, mp_irq_locals_dict_table);
const mp_obj_type_t mp_irq_type = {
{ &mp_type_type },
.name = MP_QSTR_irq,
.call = mp_irq_call,
.locals_dict = (mp_obj_dict_t *)&mp_irq_locals_dict,
};

82
lib/utils/mpirq.h Normal file
View File

@ -0,0 +1,82 @@
/*
* This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2015 Daniel Campora
*
* 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.
*/
#ifndef MICROPY_INCLUDED_LIB_UTILS_MPIRQ_H
#define MICROPY_INCLUDED_LIB_UTILS_MPIRQ_H
/******************************************************************************
DEFINE CONSTANTS
******************************************************************************/
enum {
MP_IRQ_ARG_INIT_handler = 0,
MP_IRQ_ARG_INIT_trigger,
MP_IRQ_ARG_INIT_hard,
MP_IRQ_ARG_INIT_NUM_ARGS,
};
/******************************************************************************
DEFINE TYPES
******************************************************************************/
typedef mp_obj_t (*mp_irq_init_t)(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args);
typedef mp_uint_t (*mp_irq_uint_method_one_uint_para_t)(mp_obj_t self, mp_uint_t trigger);
typedef mp_uint_t (*mp_irq_int_method_one_para_t)(mp_obj_t self, mp_uint_t info_type);
enum {
MP_IRQ_INFO_FLAGS,
MP_IRQ_INFO_TRIGGERS,
MP_IRQ_INFO_CNT
};
typedef struct _mp_irq_methods_t {
mp_irq_init_t init;
mp_irq_uint_method_one_uint_para_t trigger;
mp_irq_int_method_one_para_t info;
} mp_irq_methods_t;
typedef struct _mp_irq_obj_t {
mp_obj_base_t base;
mp_irq_methods_t *methods;
mp_obj_t parent;
mp_obj_t handler;
bool ishard;
} mp_irq_obj_t;
/******************************************************************************
DECLARE EXPORTED DATA
******************************************************************************/
extern const mp_arg_t mp_irq_init_args[];
extern const mp_obj_type_t mp_irq_type;
/******************************************************************************
DECLARE PUBLIC FUNCTIONS
******************************************************************************/
mp_irq_obj_t *mp_irq_new(const mp_irq_methods_t *methods, mp_obj_t parent);
void mp_irq_handler(mp_irq_obj_t *self);
#endif // MICROPY_INCLUDED_LIB_UTILS_MPIRQ_H

View File

@ -26,8 +26,6 @@
#include "py/mpconfig.h"
#if MICROPY_USE_INTERNAL_PRINTF
#include <stdint.h>
#include <string.h>
#include <stdarg.h>
@ -39,6 +37,18 @@
#include "py/formatfloat.h"
#endif
#if MICROPY_DEBUG_PRINTERS
int DEBUG_printf(const char *fmt, ...) {
va_list ap;
va_start(ap, fmt);
int ret = mp_vprintf(MICROPY_DEBUG_PRINTER, fmt, ap);
va_end(ap);
return ret;
}
#endif
#if MICROPY_USE_INTERNAL_PRINTF
#undef putchar // Some stdlibs have a #define for putchar
int printf(const char *fmt, ...);
int vprintf(const char *fmt, va_list ap);
@ -59,20 +69,6 @@ int vprintf(const char *fmt, va_list ap) {
return mp_vprintf(&mp_plat_print, fmt, ap);
}
#if MICROPY_DEBUG_PRINTERS
extern const mp_print_t MICROPY_DEBUG_PRINTER_DEST;
int DEBUG_printf(const char *fmt, ...) {
va_list ap;
va_start(ap, fmt);
#ifndef MICROPY_DEBUG_PRINTER_DEST
#define MICROPY_DEBUG_PRINTER_DEST mp_plat_print
#endif
int ret = mp_vprintf(&MICROPY_DEBUG_PRINTER_DEST, fmt, ap);
va_end(ap);
return ret;
}
#endif
// need this because gcc optimises printf("%c", c) -> putchar(c), and printf("a") -> putchar('a')
int putchar(int c) {
char chr = c;

View File

@ -129,7 +129,7 @@ STATIC int parse_compile_execute(const void *source, mp_parse_input_kind_t input
mp_hal_stdout_tx_strn("\x04", 1);
}
// check for SystemExit
if (mp_obj_is_subclass_fast(mp_obj_get_type((mp_obj_t)nlr.ret_val), &mp_type_SystemExit)) {
if (mp_obj_is_subclass_fast(MP_OBJ_FROM_PTR(((mp_obj_base_t *)nlr.ret_val)->type), MP_OBJ_FROM_PTR(&mp_type_SystemExit))) {
// at the moment, the value of SystemExit is unused
ret = pyexec_system_exit;
#if CIRCUITPY_ALARM
@ -138,7 +138,7 @@ STATIC int parse_compile_execute(const void *source, mp_parse_input_kind_t input
#endif
} else {
if ((mp_obj_t)nlr.ret_val != MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception))) {
mp_obj_print_exception(&mp_plat_print, (mp_obj_t)nlr.ret_val);
mp_obj_print_exception(&mp_plat_print, MP_OBJ_FROM_PTR(nlr.ret_val));
}
ret = PYEXEC_EXCEPTION;
}
@ -455,6 +455,12 @@ friendly_repl_reset:
}
#endif
// If the GC is locked at this point there is no way out except a reset,
// so force the GC to be unlocked to help the user debug what went wrong.
if (MP_STATE_MEM(gc_lock_depth) != 0) {
MP_STATE_MEM(gc_lock_depth) = 0;
}
vstr_reset(&line);
int ret = readline(&line, ">>> ");
mp_parse_input_kind_t parse_input_kind = MP_PARSE_SINGLE_INPUT;

View File

@ -172,7 +172,7 @@ STATIC const mp_obj_type_t stdio_buffer_obj_type = {
.getiter = mp_identity_getiter,
.iternext = mp_stream_unbuffered_iter,
.protocol = &stdio_buffer_obj_stream_p,
.locals_dict = (mp_obj_t)&stdio_locals_dict,
.locals_dict = (mp_obj_dict_t *)&stdio_locals_dict,
};
STATIC const sys_stdio_obj_t stdio_buffer_obj = {{&stdio_buffer_obj_type}, .fd = 0}; // fd unused

View File

@ -6,15 +6,15 @@ 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-01-15 19:49+0000\n"
"Last-Translator: oon arfiandwi <oon.arfiandwi@gmail.com>\n"
"PO-Revision-Date: 2021-04-07 12:23+0000\n"
"Last-Translator: Reza Almanda <rezaalmanda27@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: ID\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Weblate 4.5-dev\n"
"X-Generator: Weblate 4.6-dev\n"
#: main.c
msgid ""
@ -29,6 +29,8 @@ msgid ""
"\n"
"Code stopped by auto-reload.\n"
msgstr ""
"\n"
"Kode berhenti oleh auto-reload.\n"
#: supervisor/shared/safe_mode.c
msgid ""
@ -443,8 +445,8 @@ msgid "Attempt to allocate %d blocks"
msgstr ""
#: supervisor/shared/safe_mode.c
msgid "Attempted heap allocation when MicroPython VM not running."
msgstr "Mencoba alokasi heap ketika MicroPython VM tidak berjalan."
msgid "Attempted heap allocation when VM not running."
msgstr ""
#: shared-bindings/wifi/Radio.c
msgid "Authentication failure"
@ -852,9 +854,8 @@ msgid "Data chunk must follow fmt chunk"
msgstr "Potongan data harus mengikuti fmt chunk"
#: ports/nrf/common-hal/_bleio/Adapter.c
#, fuzzy
msgid "Data too large for advertisement packet"
msgstr "Tidak bisa menyesuaikan data ke dalam paket advertisment"
msgstr "Data terlalu besar untuk paket advertisment"
#: shared-bindings/audiobusio/PDMIn.c
msgid "Destination capacity is smaller than destination_length."
@ -898,6 +899,11 @@ msgstr ""
msgid "EXTINT channel already in use"
msgstr "Channel EXTINT sedang digunakan"
#: shared-module/synthio/MidiTrack.c
#, c-format
msgid "Error in MIDI stream at position %d"
msgstr ""
#: extmod/modure.c
msgid "Error in regex"
msgstr "Error pada regex"
@ -970,9 +976,9 @@ msgid "Failed sending command."
msgstr "Gagal mengirim perintah."
#: ports/nrf/sd_mutex.c
#, fuzzy, c-format
#, c-format
msgid "Failed to acquire mutex, err 0x%04x"
msgstr "Gagal untuk mendapatkan mutex, status: 0x%08lX"
msgstr "Gagal memperoleh mutex, err 0x%04x"
#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c
#: ports/raspberrypi/common-hal/busio/UART.c
@ -1019,14 +1025,18 @@ msgid "Failed to parse MP3 file"
msgstr "Gagal mengurai file MP3"
#: ports/nrf/sd_mutex.c
#, fuzzy, c-format
#, c-format
msgid "Failed to release mutex, err 0x%04x"
msgstr "Gagal untuk melepaskan mutex, status: 0x%08lX"
msgstr "Gagal melepaskan mutex, err 0x%04x"
#: supervisor/shared/safe_mode.c
msgid "Failed to write internal flash."
msgstr "Gagal menulis flash internal."
#: supervisor/shared/safe_mode.c
msgid "Fatal error."
msgstr ""
#: py/moduerrno.c
msgid "File exists"
msgstr "File sudah ada"
@ -1099,10 +1109,6 @@ msgstr ""
msgid "I2SOut not available"
msgstr ""
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "IOs 0, 2 & 4 do not support internal pullup in sleep"
msgstr ""
#: shared-bindings/aesio/aes.c
#, c-format
msgid "IV must be %d bytes long"
@ -1228,6 +1234,10 @@ msgstr ""
msgid "Invalid DAC pin supplied"
msgstr "Pin DAC yang diberikan tidak valid"
#: shared-bindings/synthio/__init__.c
msgid "Invalid MIDI file"
msgstr ""
#: ports/atmel-samd/common-hal/pwmio/PWMOut.c
#: ports/cxd56/common-hal/pwmio/PWMOut.c
#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c
@ -1419,14 +1429,6 @@ msgstr "Nilai x maksimum ketika dicerminkan adalah %d"
msgid "Messages limited to 8 bytes"
msgstr ""
#: supervisor/shared/safe_mode.c
msgid "MicroPython NLR jump failed. Likely memory corruption."
msgstr "Lompatan NLR MicroPython gagal. Kemungkinan kerusakan memori."
#: supervisor/shared/safe_mode.c
msgid "MicroPython fatal error."
msgstr "Kesalahan fatal MicroPython."
#: shared-bindings/audiobusio/PDMIn.c
msgid "Microphone startup delay must be in range 0.0 to 1.0"
msgstr "Penundaan mulai mikrofon harus dalam kisaran 0,0 hingga 1,0"
@ -1478,6 +1480,10 @@ msgstr "Harus menyediakan pin MISO atau MOSI"
msgid "Must use a multiple of 6 rgb pins, not %d"
msgstr "Harus menggunakan kelipatan 6 pin rgb, bukan %d"
#: supervisor/shared/safe_mode.c
msgid "NLR jump failed. Likely memory corruption."
msgstr ""
#: ports/esp32s2/common-hal/nvm/ByteArray.c
msgid "NVS Error"
msgstr ""
@ -1622,11 +1628,11 @@ msgstr ""
msgid "Not a valid IP string"
msgstr ""
#: ports/nrf/common-hal/_bleio/PacketBuffer.c
#: ports/nrf/common-hal/_bleio/__init__.c
#: shared-bindings/_bleio/CharacteristicBuffer.c
#, fuzzy
msgid "Not connected"
msgstr "Tidak dapat menyambungkan ke AP"
msgstr "Tidak terhubung"
#: shared-bindings/audiobusio/I2SOut.c shared-bindings/audioio/AudioOut.c
#: shared-bindings/audiopwmio/PWMAudioOut.c
@ -1635,7 +1641,7 @@ msgstr "Tidak berfungsi"
#: main.c
msgid "Not running saved code.\n"
msgstr ""
msgstr "Tidak menjalankan kode yang disimpan.\n"
#: shared-bindings/_bleio/__init__.c
msgid "Not settable"
@ -1847,6 +1853,8 @@ msgstr "Buffer awalan harus ada di heap"
#: main.c
msgid "Press any key to enter the REPL. Use CTRL-D to reload.\n"
msgstr ""
"Tekan sembarang tombol untuk masuk ke REPL. Tekan CTRL-D untuk memuat "
"ulang.\n"
#: main.c
msgid "Pretending to deep sleep until alarm, CTRL-C or file write.\n"
@ -1926,9 +1934,8 @@ msgid "Read-only filesystem"
msgstr "sistem file (filesystem) bersifat Read-only"
#: shared-module/displayio/Bitmap.c
#, fuzzy
msgid "Read-only object"
msgstr "sistem file (filesystem) bersifat Read-only"
msgstr "Objek Read-only"
#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c
msgid "Received response was invalid"
@ -2166,9 +2173,8 @@ msgid "Too many displays"
msgstr "Terlalu banyak tampilan"
#: ports/nrf/common-hal/_bleio/PacketBuffer.c
msgid "Total data to write is larger than outgoing_packet_length"
msgid "Total data to write is larger than %q"
msgstr ""
"Total data yang akan ditulis lebih besar daripada outgoing_packet_length"
#: py/obj.c
msgid "Traceback (most recent call last):\n"
@ -2308,9 +2314,8 @@ msgid "Unsupported baudrate"
msgstr "Baudrate tidak didukung"
#: shared-module/displayio/display_core.c
#, fuzzy
msgid "Unsupported display bus type"
msgstr "Baudrate tidak didukung"
msgstr "Tipe bus tampilan tidak didukung"
#: shared-module/audiocore/WaveFile.c
msgid "Unsupported format"
@ -2342,10 +2347,6 @@ msgstr "Panjang nilai > max_length"
msgid "Version was invalid"
msgstr ""
#: py/emitnative.c
msgid "Viper functions don't currently support more than 4 arguments"
msgstr "Fungsi Viper saat ini tidak mendukung lebih dari 4 argumen"
#: ports/stm/common-hal/microcontroller/Processor.c
msgid "Voltage read timed out"
msgstr "Tegangan baca habis waktu"
@ -2431,11 +2432,6 @@ msgstr "sebuah objek menyerupai byte (bytes-like) dibutuhkan"
msgid "abort() called"
msgstr "abort() dipanggil"
#: extmod/machine_mem.c
#, c-format
msgid "address %08x is not aligned to %d bytes"
msgstr "alamat %08x tidak selaras dengan %d bytes"
#: shared-bindings/i2cperipheral/I2CPeripheral.c
msgid "address out of bounds"
msgstr "alamat di luar batas"
@ -2444,6 +2440,10 @@ msgstr "alamat di luar batas"
msgid "addresses is empty"
msgstr "alamatnya kosong"
#: py/compile.c
msgid "annotation must be an identifier"
msgstr ""
#: py/modbuiltins.c
msgid "arg is an empty sequence"
msgstr "arg berisi urutan kosong"
@ -2543,18 +2543,13 @@ msgstr ""
msgid "buffer is smaller than requested size"
msgstr ""
#: shared-bindings/audiocore/RawSample.c
msgid "buffer must be a bytes-like object"
msgstr ""
#: extmod/ulab/code/ulab_create.c extmod/ulab/code/utils/utils.c
msgid "buffer size must be a multiple of element size"
msgstr ""
#: shared-module/struct/__init__.c
#, fuzzy
msgid "buffer size must match format"
msgstr "buffers harus mempunyai panjang yang sama"
msgstr "ukuran buffer harus sesuai dengan format"
#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c
msgid "buffer slices must be of equal length"
@ -2631,6 +2626,10 @@ msgstr "tidak dapat menetapkan ke ekspresi"
msgid "can't convert %q to %q"
msgstr ""
#: py/runtime.c
msgid "can't convert %q to int"
msgstr ""
#: py/objstr.c
msgid "can't convert '%q' object to %q implicitly"
msgstr ""
@ -2639,6 +2638,10 @@ msgstr ""
msgid "can't convert to %q"
msgstr ""
#: py/runtime.c
msgid "can't convert to int"
msgstr ""
#: py/objstr.c
msgid "can't convert to str implicitly"
msgstr ""
@ -2989,7 +2992,7 @@ msgid "f-string: single '}' is not allowed"
msgstr ""
#: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c
#: shared-bindings/displayio/OnDiskBitmap.c
#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c
msgid "file must be a file opened in byte mode"
msgstr ""
@ -3042,8 +3045,8 @@ msgid "full"
msgstr ""
#: py/argcheck.c
msgid "function does not take keyword arguments"
msgstr "fungsi tidak dapat mengambil argumen keyword"
msgid "function doesn't take keyword arguments"
msgstr ""
#: py/argcheck.c
#, c-format
@ -3097,6 +3100,10 @@ msgstr ""
msgid "generator ignored GeneratorExit"
msgstr ""
#: py/objgenerator.c
msgid "generator raised StopIteration"
msgstr ""
#: shared-bindings/_stage/Layer.c
msgid "graphic must be 2048 bytes long"
msgstr ""
@ -3245,6 +3252,10 @@ msgstr ""
msgid "invalid cert"
msgstr "cert tidak valid"
#: py/compile.c
msgid "invalid decorator"
msgstr ""
#: extmod/uos_dupterm.c
msgid "invalid dupterm index"
msgstr "indeks dupterm tidak valid"
@ -3300,10 +3311,6 @@ msgstr ""
msgid "invalid syntax for number"
msgstr ""
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "io must be rtc io"
msgstr ""
#: py/objtype.c
msgid "issubclass() arg 1 must be a class"
msgstr ""
@ -3476,6 +3483,10 @@ msgstr ""
msgid "need more than %d values to unpack"
msgstr ""
#: py/modmath.c
msgid "negative factorial"
msgstr ""
#: py/objint_longlong.c py/objint_mpz.c py/runtime.c
msgid "negative power with no float support"
msgstr ""
@ -3706,10 +3717,6 @@ msgstr ""
msgid "palette_index should be an int"
msgstr ""
#: py/compile.c
msgid "parameter annotation must be an identifier"
msgstr "anotasi parameter haruse sebuah identifier"
#: py/emitinlinextensa.c
msgid "parameters must be registers in sequence a2 to a5"
msgstr ""
@ -3764,6 +3771,8 @@ msgstr ""
#: ports/esp32s2/boards/adafruit_funhouse/mpconfigboard.h
#: ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h
#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h
#: ports/esp32s2/boards/artisense_rd00/mpconfigboard.h
#: ports/esp32s2/boards/atmegazero_esp32s2/mpconfigboard.h
#: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h
#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h
#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h
@ -3789,6 +3798,10 @@ msgstr ""
msgid "pressing both buttons at start up.\n"
msgstr ""
#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h
msgid "pressing the left button at start up\n"
msgstr ""
#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
msgid "pull masks conflict with direction masks"
msgstr ""
@ -4018,9 +4031,8 @@ msgid "timeout must be < 655.35 secs"
msgstr ""
#: shared-bindings/_bleio/CharacteristicBuffer.c
#, fuzzy
msgid "timeout must be >= 0.0"
msgstr "bits harus memilki nilai 8"
msgstr "waktu habis harus >= 0,0"
#: shared-module/sdcardio/SDCard.c
msgid "timeout waiting for v1 card"
@ -4063,10 +4075,6 @@ msgstr ""
msgid "trapz is defined for 1D arrays of equal length"
msgstr ""
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "trigger level must be 0 or 1"
msgstr ""
#: py/obj.c
msgid "tuple/list has wrong length"
msgstr ""
@ -4148,7 +4156,7 @@ msgstr ""
msgid "unknown type"
msgstr "tipe tidak diketahui"
#: py/emitnative.c
#: py/compile.c
msgid "unknown type '%q'"
msgstr ""
@ -4201,10 +4209,6 @@ msgstr ""
msgid "value_count must be > 0"
msgstr ""
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "wakeup conflict"
msgstr ""
#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c
msgid "watchdog not initialized"
msgstr ""
@ -4232,20 +4236,20 @@ msgstr ""
#: extmod/ulab/code/numpy/numerical/numerical.c
msgid "wrong axis index"
msgstr ""
msgstr "indeks sumbu salah"
#: extmod/ulab/code/ulab_create.c
msgid "wrong axis specified"
msgstr ""
msgstr "sumbu yang ditentukan salah"
#: extmod/ulab/code/numpy/compare/compare.c
#: extmod/ulab/code/numpy/vector/vector.c
msgid "wrong input type"
msgstr ""
msgstr "tipe input salah"
#: extmod/ulab/code/ulab_create.c py/objstr.c
msgid "wrong number of arguments"
msgstr ""
msgstr "jumlah argumen salah"
#: py/runtime.c
msgid "wrong number of values to unpack"
@ -4281,16 +4285,41 @@ msgstr ""
#: extmod/ulab/code/scipy/signal/signal.c
msgid "zi must be an ndarray"
msgstr ""
msgstr "zi harus ndarray"
#: extmod/ulab/code/scipy/signal/signal.c
msgid "zi must be of float type"
msgstr ""
msgstr "zi harus berjenis float"
#: extmod/ulab/code/scipy/signal/signal.c
msgid "zi must be of shape (n_section, 2)"
msgstr ""
#~ msgid "Viper functions don't currently support more than 4 arguments"
#~ msgstr "Fungsi Viper saat ini tidak mendukung lebih dari 4 argumen"
#~ msgid "address %08x is not aligned to %d bytes"
#~ msgstr "alamat %08x tidak selaras dengan %d bytes"
#~ msgid "function does not take keyword arguments"
#~ msgstr "fungsi tidak dapat mengambil argumen keyword"
#~ msgid "parameter annotation must be an identifier"
#~ msgstr "anotasi parameter haruse sebuah identifier"
#~ msgid "Total data to write is larger than outgoing_packet_length"
#~ msgstr ""
#~ "Total data yang akan ditulis lebih besar daripada outgoing_packet_length"
#~ msgid "Attempted heap allocation when MicroPython VM not running."
#~ msgstr "Mencoba alokasi heap ketika MicroPython VM tidak berjalan."
#~ msgid "MicroPython NLR jump failed. Likely memory corruption."
#~ msgstr "Lompatan NLR MicroPython gagal. Kemungkinan kerusakan memori."
#~ msgid "MicroPython fatal error."
#~ msgstr "Kesalahan fatal MicroPython."
#~ msgid "Nordic Soft Device failure assertion."
#~ msgstr "Pernyataan kegagalan Perangkat Lunak Nordic."

View File

@ -366,7 +366,7 @@ msgstr ""
msgid "All state machines in use"
msgstr ""
#: ports/atmel-samd/audio_dma.c ports/atmel-samd/common-hal/audiobusio/PDMIn.c
#: ports/atmel-samd/audio_dma.c
msgid "All sync event channels in use"
msgstr ""
@ -454,7 +454,7 @@ msgid "Attempt to allocate %d blocks"
msgstr ""
#: supervisor/shared/safe_mode.c
msgid "Attempted heap allocation when MicroPython VM not running."
msgid "Attempted heap allocation when VM not running."
msgstr ""
#: shared-bindings/wifi/Radio.c
@ -904,6 +904,11 @@ msgstr ""
msgid "EXTINT channel already in use"
msgstr ""
#: shared-module/synthio/MidiTrack.c
#, c-format
msgid "Error in MIDI stream at position %d"
msgstr ""
#: extmod/modure.c
msgid "Error in regex"
msgstr ""
@ -1033,6 +1038,10 @@ msgstr ""
msgid "Failed to write internal flash."
msgstr ""
#: supervisor/shared/safe_mode.c
msgid "Fatal error."
msgstr ""
#: py/moduerrno.c
msgid "File exists"
msgstr ""
@ -1201,6 +1210,7 @@ msgstr ""
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c
#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c
#: ports/mimxrt10xx/common-hal/busio/UART.c
msgid "Invalid %q pin"
msgstr ""
@ -1228,6 +1238,10 @@ msgstr ""
msgid "Invalid DAC pin supplied"
msgstr ""
#: shared-bindings/synthio/__init__.c
msgid "Invalid MIDI file"
msgstr ""
#: ports/atmel-samd/common-hal/pwmio/PWMOut.c
#: ports/cxd56/common-hal/pwmio/PWMOut.c
#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c
@ -1267,6 +1281,11 @@ msgstr ""
msgid "Invalid channel count"
msgstr ""
#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c
#, c-format
msgid "Invalid data_count %d"
msgstr ""
#: shared-bindings/digitalio/DigitalInOut.c
msgid "Invalid direction."
msgstr ""
@ -1419,14 +1438,6 @@ msgstr ""
msgid "Messages limited to 8 bytes"
msgstr ""
#: supervisor/shared/safe_mode.c
msgid "MicroPython NLR jump failed. Likely memory corruption."
msgstr ""
#: supervisor/shared/safe_mode.c
msgid "MicroPython fatal error."
msgstr ""
#: shared-bindings/audiobusio/PDMIn.c
msgid "Microphone startup delay must be in range 0.0 to 1.0"
msgstr ""
@ -1478,6 +1489,10 @@ msgstr ""
msgid "Must use a multiple of 6 rgb pins, not %d"
msgstr ""
#: supervisor/shared/safe_mode.c
msgid "NLR jump failed. Likely memory corruption."
msgstr ""
#: ports/esp32s2/common-hal/nvm/ByteArray.c
msgid "NVS Error"
msgstr ""
@ -1622,6 +1637,7 @@ msgstr ""
msgid "Not a valid IP string"
msgstr ""
#: ports/nrf/common-hal/_bleio/PacketBuffer.c
#: ports/nrf/common-hal/_bleio/__init__.c
#: shared-bindings/_bleio/CharacteristicBuffer.c
msgid "Not connected"
@ -2147,7 +2163,7 @@ msgid "Too many displays"
msgstr ""
#: ports/nrf/common-hal/_bleio/PacketBuffer.c
msgid "Total data to write is larger than outgoing_packet_length"
msgid "Total data to write is larger than %q"
msgstr ""
#: py/obj.c
@ -2319,10 +2335,6 @@ msgstr ""
msgid "Version was invalid"
msgstr ""
#: py/emitnative.c
msgid "Viper functions don't currently support more than 4 arguments"
msgstr ""
#: ports/stm/common-hal/microcontroller/Processor.c
msgid "Voltage read timed out"
msgstr ""
@ -2402,11 +2414,6 @@ msgstr ""
msgid "abort() called"
msgstr ""
#: extmod/machine_mem.c
#, c-format
msgid "address %08x is not aligned to %d bytes"
msgstr ""
#: shared-bindings/i2cperipheral/I2CPeripheral.c
msgid "address out of bounds"
msgstr ""
@ -2415,6 +2422,10 @@ msgstr ""
msgid "addresses is empty"
msgstr ""
#: py/compile.c
msgid "annotation must be an identifier"
msgstr ""
#: py/modbuiltins.c
msgid "arg is an empty sequence"
msgstr ""
@ -2514,10 +2525,6 @@ msgstr ""
msgid "buffer is smaller than requested size"
msgstr ""
#: shared-bindings/audiocore/RawSample.c
msgid "buffer must be a bytes-like object"
msgstr ""
#: extmod/ulab/code/ulab_create.c extmod/ulab/code/utils/utils.c
msgid "buffer size must be a multiple of element size"
msgstr ""
@ -2601,6 +2608,10 @@ msgstr ""
msgid "can't convert %q to %q"
msgstr ""
#: py/runtime.c
msgid "can't convert %q to int"
msgstr ""
#: py/objstr.c
msgid "can't convert '%q' object to %q implicitly"
msgstr ""
@ -2609,6 +2620,10 @@ msgstr ""
msgid "can't convert to %q"
msgstr ""
#: py/runtime.c
msgid "can't convert to int"
msgstr ""
#: py/objstr.c
msgid "can't convert to str implicitly"
msgstr ""
@ -2807,6 +2822,11 @@ msgstr ""
msgid "data must be of equal length"
msgstr ""
#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c
#, c-format
msgid "data pin #%d in use"
msgstr ""
#: extmod/ulab/code/ndarray.c
msgid "data type not understood"
msgstr ""
@ -2959,7 +2979,7 @@ msgid "f-string: single '}' is not allowed"
msgstr ""
#: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c
#: shared-bindings/displayio/OnDiskBitmap.c
#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c
msgid "file must be a file opened in byte mode"
msgstr ""
@ -3012,7 +3032,7 @@ msgid "full"
msgstr ""
#: py/argcheck.c
msgid "function does not take keyword arguments"
msgid "function doesn't take keyword arguments"
msgstr ""
#: py/argcheck.c
@ -3067,6 +3087,10 @@ msgstr ""
msgid "generator ignored GeneratorExit"
msgstr ""
#: py/objgenerator.c
msgid "generator raised StopIteration"
msgstr ""
#: shared-bindings/_stage/Layer.c
msgid "graphic must be 2048 bytes long"
msgstr ""
@ -3215,6 +3239,10 @@ msgstr ""
msgid "invalid cert"
msgstr ""
#: py/compile.c
msgid "invalid decorator"
msgstr ""
#: extmod/uos_dupterm.c
msgid "invalid dupterm index"
msgstr ""
@ -3442,6 +3470,10 @@ msgstr ""
msgid "need more than %d values to unpack"
msgstr ""
#: py/modmath.c
msgid "negative factorial"
msgstr ""
#: py/objint_longlong.c py/objint_mpz.c py/runtime.c
msgid "negative power with no float support"
msgstr ""
@ -3675,10 +3707,6 @@ msgstr ""
msgid "palette_index should be an int"
msgstr ""
#: py/compile.c
msgid "parameter annotation must be an identifier"
msgstr ""
#: py/emitinlinextensa.c
msgid "parameters must be registers in sequence a2 to a5"
msgstr ""
@ -3734,6 +3762,7 @@ msgstr ""
#: ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h
#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h
#: ports/esp32s2/boards/artisense_rd00/mpconfigboard.h
#: ports/esp32s2/boards/atmegazero_esp32s2/mpconfigboard.h
#: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h
#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h
#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h
@ -3759,6 +3788,10 @@ msgstr ""
msgid "pressing both buttons at start up.\n"
msgstr ""
#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h
msgid "pressing the left button at start up\n"
msgstr ""
#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
msgid "pull masks conflict with direction masks"
msgstr ""
@ -4113,7 +4146,7 @@ msgstr ""
msgid "unknown type"
msgstr ""
#: py/emitnative.c
#: py/compile.c
msgid "unknown type '%q'"
msgstr ""

View File

@ -441,7 +441,7 @@ msgid "Attempt to allocate %d blocks"
msgstr ""
#: supervisor/shared/safe_mode.c
msgid "Attempted heap allocation when MicroPython VM not running."
msgid "Attempted heap allocation when VM not running."
msgstr ""
#: shared-bindings/wifi/Radio.c
@ -882,6 +882,11 @@ msgstr ""
msgid "EXTINT channel already in use"
msgstr ""
#: shared-module/synthio/MidiTrack.c
#, c-format
msgid "Error in MIDI stream at position %d"
msgstr ""
#: extmod/modure.c
msgid "Error in regex"
msgstr ""
@ -1011,6 +1016,10 @@ msgstr ""
msgid "Failed to write internal flash."
msgstr ""
#: supervisor/shared/safe_mode.c
msgid "Fatal error."
msgstr ""
#: py/moduerrno.c
msgid "File exists"
msgstr ""
@ -1083,10 +1092,6 @@ msgstr ""
msgid "I2SOut not available"
msgstr ""
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "IOs 0, 2 & 4 do not support internal pullup in sleep"
msgstr ""
#: shared-bindings/aesio/aes.c
#, c-format
msgid "IV must be %d bytes long"
@ -1210,6 +1215,10 @@ msgstr ""
msgid "Invalid DAC pin supplied"
msgstr ""
#: shared-bindings/synthio/__init__.c
msgid "Invalid MIDI file"
msgstr ""
#: ports/atmel-samd/common-hal/pwmio/PWMOut.c
#: ports/cxd56/common-hal/pwmio/PWMOut.c
#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c
@ -1401,14 +1410,6 @@ msgstr ""
msgid "Messages limited to 8 bytes"
msgstr ""
#: supervisor/shared/safe_mode.c
msgid "MicroPython NLR jump failed. Likely memory corruption."
msgstr ""
#: supervisor/shared/safe_mode.c
msgid "MicroPython fatal error."
msgstr ""
#: shared-bindings/audiobusio/PDMIn.c
msgid "Microphone startup delay must be in range 0.0 to 1.0"
msgstr ""
@ -1460,6 +1461,10 @@ msgstr ""
msgid "Must use a multiple of 6 rgb pins, not %d"
msgstr ""
#: supervisor/shared/safe_mode.c
msgid "NLR jump failed. Likely memory corruption."
msgstr ""
#: ports/esp32s2/common-hal/nvm/ByteArray.c
msgid "NVS Error"
msgstr ""
@ -1604,6 +1609,7 @@ msgstr ""
msgid "Not a valid IP string"
msgstr ""
#: ports/nrf/common-hal/_bleio/PacketBuffer.c
#: ports/nrf/common-hal/_bleio/__init__.c
#: shared-bindings/_bleio/CharacteristicBuffer.c
msgid "Not connected"
@ -2129,7 +2135,7 @@ msgid "Too many displays"
msgstr ""
#: ports/nrf/common-hal/_bleio/PacketBuffer.c
msgid "Total data to write is larger than outgoing_packet_length"
msgid "Total data to write is larger than %q"
msgstr ""
#: py/obj.c
@ -2301,10 +2307,6 @@ msgstr ""
msgid "Version was invalid"
msgstr ""
#: py/emitnative.c
msgid "Viper functions don't currently support more than 4 arguments"
msgstr ""
#: ports/stm/common-hal/microcontroller/Processor.c
msgid "Voltage read timed out"
msgstr ""
@ -2384,11 +2386,6 @@ msgstr ""
msgid "abort() called"
msgstr ""
#: extmod/machine_mem.c
#, c-format
msgid "address %08x is not aligned to %d bytes"
msgstr ""
#: shared-bindings/i2cperipheral/I2CPeripheral.c
msgid "address out of bounds"
msgstr ""
@ -2397,6 +2394,10 @@ msgstr ""
msgid "addresses is empty"
msgstr ""
#: py/compile.c
msgid "annotation must be an identifier"
msgstr ""
#: py/modbuiltins.c
msgid "arg is an empty sequence"
msgstr ""
@ -2496,10 +2497,6 @@ msgstr ""
msgid "buffer is smaller than requested size"
msgstr ""
#: shared-bindings/audiocore/RawSample.c
msgid "buffer must be a bytes-like object"
msgstr ""
#: extmod/ulab/code/ulab_create.c extmod/ulab/code/utils/utils.c
msgid "buffer size must be a multiple of element size"
msgstr ""
@ -2583,6 +2580,10 @@ msgstr ""
msgid "can't convert %q to %q"
msgstr ""
#: py/runtime.c
msgid "can't convert %q to int"
msgstr ""
#: py/objstr.c
msgid "can't convert '%q' object to %q implicitly"
msgstr ""
@ -2591,6 +2592,10 @@ msgstr ""
msgid "can't convert to %q"
msgstr ""
#: py/runtime.c
msgid "can't convert to int"
msgstr ""
#: py/objstr.c
msgid "can't convert to str implicitly"
msgstr ""
@ -2941,7 +2946,7 @@ msgid "f-string: single '}' is not allowed"
msgstr ""
#: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c
#: shared-bindings/displayio/OnDiskBitmap.c
#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c
msgid "file must be a file opened in byte mode"
msgstr ""
@ -2994,7 +2999,7 @@ msgid "full"
msgstr ""
#: py/argcheck.c
msgid "function does not take keyword arguments"
msgid "function doesn't take keyword arguments"
msgstr ""
#: py/argcheck.c
@ -3049,6 +3054,10 @@ msgstr ""
msgid "generator ignored GeneratorExit"
msgstr ""
#: py/objgenerator.c
msgid "generator raised StopIteration"
msgstr ""
#: shared-bindings/_stage/Layer.c
msgid "graphic must be 2048 bytes long"
msgstr ""
@ -3197,6 +3206,10 @@ msgstr ""
msgid "invalid cert"
msgstr ""
#: py/compile.c
msgid "invalid decorator"
msgstr ""
#: extmod/uos_dupterm.c
msgid "invalid dupterm index"
msgstr ""
@ -3252,10 +3265,6 @@ msgstr ""
msgid "invalid syntax for number"
msgstr ""
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "io must be rtc io"
msgstr ""
#: py/objtype.c
msgid "issubclass() arg 1 must be a class"
msgstr ""
@ -3428,6 +3437,10 @@ msgstr ""
msgid "need more than %d values to unpack"
msgstr ""
#: py/modmath.c
msgid "negative factorial"
msgstr ""
#: py/objint_longlong.c py/objint_mpz.c py/runtime.c
msgid "negative power with no float support"
msgstr ""
@ -3657,10 +3670,6 @@ msgstr ""
msgid "palette_index should be an int"
msgstr ""
#: py/compile.c
msgid "parameter annotation must be an identifier"
msgstr ""
#: py/emitinlinextensa.c
msgid "parameters must be registers in sequence a2 to a5"
msgstr ""
@ -3715,6 +3724,8 @@ msgstr ""
#: ports/esp32s2/boards/adafruit_funhouse/mpconfigboard.h
#: ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h
#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h
#: ports/esp32s2/boards/artisense_rd00/mpconfigboard.h
#: ports/esp32s2/boards/atmegazero_esp32s2/mpconfigboard.h
#: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h
#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h
#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h
@ -3740,6 +3751,10 @@ msgstr ""
msgid "pressing both buttons at start up.\n"
msgstr ""
#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h
msgid "pressing the left button at start up\n"
msgstr ""
#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
msgid "pull masks conflict with direction masks"
msgstr ""
@ -4013,10 +4028,6 @@ msgstr ""
msgid "trapz is defined for 1D arrays of equal length"
msgstr ""
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "trigger level must be 0 or 1"
msgstr ""
#: py/obj.c
msgid "tuple/list has wrong length"
msgstr ""
@ -4098,7 +4109,7 @@ msgstr ""
msgid "unknown type"
msgstr ""
#: py/emitnative.c
#: py/compile.c
msgid "unknown type '%q'"
msgstr ""
@ -4151,10 +4162,6 @@ msgstr ""
msgid "value_count must be > 0"
msgstr ""
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "wakeup conflict"
msgstr ""
#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c
msgid "watchdog not initialized"
msgstr ""

View File

@ -447,10 +447,8 @@ msgid "Attempt to allocate %d blocks"
msgstr "Versuche %d Blöcke zu allokieren"
#: supervisor/shared/safe_mode.c
msgid "Attempted heap allocation when MicroPython VM not running."
msgid "Attempted heap allocation when VM not running."
msgstr ""
"Versuch einer Heap Reservierung, wenn die MicroPython-VM nicht ausgeführt "
"wird."
#: shared-bindings/wifi/Radio.c
msgid "Authentication failure"
@ -899,6 +897,11 @@ msgstr "ESP-IDF Speicherallozierung fehlgeschlagen"
msgid "EXTINT channel already in use"
msgstr "EXTINT Kanal ist schon in Benutzung"
#: shared-module/synthio/MidiTrack.c
#, c-format
msgid "Error in MIDI stream at position %d"
msgstr ""
#: extmod/modure.c
msgid "Error in regex"
msgstr "Fehler in regex"
@ -1029,6 +1032,10 @@ msgstr "Mutex konnte nicht freigegeben werden. Status: 0x%04x"
msgid "Failed to write internal flash."
msgstr "Interner Flash konnte nicht geschrieben werden."
#: supervisor/shared/safe_mode.c
msgid "Fatal error."
msgstr ""
#: py/moduerrno.c
msgid "File exists"
msgstr "Datei existiert"
@ -1103,10 +1110,6 @@ msgstr "I2C Peripherie in Verwendung"
msgid "I2SOut not available"
msgstr "I2SOut nicht verfügbar"
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "IOs 0, 2 & 4 do not support internal pullup in sleep"
msgstr "IOs 0, 2 & 4 unterstützen keinen internen Pull up im sleep-Modus"
#: shared-bindings/aesio/aes.c
#, c-format
msgid "IV must be %d bytes long"
@ -1232,6 +1235,10 @@ msgstr "Ungültige BSSID"
msgid "Invalid DAC pin supplied"
msgstr "Ungültiger DAC-Pin angegeben"
#: shared-bindings/synthio/__init__.c
msgid "Invalid MIDI file"
msgstr ""
#: ports/atmel-samd/common-hal/pwmio/PWMOut.c
#: ports/cxd56/common-hal/pwmio/PWMOut.c
#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c
@ -1423,15 +1430,6 @@ msgstr "Maximaler x-Wert beim Spiegeln ist %d"
msgid "Messages limited to 8 bytes"
msgstr ""
#: supervisor/shared/safe_mode.c
msgid "MicroPython NLR jump failed. Likely memory corruption."
msgstr ""
"MicroPython NLR-Sprung fehlgeschlagen. Wahrscheinlich Speicherbeschädigung."
#: supervisor/shared/safe_mode.c
msgid "MicroPython fatal error."
msgstr "Schwerwiegender MicroPython-Fehler."
#: shared-bindings/audiobusio/PDMIn.c
msgid "Microphone startup delay must be in range 0.0 to 1.0"
msgstr ""
@ -1484,6 +1482,10 @@ msgstr "Muss MISO- oder MOSI-Pin bereitstellen"
msgid "Must use a multiple of 6 rgb pins, not %d"
msgstr "Muss ein Vielfaches von 6 RGB-Pins verwenden, nicht %d"
#: supervisor/shared/safe_mode.c
msgid "NLR jump failed. Likely memory corruption."
msgstr ""
#: ports/esp32s2/common-hal/nvm/ByteArray.c
msgid "NVS Error"
msgstr ""
@ -1628,6 +1630,7 @@ msgstr ""
msgid "Not a valid IP string"
msgstr ""
#: ports/nrf/common-hal/_bleio/PacketBuffer.c
#: ports/nrf/common-hal/_bleio/__init__.c
#: shared-bindings/_bleio/CharacteristicBuffer.c
msgid "Not connected"
@ -2176,10 +2179,8 @@ msgid "Too many displays"
msgstr "Zu viele displays"
#: ports/nrf/common-hal/_bleio/PacketBuffer.c
msgid "Total data to write is larger than outgoing_packet_length"
msgid "Total data to write is larger than %q"
msgstr ""
"Die Gesamtzahl der zu schreibenden Daten ist größer als "
"outgoing_packet_length"
#: py/obj.c
msgid "Traceback (most recent call last):\n"
@ -2354,10 +2355,6 @@ msgstr "Länge des Wertes > max_length"
msgid "Version was invalid"
msgstr ""
#: py/emitnative.c
msgid "Viper functions don't currently support more than 4 arguments"
msgstr "Viper-Funktionen unterstützen derzeit nicht mehr als 4 Argumente"
#: ports/stm/common-hal/microcontroller/Processor.c
msgid "Voltage read timed out"
msgstr "Zeitüberschreitung beim Lesen der Spannung"
@ -2448,11 +2445,6 @@ msgstr "ein Byte-ähnliches Objekt ist erforderlich"
msgid "abort() called"
msgstr "abort() wurde aufgerufen"
#: extmod/machine_mem.c
#, c-format
msgid "address %08x is not aligned to %d bytes"
msgstr "Addresse %08x ist nicht an %d bytes ausgerichtet"
#: shared-bindings/i2cperipheral/I2CPeripheral.c
msgid "address out of bounds"
msgstr "Adresse außerhalb der Grenzen"
@ -2461,6 +2453,10 @@ msgstr "Adresse außerhalb der Grenzen"
msgid "addresses is empty"
msgstr "adresses ist leer"
#: py/compile.c
msgid "annotation must be an identifier"
msgstr ""
#: py/modbuiltins.c
msgid "arg is an empty sequence"
msgstr "arg ist eine leere Sequenz"
@ -2560,10 +2556,6 @@ msgstr "Zweig ist außerhalb der Reichweite"
msgid "buffer is smaller than requested size"
msgstr ""
#: shared-bindings/audiocore/RawSample.c
msgid "buffer must be a bytes-like object"
msgstr "Puffer muss ein bytes-artiges Objekt sein"
#: extmod/ulab/code/ulab_create.c extmod/ulab/code/utils/utils.c
msgid "buffer size must be a multiple of element size"
msgstr ""
@ -2649,6 +2641,10 @@ msgstr "kann keinem Ausdruck zuweisen"
msgid "can't convert %q to %q"
msgstr "kann %q nicht zu %q konvertieren"
#: py/runtime.c
msgid "can't convert %q to int"
msgstr ""
#: py/objstr.c
msgid "can't convert '%q' object to %q implicitly"
msgstr "Kann '%q' Objekt nicht implizit nach %q konvertieren"
@ -2657,6 +2653,10 @@ msgstr "Kann '%q' Objekt nicht implizit nach %q konvertieren"
msgid "can't convert to %q"
msgstr "kann nicht zu %q konvertieren"
#: py/runtime.c
msgid "can't convert to int"
msgstr "kann nicht nach int konvertieren"
#: py/objstr.c
msgid "can't convert to str implicitly"
msgstr "Kann nicht implizit nach str konvertieren"
@ -3017,7 +3017,7 @@ msgid "f-string: single '}' is not allowed"
msgstr "f-string: einzelne '}' nicht erlaubt"
#: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c
#: shared-bindings/displayio/OnDiskBitmap.c
#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c
msgid "file must be a file opened in byte mode"
msgstr "Die Datei muss eine im Byte-Modus geöffnete Datei sein"
@ -3070,8 +3070,8 @@ msgid "full"
msgstr "voll"
#: py/argcheck.c
msgid "function does not take keyword arguments"
msgstr "Funktion akzeptiert keine Schlüsselwort-Argumente"
msgid "function doesn't take keyword arguments"
msgstr ""
#: py/argcheck.c
#, c-format
@ -3127,6 +3127,10 @@ msgstr "Generator läuft bereits"
msgid "generator ignored GeneratorExit"
msgstr "Generator ignoriert GeneratorExit"
#: py/objgenerator.c
msgid "generator raised StopIteration"
msgstr ""
#: shared-bindings/_stage/Layer.c
msgid "graphic must be 2048 bytes long"
msgstr "graphic muss 2048 Byte lang sein"
@ -3275,6 +3279,10 @@ msgstr ""
msgid "invalid cert"
msgstr "ungültiges cert"
#: py/compile.c
msgid "invalid decorator"
msgstr ""
#: extmod/uos_dupterm.c
msgid "invalid dupterm index"
msgstr "ungültiger dupterm index"
@ -3330,10 +3338,6 @@ msgstr "ungültige Syntax für integer mit Basis %d"
msgid "invalid syntax for number"
msgstr "ungültige Syntax für number"
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "io must be rtc io"
msgstr ""
#: py/objtype.c
msgid "issubclass() arg 1 must be a class"
msgstr "issubclass() arg 1 muss eine Klasse sein"
@ -3512,6 +3516,10 @@ msgstr "native Ausbeute (yield)"
msgid "need more than %d values to unpack"
msgstr "Zum Entpacken sind mehr als %d Werte erforderlich"
#: py/modmath.c
msgid "negative factorial"
msgstr ""
#: py/objint_longlong.c py/objint_mpz.c py/runtime.c
msgid "negative power with no float support"
msgstr "negative Potenz ohne Gleitkomma (float) Unterstützung"
@ -3745,10 +3753,6 @@ msgstr "Die Palette muss 32 Byte lang sein"
msgid "palette_index should be an int"
msgstr "palette_index sollte ein int sein"
#: py/compile.c
msgid "parameter annotation must be an identifier"
msgstr "parameter annotation muss ein identifier sein"
#: py/emitinlinextensa.c
msgid "parameters must be registers in sequence a2 to a5"
msgstr "Die Parameter müssen Register der Reihenfolge a2 bis a5 sein"
@ -3803,6 +3807,8 @@ msgstr "pow () mit 3 Argumenten erfordert Integer"
#: ports/esp32s2/boards/adafruit_funhouse/mpconfigboard.h
#: ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h
#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h
#: ports/esp32s2/boards/artisense_rd00/mpconfigboard.h
#: ports/esp32s2/boards/atmegazero_esp32s2/mpconfigboard.h
#: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h
#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h
#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h
@ -3828,6 +3834,10 @@ msgstr ""
msgid "pressing both buttons at start up.\n"
msgstr ""
#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h
msgid "pressing the left button at start up\n"
msgstr ""
#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
msgid "pull masks conflict with direction masks"
msgstr ""
@ -4104,10 +4114,6 @@ msgstr ""
msgid "trapz is defined for 1D arrays of equal length"
msgstr ""
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "trigger level must be 0 or 1"
msgstr ""
#: py/obj.c
msgid "tuple/list has wrong length"
msgstr "tupel/list hat falsche Länge"
@ -4193,7 +4199,7 @@ msgstr "Unbekannter Formatcode '%c' für Objekt vom Typ '%q'"
msgid "unknown type"
msgstr "unbekannter Typ"
#: py/emitnative.c
#: py/compile.c
msgid "unknown type '%q'"
msgstr "unbekannter Typ '%q'"
@ -4246,10 +4252,6 @@ msgstr "Wert muss in %d Byte(s) passen"
msgid "value_count must be > 0"
msgstr "value_count muss größer als 0 sein"
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "wakeup conflict"
msgstr ""
#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c
msgid "watchdog not initialized"
msgstr ""
@ -4336,6 +4338,42 @@ msgstr ""
msgid "zi must be of shape (n_section, 2)"
msgstr ""
#~ msgid "Viper functions don't currently support more than 4 arguments"
#~ msgstr "Viper-Funktionen unterstützen derzeit nicht mehr als 4 Argumente"
#~ msgid "address %08x is not aligned to %d bytes"
#~ msgstr "Addresse %08x ist nicht an %d bytes ausgerichtet"
#~ msgid "function does not take keyword arguments"
#~ msgstr "Funktion akzeptiert keine Schlüsselwort-Argumente"
#~ msgid "parameter annotation must be an identifier"
#~ msgstr "parameter annotation muss ein identifier sein"
#~ msgid "Total data to write is larger than outgoing_packet_length"
#~ msgstr ""
#~ "Die Gesamtzahl der zu schreibenden Daten ist größer als "
#~ "outgoing_packet_length"
#~ msgid "IOs 0, 2 & 4 do not support internal pullup in sleep"
#~ msgstr "IOs 0, 2 & 4 unterstützen keinen internen Pull up im sleep-Modus"
#~ msgid "buffer must be a bytes-like object"
#~ msgstr "Puffer muss ein bytes-artiges Objekt sein"
#~ msgid "Attempted heap allocation when MicroPython VM not running."
#~ msgstr ""
#~ "Versuch einer Heap Reservierung, wenn die MicroPython-VM nicht ausgeführt "
#~ "wird."
#~ msgid "MicroPython NLR jump failed. Likely memory corruption."
#~ msgstr ""
#~ "MicroPython NLR-Sprung fehlgeschlagen. Wahrscheinlich "
#~ "Speicherbeschädigung."
#~ msgid "MicroPython fatal error."
#~ msgstr "Schwerwiegender MicroPython-Fehler."
#~ msgid "argument must be ndarray"
#~ msgstr "Argument muss ein ndarray sein"
@ -4545,9 +4583,6 @@ msgstr ""
#~ msgid "can't convert to float"
#~ msgstr "kann nicht nach float konvertieren"
#~ msgid "can't convert to int"
#~ msgstr "kann nicht nach int konvertieren"
#~ msgid "object '%s' is not a tuple or list"
#~ msgstr "Objekt '%s' ist weder tupel noch list"

View File

@ -438,7 +438,7 @@ msgid "Attempt to allocate %d blocks"
msgstr ""
#: supervisor/shared/safe_mode.c
msgid "Attempted heap allocation when MicroPython VM not running."
msgid "Attempted heap allocation when VM not running."
msgstr ""
#: shared-bindings/wifi/Radio.c
@ -879,6 +879,11 @@ msgstr ""
msgid "EXTINT channel already in use"
msgstr ""
#: shared-module/synthio/MidiTrack.c
#, c-format
msgid "Error in MIDI stream at position %d"
msgstr ""
#: extmod/modure.c
msgid "Error in regex"
msgstr ""
@ -1008,6 +1013,10 @@ msgstr ""
msgid "Failed to write internal flash."
msgstr ""
#: supervisor/shared/safe_mode.c
msgid "Fatal error."
msgstr ""
#: py/moduerrno.c
msgid "File exists"
msgstr ""
@ -1080,10 +1089,6 @@ msgstr ""
msgid "I2SOut not available"
msgstr ""
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "IOs 0, 2 & 4 do not support internal pullup in sleep"
msgstr ""
#: shared-bindings/aesio/aes.c
#, c-format
msgid "IV must be %d bytes long"
@ -1207,6 +1212,10 @@ msgstr ""
msgid "Invalid DAC pin supplied"
msgstr ""
#: shared-bindings/synthio/__init__.c
msgid "Invalid MIDI file"
msgstr ""
#: ports/atmel-samd/common-hal/pwmio/PWMOut.c
#: ports/cxd56/common-hal/pwmio/PWMOut.c
#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c
@ -1398,14 +1407,6 @@ msgstr ""
msgid "Messages limited to 8 bytes"
msgstr ""
#: supervisor/shared/safe_mode.c
msgid "MicroPython NLR jump failed. Likely memory corruption."
msgstr ""
#: supervisor/shared/safe_mode.c
msgid "MicroPython fatal error."
msgstr ""
#: shared-bindings/audiobusio/PDMIn.c
msgid "Microphone startup delay must be in range 0.0 to 1.0"
msgstr ""
@ -1457,6 +1458,10 @@ msgstr ""
msgid "Must use a multiple of 6 rgb pins, not %d"
msgstr ""
#: supervisor/shared/safe_mode.c
msgid "NLR jump failed. Likely memory corruption."
msgstr ""
#: ports/esp32s2/common-hal/nvm/ByteArray.c
msgid "NVS Error"
msgstr ""
@ -1601,6 +1606,7 @@ msgstr ""
msgid "Not a valid IP string"
msgstr ""
#: ports/nrf/common-hal/_bleio/PacketBuffer.c
#: ports/nrf/common-hal/_bleio/__init__.c
#: shared-bindings/_bleio/CharacteristicBuffer.c
msgid "Not connected"
@ -2126,7 +2132,7 @@ msgid "Too many displays"
msgstr ""
#: ports/nrf/common-hal/_bleio/PacketBuffer.c
msgid "Total data to write is larger than outgoing_packet_length"
msgid "Total data to write is larger than %q"
msgstr ""
#: py/obj.c
@ -2298,10 +2304,6 @@ msgstr ""
msgid "Version was invalid"
msgstr ""
#: py/emitnative.c
msgid "Viper functions don't currently support more than 4 arguments"
msgstr ""
#: ports/stm/common-hal/microcontroller/Processor.c
msgid "Voltage read timed out"
msgstr ""
@ -2381,11 +2383,6 @@ msgstr ""
msgid "abort() called"
msgstr ""
#: extmod/machine_mem.c
#, c-format
msgid "address %08x is not aligned to %d bytes"
msgstr ""
#: shared-bindings/i2cperipheral/I2CPeripheral.c
msgid "address out of bounds"
msgstr ""
@ -2394,6 +2391,10 @@ msgstr ""
msgid "addresses is empty"
msgstr ""
#: py/compile.c
msgid "annotation must be an identifier"
msgstr ""
#: py/modbuiltins.c
msgid "arg is an empty sequence"
msgstr ""
@ -2493,10 +2494,6 @@ msgstr ""
msgid "buffer is smaller than requested size"
msgstr ""
#: shared-bindings/audiocore/RawSample.c
msgid "buffer must be a bytes-like object"
msgstr ""
#: extmod/ulab/code/ulab_create.c extmod/ulab/code/utils/utils.c
msgid "buffer size must be a multiple of element size"
msgstr ""
@ -2580,6 +2577,10 @@ msgstr ""
msgid "can't convert %q to %q"
msgstr ""
#: py/runtime.c
msgid "can't convert %q to int"
msgstr ""
#: py/objstr.c
msgid "can't convert '%q' object to %q implicitly"
msgstr ""
@ -2588,6 +2589,10 @@ msgstr ""
msgid "can't convert to %q"
msgstr ""
#: py/runtime.c
msgid "can't convert to int"
msgstr ""
#: py/objstr.c
msgid "can't convert to str implicitly"
msgstr ""
@ -2938,7 +2943,7 @@ msgid "f-string: single '}' is not allowed"
msgstr ""
#: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c
#: shared-bindings/displayio/OnDiskBitmap.c
#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c
msgid "file must be a file opened in byte mode"
msgstr ""
@ -2991,7 +2996,7 @@ msgid "full"
msgstr ""
#: py/argcheck.c
msgid "function does not take keyword arguments"
msgid "function doesn't take keyword arguments"
msgstr ""
#: py/argcheck.c
@ -3046,6 +3051,10 @@ msgstr ""
msgid "generator ignored GeneratorExit"
msgstr ""
#: py/objgenerator.c
msgid "generator raised StopIteration"
msgstr ""
#: shared-bindings/_stage/Layer.c
msgid "graphic must be 2048 bytes long"
msgstr ""
@ -3194,6 +3203,10 @@ msgstr ""
msgid "invalid cert"
msgstr ""
#: py/compile.c
msgid "invalid decorator"
msgstr ""
#: extmod/uos_dupterm.c
msgid "invalid dupterm index"
msgstr ""
@ -3249,10 +3262,6 @@ msgstr ""
msgid "invalid syntax for number"
msgstr ""
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "io must be rtc io"
msgstr ""
#: py/objtype.c
msgid "issubclass() arg 1 must be a class"
msgstr ""
@ -3425,6 +3434,10 @@ msgstr ""
msgid "need more than %d values to unpack"
msgstr ""
#: py/modmath.c
msgid "negative factorial"
msgstr ""
#: py/objint_longlong.c py/objint_mpz.c py/runtime.c
msgid "negative power with no float support"
msgstr ""
@ -3654,10 +3667,6 @@ msgstr ""
msgid "palette_index should be an int"
msgstr ""
#: py/compile.c
msgid "parameter annotation must be an identifier"
msgstr ""
#: py/emitinlinextensa.c
msgid "parameters must be registers in sequence a2 to a5"
msgstr ""
@ -3712,6 +3721,8 @@ msgstr ""
#: ports/esp32s2/boards/adafruit_funhouse/mpconfigboard.h
#: ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h
#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h
#: ports/esp32s2/boards/artisense_rd00/mpconfigboard.h
#: ports/esp32s2/boards/atmegazero_esp32s2/mpconfigboard.h
#: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h
#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h
#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h
@ -3737,6 +3748,10 @@ msgstr ""
msgid "pressing both buttons at start up.\n"
msgstr ""
#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h
msgid "pressing the left button at start up\n"
msgstr ""
#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
msgid "pull masks conflict with direction masks"
msgstr ""
@ -4010,10 +4025,6 @@ msgstr ""
msgid "trapz is defined for 1D arrays of equal length"
msgstr ""
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "trigger level must be 0 or 1"
msgstr ""
#: py/obj.c
msgid "tuple/list has wrong length"
msgstr ""
@ -4095,7 +4106,7 @@ msgstr ""
msgid "unknown type"
msgstr ""
#: py/emitnative.c
#: py/compile.c
msgid "unknown type '%q'"
msgstr ""
@ -4148,10 +4159,6 @@ msgstr ""
msgid "value_count must be > 0"
msgstr ""
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "wakeup conflict"
msgstr ""
#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c
msgid "watchdog not initialized"
msgstr ""

View File

@ -7,15 +7,15 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2021-03-25 23:30+0000\n"
"Last-Translator: Gareth Coleman <gareth@sublime.org>\n"
"PO-Revision-Date: 2021-04-11 01:30+0000\n"
"Last-Translator: Hugo Dahl <hugo@code-jedi.com>\n"
"Language-Team: none\n"
"Language: en_GB\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.2-dev\n"
"X-Generator: Weblate 4.6-dev\n"
#: main.c
msgid ""
@ -447,9 +447,8 @@ msgid "Attempt to allocate %d blocks"
msgstr "Attempt to allocate %d blocks"
#: supervisor/shared/safe_mode.c
#, fuzzy
msgid "Attempted heap allocation when MicroPython VM not running."
msgstr "Attempted heap allocation when CircuitPython VM not running."
msgid "Attempted heap allocation when VM not running."
msgstr ""
#: shared-bindings/wifi/Radio.c
msgid "Authentication failure"
@ -895,6 +894,11 @@ msgstr "ESP-IDF memory allocation failed"
msgid "EXTINT channel already in use"
msgstr "EXTINT channel already in use"
#: shared-module/synthio/MidiTrack.c
#, c-format
msgid "Error in MIDI stream at position %d"
msgstr ""
#: extmod/modure.c
msgid "Error in regex"
msgstr "Error in regex"
@ -1024,6 +1028,10 @@ msgstr "Failed to release mutex, err 0x%04x"
msgid "Failed to write internal flash."
msgstr "Failed to write internal flash."
#: supervisor/shared/safe_mode.c
msgid "Fatal error."
msgstr ""
#: py/moduerrno.c
msgid "File exists"
msgstr "File exists"
@ -1096,10 +1104,6 @@ msgstr "I2C peripheral in use"
msgid "I2SOut not available"
msgstr "I2SOut not available"
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "IOs 0, 2 & 4 do not support internal pullup in sleep"
msgstr "IOs 0, 2 & 4 do not support internal pullup in sleep"
#: shared-bindings/aesio/aes.c
#, c-format
msgid "IV must be %d bytes long"
@ -1225,6 +1229,10 @@ msgstr "Invalid BSSID"
msgid "Invalid DAC pin supplied"
msgstr "Invalid DAC pin supplied"
#: shared-bindings/synthio/__init__.c
msgid "Invalid MIDI file"
msgstr ""
#: ports/atmel-samd/common-hal/pwmio/PWMOut.c
#: ports/cxd56/common-hal/pwmio/PWMOut.c
#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c
@ -1416,16 +1424,6 @@ msgstr "Maximum x value when mirrored is %d"
msgid "Messages limited to 8 bytes"
msgstr "Messages limited to 8 bytes"
#: supervisor/shared/safe_mode.c
#, fuzzy
msgid "MicroPython NLR jump failed. Likely memory corruption."
msgstr "CircuitPython NLR jump failed. Likely memory corruption."
#: supervisor/shared/safe_mode.c
#, fuzzy
msgid "MicroPython fatal error."
msgstr "CircuitPython fatal error."
#: shared-bindings/audiobusio/PDMIn.c
msgid "Microphone startup delay must be in range 0.0 to 1.0"
msgstr "Microphone startup delay must be in range 0.0 to 1.0"
@ -1477,6 +1475,10 @@ msgstr "Must provide MISO or MOSI pin"
msgid "Must use a multiple of 6 rgb pins, not %d"
msgstr "Must use a multiple of 6 rgb pins, not %d"
#: supervisor/shared/safe_mode.c
msgid "NLR jump failed. Likely memory corruption."
msgstr ""
#: ports/esp32s2/common-hal/nvm/ByteArray.c
msgid "NVS Error"
msgstr "NVS Error"
@ -1621,6 +1623,7 @@ msgstr ""
msgid "Not a valid IP string"
msgstr "Not a valid IP string"
#: ports/nrf/common-hal/_bleio/PacketBuffer.c
#: ports/nrf/common-hal/_bleio/__init__.c
#: shared-bindings/_bleio/CharacteristicBuffer.c
msgid "Not connected"
@ -2166,8 +2169,8 @@ msgid "Too many displays"
msgstr "Too many displays"
#: ports/nrf/common-hal/_bleio/PacketBuffer.c
msgid "Total data to write is larger than outgoing_packet_length"
msgstr "Total data to write is larger than outgoing_packet_length"
msgid "Total data to write is larger than %q"
msgstr ""
#: py/obj.c
msgid "Traceback (most recent call last):\n"
@ -2340,10 +2343,6 @@ msgstr "Value length > max_length"
msgid "Version was invalid"
msgstr "Version was invalid"
#: py/emitnative.c
msgid "Viper functions don't currently support more than 4 arguments"
msgstr "Viper functions don't currently support more than 4 arguments"
#: ports/stm/common-hal/microcontroller/Processor.c
msgid "Voltage read timed out"
msgstr "Voltage read timed out"
@ -2428,11 +2427,6 @@ msgstr "a bytes-like object is required"
msgid "abort() called"
msgstr "abort() called"
#: extmod/machine_mem.c
#, c-format
msgid "address %08x is not aligned to %d bytes"
msgstr "address %08x is not aligned to %d bytes"
#: shared-bindings/i2cperipheral/I2CPeripheral.c
msgid "address out of bounds"
msgstr "address out of bounds"
@ -2441,6 +2435,10 @@ msgstr "address out of bounds"
msgid "addresses is empty"
msgstr "addresses is empty"
#: py/compile.c
msgid "annotation must be an identifier"
msgstr ""
#: py/modbuiltins.c
msgid "arg is an empty sequence"
msgstr "arg is an empty sequence"
@ -2540,10 +2538,6 @@ msgstr "Branch not in range"
msgid "buffer is smaller than requested size"
msgstr "Buffer is smaller than requested size"
#: shared-bindings/audiocore/RawSample.c
msgid "buffer must be a bytes-like object"
msgstr "Buffer must be a bytes-like object"
#: extmod/ulab/code/ulab_create.c extmod/ulab/code/utils/utils.c
msgid "buffer size must be a multiple of element size"
msgstr "Buffer size must be a multiple of element size"
@ -2627,6 +2621,10 @@ msgstr "Can't assign to expression"
msgid "can't convert %q to %q"
msgstr "Can't convert %q to %q"
#: py/runtime.c
msgid "can't convert %q to int"
msgstr ""
#: py/objstr.c
msgid "can't convert '%q' object to %q implicitly"
msgstr "Can't convert '%q' object to %q implicitly"
@ -2635,6 +2633,10 @@ msgstr "Can't convert '%q' object to %q implicitly"
msgid "can't convert to %q"
msgstr "Can't convert to %q"
#: py/runtime.c
msgid "can't convert to int"
msgstr ""
#: py/objstr.c
msgid "can't convert to str implicitly"
msgstr "Can't convert to str implicitly"
@ -2988,7 +2990,7 @@ msgid "f-string: single '}' is not allowed"
msgstr "f-string: single '}' is not allowed"
#: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c
#: shared-bindings/displayio/OnDiskBitmap.c
#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c
msgid "file must be a file opened in byte mode"
msgstr "file must be a file opened in byte mode"
@ -3041,8 +3043,8 @@ msgid "full"
msgstr "full"
#: py/argcheck.c
msgid "function does not take keyword arguments"
msgstr "function does not take keyword arguments"
msgid "function doesn't take keyword arguments"
msgstr ""
#: py/argcheck.c
#, c-format
@ -3096,6 +3098,10 @@ msgstr "generator already executing"
msgid "generator ignored GeneratorExit"
msgstr "generator ignored GeneratorExit"
#: py/objgenerator.c
msgid "generator raised StopIteration"
msgstr ""
#: shared-bindings/_stage/Layer.c
msgid "graphic must be 2048 bytes long"
msgstr "graphic must be 2048 bytes long"
@ -3244,6 +3250,10 @@ msgstr "invalid bits_per_pixel %d, must be, 1, 4, 8, 16, 24, or 32"
msgid "invalid cert"
msgstr "invalid cert"
#: py/compile.c
msgid "invalid decorator"
msgstr ""
#: extmod/uos_dupterm.c
msgid "invalid dupterm index"
msgstr "invalid dupterm index"
@ -3300,10 +3310,6 @@ msgstr "invalid syntax for integer with base %d"
msgid "invalid syntax for number"
msgstr "invalid syntax for number"
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "io must be rtc io"
msgstr "io must be rtc io"
#: py/objtype.c
msgid "issubclass() arg 1 must be a class"
msgstr "issubclass() arg 1 must be a class"
@ -3476,6 +3482,10 @@ msgstr "native yield"
msgid "need more than %d values to unpack"
msgstr "need more than %d values to unpack"
#: py/modmath.c
msgid "negative factorial"
msgstr ""
#: py/objint_longlong.c py/objint_mpz.c py/runtime.c
msgid "negative power with no float support"
msgstr "negative power with no float support"
@ -3705,10 +3715,6 @@ msgstr "palette must be 32 bytes long"
msgid "palette_index should be an int"
msgstr "palette_index should be an int"
#: py/compile.c
msgid "parameter annotation must be an identifier"
msgstr "parameter annotation must be an identifier"
#: py/emitinlinextensa.c
msgid "parameters must be registers in sequence a2 to a5"
msgstr "parameters must be registers in sequence a2 to a5"
@ -3763,6 +3769,8 @@ msgstr "pow() with 3 arguments requires integers"
#: ports/esp32s2/boards/adafruit_funhouse/mpconfigboard.h
#: ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h
#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h
#: ports/esp32s2/boards/artisense_rd00/mpconfigboard.h
#: ports/esp32s2/boards/atmegazero_esp32s2/mpconfigboard.h
#: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h
#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h
#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h
@ -3788,6 +3796,10 @@ msgstr "pressing boot button at start up.\n"
msgid "pressing both buttons at start up.\n"
msgstr "pressing both buttons at start up.\n"
#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h
msgid "pressing the left button at start up\n"
msgstr ""
#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
msgid "pull masks conflict with direction masks"
msgstr "pull masks conflict with direction masks"
@ -4063,10 +4075,6 @@ msgstr "trapz is defined for 1D arrays"
msgid "trapz is defined for 1D arrays of equal length"
msgstr "trapz is defined for 1D arrays of equal length"
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "trigger level must be 0 or 1"
msgstr "trigger level must be 0 or 1"
#: py/obj.c
msgid "tuple/list has wrong length"
msgstr "tuple/list has wrong length"
@ -4148,7 +4156,7 @@ msgstr "unknown format code '%c' for object of type '%q'"
msgid "unknown type"
msgstr "unknown type"
#: py/emitnative.c
#: py/compile.c
msgid "unknown type '%q'"
msgstr "unknown type '%q'"
@ -4201,10 +4209,6 @@ msgstr "value must fit in %d byte(s)"
msgid "value_count must be > 0"
msgstr "value_count must be > 0"
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "wakeup conflict"
msgstr "wakeup conflict"
#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c
msgid "watchdog not initialized"
msgstr "WatchDog not initialised"
@ -4291,6 +4295,46 @@ msgstr "zi must be of float type"
msgid "zi must be of shape (n_section, 2)"
msgstr "zi must be of shape (n_section, 2)"
#~ msgid "Viper functions don't currently support more than 4 arguments"
#~ msgstr "Viper functions don't currently support more than 4 arguments"
#~ msgid "address %08x is not aligned to %d bytes"
#~ msgstr "address %08x is not aligned to %d bytes"
#~ msgid "function does not take keyword arguments"
#~ msgstr "function does not take keyword arguments"
#~ msgid "parameter annotation must be an identifier"
#~ msgstr "parameter annotation must be an identifier"
#~ msgid "Total data to write is larger than outgoing_packet_length"
#~ msgstr "Total data to write is larger than outgoing_packet_length"
#~ msgid "IOs 0, 2 & 4 do not support internal pullup in sleep"
#~ msgstr "IOs 0, 2 & 4 do not support internal pullup in sleep"
#~ msgid "buffer must be a bytes-like object"
#~ msgstr "Buffer must be a bytes-like object"
#~ msgid "io must be rtc io"
#~ msgstr "io must be rtc io"
#~ msgid "trigger level must be 0 or 1"
#~ msgstr "trigger level must be 0 or 1"
#~ msgid "wakeup conflict"
#~ msgstr "wakeup conflict"
#~ msgid "Attempted heap allocation when MicroPython VM not running."
#~ msgstr "Attempted heap allocation when MicroPython VM not running."
#~ msgid "MicroPython NLR jump failed. Likely memory corruption."
#~ msgstr "MicroPython NLR jump failed. Likely memory corruption."
#, fuzzy
#~ msgid "MicroPython fatal error."
#~ msgstr "CircuitPython fatal error."
#~ msgid "argument must be ndarray"
#~ msgstr "argument must be ndarray"

View File

@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-01-04 12:55-0600\n"
"PO-Revision-Date: 2021-04-05 22:35+0000\n"
"PO-Revision-Date: 2021-04-22 17:16+0000\n"
"Last-Translator: Jose David M <jquintana202020@gmail.com>\n"
"Language-Team: \n"
"Language: es\n"
@ -16,7 +16,7 @@ msgstr ""
"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.6-dev\n"
"X-Generator: Weblate 4.7-dev\n"
#: main.c
msgid ""
@ -426,7 +426,7 @@ msgstr "El pin proporcionado no soporta AnalogOut"
#: ports/stm/common-hal/audiopwmio/PWMAudioOut.c
msgid "Another PWMAudioOut is already active"
msgstr ""
msgstr "Otra salida PWMAudioOut esta ya activada"
#: ports/atmel-samd/common-hal/pulseio/PulseOut.c
#: ports/cxd56/common-hal/pulseio/PulseOut.c
@ -451,10 +451,8 @@ msgid "Attempt to allocate %d blocks"
msgstr "Tratando de localizar %d bloques"
#: supervisor/shared/safe_mode.c
msgid "Attempted heap allocation when MicroPython VM not running."
msgstr ""
"Se intentó asignación del montículo, sin que la VM de MicroPython esté "
"ejecutando."
msgid "Attempted heap allocation when VM not running."
msgstr "Asignación del montículo mientras la VM no esta ejecutándose."
#: shared-bindings/wifi/Radio.c
msgid "Authentication failure"
@ -905,6 +903,11 @@ msgstr "Fallo ESP-IDF al tomar la memoria"
msgid "EXTINT channel already in use"
msgstr "El canal EXTINT ya está siendo utilizado"
#: shared-module/synthio/MidiTrack.c
#, c-format
msgid "Error in MIDI stream at position %d"
msgstr "Error en el flujo MIDI en la posición %d"
#: extmod/modure.c
msgid "Error in regex"
msgstr "Error en regex"
@ -1007,7 +1010,7 @@ msgstr "Fallo al tomar memoria para búsqueda wifi"
#: ports/stm/common-hal/audiopwmio/PWMAudioOut.c
msgid "Failed to buffer the sample"
msgstr ""
msgstr "Fallo al hacer el búfer de la muestra"
#: ports/nrf/common-hal/_bleio/Adapter.c
msgid "Failed to connect: internal error"
@ -1034,6 +1037,10 @@ msgstr "No se puede liberar el mutex, err 0x%04x"
msgid "Failed to write internal flash."
msgstr "Error al escribir el flash interno."
#: supervisor/shared/safe_mode.c
msgid "Fatal error."
msgstr "Error grave."
#: py/moduerrno.c
msgid "File exists"
msgstr "El archivo ya existe"
@ -1107,10 +1114,6 @@ msgstr "Dispositivo I2C en uso"
msgid "I2SOut not available"
msgstr "I2SOut no disponible"
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "IOs 0, 2 & 4 do not support internal pullup in sleep"
msgstr "IOs 0, 2 y 4 no soportan pullup interno durante sleep"
#: shared-bindings/aesio/aes.c
#, c-format
msgid "IV must be %d bytes long"
@ -1243,6 +1246,10 @@ msgstr "BSSID inválido"
msgid "Invalid DAC pin supplied"
msgstr "Pin suministrado inválido para DAC"
#: shared-bindings/synthio/__init__.c
msgid "Invalid MIDI file"
msgstr "Archivo MIDI inválido"
#: ports/atmel-samd/common-hal/pwmio/PWMOut.c
#: ports/cxd56/common-hal/pwmio/PWMOut.c
#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c
@ -1434,14 +1441,6 @@ msgstr "Valor máximo de x cuando se refleja es %d"
msgid "Messages limited to 8 bytes"
msgstr "Mensajes limitados a 8 bytes"
#: supervisor/shared/safe_mode.c
msgid "MicroPython NLR jump failed. Likely memory corruption."
msgstr "MicroPython NLR jump falló. Probable corrupción de la memoria."
#: supervisor/shared/safe_mode.c
msgid "MicroPython fatal error."
msgstr "Error fatal de MicroPython."
#: shared-bindings/audiobusio/PDMIn.c
msgid "Microphone startup delay must be in range 0.0 to 1.0"
msgstr "Micrófono demora de inicio debe estar en el rango 0.0 a 1.0"
@ -1497,6 +1496,10 @@ msgstr "Debe proporcionar un pin MISO o MOSI"
msgid "Must use a multiple of 6 rgb pins, not %d"
msgstr "Debe usar un múltiplo de 6 pines rgb, no %d"
#: supervisor/shared/safe_mode.c
msgid "NLR jump failed. Likely memory corruption."
msgstr "Salto NLR falló. Probablemente corrupción de memoria."
#: ports/esp32s2/common-hal/nvm/ByteArray.c
msgid "NVS Error"
msgstr "Error NVS"
@ -1641,6 +1644,7 @@ msgstr "El firmware del sistema Nordic no tiene memoria"
msgid "Not a valid IP string"
msgstr "No es una cadena de IP válida"
#: ports/nrf/common-hal/_bleio/PacketBuffer.c
#: ports/nrf/common-hal/_bleio/__init__.c
#: shared-bindings/_bleio/CharacteristicBuffer.c
msgid "Not connected"
@ -2194,9 +2198,8 @@ msgid "Too many displays"
msgstr "Muchos displays"
#: ports/nrf/common-hal/_bleio/PacketBuffer.c
msgid "Total data to write is larger than outgoing_packet_length"
msgstr ""
"Los datos totales a escribir son más grandes que outgoing_packet_length"
msgid "Total data to write is larger than %q"
msgstr "La cantidad total de datos es mas grande que %q"
#: py/obj.c
msgid "Traceback (most recent call last):\n"
@ -2369,10 +2372,6 @@ msgstr "Tamaño de valor > max_length"
msgid "Version was invalid"
msgstr "La versión era invalida"
#: py/emitnative.c
msgid "Viper functions don't currently support more than 4 arguments"
msgstr "funciones Viper no soportan por el momento, más de 4 argumentos"
#: ports/stm/common-hal/microcontroller/Processor.c
msgid "Voltage read timed out"
msgstr "Tiempo de espera agotado para lectura de voltaje"
@ -2461,11 +2460,6 @@ msgstr "se requiere un objeto bytes-like"
msgid "abort() called"
msgstr "se llamó abort()"
#: extmod/machine_mem.c
#, c-format
msgid "address %08x is not aligned to %d bytes"
msgstr "la dirección %08x no esta alineada a %d bytes"
#: shared-bindings/i2cperipheral/I2CPeripheral.c
msgid "address out of bounds"
msgstr "address fuera de límites"
@ -2474,6 +2468,10 @@ msgstr "address fuera de límites"
msgid "addresses is empty"
msgstr "addresses esta vacío"
#: py/compile.c
msgid "annotation must be an identifier"
msgstr ""
#: py/modbuiltins.c
msgid "arg is an empty sequence"
msgstr "argumento es una secuencia vacía"
@ -2573,10 +2571,6 @@ msgstr "la rama no está dentro del rango"
msgid "buffer is smaller than requested size"
msgstr "El buffer es mas pequeño que el requerido"
#: shared-bindings/audiocore/RawSample.c
msgid "buffer must be a bytes-like object"
msgstr "buffer debe de ser un objeto bytes-like"
#: extmod/ulab/code/ulab_create.c extmod/ulab/code/utils/utils.c
msgid "buffer size must be a multiple of element size"
msgstr "El tamaño del buffer debe ser un múltiplo del tamaño del elemento"
@ -2660,6 +2654,10 @@ msgstr "no se puede asignar a la expresión"
msgid "can't convert %q to %q"
msgstr "no puede convertir %q a %q"
#: py/runtime.c
msgid "can't convert %q to int"
msgstr ""
#: py/objstr.c
msgid "can't convert '%q' object to %q implicitly"
msgstr "no se puede convertir el objeto '%q' a %q implícitamente"
@ -2668,6 +2666,10 @@ msgstr "no se puede convertir el objeto '%q' a %q implícitamente"
msgid "can't convert to %q"
msgstr "no puede convertir a %q"
#: py/runtime.c
msgid "can't convert to int"
msgstr "no se puede convertir a int"
#: py/objstr.c
msgid "can't convert to str implicitly"
msgstr "no se puede convertir a str implícitamente"
@ -3025,7 +3027,7 @@ msgid "f-string: single '}' is not allowed"
msgstr "cadena-f: solo '}' no está permitido"
#: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c
#: shared-bindings/displayio/OnDiskBitmap.c
#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c
msgid "file must be a file opened in byte mode"
msgstr "el archivo deberia ser una archivo abierto en modo byte"
@ -3078,8 +3080,8 @@ msgid "full"
msgstr "lleno"
#: py/argcheck.c
msgid "function does not take keyword arguments"
msgstr "la función no tiene argumentos por palabra clave"
msgid "function doesn't take keyword arguments"
msgstr ""
#: py/argcheck.c
#, c-format
@ -3133,6 +3135,10 @@ msgstr "generador ya se esta ejecutando"
msgid "generator ignored GeneratorExit"
msgstr "generador ignorado GeneratorExit"
#: py/objgenerator.c
msgid "generator raised StopIteration"
msgstr ""
#: shared-bindings/_stage/Layer.c
msgid "graphic must be 2048 bytes long"
msgstr "graphic debe ser 2048 bytes de largo"
@ -3281,6 +3287,10 @@ msgstr "los bits_per_pixel %d no son validos, deben ser 1, 4, 8, 16, 24 o 32"
msgid "invalid cert"
msgstr "certificado inválido"
#: py/compile.c
msgid "invalid decorator"
msgstr "decorador invalido"
#: extmod/uos_dupterm.c
msgid "invalid dupterm index"
msgstr "index dupterm inválido"
@ -3336,10 +3346,6 @@ msgstr "sintaxis inválida para entero con base %d"
msgid "invalid syntax for number"
msgstr "sintaxis inválida para número"
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "io must be rtc io"
msgstr "io debe ser rtc io"
#: py/objtype.c
msgid "issubclass() arg 1 must be a class"
msgstr "issubclass() arg 1 debe ser una clase"
@ -3516,6 +3522,10 @@ msgstr "yield nativo"
msgid "need more than %d values to unpack"
msgstr "necesita más de %d valores para descomprimir"
#: py/modmath.c
msgid "negative factorial"
msgstr ""
#: py/objint_longlong.c py/objint_mpz.c py/runtime.c
msgid "negative power with no float support"
msgstr "potencia negativa sin float support"
@ -3748,10 +3758,6 @@ msgstr "palette debe ser 32 bytes de largo"
msgid "palette_index should be an int"
msgstr "palette_index deberia ser un int"
#: py/compile.c
msgid "parameter annotation must be an identifier"
msgstr "parámetro de anotación debe ser un identificador"
#: py/emitinlinextensa.c
msgid "parameters must be registers in sequence a2 to a5"
msgstr "los parámetros deben ser registros en secuencia de a2 a a5"
@ -3806,6 +3812,8 @@ msgstr "pow() con 3 argumentos requiere enteros"
#: ports/esp32s2/boards/adafruit_funhouse/mpconfigboard.h
#: ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h
#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h
#: ports/esp32s2/boards/artisense_rd00/mpconfigboard.h
#: ports/esp32s2/boards/atmegazero_esp32s2/mpconfigboard.h
#: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h
#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h
#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h
@ -3831,6 +3839,10 @@ msgstr "presionando botón de arranque al inicio.\n"
msgid "pressing both buttons at start up.\n"
msgstr "presionando ambos botones al inicio.\n"
#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h
msgid "pressing the left button at start up\n"
msgstr "presione el botón izquierdo al arranque\n"
#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
msgid "pull masks conflict with direction masks"
msgstr "máscara de pull en conflicto con máscara de dirección"
@ -4107,10 +4119,6 @@ msgstr "trapz esta definido para matrices 1D"
msgid "trapz is defined for 1D arrays of equal length"
msgstr "trapz está definido para arreglos 1D de igual tamaño"
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "trigger level must be 0 or 1"
msgstr "nivel de accionamiento debe ser 0 o 1"
#: py/obj.c
msgid "tuple/list has wrong length"
msgstr "tupla/lista tiene una longitud incorrecta"
@ -4192,7 +4200,7 @@ msgstr "formato de código desconocicdo '%c' para objeto de tipo '%q'"
msgid "unknown type"
msgstr "tipo desconocido"
#: py/emitnative.c
#: py/compile.c
msgid "unknown type '%q'"
msgstr "tipo desconocido '%q'"
@ -4245,10 +4253,6 @@ msgstr "el valor debe caber en %d byte(s)"
msgid "value_count must be > 0"
msgstr "value_count debe ser > 0"
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "wakeup conflict"
msgstr "conflicto de wakeup"
#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c
msgid "watchdog not initialized"
msgstr "watchdog no inicializado"
@ -4335,6 +4339,48 @@ msgstr "zi debe ser de tipo flotante"
msgid "zi must be of shape (n_section, 2)"
msgstr "zi debe ser una forma (n_section,2)"
#~ msgid "Viper functions don't currently support more than 4 arguments"
#~ msgstr "funciones Viper no soportan por el momento, más de 4 argumentos"
#~ msgid "address %08x is not aligned to %d bytes"
#~ msgstr "la dirección %08x no esta alineada a %d bytes"
#~ msgid "function does not take keyword arguments"
#~ msgstr "la función no tiene argumentos por palabra clave"
#~ msgid "parameter annotation must be an identifier"
#~ msgstr "parámetro de anotación debe ser un identificador"
#~ msgid "Total data to write is larger than outgoing_packet_length"
#~ msgstr ""
#~ "Los datos totales a escribir son más grandes que outgoing_packet_length"
#~ msgid "IOs 0, 2 & 4 do not support internal pullup in sleep"
#~ msgstr "IOs 0, 2 y 4 no soportan pullup interno durante sleep"
#~ msgid "buffer must be a bytes-like object"
#~ msgstr "buffer debe de ser un objeto bytes-like"
#~ msgid "io must be rtc io"
#~ msgstr "io debe ser rtc io"
#~ msgid "trigger level must be 0 or 1"
#~ msgstr "nivel de accionamiento debe ser 0 o 1"
#~ msgid "wakeup conflict"
#~ msgstr "conflicto de wakeup"
#~ msgid "Attempted heap allocation when MicroPython VM not running."
#~ msgstr ""
#~ "Se intentó asignación del montículo, sin que la VM de MicroPython esté "
#~ "ejecutando."
#~ msgid "MicroPython NLR jump failed. Likely memory corruption."
#~ msgstr "MicroPython NLR jump falló. Probable corrupción de la memoria."
#~ msgid "MicroPython fatal error."
#~ msgstr "Error fatal de MicroPython."
#~ msgid "argument must be ndarray"
#~ msgstr "argumento debe ser ndarray"
@ -4600,9 +4646,6 @@ msgstr "zi debe ser una forma (n_section,2)"
#~ msgid "can't convert to float"
#~ msgstr "no se puede convertir a float"
#~ msgid "can't convert to int"
#~ msgstr "no se puede convertir a int"
#~ msgid "object '%s' is not a tuple or list"
#~ msgstr "el objeto '%s' no es una tupla o lista"

View File

@ -441,7 +441,7 @@ msgid "Attempt to allocate %d blocks"
msgstr ""
#: supervisor/shared/safe_mode.c
msgid "Attempted heap allocation when MicroPython VM not running."
msgid "Attempted heap allocation when VM not running."
msgstr ""
#: shared-bindings/wifi/Radio.c
@ -890,6 +890,11 @@ msgstr ""
msgid "EXTINT channel already in use"
msgstr "Ginagamit na ang EXTINT channel"
#: shared-module/synthio/MidiTrack.c
#, c-format
msgid "Error in MIDI stream at position %d"
msgstr ""
#: extmod/modure.c
msgid "Error in regex"
msgstr "May pagkakamali sa REGEX"
@ -1021,6 +1026,10 @@ msgstr "Nabigo sa pagrelease ng mutex, status: 0x%08lX"
msgid "Failed to write internal flash."
msgstr ""
#: supervisor/shared/safe_mode.c
msgid "Fatal error."
msgstr ""
#: py/moduerrno.c
msgid "File exists"
msgstr "Mayroong file"
@ -1093,10 +1102,6 @@ msgstr ""
msgid "I2SOut not available"
msgstr ""
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "IOs 0, 2 & 4 do not support internal pullup in sleep"
msgstr ""
#: shared-bindings/aesio/aes.c
#, c-format
msgid "IV must be %d bytes long"
@ -1222,6 +1227,10 @@ msgstr ""
msgid "Invalid DAC pin supplied"
msgstr ""
#: shared-bindings/synthio/__init__.c
msgid "Invalid MIDI file"
msgstr ""
#: ports/atmel-samd/common-hal/pwmio/PWMOut.c
#: ports/cxd56/common-hal/pwmio/PWMOut.c
#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c
@ -1413,14 +1422,6 @@ msgstr ""
msgid "Messages limited to 8 bytes"
msgstr ""
#: supervisor/shared/safe_mode.c
msgid "MicroPython NLR jump failed. Likely memory corruption."
msgstr ""
#: supervisor/shared/safe_mode.c
msgid "MicroPython fatal error."
msgstr ""
#: shared-bindings/audiobusio/PDMIn.c
msgid "Microphone startup delay must be in range 0.0 to 1.0"
msgstr "Ang delay ng startup ng mikropono ay dapat na nasa 0.0 hanggang 1.0"
@ -1472,6 +1473,10 @@ msgstr ""
msgid "Must use a multiple of 6 rgb pins, not %d"
msgstr ""
#: supervisor/shared/safe_mode.c
msgid "NLR jump failed. Likely memory corruption."
msgstr ""
#: ports/esp32s2/common-hal/nvm/ByteArray.c
msgid "NVS Error"
msgstr ""
@ -1616,6 +1621,7 @@ msgstr ""
msgid "Not a valid IP string"
msgstr ""
#: ports/nrf/common-hal/_bleio/PacketBuffer.c
#: ports/nrf/common-hal/_bleio/__init__.c
#: shared-bindings/_bleio/CharacteristicBuffer.c
#, fuzzy
@ -2146,7 +2152,7 @@ msgid "Too many displays"
msgstr ""
#: ports/nrf/common-hal/_bleio/PacketBuffer.c
msgid "Total data to write is larger than outgoing_packet_length"
msgid "Total data to write is larger than %q"
msgstr ""
#: py/obj.c
@ -2320,12 +2326,6 @@ msgstr ""
msgid "Version was invalid"
msgstr ""
#: py/emitnative.c
msgid "Viper functions don't currently support more than 4 arguments"
msgstr ""
"Ang mga function ng Viper ay kasalukuyang hindi sumusuporta sa higit sa 4 na "
"argumento"
#: ports/stm/common-hal/microcontroller/Processor.c
msgid "Voltage read timed out"
msgstr ""
@ -2411,11 +2411,6 @@ msgstr "a bytes-like object ay kailangan"
msgid "abort() called"
msgstr "abort() tinawag"
#: extmod/machine_mem.c
#, c-format
msgid "address %08x is not aligned to %d bytes"
msgstr "address %08x ay hindi pantay sa %d bytes"
#: shared-bindings/i2cperipheral/I2CPeripheral.c
msgid "address out of bounds"
msgstr "wala sa sakop ang address"
@ -2424,6 +2419,10 @@ msgstr "wala sa sakop ang address"
msgid "addresses is empty"
msgstr "walang laman ang address"
#: py/compile.c
msgid "annotation must be an identifier"
msgstr ""
#: py/modbuiltins.c
msgid "arg is an empty sequence"
msgstr "arg ay walang laman na sequence"
@ -2523,10 +2522,6 @@ msgstr "branch wala sa range"
msgid "buffer is smaller than requested size"
msgstr ""
#: shared-bindings/audiocore/RawSample.c
msgid "buffer must be a bytes-like object"
msgstr "buffer ay dapat bytes-like object"
#: extmod/ulab/code/ulab_create.c extmod/ulab/code/utils/utils.c
msgid "buffer size must be a multiple of element size"
msgstr ""
@ -2612,6 +2607,10 @@ msgstr "hindi ma i-assign sa expression"
msgid "can't convert %q to %q"
msgstr ""
#: py/runtime.c
msgid "can't convert %q to int"
msgstr ""
#: py/objstr.c
msgid "can't convert '%q' object to %q implicitly"
msgstr "hindi maaaring i-convert ang '%q' na bagay sa %q nang walang pahiwatig"
@ -2620,6 +2619,10 @@ msgstr "hindi maaaring i-convert ang '%q' na bagay sa %q nang walang pahiwatig"
msgid "can't convert to %q"
msgstr ""
#: py/runtime.c
msgid "can't convert to int"
msgstr "hindi ma-convert sa int"
#: py/objstr.c
msgid "can't convert to str implicitly"
msgstr "hindi ma i-convert sa string ng walang pahiwatig"
@ -2980,7 +2983,7 @@ msgid "f-string: single '}' is not allowed"
msgstr ""
#: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c
#: shared-bindings/displayio/OnDiskBitmap.c
#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c
msgid "file must be a file opened in byte mode"
msgstr "file ay dapat buksan sa byte mode"
@ -3033,8 +3036,8 @@ msgid "full"
msgstr "puno"
#: py/argcheck.c
msgid "function does not take keyword arguments"
msgstr "ang function ay hindi kumukuha ng mga argumento ng keyword"
msgid "function doesn't take keyword arguments"
msgstr ""
#: py/argcheck.c
#, c-format
@ -3089,6 +3092,10 @@ msgstr "insinasagawa na ng generator"
msgid "generator ignored GeneratorExit"
msgstr "hindi pinansin ng generator ang GeneratorExit"
#: py/objgenerator.c
msgid "generator raised StopIteration"
msgstr ""
#: shared-bindings/_stage/Layer.c
msgid "graphic must be 2048 bytes long"
msgstr "graphic ay dapat 2048 bytes ang haba"
@ -3237,6 +3244,10 @@ msgstr ""
msgid "invalid cert"
msgstr "mali ang cert"
#: py/compile.c
msgid "invalid decorator"
msgstr ""
#: extmod/uos_dupterm.c
msgid "invalid dupterm index"
msgstr "mali ang dupterm index"
@ -3292,10 +3303,6 @@ msgstr "maling sintaks sa integer na may base %d"
msgid "invalid syntax for number"
msgstr "maling sintaks sa number"
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "io must be rtc io"
msgstr ""
#: py/objtype.c
msgid "issubclass() arg 1 must be a class"
msgstr "issubclass() arg 1 ay dapat na class"
@ -3472,6 +3479,10 @@ msgstr "native yield"
msgid "need more than %d values to unpack"
msgstr "kailangan ng higit sa %d na halaga upang i-unpack"
#: py/modmath.c
msgid "negative factorial"
msgstr ""
#: py/objint_longlong.c py/objint_mpz.c py/runtime.c
msgid "negative power with no float support"
msgstr "negatibong power na walang float support"
@ -3702,10 +3713,6 @@ msgstr "ang palette ay dapat 32 bytes ang haba"
msgid "palette_index should be an int"
msgstr "palette_index ay dapat na int"
#: py/compile.c
msgid "parameter annotation must be an identifier"
msgstr "parameter annotation ay dapat na identifier"
#: py/emitinlinextensa.c
msgid "parameters must be registers in sequence a2 to a5"
msgstr "ang mga parameter ay dapat na nagrerehistro sa sequence a2 hanggang a5"
@ -3761,6 +3768,8 @@ msgstr "pow() na may 3 argumento kailangan ng integers"
#: ports/esp32s2/boards/adafruit_funhouse/mpconfigboard.h
#: ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h
#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h
#: ports/esp32s2/boards/artisense_rd00/mpconfigboard.h
#: ports/esp32s2/boards/atmegazero_esp32s2/mpconfigboard.h
#: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h
#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h
#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h
@ -3786,6 +3795,10 @@ msgstr ""
msgid "pressing both buttons at start up.\n"
msgstr ""
#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h
msgid "pressing the left button at start up\n"
msgstr ""
#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
msgid "pull masks conflict with direction masks"
msgstr ""
@ -4063,10 +4076,6 @@ msgstr ""
msgid "trapz is defined for 1D arrays of equal length"
msgstr ""
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "trigger level must be 0 or 1"
msgstr ""
#: py/obj.c
msgid "tuple/list has wrong length"
msgstr "mali ang haba ng tuple/list"
@ -4148,7 +4157,7 @@ msgstr ""
msgid "unknown type"
msgstr "hindi malaman ang type (unknown type)"
#: py/emitnative.c
#: py/compile.c
msgid "unknown type '%q'"
msgstr "hindi malaman ang type '%q'"
@ -4201,10 +4210,6 @@ msgstr ""
msgid "value_count must be > 0"
msgstr ""
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "wakeup conflict"
msgstr ""
#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c
msgid "watchdog not initialized"
msgstr ""
@ -4293,6 +4298,23 @@ msgstr ""
msgid "zi must be of shape (n_section, 2)"
msgstr ""
#~ msgid "Viper functions don't currently support more than 4 arguments"
#~ msgstr ""
#~ "Ang mga function ng Viper ay kasalukuyang hindi sumusuporta sa higit sa 4 "
#~ "na argumento"
#~ msgid "address %08x is not aligned to %d bytes"
#~ msgstr "address %08x ay hindi pantay sa %d bytes"
#~ msgid "function does not take keyword arguments"
#~ msgstr "ang function ay hindi kumukuha ng mga argumento ng keyword"
#~ msgid "parameter annotation must be an identifier"
#~ msgstr "parameter annotation ay dapat na identifier"
#~ msgid "buffer must be a bytes-like object"
#~ msgstr "buffer ay dapat bytes-like object"
#~ msgid "Group full"
#~ msgstr "Puno ang group"
@ -4367,9 +4389,6 @@ msgstr ""
#~ msgid "can't convert to float"
#~ msgstr "hindi ma-convert sa float"
#~ msgid "can't convert to int"
#~ msgstr "hindi ma-convert sa int"
#~ msgid "object '%s' is not a tuple or list"
#~ msgstr "object '%s' ay hindi tuple o list"

View File

@ -8,14 +8,14 @@ msgstr ""
"Project-Id-Version: 0.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-01-04 12:55-0600\n"
"PO-Revision-Date: 2021-04-03 21:57+0000\n"
"PO-Revision-Date: 2021-04-22 17:16+0000\n"
"Last-Translator: Hugo Dahl <hugo@code-jedi.com>\n"
"Language: fr\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.6-dev\n"
"X-Generator: Weblate 4.7-dev\n"
#: main.c
msgid ""
@ -426,7 +426,7 @@ msgstr "'AnalogOut' n'est pas supporté sur la broche indiquée"
#: ports/stm/common-hal/audiopwmio/PWMAudioOut.c
msgid "Another PWMAudioOut is already active"
msgstr ""
msgstr "Un autre PWMAudioOut est déjà actif"
#: ports/atmel-samd/common-hal/pulseio/PulseOut.c
#: ports/cxd56/common-hal/pulseio/PulseOut.c
@ -435,11 +435,11 @@ msgstr "Un autre envoi est déjà actif"
#: shared-bindings/pulseio/PulseOut.c
msgid "Array must contain halfwords (type 'H')"
msgstr "Le tableau doit contenir des demi-mots (type 'H')"
msgstr "La matrice doit contenir des demi-mots (type 'H')"
#: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c
msgid "Array values should be single bytes."
msgstr "Les valeurs du tableau doivent être des octets singuliers."
msgstr "Les valeurs de la matrice doivent être des octets singuliers."
#: shared-bindings/microcontroller/Pin.c
msgid "At most %d %q may be specified (not %d)"
@ -451,10 +451,10 @@ msgid "Attempt to allocate %d blocks"
msgstr "Tentative d'allocation de %d blocs"
#: supervisor/shared/safe_mode.c
msgid "Attempted heap allocation when MicroPython VM not running."
msgid "Attempted heap allocation when VM not running."
msgstr ""
"Tentative d'allocation de segments lorsque la machine virtuelle MicroPython "
"n'est pas en cours d'exécution."
"Tentative d'allocation à la pile quand la Machine Virtuelle n'est pas en "
"exécution."
#: shared-bindings/wifi/Radio.c
msgid "Authentication failure"
@ -911,6 +911,11 @@ msgstr "ESP-IDF échec d'allocation de la mémoire"
msgid "EXTINT channel already in use"
msgstr "Canal EXTINT déjà utilisé"
#: shared-module/synthio/MidiTrack.c
#, c-format
msgid "Error in MIDI stream at position %d"
msgstr "Erreur dans le flot MIDI à la position %d"
#: extmod/modure.c
msgid "Error in regex"
msgstr "Erreur dans l'expression régulière"
@ -973,7 +978,7 @@ msgstr "La FFT est définie uniquement pour les ndarrays"
#: extmod/ulab/code/numpy/fft/fft_tools.c
msgid "FFT is implemented for linear arrays only"
msgstr "FFT n'est implémenté que pour les tableaux linéaires"
msgstr "FFT n'est implémenté que pour les matrices linéaires"
#: ports/esp32s2/common-hal/ssl/SSLSocket.c
msgid "Failed SSL handshake"
@ -1014,7 +1019,7 @@ msgstr "Impossible d'allouer la mémoire pour le scan wifi"
#: ports/stm/common-hal/audiopwmio/PWMAudioOut.c
msgid "Failed to buffer the sample"
msgstr ""
msgstr "Échec du tamponage de l'échantillon"
#: ports/nrf/common-hal/_bleio/Adapter.c
msgid "Failed to connect: internal error"
@ -1041,6 +1046,10 @@ msgstr "Impossible de libérer mutex, err 0x%04x"
msgid "Failed to write internal flash."
msgstr "Échec de l'écriture vers flash interne."
#: supervisor/shared/safe_mode.c
msgid "Fatal error."
msgstr "Erreurre fatale."
#: py/moduerrno.c
msgid "File exists"
msgstr "Le fichier existe"
@ -1115,10 +1124,6 @@ msgstr "périphérique I2C utilisé"
msgid "I2SOut not available"
msgstr "I2SOut n'est pas disponible"
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "IOs 0, 2 & 4 do not support internal pullup in sleep"
msgstr "IOs 0, 2 & 4 ne supportent pas l'éleveuse interne en mode someil"
#: shared-bindings/aesio/aes.c
#, c-format
msgid "IV must be %d bytes long"
@ -1253,6 +1258,10 @@ msgstr "BSSID invalide"
msgid "Invalid DAC pin supplied"
msgstr "Broche DAC non valide fournie"
#: shared-bindings/synthio/__init__.c
msgid "Invalid MIDI file"
msgstr "Fichier MIDI invalide"
#: ports/atmel-samd/common-hal/pwmio/PWMOut.c
#: ports/cxd56/common-hal/pwmio/PWMOut.c
#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c
@ -1444,14 +1453,6 @@ msgstr "La valeur maximale de x est %d lors d'une opération miroir"
msgid "Messages limited to 8 bytes"
msgstr "Messages limités à 8 octets"
#: supervisor/shared/safe_mode.c
msgid "MicroPython NLR jump failed. Likely memory corruption."
msgstr "Échec du saut MicroPython NLR. Corruption de la mémoire probable."
#: supervisor/shared/safe_mode.c
msgid "MicroPython fatal error."
msgstr "Erreur fatale MicroPython."
#: shared-bindings/audiobusio/PDMIn.c
msgid "Microphone startup delay must be in range 0.0 to 1.0"
msgstr "Le délais au démarrage du micro doit être entre 0.0 et 1.0"
@ -1505,6 +1506,10 @@ msgstr "Doit fournir une broche MISO ou MOSI"
msgid "Must use a multiple of 6 rgb pins, not %d"
msgstr "Doit utiliser un multiple de 6 broches RVB, pas %d"
#: supervisor/shared/safe_mode.c
msgid "NLR jump failed. Likely memory corruption."
msgstr "Saut NLR échoué. Corruption de mémoire probable."
#: ports/esp32s2/common-hal/nvm/ByteArray.c
msgid "NVS Error"
msgstr "Erreur NVS"
@ -1649,6 +1654,7 @@ msgstr "Logiciel systême Nordic hors de mémoire"
msgid "Not a valid IP string"
msgstr "Chaîne IP non valide"
#: ports/nrf/common-hal/_bleio/PacketBuffer.c
#: ports/nrf/common-hal/_bleio/__init__.c
#: shared-bindings/_bleio/CharacteristicBuffer.c
msgid "Not connected"
@ -2203,9 +2209,8 @@ msgid "Too many displays"
msgstr "Trop d'affichages"
#: ports/nrf/common-hal/_bleio/PacketBuffer.c
msgid "Total data to write is larger than outgoing_packet_length"
msgstr ""
"Le nombre total de données à écrire est supérieur à outgoing_packet_length"
msgid "Total data to write is larger than %q"
msgstr "Quantité de données à écrire est plus que %q"
#: py/obj.c
msgid "Traceback (most recent call last):\n"
@ -2382,11 +2387,6 @@ msgstr "Longueur de la valeur > max_length"
msgid "Version was invalid"
msgstr "Version est invalide"
#: py/emitnative.c
msgid "Viper functions don't currently support more than 4 arguments"
msgstr ""
"les fonctions de Viper ne supportent pas plus de 4 arguments actuellement"
#: ports/stm/common-hal/microcontroller/Processor.c
msgid "Voltage read timed out"
msgstr "La lecture de la tension a expiré"
@ -2475,11 +2475,6 @@ msgstr "un objet 'bytes-like' est requis"
msgid "abort() called"
msgstr "abort() appelé"
#: extmod/machine_mem.c
#, c-format
msgid "address %08x is not aligned to %d bytes"
msgstr "l'adresse %08x n'est pas alignée sur %d octets"
#: shared-bindings/i2cperipheral/I2CPeripheral.c
msgid "address out of bounds"
msgstr "adresse hors limites"
@ -2488,17 +2483,21 @@ msgstr "adresse hors limites"
msgid "addresses is empty"
msgstr "adresses vides"
#: py/compile.c
msgid "annotation must be an identifier"
msgstr ""
#: py/modbuiltins.c
msgid "arg is an empty sequence"
msgstr "l'argument est une séquence vide"
#: extmod/ulab/code/numpy/numerical/numerical.c
msgid "argsort argument must be an ndarray"
msgstr "L'argument argsort doit être un ndarray"
msgstr "Le paramêtre argsort doit être un ndarray"
#: extmod/ulab/code/numpy/numerical/numerical.c
msgid "argsort is not implemented for flattened arrays"
msgstr "argsort n'est pas mis en œuvre pour les tableaux aplatis"
msgstr "argsort n'est pas mis en œuvre pour les matrices aplatis"
#: py/runtime.c
msgid "argument has wrong type"
@ -2520,12 +2519,12 @@ msgstr "les paramètres doivent être des ndarrays"
#: extmod/ulab/code/ndarray.c
msgid "array and index length must be equal"
msgstr "la longueur du tableau et de l'index doivent être égaux"
msgstr "la taille de la matrice et de l'index doivent être égaux"
#: py/objarray.c shared-bindings/alarm/SleepMemory.c
#: shared-bindings/nvm/ByteArray.c
msgid "array/bytes required on right side"
msgstr "tableau/octets requis à droite"
msgstr "matrice/octets requis à la droite"
#: extmod/ulab/code/numpy/numerical/numerical.c
msgid "attempt to get (arg)min/(arg)max of empty sequence"
@ -2587,10 +2586,6 @@ msgstr "branche hors-bornes"
msgid "buffer is smaller than requested size"
msgstr "tampon est plus petit que la taille demandée"
#: shared-bindings/audiocore/RawSample.c
msgid "buffer must be a bytes-like object"
msgstr "le tampon doit être un objet bytes-like"
#: extmod/ulab/code/ulab_create.c extmod/ulab/code/utils/utils.c
msgid "buffer size must be a multiple of element size"
msgstr "taille du tampon doit être un multiple de la taille de l'élement"
@ -2675,6 +2670,10 @@ msgstr "ne peut pas assigner à une expression"
msgid "can't convert %q to %q"
msgstr "impossible de convertir %q en %q"
#: py/runtime.c
msgid "can't convert %q to int"
msgstr ""
#: py/objstr.c
msgid "can't convert '%q' object to %q implicitly"
msgstr "impossible de convertir l'objet '%q' en '%q' implicitement"
@ -2683,6 +2682,10 @@ msgstr "impossible de convertir l'objet '%q' en '%q' implicitement"
msgid "can't convert to %q"
msgstr "impossible de convertir en %q"
#: py/runtime.c
msgid "can't convert to int"
msgstr "ne peut convertir en entier 'int'"
#: py/objstr.c
msgid "can't convert to str implicitly"
msgstr "impossible de convertir en chaine 'str' implicitement"
@ -2828,8 +2831,7 @@ msgstr ""
#: shared-bindings/displayio/Palette.c
msgid "color buffer must be a bytearray or array of type 'b' or 'B'"
msgstr ""
"le tampon de couleur doit être un bytearray ou un tableau de type 'b' ou 'B'"
msgstr "tampon color doit être un bytearray ou une matrice de type 'b' ou 'B'"
#: shared-bindings/displayio/Palette.c
msgid "color must be between 0x000000 and 0xffffff"
@ -2861,11 +2863,11 @@ msgstr "conversion en objet"
#: extmod/ulab/code/numpy/filter/filter.c
msgid "convolve arguments must be linear arrays"
msgstr "les arguments convolve doivent être des tableaux linéaires"
msgstr "les paramêtres pour convolve doivent être des matrices linéaires"
#: extmod/ulab/code/numpy/filter/filter.c
msgid "convolve arguments must be ndarrays"
msgstr "les arguments convolve doivent être des ndarrays"
msgstr "les paramêtres pour convolve doivent être des ndarrays"
#: extmod/ulab/code/numpy/filter/filter.c
msgid "convolve arguments must not be empty"
@ -2881,7 +2883,7 @@ msgstr "impossible de déterminer la version de la carte SD"
#: extmod/ulab/code/numpy/numerical/numerical.c
msgid "cross is defined for 1D arrays of length 3"
msgstr "cross est défini pour les tableaux 1D de longueur 3"
msgstr "cross est défini pour les matrices 1D de longueur 3"
#: extmod/ulab/code/scipy/optimize/optimize.c
msgid "data must be iterable"
@ -2911,12 +2913,13 @@ msgstr "default n'est pas une fonction"
msgid ""
"destination buffer must be a bytearray or array of type 'B' for bit_depth = 8"
msgstr ""
"le tampon de destination doit être un tableau de type 'B' pour bit_depth = 8"
"le tampon de destination doit être une matrice de type 'B' pour bit_depth = 8"
#: shared-bindings/audiobusio/PDMIn.c
msgid "destination buffer must be an array of type 'H' for bit_depth = 16"
msgstr ""
"le tampon de destination doit être un tableau de type 'H' pour bit_depth = 16"
"le tampon de destination doit être une matrice de type 'H' pour bit_depth = "
"16"
#: shared-bindings/audiobusio/PDMIn.c
msgid "destination_length must be an int >= 0"
@ -2928,7 +2931,7 @@ msgstr "la séquence de mise à jour de dict a une mauvaise longueur"
#: extmod/ulab/code/numpy/numerical/numerical.c
msgid "diff argument must be an ndarray"
msgstr "l'argument diff doit être un ndarray"
msgstr "le paramêtre diff doit être un ndarray"
#: extmod/ulab/code/numpy/numerical/numerical.c
msgid "differentiation order out of range"
@ -3047,7 +3050,7 @@ msgid "f-string: single '}' is not allowed"
msgstr "f-string : single '}' n'est pas autorisé"
#: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c
#: shared-bindings/displayio/OnDiskBitmap.c
#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c
msgid "file must be a file opened in byte mode"
msgstr "le fichier doit être un fichier ouvert en mode 'byte'"
@ -3065,11 +3068,11 @@ msgstr "le premier argument doit être une fonction"
#: extmod/ulab/code/ulab_create.c
msgid "first argument must be a tuple of ndarrays"
msgstr "le premier argument doit être un tuple de ndarrays"
msgstr "le premier paramêtre doit être un tuple de ndarrays"
#: extmod/ulab/code/numpy/vector/vector.c
msgid "first argument must be an ndarray"
msgstr "le premier argument doit être un ndarray"
msgstr "le premier paramêtre doit être un ndarray"
#: py/objtype.c
msgid "first argument to super() must be type"
@ -3081,7 +3084,7 @@ msgstr "l'ordre d'aplatissement doit être «C» ou «F»"
#: extmod/ulab/code/numpy/numerical/numerical.c
msgid "flip argument must be an ndarray"
msgstr "l'argument flip doit être un ndarray"
msgstr "le paramêtre flip doit être un ndarray"
#: py/objint.c
msgid "float too big"
@ -3100,8 +3103,8 @@ msgid "full"
msgstr "plein"
#: py/argcheck.c
msgid "function does not take keyword arguments"
msgstr "la fonction ne prend pas d'arguments nommés"
msgid "function doesn't take keyword arguments"
msgstr ""
#: py/argcheck.c
#, c-format
@ -3118,7 +3121,7 @@ msgstr "la fonction a le même signe aux extrémités de lintervalle"
#: extmod/ulab/code/ndarray.c
msgid "function is defined for ndarrays only"
msgstr "La fonction n'est définie que pour les ndarrays"
msgstr "fonction définie que pour les ndarrays"
#: py/argcheck.c
#, c-format
@ -3155,6 +3158,10 @@ msgstr "générateur déjà en cours d'exécution"
msgid "generator ignored GeneratorExit"
msgstr "le générateur a ignoré GeneratorExit"
#: py/objgenerator.c
msgid "generator raised StopIteration"
msgstr ""
#: shared-bindings/_stage/Layer.c
msgid "graphic must be 2048 bytes long"
msgstr "graphic doit être long de 2048 octets"
@ -3224,11 +3231,11 @@ msgstr "Paramètre entrant doit être un chiffre entier, un tuple, ou une liste"
#: extmod/ulab/code/numpy/fft/fft_tools.c
msgid "input array length must be power of 2"
msgstr "la longueur du tableau d'entrée doit être une puissance de 2"
msgstr "longueur de la matrice d'entrée doit être une puissance de 2"
#: extmod/ulab/code/ulab_create.c
msgid "input arrays are not compatible"
msgstr "les tableaux d'entrée ne sont pas compatibles"
msgstr "les matrices d'entrée ne sont pas compatibles"
#: extmod/ulab/code/numpy/poly/poly.c
msgid "input data must be an iterable"
@ -3244,7 +3251,7 @@ msgstr "la matrice d'entrée est singulière"
#: extmod/ulab/code/user/user.c
msgid "input must be a dense ndarray"
msgstr "l'entrée doit être un tableau dense"
msgstr "l'entrée doit être un ndarray dense"
#: extmod/ulab/code/ulab_create.c
msgid "input must be a tensor of rank 2"
@ -3284,7 +3291,7 @@ msgstr "entier requis"
#: extmod/ulab/code/numpy/approx/approx.c
msgid "interp is defined for 1D arrays of equal length"
msgstr "interp est défini pour les tableaux 1D de longueur égale"
msgstr "interp est défini pour les matrices 1D de longueur égale"
#: shared-bindings/_bleio/Adapter.c
#, c-format
@ -3304,6 +3311,10 @@ msgstr "bits_per_pixel %d est invalid, doit être 1, 4, 8, 16, 24 ou 32"
msgid "invalid cert"
msgstr "certificat invalide"
#: py/compile.c
msgid "invalid decorator"
msgstr "décorateur invalide"
#: extmod/uos_dupterm.c
msgid "invalid dupterm index"
msgstr "index invalide pour dupterm"
@ -3359,10 +3370,6 @@ msgstr "syntaxe invalide pour un entier de base %d"
msgid "invalid syntax for number"
msgstr "syntaxe invalide pour un nombre"
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "io must be rtc io"
msgstr "io doit être rtc io"
#: py/objtype.c
msgid "issubclass() arg 1 must be a class"
msgstr "l'argument 1 de issubclass() doit être une classe"
@ -3539,6 +3546,10 @@ msgstr "'yield' natif"
msgid "need more than %d values to unpack"
msgstr "nécessite plus de %d valeurs à dégrouper"
#: py/modmath.c
msgid "negative factorial"
msgstr ""
#: py/objint_longlong.c py/objint_mpz.c py/runtime.c
msgid "negative power with no float support"
msgstr "puissance négative sans support des nombres à virgule flottante"
@ -3718,11 +3729,11 @@ msgstr "les opérandes ne pouvaient pas être diffusés ensemble"
#: extmod/ulab/code/ndarray.c
msgid "operation is implemented for 1D Boolean arrays only"
msgstr "opération implémentée que pour des tableaux 1D booléennes"
msgstr "opération implémentée que pour les matrices 1D booléennes"
#: extmod/ulab/code/numpy/numerical/numerical.c
msgid "operation is not implemented on ndarrays"
msgstr "l'opération n'est pas implémentée sur les ndarrays"
msgstr "l'opération n'est pas implémentée pour les ndarrays"
#: extmod/ulab/code/ndarray.c
msgid "operation is not supported for given type"
@ -3741,11 +3752,11 @@ msgstr ""
#: extmod/ulab/code/utils/utils.c
msgid "out array is too small"
msgstr ""
msgstr "matrice de sortie est trop petite"
#: extmod/ulab/code/utils/utils.c
msgid "out must be a float dense array"
msgstr ""
msgstr "la matrice sortante doit être de type float"
#: shared-bindings/displayio/Bitmap.c
msgid "out of range of source"
@ -3772,10 +3783,6 @@ msgstr "la palette doit être longue de 32 octets"
msgid "palette_index should be an int"
msgstr "palette_index devrait être un entier 'int'"
#: py/compile.c
msgid "parameter annotation must be an identifier"
msgstr "l'annotation du paramètre doit être un identifiant"
#: py/emitinlinextensa.c
msgid "parameters must be registers in sequence a2 to a5"
msgstr "les paramètres doivent être des registres dans la séquence a2 à a5"
@ -3831,6 +3838,8 @@ msgstr "pow() avec 3 arguments nécessite des entiers"
#: ports/esp32s2/boards/adafruit_funhouse/mpconfigboard.h
#: ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h
#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h
#: ports/esp32s2/boards/artisense_rd00/mpconfigboard.h
#: ports/esp32s2/boards/atmegazero_esp32s2/mpconfigboard.h
#: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h
#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h
#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h
@ -3856,6 +3865,10 @@ msgstr "bouton boot appuyé lors du démarrage.\n"
msgid "pressing both buttons at start up.\n"
msgstr "les deux boutons appuyés lors du démarrage.\n"
#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h
msgid "pressing the left button at start up\n"
msgstr "appuyer le bouton de gauche au démarage\n"
#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
msgid "pull masks conflict with direction masks"
msgstr "masque pull est en conflit avec les masques de direction"
@ -3924,8 +3937,8 @@ msgid ""
"sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' or "
"'B'"
msgstr ""
"le tampon de sample_source doit être un bytearray ou un tableau de type "
"'h','H', 'b' ou 'B'"
"tampon sample_source doit être un bytearray ou une matrice de type 'h', 'H', "
"'b' ou 'B'"
#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c
#: ports/raspberrypi/common-hal/audiobusio/PDMIn.c
@ -3962,7 +3975,7 @@ msgstr "'}' seule rencontrée dans une chaîne de format"
#: extmod/ulab/code/ulab_tools.c
msgid "size is defined for ndarrays only"
msgstr "la taille est définie pour les ndarrays uniquement"
msgstr "la taille n'est définie que pour les ndarrays"
#: shared-bindings/time/__init__.c
msgid "sleep length must be non-negative"
@ -3986,11 +3999,11 @@ msgstr "redémarrage logiciel\n"
#: extmod/ulab/code/numpy/numerical/numerical.c
msgid "sort argument must be an ndarray"
msgstr "l'argument de «sort» doit être un ndarray"
msgstr "le paramètre de «sort» doit être un ndarray"
#: extmod/ulab/code/scipy/signal/signal.c
msgid "sos array must be of shape (n_section, 6)"
msgstr "le tableau sos doit être de forme (n_section, 6)"
msgstr "la matrice sos doit être de forme (n_section, 6)"
#: extmod/ulab/code/scipy/signal/signal.c
msgid "sos[:, 3] should be all ones"
@ -4035,7 +4048,7 @@ msgstr "les indices d'une chaîne doivent être des entiers, pas %q"
#: py/stream.c
msgid "string not supported; use bytes or bytearray"
msgstr ""
"chaîne de carac. non supportée ; utilisez des bytes ou un tableau de bytes"
"chaîne de carac. non supportée; utilisez des bytes ou une matrice de bytes"
#: extmod/moductypes.c
msgid "struct: cannot index"
@ -4105,7 +4118,7 @@ msgstr "timestamp hors bornes pour 'time_t' de la plateforme"
#: extmod/ulab/code/ndarray.c
msgid "tobytes can be invoked for dense arrays only"
msgstr "tobytes ne peut être appelé que pour des tableaux dense"
msgstr "tobytes ne peut être appelée que pour des matrices dense"
#: shared-module/struct/__init__.c
msgid "too many arguments provided with the given format"
@ -4126,15 +4139,11 @@ msgstr "trop de valeur à dégrouper (%d attendues)"
#: extmod/ulab/code/numpy/approx/approx.c
msgid "trapz is defined for 1D arrays"
msgstr "trapz est défini pour tableaux à une dimension"
msgstr "trapz est définie pour matrices à une dimension"
#: extmod/ulab/code/numpy/approx/approx.c
msgid "trapz is defined for 1D arrays of equal length"
msgstr "trapz n'est défini que pour des tableaux 1D de longueur égale"
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "trigger level must be 0 or 1"
msgstr "niveau du déclencheur doit être 0 ou 1"
msgstr "trapz n'est défini que pour des matrices 1D de longueur égales"
#: py/obj.c
msgid "tuple/list has wrong length"
@ -4217,7 +4226,7 @@ msgstr "code de formatage inconnu '%c' pour objet de type '%q'"
msgid "unknown type"
msgstr "type inconnu"
#: py/emitnative.c
#: py/compile.c
msgid "unknown type '%q'"
msgstr "type '%q' inconnu"
@ -4270,10 +4279,6 @@ msgstr "la valeur doit tenir dans %d octet(s)"
msgid "value_count must be > 0"
msgstr "'value_count' doit être > 0"
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "wakeup conflict"
msgstr "conflit au réveil"
#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c
msgid "watchdog not initialized"
msgstr "chien de garde (watchdog) non initialisé"
@ -4350,7 +4355,7 @@ msgstr "'step' nul"
#: extmod/ulab/code/scipy/signal/signal.c
msgid "zi must be an ndarray"
msgstr "zi doit être ndarray"
msgstr "zi doit être un ndarray"
#: extmod/ulab/code/scipy/signal/signal.c
msgid "zi must be of float type"
@ -4360,6 +4365,49 @@ msgstr "zi doit être de type float"
msgid "zi must be of shape (n_section, 2)"
msgstr "zi doit être de forme (n_section, 2)"
#~ msgid "Viper functions don't currently support more than 4 arguments"
#~ msgstr ""
#~ "les fonctions de Viper ne supportent pas plus de 4 arguments actuellement"
#~ msgid "address %08x is not aligned to %d bytes"
#~ msgstr "l'adresse %08x n'est pas alignée sur %d octets"
#~ msgid "function does not take keyword arguments"
#~ msgstr "la fonction ne prend pas d'arguments nommés"
#~ msgid "parameter annotation must be an identifier"
#~ msgstr "l'annotation du paramètre doit être un identifiant"
#~ msgid "Total data to write is larger than outgoing_packet_length"
#~ msgstr ""
#~ "Le nombre total de données à écrire est supérieur à outgoing_packet_length"
#~ msgid "IOs 0, 2 & 4 do not support internal pullup in sleep"
#~ msgstr "IOs 0, 2 & 4 ne supportent pas l'éleveuse interne en mode someil"
#~ msgid "buffer must be a bytes-like object"
#~ msgstr "le tampon doit être un objet bytes-like"
#~ msgid "io must be rtc io"
#~ msgstr "io doit être rtc io"
#~ msgid "trigger level must be 0 or 1"
#~ msgstr "niveau du déclencheur doit être 0 ou 1"
#~ msgid "wakeup conflict"
#~ msgstr "conflit au réveil"
#~ msgid "Attempted heap allocation when MicroPython VM not running."
#~ msgstr ""
#~ "Tentative d'allocation de segments lorsque la machine virtuelle "
#~ "MicroPython n'est pas en cours d'exécution."
#~ msgid "MicroPython NLR jump failed. Likely memory corruption."
#~ msgstr "Échec du saut MicroPython NLR. Corruption de la mémoire probable."
#~ msgid "MicroPython fatal error."
#~ msgstr "Erreur fatale MicroPython."
#~ msgid "argument must be ndarray"
#~ msgstr "l'argument doit être un ndarray"
@ -4627,9 +4675,6 @@ msgstr "zi doit être de forme (n_section, 2)"
#~ msgid "can't convert to float"
#~ msgstr "ne peut convertir en nombre à virgule flottante 'float'"
#~ msgid "can't convert to int"
#~ msgstr "ne peut convertir en entier 'int'"
#~ msgid "object '%s' is not a tuple or list"
#~ msgstr "l'objet '%s' n'est pas un tuple ou une liste"

View File

@ -438,7 +438,7 @@ msgid "Attempt to allocate %d blocks"
msgstr ""
#: supervisor/shared/safe_mode.c
msgid "Attempted heap allocation when MicroPython VM not running."
msgid "Attempted heap allocation when VM not running."
msgstr ""
#: shared-bindings/wifi/Radio.c
@ -879,6 +879,11 @@ msgstr ""
msgid "EXTINT channel already in use"
msgstr ""
#: shared-module/synthio/MidiTrack.c
#, c-format
msgid "Error in MIDI stream at position %d"
msgstr ""
#: extmod/modure.c
msgid "Error in regex"
msgstr ""
@ -1008,6 +1013,10 @@ msgstr ""
msgid "Failed to write internal flash."
msgstr ""
#: supervisor/shared/safe_mode.c
msgid "Fatal error."
msgstr ""
#: py/moduerrno.c
msgid "File exists"
msgstr ""
@ -1080,10 +1089,6 @@ msgstr ""
msgid "I2SOut not available"
msgstr ""
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "IOs 0, 2 & 4 do not support internal pullup in sleep"
msgstr ""
#: shared-bindings/aesio/aes.c
#, c-format
msgid "IV must be %d bytes long"
@ -1207,6 +1212,10 @@ msgstr ""
msgid "Invalid DAC pin supplied"
msgstr ""
#: shared-bindings/synthio/__init__.c
msgid "Invalid MIDI file"
msgstr ""
#: ports/atmel-samd/common-hal/pwmio/PWMOut.c
#: ports/cxd56/common-hal/pwmio/PWMOut.c
#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c
@ -1398,14 +1407,6 @@ msgstr ""
msgid "Messages limited to 8 bytes"
msgstr ""
#: supervisor/shared/safe_mode.c
msgid "MicroPython NLR jump failed. Likely memory corruption."
msgstr ""
#: supervisor/shared/safe_mode.c
msgid "MicroPython fatal error."
msgstr ""
#: shared-bindings/audiobusio/PDMIn.c
msgid "Microphone startup delay must be in range 0.0 to 1.0"
msgstr ""
@ -1457,6 +1458,10 @@ msgstr ""
msgid "Must use a multiple of 6 rgb pins, not %d"
msgstr ""
#: supervisor/shared/safe_mode.c
msgid "NLR jump failed. Likely memory corruption."
msgstr ""
#: ports/esp32s2/common-hal/nvm/ByteArray.c
msgid "NVS Error"
msgstr ""
@ -1601,6 +1606,7 @@ msgstr ""
msgid "Not a valid IP string"
msgstr ""
#: ports/nrf/common-hal/_bleio/PacketBuffer.c
#: ports/nrf/common-hal/_bleio/__init__.c
#: shared-bindings/_bleio/CharacteristicBuffer.c
msgid "Not connected"
@ -2126,7 +2132,7 @@ msgid "Too many displays"
msgstr ""
#: ports/nrf/common-hal/_bleio/PacketBuffer.c
msgid "Total data to write is larger than outgoing_packet_length"
msgid "Total data to write is larger than %q"
msgstr ""
#: py/obj.c
@ -2298,10 +2304,6 @@ msgstr ""
msgid "Version was invalid"
msgstr ""
#: py/emitnative.c
msgid "Viper functions don't currently support more than 4 arguments"
msgstr ""
#: ports/stm/common-hal/microcontroller/Processor.c
msgid "Voltage read timed out"
msgstr ""
@ -2381,11 +2383,6 @@ msgstr ""
msgid "abort() called"
msgstr ""
#: extmod/machine_mem.c
#, c-format
msgid "address %08x is not aligned to %d bytes"
msgstr ""
#: shared-bindings/i2cperipheral/I2CPeripheral.c
msgid "address out of bounds"
msgstr ""
@ -2394,6 +2391,10 @@ msgstr ""
msgid "addresses is empty"
msgstr ""
#: py/compile.c
msgid "annotation must be an identifier"
msgstr ""
#: py/modbuiltins.c
msgid "arg is an empty sequence"
msgstr ""
@ -2493,10 +2494,6 @@ msgstr ""
msgid "buffer is smaller than requested size"
msgstr ""
#: shared-bindings/audiocore/RawSample.c
msgid "buffer must be a bytes-like object"
msgstr ""
#: extmod/ulab/code/ulab_create.c extmod/ulab/code/utils/utils.c
msgid "buffer size must be a multiple of element size"
msgstr ""
@ -2580,6 +2577,10 @@ msgstr ""
msgid "can't convert %q to %q"
msgstr ""
#: py/runtime.c
msgid "can't convert %q to int"
msgstr ""
#: py/objstr.c
msgid "can't convert '%q' object to %q implicitly"
msgstr ""
@ -2588,6 +2589,10 @@ msgstr ""
msgid "can't convert to %q"
msgstr ""
#: py/runtime.c
msgid "can't convert to int"
msgstr ""
#: py/objstr.c
msgid "can't convert to str implicitly"
msgstr ""
@ -2938,7 +2943,7 @@ msgid "f-string: single '}' is not allowed"
msgstr ""
#: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c
#: shared-bindings/displayio/OnDiskBitmap.c
#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c
msgid "file must be a file opened in byte mode"
msgstr ""
@ -2991,7 +2996,7 @@ msgid "full"
msgstr ""
#: py/argcheck.c
msgid "function does not take keyword arguments"
msgid "function doesn't take keyword arguments"
msgstr ""
#: py/argcheck.c
@ -3046,6 +3051,10 @@ msgstr ""
msgid "generator ignored GeneratorExit"
msgstr ""
#: py/objgenerator.c
msgid "generator raised StopIteration"
msgstr ""
#: shared-bindings/_stage/Layer.c
msgid "graphic must be 2048 bytes long"
msgstr ""
@ -3194,6 +3203,10 @@ msgstr ""
msgid "invalid cert"
msgstr ""
#: py/compile.c
msgid "invalid decorator"
msgstr ""
#: extmod/uos_dupterm.c
msgid "invalid dupterm index"
msgstr ""
@ -3249,10 +3262,6 @@ msgstr ""
msgid "invalid syntax for number"
msgstr ""
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "io must be rtc io"
msgstr ""
#: py/objtype.c
msgid "issubclass() arg 1 must be a class"
msgstr ""
@ -3425,6 +3434,10 @@ msgstr ""
msgid "need more than %d values to unpack"
msgstr ""
#: py/modmath.c
msgid "negative factorial"
msgstr ""
#: py/objint_longlong.c py/objint_mpz.c py/runtime.c
msgid "negative power with no float support"
msgstr ""
@ -3654,10 +3667,6 @@ msgstr ""
msgid "palette_index should be an int"
msgstr ""
#: py/compile.c
msgid "parameter annotation must be an identifier"
msgstr ""
#: py/emitinlinextensa.c
msgid "parameters must be registers in sequence a2 to a5"
msgstr ""
@ -3712,6 +3721,8 @@ msgstr ""
#: ports/esp32s2/boards/adafruit_funhouse/mpconfigboard.h
#: ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h
#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h
#: ports/esp32s2/boards/artisense_rd00/mpconfigboard.h
#: ports/esp32s2/boards/atmegazero_esp32s2/mpconfigboard.h
#: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h
#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h
#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h
@ -3737,6 +3748,10 @@ msgstr ""
msgid "pressing both buttons at start up.\n"
msgstr ""
#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h
msgid "pressing the left button at start up\n"
msgstr ""
#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
msgid "pull masks conflict with direction masks"
msgstr ""
@ -4010,10 +4025,6 @@ msgstr ""
msgid "trapz is defined for 1D arrays of equal length"
msgstr ""
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "trigger level must be 0 or 1"
msgstr ""
#: py/obj.c
msgid "tuple/list has wrong length"
msgstr ""
@ -4095,7 +4106,7 @@ msgstr ""
msgid "unknown type"
msgstr ""
#: py/emitnative.c
#: py/compile.c
msgid "unknown type '%q'"
msgstr ""
@ -4148,10 +4159,6 @@ msgstr ""
msgid "value_count must be > 0"
msgstr ""
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "wakeup conflict"
msgstr ""
#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c
msgid "watchdog not initialized"
msgstr ""

View File

@ -450,8 +450,8 @@ msgid "Attempt to allocate %d blocks"
msgstr "Provo ad allocare %d blocchi"
#: supervisor/shared/safe_mode.c
msgid "Attempted heap allocation when MicroPython VM not running."
msgstr "Provo l'allocazione quando MicroPython VM non è attivo."
msgid "Attempted heap allocation when VM not running."
msgstr ""
#: shared-bindings/wifi/Radio.c
msgid "Authentication failure"
@ -899,6 +899,11 @@ msgstr ""
msgid "EXTINT channel already in use"
msgstr "Canale EXTINT già in uso"
#: shared-module/synthio/MidiTrack.c
#, c-format
msgid "Error in MIDI stream at position %d"
msgstr ""
#: extmod/modure.c
msgid "Error in regex"
msgstr "Errore nella regex"
@ -1030,6 +1035,10 @@ msgstr "Impossibile rilasciare il mutex, err 0x%04x"
msgid "Failed to write internal flash."
msgstr ""
#: supervisor/shared/safe_mode.c
msgid "Fatal error."
msgstr ""
#: py/moduerrno.c
msgid "File exists"
msgstr "File esistente"
@ -1102,10 +1111,6 @@ msgstr ""
msgid "I2SOut not available"
msgstr ""
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "IOs 0, 2 & 4 do not support internal pullup in sleep"
msgstr ""
#: shared-bindings/aesio/aes.c
#, c-format
msgid "IV must be %d bytes long"
@ -1231,6 +1236,10 @@ msgstr ""
msgid "Invalid DAC pin supplied"
msgstr ""
#: shared-bindings/synthio/__init__.c
msgid "Invalid MIDI file"
msgstr ""
#: ports/atmel-samd/common-hal/pwmio/PWMOut.c
#: ports/cxd56/common-hal/pwmio/PWMOut.c
#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c
@ -1425,14 +1434,6 @@ msgstr "Valore massimo di x quando rispachiato è %d"
msgid "Messages limited to 8 bytes"
msgstr ""
#: supervisor/shared/safe_mode.c
msgid "MicroPython NLR jump failed. Likely memory corruption."
msgstr ""
#: supervisor/shared/safe_mode.c
msgid "MicroPython fatal error."
msgstr ""
#: shared-bindings/audiobusio/PDMIn.c
msgid "Microphone startup delay must be in range 0.0 to 1.0"
msgstr ""
@ -1485,6 +1486,10 @@ msgstr ""
msgid "Must use a multiple of 6 rgb pins, not %d"
msgstr ""
#: supervisor/shared/safe_mode.c
msgid "NLR jump failed. Likely memory corruption."
msgstr ""
#: ports/esp32s2/common-hal/nvm/ByteArray.c
msgid "NVS Error"
msgstr ""
@ -1629,6 +1634,7 @@ msgstr ""
msgid "Not a valid IP string"
msgstr ""
#: ports/nrf/common-hal/_bleio/PacketBuffer.c
#: ports/nrf/common-hal/_bleio/__init__.c
#: shared-bindings/_bleio/CharacteristicBuffer.c
#, fuzzy
@ -2167,7 +2173,7 @@ msgid "Too many displays"
msgstr "Troppi schermi"
#: ports/nrf/common-hal/_bleio/PacketBuffer.c
msgid "Total data to write is larger than outgoing_packet_length"
msgid "Total data to write is larger than %q"
msgstr ""
#: py/obj.c
@ -2341,10 +2347,6 @@ msgstr ""
msgid "Version was invalid"
msgstr ""
#: py/emitnative.c
msgid "Viper functions don't currently support more than 4 arguments"
msgstr "Le funzioni Viper non supportano più di 4 argomenti al momento"
#: ports/stm/common-hal/microcontroller/Processor.c
msgid "Voltage read timed out"
msgstr ""
@ -2424,11 +2426,6 @@ msgstr "un oggetto byte-like è richiesto"
msgid "abort() called"
msgstr "abort() chiamato"
#: extmod/machine_mem.c
#, c-format
msgid "address %08x is not aligned to %d bytes"
msgstr "l'indirizzo %08x non è allineato a %d bytes"
#: shared-bindings/i2cperipheral/I2CPeripheral.c
msgid "address out of bounds"
msgstr "indirizzo fuori limite"
@ -2437,6 +2434,10 @@ msgstr "indirizzo fuori limite"
msgid "addresses is empty"
msgstr "gli indirizzi sono vuoti"
#: py/compile.c
msgid "annotation must be an identifier"
msgstr ""
#: py/modbuiltins.c
msgid "arg is an empty sequence"
msgstr "l'argomento è una sequenza vuota"
@ -2538,10 +2539,6 @@ msgstr "argomento di chr() non è in range(256)"
msgid "buffer is smaller than requested size"
msgstr ""
#: shared-bindings/audiocore/RawSample.c
msgid "buffer must be a bytes-like object"
msgstr ""
#: extmod/ulab/code/ulab_create.c extmod/ulab/code/utils/utils.c
msgid "buffer size must be a multiple of element size"
msgstr ""
@ -2627,6 +2624,10 @@ msgstr "impossibile assegnare all'espressione"
msgid "can't convert %q to %q"
msgstr ""
#: py/runtime.c
msgid "can't convert %q to int"
msgstr ""
#: py/objstr.c
msgid "can't convert '%q' object to %q implicitly"
msgstr "impossibile convertire l'oggetto '%q' implicitamente in %q"
@ -2635,6 +2636,10 @@ msgstr "impossibile convertire l'oggetto '%q' implicitamente in %q"
msgid "can't convert to %q"
msgstr ""
#: py/runtime.c
msgid "can't convert to int"
msgstr "non è possibile convertire a int"
#: py/objstr.c
msgid "can't convert to str implicitly"
msgstr "impossibile convertire a stringa implicitamente"
@ -2991,7 +2996,7 @@ msgid "f-string: single '}' is not allowed"
msgstr ""
#: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c
#: shared-bindings/displayio/OnDiskBitmap.c
#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c
msgid "file must be a file opened in byte mode"
msgstr ""
@ -3044,8 +3049,8 @@ msgid "full"
msgstr "pieno"
#: py/argcheck.c
msgid "function does not take keyword arguments"
msgstr "la funzione non prende argomenti nominati"
msgid "function doesn't take keyword arguments"
msgstr ""
#: py/argcheck.c
#, c-format
@ -3100,6 +3105,10 @@ msgstr ""
msgid "generator ignored GeneratorExit"
msgstr ""
#: py/objgenerator.c
msgid "generator raised StopIteration"
msgstr ""
#: shared-bindings/_stage/Layer.c
msgid "graphic must be 2048 bytes long"
msgstr "graphic deve essere lunga 2048 byte"
@ -3248,6 +3257,10 @@ msgstr ""
msgid "invalid cert"
msgstr "certificato non valido"
#: py/compile.c
msgid "invalid decorator"
msgstr ""
#: extmod/uos_dupterm.c
msgid "invalid dupterm index"
msgstr "indice dupterm non valido"
@ -3303,10 +3316,6 @@ msgstr "sintassi invalida per l'intero con base %d"
msgid "invalid syntax for number"
msgstr "sintassi invalida per il numero"
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "io must be rtc io"
msgstr ""
#: py/objtype.c
msgid "issubclass() arg 1 must be a class"
msgstr "il primo argomento di issubclass() deve essere una classe"
@ -3484,6 +3493,10 @@ msgstr "yield nativo"
msgid "need more than %d values to unpack"
msgstr "necessari più di %d valori da scompattare"
#: py/modmath.c
msgid "negative factorial"
msgstr ""
#: py/objint_longlong.c py/objint_mpz.c py/runtime.c
msgid "negative power with no float support"
msgstr "potenza negativa senza supporto per float"
@ -3718,10 +3731,6 @@ msgstr "la palette deve essere lunga 32 byte"
msgid "palette_index should be an int"
msgstr "palette_index deve essere un int"
#: py/compile.c
msgid "parameter annotation must be an identifier"
msgstr ""
#: py/emitinlinextensa.c
msgid "parameters must be registers in sequence a2 to a5"
msgstr "parametri devono essere i registri in sequenza da a2 a a5"
@ -3778,6 +3787,8 @@ msgstr "pow() con 3 argomenti richiede interi"
#: ports/esp32s2/boards/adafruit_funhouse/mpconfigboard.h
#: ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h
#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h
#: ports/esp32s2/boards/artisense_rd00/mpconfigboard.h
#: ports/esp32s2/boards/atmegazero_esp32s2/mpconfigboard.h
#: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h
#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h
#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h
@ -3803,6 +3814,10 @@ msgstr ""
msgid "pressing both buttons at start up.\n"
msgstr ""
#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h
msgid "pressing the left button at start up\n"
msgstr ""
#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
msgid "pull masks conflict with direction masks"
msgstr ""
@ -4080,10 +4095,6 @@ msgstr ""
msgid "trapz is defined for 1D arrays of equal length"
msgstr ""
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "trigger level must be 0 or 1"
msgstr ""
#: py/obj.c
msgid "tuple/list has wrong length"
msgstr "tupla/lista ha la lunghezza sbagliata"
@ -4165,7 +4176,7 @@ msgstr ""
msgid "unknown type"
msgstr "tipo sconosciuto"
#: py/emitnative.c
#: py/compile.c
msgid "unknown type '%q'"
msgstr "tipo '%q' sconosciuto"
@ -4218,10 +4229,6 @@ msgstr ""
msgid "value_count must be > 0"
msgstr ""
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "wakeup conflict"
msgstr ""
#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c
msgid "watchdog not initialized"
msgstr ""
@ -4310,6 +4317,18 @@ msgstr ""
msgid "zi must be of shape (n_section, 2)"
msgstr ""
#~ msgid "Viper functions don't currently support more than 4 arguments"
#~ msgstr "Le funzioni Viper non supportano più di 4 argomenti al momento"
#~ msgid "address %08x is not aligned to %d bytes"
#~ msgstr "l'indirizzo %08x non è allineato a %d bytes"
#~ msgid "function does not take keyword arguments"
#~ msgstr "la funzione non prende argomenti nominati"
#~ msgid "Attempted heap allocation when MicroPython VM not running."
#~ msgstr "Provo l'allocazione quando MicroPython VM non è attivo."
#~ msgid "Group full"
#~ msgstr "Gruppo pieno"
@ -4384,9 +4403,6 @@ msgstr ""
#~ msgid "can't convert to float"
#~ msgstr "non è possibile convertire a float"
#~ msgid "can't convert to int"
#~ msgstr "non è possibile convertire a int"
#~ msgid "object '%s' is not a tuple or list"
#~ msgstr "oggetto '%s' non è una tupla o una lista"

View File

@ -443,8 +443,8 @@ msgid "Attempt to allocate %d blocks"
msgstr "%d個のブロックの確保を試みました"
#: supervisor/shared/safe_mode.c
msgid "Attempted heap allocation when MicroPython VM not running."
msgstr "MicroPython VMの非実行時にヒープ確保を試みました"
msgid "Attempted heap allocation when VM not running."
msgstr ""
#: shared-bindings/wifi/Radio.c
msgid "Authentication failure"
@ -890,6 +890,11 @@ msgstr ""
msgid "EXTINT channel already in use"
msgstr "EXTINTチャネルはすでに使用されています"
#: shared-module/synthio/MidiTrack.c
#, c-format
msgid "Error in MIDI stream at position %d"
msgstr ""
#: extmod/modure.c
msgid "Error in regex"
msgstr "正規表現にエラーがあります"
@ -1019,6 +1024,10 @@ msgstr "ミューテックスの開放に失敗。エラー 0x%04x"
msgid "Failed to write internal flash."
msgstr "内部フラッシュ書き込みに失敗"
#: supervisor/shared/safe_mode.c
msgid "Fatal error."
msgstr ""
#: py/moduerrno.c
msgid "File exists"
msgstr "ファイルが存在します"
@ -1091,10 +1100,6 @@ msgstr ""
msgid "I2SOut not available"
msgstr "I2SOutが利用できません"
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "IOs 0, 2 & 4 do not support internal pullup in sleep"
msgstr ""
#: shared-bindings/aesio/aes.c
#, c-format
msgid "IV must be %d bytes long"
@ -1220,6 +1225,10 @@ msgstr "不正なBSSID"
msgid "Invalid DAC pin supplied"
msgstr "不正なDACピンが与えられました"
#: shared-bindings/synthio/__init__.c
msgid "Invalid MIDI file"
msgstr ""
#: ports/atmel-samd/common-hal/pwmio/PWMOut.c
#: ports/cxd56/common-hal/pwmio/PWMOut.c
#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c
@ -1411,14 +1420,6 @@ msgstr ""
msgid "Messages limited to 8 bytes"
msgstr ""
#: supervisor/shared/safe_mode.c
msgid "MicroPython NLR jump failed. Likely memory corruption."
msgstr "MicroPython NLRジャンプ失敗。メモリ破壊の可能性あり"
#: supervisor/shared/safe_mode.c
msgid "MicroPython fatal error."
msgstr "MicroPython致命的エラー"
#: shared-bindings/audiobusio/PDMIn.c
msgid "Microphone startup delay must be in range 0.0 to 1.0"
msgstr "マイクのスタートアップディレイは 0.0 から 1.0 の間でなければなりません"
@ -1470,6 +1471,10 @@ msgstr "MISOピンまたはMOSIピンが必要"
msgid "Must use a multiple of 6 rgb pins, not %d"
msgstr "%d個でなく6の倍数個のrgbピンを使ってください"
#: supervisor/shared/safe_mode.c
msgid "NLR jump failed. Likely memory corruption."
msgstr ""
#: ports/esp32s2/common-hal/nvm/ByteArray.c
msgid "NVS Error"
msgstr ""
@ -1614,6 +1619,7 @@ msgstr ""
msgid "Not a valid IP string"
msgstr "不正なIP文字列です"
#: ports/nrf/common-hal/_bleio/PacketBuffer.c
#: ports/nrf/common-hal/_bleio/__init__.c
#: shared-bindings/_bleio/CharacteristicBuffer.c
msgid "Not connected"
@ -2148,7 +2154,7 @@ msgid "Too many displays"
msgstr ""
#: ports/nrf/common-hal/_bleio/PacketBuffer.c
msgid "Total data to write is larger than outgoing_packet_length"
msgid "Total data to write is larger than %q"
msgstr ""
#: py/obj.c
@ -2321,10 +2327,6 @@ msgstr ""
msgid "Version was invalid"
msgstr ""
#: py/emitnative.c
msgid "Viper functions don't currently support more than 4 arguments"
msgstr ""
#: ports/stm/common-hal/microcontroller/Processor.c
msgid "Voltage read timed out"
msgstr "電圧読み取りがタイムアウト"
@ -2404,11 +2406,6 @@ msgstr "bytes-likeオブジェクトが必要"
msgid "abort() called"
msgstr "abort()が呼ばれました"
#: extmod/machine_mem.c
#, c-format
msgid "address %08x is not aligned to %d bytes"
msgstr ""
#: shared-bindings/i2cperipheral/I2CPeripheral.c
msgid "address out of bounds"
msgstr "アドレスが範囲外"
@ -2417,6 +2414,10 @@ msgstr "アドレスが範囲外"
msgid "addresses is empty"
msgstr ""
#: py/compile.c
msgid "annotation must be an identifier"
msgstr ""
#: py/modbuiltins.c
msgid "arg is an empty sequence"
msgstr ""
@ -2516,10 +2517,6 @@ msgstr ""
msgid "buffer is smaller than requested size"
msgstr ""
#: shared-bindings/audiocore/RawSample.c
msgid "buffer must be a bytes-like object"
msgstr "バッファはbytes-likeオブジェクトでなければなりません"
#: extmod/ulab/code/ulab_create.c extmod/ulab/code/utils/utils.c
msgid "buffer size must be a multiple of element size"
msgstr ""
@ -2603,6 +2600,10 @@ msgstr "式には代入できません"
msgid "can't convert %q to %q"
msgstr "%qを%qに変換できません"
#: py/runtime.c
msgid "can't convert %q to int"
msgstr ""
#: py/objstr.c
msgid "can't convert '%q' object to %q implicitly"
msgstr "オブジェクト '%q' を %q に暗黙に変換できません"
@ -2611,6 +2612,10 @@ msgstr "オブジェクト '%q' を %q に暗黙に変換できません"
msgid "can't convert to %q"
msgstr "%q に変換できません"
#: py/runtime.c
msgid "can't convert to int"
msgstr ""
#: py/objstr.c
msgid "can't convert to str implicitly"
msgstr ""
@ -2965,7 +2970,7 @@ msgid "f-string: single '}' is not allowed"
msgstr "f-string: 1つだけの'}'は許されません"
#: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c
#: shared-bindings/displayio/OnDiskBitmap.c
#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c
msgid "file must be a file opened in byte mode"
msgstr "fileはバイトモードで開かれたファイルでなければなりません"
@ -3018,7 +3023,7 @@ msgid "full"
msgstr ""
#: py/argcheck.c
msgid "function does not take keyword arguments"
msgid "function doesn't take keyword arguments"
msgstr ""
#: py/argcheck.c
@ -3073,6 +3078,10 @@ msgstr ""
msgid "generator ignored GeneratorExit"
msgstr ""
#: py/objgenerator.c
msgid "generator raised StopIteration"
msgstr ""
#: shared-bindings/_stage/Layer.c
msgid "graphic must be 2048 bytes long"
msgstr "graphicは2048バイトでなければなりません"
@ -3222,6 +3231,10 @@ msgstr ""
msgid "invalid cert"
msgstr "不正な証明書"
#: py/compile.c
msgid "invalid decorator"
msgstr ""
#: extmod/uos_dupterm.c
msgid "invalid dupterm index"
msgstr "不正なduptermインデクス"
@ -3277,10 +3290,6 @@ msgstr ""
msgid "invalid syntax for number"
msgstr "数字として不正な構文"
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "io must be rtc io"
msgstr ""
#: py/objtype.c
msgid "issubclass() arg 1 must be a class"
msgstr "issubclass()の第1引数はクラスでなければなりません"
@ -3453,6 +3462,10 @@ msgstr ""
msgid "need more than %d values to unpack"
msgstr "アンパックする値は%d個では足りません"
#: py/modmath.c
msgid "negative factorial"
msgstr ""
#: py/objint_longlong.c py/objint_mpz.c py/runtime.c
msgid "negative power with no float support"
msgstr ""
@ -3682,10 +3695,6 @@ msgstr "パレットの長さは32バイトでなければなりません"
msgid "palette_index should be an int"
msgstr "palette_indexには整数が必要"
#: py/compile.c
msgid "parameter annotation must be an identifier"
msgstr "引数アノテーションは識別子でなければなりません"
#: py/emitinlinextensa.c
msgid "parameters must be registers in sequence a2 to a5"
msgstr ""
@ -3742,6 +3751,8 @@ msgstr "pow()の第3引数には整数が必要"
#: ports/esp32s2/boards/adafruit_funhouse/mpconfigboard.h
#: ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h
#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h
#: ports/esp32s2/boards/artisense_rd00/mpconfigboard.h
#: ports/esp32s2/boards/atmegazero_esp32s2/mpconfigboard.h
#: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h
#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h
#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h
@ -3767,6 +3778,10 @@ msgstr ""
msgid "pressing both buttons at start up.\n"
msgstr ""
#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h
msgid "pressing the left button at start up\n"
msgstr ""
#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
msgid "pull masks conflict with direction masks"
msgstr ""
@ -4041,10 +4056,6 @@ msgstr ""
msgid "trapz is defined for 1D arrays of equal length"
msgstr "trapzは同じ長さの1次元arrayに対して定義されています"
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "trigger level must be 0 or 1"
msgstr ""
#: py/obj.c
msgid "tuple/list has wrong length"
msgstr "タプル/リストの長さが正しくありません"
@ -4126,7 +4137,7 @@ msgstr "型'%q'のオブジェクトに対する不明な書式コード'%c'"
msgid "unknown type"
msgstr "不明な型"
#: py/emitnative.c
#: py/compile.c
msgid "unknown type '%q'"
msgstr "不明な型 '%q'"
@ -4179,10 +4190,6 @@ msgstr "値は%dバイトに収まらなければなりません"
msgid "value_count must be > 0"
msgstr "value_countは0より大きくなければなりません"
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "wakeup conflict"
msgstr ""
#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c
msgid "watchdog not initialized"
msgstr ""
@ -4269,6 +4276,21 @@ msgstr "ziはfloat値でなければなりません"
msgid "zi must be of shape (n_section, 2)"
msgstr ""
#~ msgid "parameter annotation must be an identifier"
#~ msgstr "引数アノテーションは識別子でなければなりません"
#~ msgid "buffer must be a bytes-like object"
#~ msgstr "バッファはbytes-likeオブジェクトでなければなりません"
#~ msgid "Attempted heap allocation when MicroPython VM not running."
#~ msgstr "MicroPython VMの非実行時にヒープ確保を試みました"
#~ msgid "MicroPython NLR jump failed. Likely memory corruption."
#~ msgstr "MicroPython NLRジャンプ失敗。メモリ破壊の可能性あり"
#~ msgid "MicroPython fatal error."
#~ msgstr "MicroPython致命的エラー"
#~ msgid "argument must be ndarray"
#~ msgstr "引数はndarrayでなければなりません"

View File

@ -439,7 +439,7 @@ msgid "Attempt to allocate %d blocks"
msgstr ""
#: supervisor/shared/safe_mode.c
msgid "Attempted heap allocation when MicroPython VM not running."
msgid "Attempted heap allocation when VM not running."
msgstr ""
#: shared-bindings/wifi/Radio.c
@ -882,6 +882,11 @@ msgstr ""
msgid "EXTINT channel already in use"
msgstr ""
#: shared-module/synthio/MidiTrack.c
#, c-format
msgid "Error in MIDI stream at position %d"
msgstr ""
#: extmod/modure.c
msgid "Error in regex"
msgstr "Regex에 오류가 있습니다."
@ -1011,6 +1016,10 @@ msgstr ""
msgid "Failed to write internal flash."
msgstr ""
#: supervisor/shared/safe_mode.c
msgid "Fatal error."
msgstr ""
#: py/moduerrno.c
msgid "File exists"
msgstr ""
@ -1083,10 +1092,6 @@ msgstr ""
msgid "I2SOut not available"
msgstr ""
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "IOs 0, 2 & 4 do not support internal pullup in sleep"
msgstr ""
#: shared-bindings/aesio/aes.c
#, c-format
msgid "IV must be %d bytes long"
@ -1210,6 +1215,10 @@ msgstr ""
msgid "Invalid DAC pin supplied"
msgstr ""
#: shared-bindings/synthio/__init__.c
msgid "Invalid MIDI file"
msgstr ""
#: ports/atmel-samd/common-hal/pwmio/PWMOut.c
#: ports/cxd56/common-hal/pwmio/PWMOut.c
#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c
@ -1401,14 +1410,6 @@ msgstr ""
msgid "Messages limited to 8 bytes"
msgstr ""
#: supervisor/shared/safe_mode.c
msgid "MicroPython NLR jump failed. Likely memory corruption."
msgstr ""
#: supervisor/shared/safe_mode.c
msgid "MicroPython fatal error."
msgstr ""
#: shared-bindings/audiobusio/PDMIn.c
msgid "Microphone startup delay must be in range 0.0 to 1.0"
msgstr ""
@ -1460,6 +1461,10 @@ msgstr ""
msgid "Must use a multiple of 6 rgb pins, not %d"
msgstr ""
#: supervisor/shared/safe_mode.c
msgid "NLR jump failed. Likely memory corruption."
msgstr ""
#: ports/esp32s2/common-hal/nvm/ByteArray.c
msgid "NVS Error"
msgstr ""
@ -1604,6 +1609,7 @@ msgstr ""
msgid "Not a valid IP string"
msgstr ""
#: ports/nrf/common-hal/_bleio/PacketBuffer.c
#: ports/nrf/common-hal/_bleio/__init__.c
#: shared-bindings/_bleio/CharacteristicBuffer.c
msgid "Not connected"
@ -2129,7 +2135,7 @@ msgid "Too many displays"
msgstr ""
#: ports/nrf/common-hal/_bleio/PacketBuffer.c
msgid "Total data to write is larger than outgoing_packet_length"
msgid "Total data to write is larger than %q"
msgstr ""
#: py/obj.c
@ -2302,10 +2308,6 @@ msgstr ""
msgid "Version was invalid"
msgstr ""
#: py/emitnative.c
msgid "Viper functions don't currently support more than 4 arguments"
msgstr ""
#: ports/stm/common-hal/microcontroller/Processor.c
msgid "Voltage read timed out"
msgstr ""
@ -2385,11 +2387,6 @@ msgstr ""
msgid "abort() called"
msgstr ""
#: extmod/machine_mem.c
#, c-format
msgid "address %08x is not aligned to %d bytes"
msgstr ""
#: shared-bindings/i2cperipheral/I2CPeripheral.c
msgid "address out of bounds"
msgstr ""
@ -2398,6 +2395,10 @@ msgstr ""
msgid "addresses is empty"
msgstr ""
#: py/compile.c
msgid "annotation must be an identifier"
msgstr ""
#: py/modbuiltins.c
msgid "arg is an empty sequence"
msgstr ""
@ -2497,10 +2498,6 @@ msgstr ""
msgid "buffer is smaller than requested size"
msgstr ""
#: shared-bindings/audiocore/RawSample.c
msgid "buffer must be a bytes-like object"
msgstr ""
#: extmod/ulab/code/ulab_create.c extmod/ulab/code/utils/utils.c
msgid "buffer size must be a multiple of element size"
msgstr ""
@ -2584,6 +2581,10 @@ msgstr ""
msgid "can't convert %q to %q"
msgstr ""
#: py/runtime.c
msgid "can't convert %q to int"
msgstr ""
#: py/objstr.c
msgid "can't convert '%q' object to %q implicitly"
msgstr ""
@ -2592,6 +2593,10 @@ msgstr ""
msgid "can't convert to %q"
msgstr ""
#: py/runtime.c
msgid "can't convert to int"
msgstr ""
#: py/objstr.c
msgid "can't convert to str implicitly"
msgstr ""
@ -2942,7 +2947,7 @@ msgid "f-string: single '}' is not allowed"
msgstr ""
#: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c
#: shared-bindings/displayio/OnDiskBitmap.c
#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c
msgid "file must be a file opened in byte mode"
msgstr ""
@ -2995,7 +3000,7 @@ msgid "full"
msgstr "완전한(full)"
#: py/argcheck.c
msgid "function does not take keyword arguments"
msgid "function doesn't take keyword arguments"
msgstr ""
#: py/argcheck.c
@ -3050,6 +3055,10 @@ msgstr ""
msgid "generator ignored GeneratorExit"
msgstr ""
#: py/objgenerator.c
msgid "generator raised StopIteration"
msgstr ""
#: shared-bindings/_stage/Layer.c
msgid "graphic must be 2048 bytes long"
msgstr ""
@ -3198,6 +3207,10 @@ msgstr ""
msgid "invalid cert"
msgstr "cert가 유효하지 않습니다"
#: py/compile.c
msgid "invalid decorator"
msgstr ""
#: extmod/uos_dupterm.c
msgid "invalid dupterm index"
msgstr "Dupterm index가 유효하지 않습니다"
@ -3253,10 +3266,6 @@ msgstr "구문(syntax)가 정수가 유효하지 않습니다"
msgid "invalid syntax for number"
msgstr "숫자에 대한 구문(syntax)가 유효하지 않습니다"
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "io must be rtc io"
msgstr ""
#: py/objtype.c
msgid "issubclass() arg 1 must be a class"
msgstr ""
@ -3429,6 +3438,10 @@ msgstr ""
msgid "need more than %d values to unpack"
msgstr ""
#: py/modmath.c
msgid "negative factorial"
msgstr ""
#: py/objint_longlong.c py/objint_mpz.c py/runtime.c
msgid "negative power with no float support"
msgstr ""
@ -3658,10 +3671,6 @@ msgstr ""
msgid "palette_index should be an int"
msgstr ""
#: py/compile.c
msgid "parameter annotation must be an identifier"
msgstr ""
#: py/emitinlinextensa.c
msgid "parameters must be registers in sequence a2 to a5"
msgstr ""
@ -3716,6 +3725,8 @@ msgstr ""
#: ports/esp32s2/boards/adafruit_funhouse/mpconfigboard.h
#: ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h
#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h
#: ports/esp32s2/boards/artisense_rd00/mpconfigboard.h
#: ports/esp32s2/boards/atmegazero_esp32s2/mpconfigboard.h
#: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h
#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h
#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h
@ -3741,6 +3752,10 @@ msgstr ""
msgid "pressing both buttons at start up.\n"
msgstr ""
#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h
msgid "pressing the left button at start up\n"
msgstr ""
#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
msgid "pull masks conflict with direction masks"
msgstr ""
@ -4014,10 +4029,6 @@ msgstr ""
msgid "trapz is defined for 1D arrays of equal length"
msgstr ""
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "trigger level must be 0 or 1"
msgstr ""
#: py/obj.c
msgid "tuple/list has wrong length"
msgstr ""
@ -4099,7 +4110,7 @@ msgstr ""
msgid "unknown type"
msgstr ""
#: py/emitnative.c
#: py/compile.c
msgid "unknown type '%q'"
msgstr ""
@ -4152,10 +4163,6 @@ msgstr ""
msgid "value_count must be > 0"
msgstr ""
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "wakeup conflict"
msgstr ""
#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c
msgid "watchdog not initialized"
msgstr ""

View File

@ -441,8 +441,8 @@ msgid "Attempt to allocate %d blocks"
msgstr "Poging om %d blokken toe te wijzen"
#: supervisor/shared/safe_mode.c
msgid "Attempted heap allocation when MicroPython VM not running."
msgstr "heap allocatie geprobeerd terwijl MicroPython VM niet draait."
msgid "Attempted heap allocation when VM not running."
msgstr ""
#: shared-bindings/wifi/Radio.c
msgid "Authentication failure"
@ -890,6 +890,11 @@ msgstr "ESP-IDF geheugen toewijzing mislukt"
msgid "EXTINT channel already in use"
msgstr "EXTINT kanaal al in gebruik"
#: shared-module/synthio/MidiTrack.c
#, c-format
msgid "Error in MIDI stream at position %d"
msgstr ""
#: extmod/modure.c
msgid "Error in regex"
msgstr "Fout in regex"
@ -1019,6 +1024,10 @@ msgstr "Mislukt mutex los te laten, err 0x%04x"
msgid "Failed to write internal flash."
msgstr "Schrijven naar interne flash mislukt."
#: supervisor/shared/safe_mode.c
msgid "Fatal error."
msgstr ""
#: py/moduerrno.c
msgid "File exists"
msgstr "Bestand bestaat"
@ -1092,10 +1101,6 @@ msgstr ""
msgid "I2SOut not available"
msgstr "I2SOut is niet beschikbaar"
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "IOs 0, 2 & 4 do not support internal pullup in sleep"
msgstr "IO's 0, 2 en 4 ondersteunen geen interne pullup in slaapstand"
#: shared-bindings/aesio/aes.c
#, c-format
msgid "IV must be %d bytes long"
@ -1221,6 +1226,10 @@ msgstr "Ongeldig BSSID"
msgid "Invalid DAC pin supplied"
msgstr "Ongeldige DAC pin opgegeven"
#: shared-bindings/synthio/__init__.c
msgid "Invalid MIDI file"
msgstr ""
#: ports/atmel-samd/common-hal/pwmio/PWMOut.c
#: ports/cxd56/common-hal/pwmio/PWMOut.c
#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c
@ -1412,14 +1421,6 @@ msgstr "Maximale x waarde indien gespiegeld is %d"
msgid "Messages limited to 8 bytes"
msgstr "Berichten zijn beperkt tot 8 bytes"
#: supervisor/shared/safe_mode.c
msgid "MicroPython NLR jump failed. Likely memory corruption."
msgstr "MicroPython NLR sprong mislukt. Waarschijnlijk geheugen corruptie."
#: supervisor/shared/safe_mode.c
msgid "MicroPython fatal error."
msgstr "MicroPython fatale fout."
#: shared-bindings/audiobusio/PDMIn.c
msgid "Microphone startup delay must be in range 0.0 to 1.0"
msgstr "Microfoon opstart vertraging moet in bereik van 0.0 tot 1.0 zijn"
@ -1471,6 +1472,10 @@ msgstr "MISO of MOSI moeten worden gegeven"
msgid "Must use a multiple of 6 rgb pins, not %d"
msgstr "Een meervoud van 6 rgb pinnen moet worden gebruikt, niet %d"
#: supervisor/shared/safe_mode.c
msgid "NLR jump failed. Likely memory corruption."
msgstr ""
#: ports/esp32s2/common-hal/nvm/ByteArray.c
msgid "NVS Error"
msgstr "NVS-fout"
@ -1615,6 +1620,7 @@ msgstr ""
msgid "Not a valid IP string"
msgstr "Geen geldige IP string"
#: ports/nrf/common-hal/_bleio/PacketBuffer.c
#: ports/nrf/common-hal/_bleio/__init__.c
#: shared-bindings/_bleio/CharacteristicBuffer.c
msgid "Not connected"
@ -2166,8 +2172,8 @@ msgid "Too many displays"
msgstr "Teveel beeldschermen"
#: ports/nrf/common-hal/_bleio/PacketBuffer.c
msgid "Total data to write is larger than outgoing_packet_length"
msgstr "Totale data om te schrijven is groter dan outgoing_packet_length"
msgid "Total data to write is larger than %q"
msgstr ""
#: py/obj.c
msgid "Traceback (most recent call last):\n"
@ -2340,10 +2346,6 @@ msgstr "Waarde length > max_length"
msgid "Version was invalid"
msgstr ""
#: py/emitnative.c
msgid "Viper functions don't currently support more than 4 arguments"
msgstr "Viper-functies ondersteunen momenteel niet meer dan 4 argumenten"
#: ports/stm/common-hal/microcontroller/Processor.c
msgid "Voltage read timed out"
msgstr "Voltage lees time-out"
@ -2432,11 +2434,6 @@ msgstr "een bytes-achtig object is vereist"
msgid "abort() called"
msgstr "abort() aangeroepen"
#: extmod/machine_mem.c
#, c-format
msgid "address %08x is not aligned to %d bytes"
msgstr "adres %08x is niet afgestemd op %d bytes"
#: shared-bindings/i2cperipheral/I2CPeripheral.c
msgid "address out of bounds"
msgstr "adres buiten bereik"
@ -2445,6 +2442,10 @@ msgstr "adres buiten bereik"
msgid "addresses is empty"
msgstr "adressen zijn leeg"
#: py/compile.c
msgid "annotation must be an identifier"
msgstr ""
#: py/modbuiltins.c
msgid "arg is an empty sequence"
msgstr "arg is een lege sequentie"
@ -2544,10 +2545,6 @@ msgstr "pad (branch) niet binnen bereik"
msgid "buffer is smaller than requested size"
msgstr ""
#: shared-bindings/audiocore/RawSample.c
msgid "buffer must be a bytes-like object"
msgstr "buffer moet een byte-achtig object zijn"
#: extmod/ulab/code/ulab_create.c extmod/ulab/code/utils/utils.c
msgid "buffer size must be a multiple of element size"
msgstr ""
@ -2632,6 +2629,10 @@ msgstr "kan niet toewijzen aan expressie"
msgid "can't convert %q to %q"
msgstr "kan %q niet naar %q converteren"
#: py/runtime.c
msgid "can't convert %q to int"
msgstr ""
#: py/objstr.c
msgid "can't convert '%q' object to %q implicitly"
msgstr "kan '%q' object niet omzetten naar %q impliciet"
@ -2640,6 +2641,10 @@ msgstr "kan '%q' object niet omzetten naar %q impliciet"
msgid "can't convert to %q"
msgstr "kan niet naar %q converteren"
#: py/runtime.c
msgid "can't convert to int"
msgstr "kan niet omzetten naar int"
#: py/objstr.c
msgid "can't convert to str implicitly"
msgstr "kan niet omzetten naar str impliciet"
@ -2993,7 +2998,7 @@ msgid "f-string: single '}' is not allowed"
msgstr "f-string: enkele '}' is niet toegestaan"
#: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c
#: shared-bindings/displayio/OnDiskBitmap.c
#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c
msgid "file must be a file opened in byte mode"
msgstr "bestand moet een bestand zijn geopend in byte modus"
@ -3046,8 +3051,8 @@ msgid "full"
msgstr "vol"
#: py/argcheck.c
msgid "function does not take keyword arguments"
msgstr "functie accepteert geen keyword argumenten"
msgid "function doesn't take keyword arguments"
msgstr ""
#: py/argcheck.c
#, c-format
@ -3102,6 +3107,10 @@ msgstr "generator wordt al uitgevoerd"
msgid "generator ignored GeneratorExit"
msgstr "generator negeerde GeneratorExit"
#: py/objgenerator.c
msgid "generator raised StopIteration"
msgstr ""
#: shared-bindings/_stage/Layer.c
msgid "graphic must be 2048 bytes long"
msgstr "graphic moet 2048 bytes lang zijn"
@ -3250,6 +3259,10 @@ msgstr ""
msgid "invalid cert"
msgstr "ongeldig certificaat"
#: py/compile.c
msgid "invalid decorator"
msgstr ""
#: extmod/uos_dupterm.c
msgid "invalid dupterm index"
msgstr "ongeldige dupterm index"
@ -3305,10 +3318,6 @@ msgstr "ongeldige syntax voor integer met grondtal %d"
msgid "invalid syntax for number"
msgstr "ongeldige syntax voor nummer"
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "io must be rtc io"
msgstr "io moet rtc io zijn"
#: py/objtype.c
msgid "issubclass() arg 1 must be a class"
msgstr "issubclass() argument 1 moet een klasse zijn"
@ -3484,6 +3493,10 @@ msgstr "natuurlijke opbrengst (native yield)"
msgid "need more than %d values to unpack"
msgstr "Om uit te pakken zijn meer dan %d waarden vereist"
#: py/modmath.c
msgid "negative factorial"
msgstr ""
#: py/objint_longlong.c py/objint_mpz.c py/runtime.c
msgid "negative power with no float support"
msgstr "negatieve macht terwijl er geen ondersteuning is voor float"
@ -3713,10 +3726,6 @@ msgstr "palette moet 32 bytes lang zijn"
msgid "palette_index should be an int"
msgstr "palette_index moet een int zijn"
#: py/compile.c
msgid "parameter annotation must be an identifier"
msgstr "parameter annotatie moet een identifier zijn"
#: py/emitinlinextensa.c
msgid "parameters must be registers in sequence a2 to a5"
msgstr "parameters moeten registers zijn in de volgorde a2 tot a5"
@ -3772,6 +3781,8 @@ msgstr "pow() met 3 argumenten vereist integers"
#: ports/esp32s2/boards/adafruit_funhouse/mpconfigboard.h
#: ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h
#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h
#: ports/esp32s2/boards/artisense_rd00/mpconfigboard.h
#: ports/esp32s2/boards/atmegazero_esp32s2/mpconfigboard.h
#: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h
#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h
#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h
@ -3797,6 +3808,10 @@ msgstr "druk bootknop in bij opstarten.\n"
msgid "pressing both buttons at start up.\n"
msgstr "druk beide knoppen in bij opstarten.\n"
#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h
msgid "pressing the left button at start up\n"
msgstr ""
#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
msgid "pull masks conflict with direction masks"
msgstr ""
@ -4072,10 +4087,6 @@ msgstr ""
msgid "trapz is defined for 1D arrays of equal length"
msgstr "trapz is gedefinieerd voor eendimensionale arrays van gelijke lengte"
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "trigger level must be 0 or 1"
msgstr "triggerniveau moet 0 of 1 zijn"
#: py/obj.c
msgid "tuple/list has wrong length"
msgstr "tuple of lijst heeft onjuiste lengte"
@ -4157,7 +4168,7 @@ msgstr "onbekende formaatcode '%c' voor object van type '%q'"
msgid "unknown type"
msgstr "onbekend type"
#: py/emitnative.c
#: py/compile.c
msgid "unknown type '%q'"
msgstr "onbekend type '%q'"
@ -4210,10 +4221,6 @@ msgstr "waarde moet in %d byte(s) passen"
msgid "value_count must be > 0"
msgstr "value_count moet groter dan 0 zijn"
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "wakeup conflict"
msgstr "conflict bij ontwaken"
#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c
msgid "watchdog not initialized"
msgstr "watchdog niet geïnitialiseerd"
@ -4300,6 +4307,45 @@ msgstr "zi moet van type float zijn"
msgid "zi must be of shape (n_section, 2)"
msgstr "zi moet vorm (n_section, 2) hebben"
#~ msgid "Viper functions don't currently support more than 4 arguments"
#~ msgstr "Viper-functies ondersteunen momenteel niet meer dan 4 argumenten"
#~ msgid "address %08x is not aligned to %d bytes"
#~ msgstr "adres %08x is niet afgestemd op %d bytes"
#~ msgid "function does not take keyword arguments"
#~ msgstr "functie accepteert geen keyword argumenten"
#~ msgid "parameter annotation must be an identifier"
#~ msgstr "parameter annotatie moet een identifier zijn"
#~ msgid "Total data to write is larger than outgoing_packet_length"
#~ msgstr "Totale data om te schrijven is groter dan outgoing_packet_length"
#~ msgid "IOs 0, 2 & 4 do not support internal pullup in sleep"
#~ msgstr "IO's 0, 2 en 4 ondersteunen geen interne pullup in slaapstand"
#~ msgid "buffer must be a bytes-like object"
#~ msgstr "buffer moet een byte-achtig object zijn"
#~ msgid "io must be rtc io"
#~ msgstr "io moet rtc io zijn"
#~ msgid "trigger level must be 0 or 1"
#~ msgstr "triggerniveau moet 0 of 1 zijn"
#~ msgid "wakeup conflict"
#~ msgstr "conflict bij ontwaken"
#~ msgid "Attempted heap allocation when MicroPython VM not running."
#~ msgstr "heap allocatie geprobeerd terwijl MicroPython VM niet draait."
#~ msgid "MicroPython NLR jump failed. Likely memory corruption."
#~ msgstr "MicroPython NLR sprong mislukt. Waarschijnlijk geheugen corruptie."
#~ msgid "MicroPython fatal error."
#~ msgstr "MicroPython fatale fout."
#~ msgid "argument must be ndarray"
#~ msgstr "argument moet ndarray zijn"
@ -4543,9 +4589,6 @@ msgstr "zi moet vorm (n_section, 2) hebben"
#~ msgid "can't convert to float"
#~ msgstr "kan niet omzetten naar float"
#~ msgid "can't convert to int"
#~ msgstr "kan niet omzetten naar int"
#~ msgid "object '%s' is not a tuple or list"
#~ msgstr "object '%s' is geen tuple of lijst"

View File

@ -443,8 +443,8 @@ msgid "Attempt to allocate %d blocks"
msgstr "Próba przydzielenia %d bloków"
#: supervisor/shared/safe_mode.c
msgid "Attempted heap allocation when MicroPython VM not running."
msgstr "Próba przydziału sterty, gdy MicroPython VM nie działa."
msgid "Attempted heap allocation when VM not running."
msgstr ""
#: shared-bindings/wifi/Radio.c
msgid "Authentication failure"
@ -890,6 +890,11 @@ msgstr ""
msgid "EXTINT channel already in use"
msgstr "Kanał EXTINT w użyciu"
#: shared-module/synthio/MidiTrack.c
#, c-format
msgid "Error in MIDI stream at position %d"
msgstr ""
#: extmod/modure.c
msgid "Error in regex"
msgstr "Błąd w regex"
@ -1019,6 +1024,10 @@ msgstr "Nie udało się zwolnić blokady, błąd 0x%04x"
msgid "Failed to write internal flash."
msgstr "Nie udało się zapisać wewnętrznej pamięci flash."
#: supervisor/shared/safe_mode.c
msgid "Fatal error."
msgstr ""
#: py/moduerrno.c
msgid "File exists"
msgstr "Plik istnieje"
@ -1091,10 +1100,6 @@ msgstr ""
msgid "I2SOut not available"
msgstr "I2SOut niedostępne"
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "IOs 0, 2 & 4 do not support internal pullup in sleep"
msgstr ""
#: shared-bindings/aesio/aes.c
#, c-format
msgid "IV must be %d bytes long"
@ -1220,6 +1225,10 @@ msgstr ""
msgid "Invalid DAC pin supplied"
msgstr ""
#: shared-bindings/synthio/__init__.c
msgid "Invalid MIDI file"
msgstr ""
#: ports/atmel-samd/common-hal/pwmio/PWMOut.c
#: ports/cxd56/common-hal/pwmio/PWMOut.c
#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c
@ -1411,15 +1420,6 @@ msgstr "Największa wartość x przy odwróceniu to %d"
msgid "Messages limited to 8 bytes"
msgstr "Wiadomości ograniczone do 8 bajtów"
#: supervisor/shared/safe_mode.c
msgid "MicroPython NLR jump failed. Likely memory corruption."
msgstr ""
"Skok MicroRython NLR nie powiódł się. Prawdopodobne uszkodzenie pamięci."
#: supervisor/shared/safe_mode.c
msgid "MicroPython fatal error."
msgstr "Błąd krytyczny MicroPython."
#: shared-bindings/audiobusio/PDMIn.c
msgid "Microphone startup delay must be in range 0.0 to 1.0"
msgstr "Opóźnienie włączenia mikrofonu musi być w zakresie od 0.0 do 1.0"
@ -1471,6 +1471,10 @@ msgstr "Należy podać pin MISO lub MOSI"
msgid "Must use a multiple of 6 rgb pins, not %d"
msgstr ""
#: supervisor/shared/safe_mode.c
msgid "NLR jump failed. Likely memory corruption."
msgstr ""
#: ports/esp32s2/common-hal/nvm/ByteArray.c
msgid "NVS Error"
msgstr ""
@ -1615,6 +1619,7 @@ msgstr ""
msgid "Not a valid IP string"
msgstr ""
#: ports/nrf/common-hal/_bleio/PacketBuffer.c
#: ports/nrf/common-hal/_bleio/__init__.c
#: shared-bindings/_bleio/CharacteristicBuffer.c
msgid "Not connected"
@ -2140,7 +2145,7 @@ msgid "Too many displays"
msgstr "Zbyt wiele wyświetlaczy"
#: ports/nrf/common-hal/_bleio/PacketBuffer.c
msgid "Total data to write is larger than outgoing_packet_length"
msgid "Total data to write is larger than %q"
msgstr ""
#: py/obj.c
@ -2312,10 +2317,6 @@ msgstr ""
msgid "Version was invalid"
msgstr ""
#: py/emitnative.c
msgid "Viper functions don't currently support more than 4 arguments"
msgstr "Funkcje Viper nie obsługują obecnie więcej niż 4 argumentów"
#: ports/stm/common-hal/microcontroller/Processor.c
msgid "Voltage read timed out"
msgstr ""
@ -2401,11 +2402,6 @@ msgstr "wymagany obiekt typu bytes"
msgid "abort() called"
msgstr "Wywołano abort()"
#: extmod/machine_mem.c
#, c-format
msgid "address %08x is not aligned to %d bytes"
msgstr "adres %08x nie jest wyrównany do %d bajtów"
#: shared-bindings/i2cperipheral/I2CPeripheral.c
msgid "address out of bounds"
msgstr "adres poza zakresem"
@ -2414,6 +2410,10 @@ msgstr "adres poza zakresem"
msgid "addresses is empty"
msgstr "adres jest pusty"
#: py/compile.c
msgid "annotation must be an identifier"
msgstr ""
#: py/modbuiltins.c
msgid "arg is an empty sequence"
msgstr "arg jest puste"
@ -2513,10 +2513,6 @@ msgstr "skok poza zakres"
msgid "buffer is smaller than requested size"
msgstr ""
#: shared-bindings/audiocore/RawSample.c
msgid "buffer must be a bytes-like object"
msgstr "bufor mysi być typu bytes"
#: extmod/ulab/code/ulab_create.c extmod/ulab/code/utils/utils.c
msgid "buffer size must be a multiple of element size"
msgstr ""
@ -2600,6 +2596,10 @@ msgstr "przypisanie do wyrażenia"
msgid "can't convert %q to %q"
msgstr "nie można dokonać konwersji %q na %q"
#: py/runtime.c
msgid "can't convert %q to int"
msgstr ""
#: py/objstr.c
msgid "can't convert '%q' object to %q implicitly"
msgstr "nie można automatycznie skonwertować '%q' do '%q'"
@ -2608,6 +2608,10 @@ msgstr "nie można automatycznie skonwertować '%q' do '%q'"
msgid "can't convert to %q"
msgstr ""
#: py/runtime.c
msgid "can't convert to int"
msgstr "nie można skonwertować do int"
#: py/objstr.c
msgid "can't convert to str implicitly"
msgstr "nie można automatycznie skonwertować do str"
@ -2959,7 +2963,7 @@ msgid "f-string: single '}' is not allowed"
msgstr ""
#: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c
#: shared-bindings/displayio/OnDiskBitmap.c
#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c
msgid "file must be a file opened in byte mode"
msgstr "file musi być otwarte w trybie bajtowym"
@ -3012,8 +3016,8 @@ msgid "full"
msgstr "pełny"
#: py/argcheck.c
msgid "function does not take keyword arguments"
msgstr "funkcja nie bierze argumentów nazwanych"
msgid "function doesn't take keyword arguments"
msgstr ""
#: py/argcheck.c
#, c-format
@ -3067,6 +3071,10 @@ msgstr "generator już się wykonuje"
msgid "generator ignored GeneratorExit"
msgstr "generator zignorował GeneratorExit"
#: py/objgenerator.c
msgid "generator raised StopIteration"
msgstr ""
#: shared-bindings/_stage/Layer.c
msgid "graphic must be 2048 bytes long"
msgstr "graphic musi mieć 2048 bajtów długości"
@ -3215,6 +3223,10 @@ msgstr ""
msgid "invalid cert"
msgstr "zły ceryfikat"
#: py/compile.c
msgid "invalid decorator"
msgstr ""
#: extmod/uos_dupterm.c
msgid "invalid dupterm index"
msgstr "zły indeks dupterm"
@ -3270,10 +3282,6 @@ msgstr "zła składnia dla liczby całkowitej w bazie %d"
msgid "invalid syntax for number"
msgstr "zła składnia dla liczby"
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "io must be rtc io"
msgstr ""
#: py/objtype.c
msgid "issubclass() arg 1 must be a class"
msgstr "argument 1 dla issubclass() musi być klasą"
@ -3446,6 +3454,10 @@ msgstr "natywny yield"
msgid "need more than %d values to unpack"
msgstr "potrzeba więcej niż %d do rozpakowania"
#: py/modmath.c
msgid "negative factorial"
msgstr ""
#: py/objint_longlong.c py/objint_mpz.c py/runtime.c
msgid "negative power with no float support"
msgstr "ujemna potęga, ale brak obsługi liczb zmiennoprzecinkowych"
@ -3675,10 +3687,6 @@ msgstr "paleta musi mieć 32 bajty długości"
msgid "palette_index should be an int"
msgstr "palette_index powinien być całkowity"
#: py/compile.c
msgid "parameter annotation must be an identifier"
msgstr "anotacja parametru musi być identyfikatorem"
#: py/emitinlinextensa.c
msgid "parameters must be registers in sequence a2 to a5"
msgstr "parametry muszą być rejestrami w kolejności a2 do a5"
@ -3734,6 +3742,8 @@ msgstr "trzyargumentowe pow() wymaga liczb całkowitych"
#: ports/esp32s2/boards/adafruit_funhouse/mpconfigboard.h
#: ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h
#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h
#: ports/esp32s2/boards/artisense_rd00/mpconfigboard.h
#: ports/esp32s2/boards/atmegazero_esp32s2/mpconfigboard.h
#: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h
#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h
#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h
@ -3759,6 +3769,10 @@ msgstr ""
msgid "pressing both buttons at start up.\n"
msgstr ""
#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h
msgid "pressing the left button at start up\n"
msgstr ""
#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
msgid "pull masks conflict with direction masks"
msgstr ""
@ -4033,10 +4047,6 @@ msgstr ""
msgid "trapz is defined for 1D arrays of equal length"
msgstr ""
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "trigger level must be 0 or 1"
msgstr ""
#: py/obj.c
msgid "tuple/list has wrong length"
msgstr "krotka/lista ma złą długość"
@ -4118,7 +4128,7 @@ msgstr ""
msgid "unknown type"
msgstr "zły typ"
#: py/emitnative.c
#: py/compile.c
msgid "unknown type '%q'"
msgstr "zły typ '%q'"
@ -4171,10 +4181,6 @@ msgstr "wartość musi mieścić się w %d bajtach"
msgid "value_count must be > 0"
msgstr "value_count musi być > 0"
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "wakeup conflict"
msgstr ""
#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c
msgid "watchdog not initialized"
msgstr ""
@ -4261,6 +4267,31 @@ msgstr ""
msgid "zi must be of shape (n_section, 2)"
msgstr ""
#~ msgid "Viper functions don't currently support more than 4 arguments"
#~ msgstr "Funkcje Viper nie obsługują obecnie więcej niż 4 argumentów"
#~ msgid "address %08x is not aligned to %d bytes"
#~ msgstr "adres %08x nie jest wyrównany do %d bajtów"
#~ msgid "function does not take keyword arguments"
#~ msgstr "funkcja nie bierze argumentów nazwanych"
#~ msgid "parameter annotation must be an identifier"
#~ msgstr "anotacja parametru musi być identyfikatorem"
#~ msgid "buffer must be a bytes-like object"
#~ msgstr "bufor mysi być typu bytes"
#~ msgid "Attempted heap allocation when MicroPython VM not running."
#~ msgstr "Próba przydziału sterty, gdy MicroPython VM nie działa."
#~ msgid "MicroPython NLR jump failed. Likely memory corruption."
#~ msgstr ""
#~ "Skok MicroRython NLR nie powiódł się. Prawdopodobne uszkodzenie pamięci."
#~ msgid "MicroPython fatal error."
#~ msgstr "Błąd krytyczny MicroPython."
#~ msgid "vectors must have same lengths"
#~ msgstr "wektory muszą mieć identyczną długość"
@ -4389,9 +4420,6 @@ msgstr ""
#~ msgid "can't convert to float"
#~ msgstr "nie można skonwertować do float"
#~ msgid "can't convert to int"
#~ msgstr "nie można skonwertować do int"
#~ msgid "object '%s' is not a tuple or list"
#~ msgstr "obiekt '%s' nie jest krotką ani listą"

View File

@ -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-04-05 22:35+0000\n"
"PO-Revision-Date: 2021-04-22 17:16+0000\n"
"Last-Translator: Wellington Terumi Uemura <wellingtonuemura@gmail.com>\n"
"Language-Team: \n"
"Language: pt_BR\n"
@ -14,7 +14,7 @@ msgstr ""
"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.6-dev\n"
"X-Generator: Weblate 4.7-dev\n"
#: main.c
msgid ""
@ -426,7 +426,7 @@ msgstr "Saída analógica não suportada no pino fornecido"
#: ports/stm/common-hal/audiopwmio/PWMAudioOut.c
msgid "Another PWMAudioOut is already active"
msgstr ""
msgstr "Um outro PWMAudioOut já está ativo"
#: ports/atmel-samd/common-hal/pulseio/PulseOut.c
#: ports/cxd56/common-hal/pulseio/PulseOut.c
@ -451,10 +451,9 @@ msgid "Attempt to allocate %d blocks"
msgstr "Tentativa de alocar %d blocos"
#: supervisor/shared/safe_mode.c
msgid "Attempted heap allocation when MicroPython VM not running."
msgid "Attempted heap allocation when VM not running."
msgstr ""
"A tentativa da área de alocação dinâmica de variáveis (heap) quando o "
"MicroPython VM não está em execução."
"Tentativa de alocação das pilhas quando o VM não estiver em funcionamento."
#: shared-bindings/wifi/Radio.c
msgid "Authentication failure"
@ -908,6 +907,11 @@ msgstr "Houve uma falha na alocação da memória ESP-IDF"
msgid "EXTINT channel already in use"
msgstr "Canal EXTINT em uso"
#: shared-module/synthio/MidiTrack.c
#, c-format
msgid "Error in MIDI stream at position %d"
msgstr "Houve um erro no fluxo MIDI na posição %d"
#: extmod/modure.c
msgid "Error in regex"
msgstr "Erro no regex"
@ -1010,7 +1014,7 @@ msgstr "Houve uma falha na alocação da memória para a varredura do Wifi"
#: ports/stm/common-hal/audiopwmio/PWMAudioOut.c
msgid "Failed to buffer the sample"
msgstr ""
msgstr "Houve uma falha ao fazer uma memória prévia (buffer) da amostra"
#: ports/nrf/common-hal/_bleio/Adapter.c
msgid "Failed to connect: internal error"
@ -1037,6 +1041,10 @@ msgstr "Houve uma falha ao liberar o mutex, err 0x%04x"
msgid "Failed to write internal flash."
msgstr "Falha ao gravar o flash interno."
#: supervisor/shared/safe_mode.c
msgid "Fatal error."
msgstr "Erro fatal."
#: py/moduerrno.c
msgid "File exists"
msgstr "Arquivo já existe"
@ -1110,10 +1118,6 @@ msgstr "Periférico I2C em uso"
msgid "I2SOut not available"
msgstr "O I2SOut não está disponível"
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "IOs 0, 2 & 4 do not support internal pullup in sleep"
msgstr "IOs 0, 2 e 4 não suportam pullup interno em repouso (sleep)"
#: shared-bindings/aesio/aes.c
#, c-format
msgid "IV must be %d bytes long"
@ -1245,6 +1249,10 @@ msgstr "BSSID Inválido"
msgid "Invalid DAC pin supplied"
msgstr "O pino DAC informado é inválido"
#: shared-bindings/synthio/__init__.c
msgid "Invalid MIDI file"
msgstr "O arquivo MIDI é inválido"
#: ports/atmel-samd/common-hal/pwmio/PWMOut.c
#: ports/cxd56/common-hal/pwmio/PWMOut.c
#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c
@ -1436,14 +1444,6 @@ msgstr "O valor máximo de x quando espelhado é %d"
msgid "Messages limited to 8 bytes"
msgstr "As mensagens estão limitadas a 8 bytes"
#: supervisor/shared/safe_mode.c
msgid "MicroPython NLR jump failed. Likely memory corruption."
msgstr "O salto do MicroPython NLR falhou. Possível corrupção de memória."
#: supervisor/shared/safe_mode.c
msgid "MicroPython fatal error."
msgstr "Houve um erro fatal do MicroPython."
#: shared-bindings/audiobusio/PDMIn.c
msgid "Microphone startup delay must be in range 0.0 to 1.0"
msgstr "O atraso na inicialização do microfone deve estar entre 0,0 e 1,0"
@ -1495,6 +1495,10 @@ msgstr "Deve informar os pinos MISO ou MOSI"
msgid "Must use a multiple of 6 rgb pins, not %d"
msgstr "Deve utilizar um múltiplo de 6 pinos rgb, não %d"
#: supervisor/shared/safe_mode.c
msgid "NLR jump failed. Likely memory corruption."
msgstr "O salto NLR falhou. Possível corrupção da memória."
#: ports/esp32s2/common-hal/nvm/ByteArray.c
msgid "NVS Error"
msgstr "Erro NVS"
@ -1641,6 +1645,7 @@ msgstr "O firmware do sistema nórdico está sem memória"
msgid "Not a valid IP string"
msgstr "Não é uma sequência válida de IP"
#: ports/nrf/common-hal/_bleio/PacketBuffer.c
#: ports/nrf/common-hal/_bleio/__init__.c
#: shared-bindings/_bleio/CharacteristicBuffer.c
msgid "Not connected"
@ -2199,9 +2204,8 @@ msgid "Too many displays"
msgstr "Exibições demais"
#: ports/nrf/common-hal/_bleio/PacketBuffer.c
msgid "Total data to write is larger than outgoing_packet_length"
msgstr ""
"O total dos dados que serão gravados é maior que outgoing_packet_length"
msgid "Total data to write is larger than %q"
msgstr "O total dos dados que serão escritos é maior do que %q"
#: py/obj.c
msgid "Traceback (most recent call last):\n"
@ -2374,10 +2378,6 @@ msgstr "O comprimento do valor é > max_length"
msgid "Version was invalid"
msgstr "A versão era inválida"
#: py/emitnative.c
msgid "Viper functions don't currently support more than 4 arguments"
msgstr "Atualmente, as funções do Viper não suportam mais de 4 argumentos"
#: ports/stm/common-hal/microcontroller/Processor.c
msgid "Voltage read timed out"
msgstr "O tempo limite de leitura da tensão expirou"
@ -2467,11 +2467,6 @@ msgstr "é necessário objetos tipo bytes"
msgid "abort() called"
msgstr "abort() chamado"
#: extmod/machine_mem.c
#, c-format
msgid "address %08x is not aligned to %d bytes"
msgstr "endereço %08x não está alinhado com %d bytes"
#: shared-bindings/i2cperipheral/I2CPeripheral.c
msgid "address out of bounds"
msgstr "endereço fora dos limites"
@ -2480,6 +2475,10 @@ msgstr "endereço fora dos limites"
msgid "addresses is empty"
msgstr "os endereços estão vazios"
#: py/compile.c
msgid "annotation must be an identifier"
msgstr ""
#: py/modbuiltins.c
msgid "arg is an empty sequence"
msgstr "o arg é uma sequência vazia"
@ -2579,10 +2578,6 @@ msgstr "ramo fora do alcance"
msgid "buffer is smaller than requested size"
msgstr "o tamanho do buffer é menor do que o tamanho que foi solicitado"
#: shared-bindings/audiocore/RawSample.c
msgid "buffer must be a bytes-like object"
msgstr "o buffer deve ser um objeto como bytes"
#: extmod/ulab/code/ulab_create.c extmod/ulab/code/utils/utils.c
msgid "buffer size must be a multiple of element size"
msgstr "o tamanho do buffer deve ser um múltiplo do tamanho do elemento"
@ -2666,6 +2661,10 @@ msgstr "a expressão não pode ser atribuída"
msgid "can't convert %q to %q"
msgstr "não é possível converter %q para %q"
#: py/runtime.c
msgid "can't convert %q to int"
msgstr ""
#: py/objstr.c
msgid "can't convert '%q' object to %q implicitly"
msgstr "não é possível converter implicitamente o objeto '%q' para %q"
@ -2674,6 +2673,10 @@ msgstr "não é possível converter implicitamente o objeto '%q' para %q"
msgid "can't convert to %q"
msgstr "não é possível converter para %q"
#: py/runtime.c
msgid "can't convert to int"
msgstr "não é possível converter para int"
#: py/objstr.c
msgid "can't convert to str implicitly"
msgstr "não é possível converter implicitamente para str"
@ -3033,7 +3036,7 @@ msgid "f-string: single '}' is not allowed"
msgstr "f-string: um único '}' não é permitido"
#: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c
#: shared-bindings/displayio/OnDiskBitmap.c
#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c
msgid "file must be a file opened in byte mode"
msgstr "o arquivo deve ser um arquivo aberto no modo byte"
@ -3086,8 +3089,8 @@ msgid "full"
msgstr "cheio"
#: py/argcheck.c
msgid "function does not take keyword arguments"
msgstr "função não aceita argumentos de palavras-chave"
msgid "function doesn't take keyword arguments"
msgstr ""
#: py/argcheck.c
#, c-format
@ -3141,6 +3144,10 @@ msgstr "o gerador já está em execução"
msgid "generator ignored GeneratorExit"
msgstr "ignorando o gerador GeneratorExit"
#: py/objgenerator.c
msgid "generator raised StopIteration"
msgstr ""
#: shared-bindings/_stage/Layer.c
msgid "graphic must be 2048 bytes long"
msgstr "o gráfico deve ter 2048 bytes de comprimento"
@ -3290,6 +3297,10 @@ msgstr "bits_per_pixel %d é inválido, deve ser, 1, 4, 8, 16, 24, ou 32"
msgid "invalid cert"
msgstr "certificado inválido"
#: py/compile.c
msgid "invalid decorator"
msgstr "decorador inválido"
#: extmod/uos_dupterm.c
msgid "invalid dupterm index"
msgstr "Índice de dupterm inválido"
@ -3345,10 +3356,6 @@ msgstr "sintaxe inválida para o número inteiro com base %d"
msgid "invalid syntax for number"
msgstr "sintaxe inválida para o número"
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "io must be rtc io"
msgstr "O io deve ser rtc io"
#: py/objtype.c
msgid "issubclass() arg 1 must be a class"
msgstr "issubclass() arg 1 deve ser uma classe"
@ -3526,6 +3533,10 @@ msgstr "rendimento nativo"
msgid "need more than %d values to unpack"
msgstr "precisa de mais de %d valores para desempacotar"
#: py/modmath.c
msgid "negative factorial"
msgstr ""
#: py/objint_longlong.c py/objint_mpz.c py/runtime.c
msgid "negative power with no float support"
msgstr "potência negativa sem suporte de flutuação"
@ -3760,10 +3771,6 @@ msgstr "a paleta deve ter 32 bytes de comprimento"
msgid "palette_index should be an int"
msgstr "palette_index deve ser um int"
#: py/compile.c
msgid "parameter annotation must be an identifier"
msgstr "a anotação do parâmetro deve ser um identificador"
#: py/emitinlinextensa.c
msgid "parameters must be registers in sequence a2 to a5"
msgstr "os parâmetros devem ser registradores na sequência a2 até a5"
@ -3818,6 +3825,8 @@ msgstr "o pow() com 3 argumentos requer números inteiros"
#: ports/esp32s2/boards/adafruit_funhouse/mpconfigboard.h
#: ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h
#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h
#: ports/esp32s2/boards/artisense_rd00/mpconfigboard.h
#: ports/esp32s2/boards/atmegazero_esp32s2/mpconfigboard.h
#: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h
#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h
#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h
@ -3843,6 +3852,10 @@ msgstr "pressionando o botão de boot na inicialização.\n"
msgid "pressing both buttons at start up.\n"
msgstr "pressionando ambos os botões durante a inicialização.\n"
#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h
msgid "pressing the left button at start up\n"
msgstr "pressionando o botão esquerdo durante a inicialização\n"
#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
msgid "pull masks conflict with direction masks"
msgstr "puxe as máscaras em conflito com as máscaras de direção"
@ -4118,10 +4131,6 @@ msgstr "Trapz está definido para arrays 1D"
msgid "trapz is defined for 1D arrays of equal length"
msgstr "o trapz está definido para 1D arrays de igual tamanho"
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "trigger level must be 0 or 1"
msgstr "nível do gatilho deve ser 0 ou 1"
#: py/obj.c
msgid "tuple/list has wrong length"
msgstr "a tupla/lista está com tamanho incorreto"
@ -4203,7 +4212,7 @@ msgstr "o formato do código '%c' é desconhecido para o objeto do tipo '%q'"
msgid "unknown type"
msgstr "tipo desconhecido"
#: py/emitnative.c
#: py/compile.c
msgid "unknown type '%q'"
msgstr "tipo desconhecido '%q'"
@ -4256,10 +4265,6 @@ msgstr "o valor deve caber em %d byte(s)"
msgid "value_count must be > 0"
msgstr "o value_count deve ser > 0"
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "wakeup conflict"
msgstr "conflito de wakeup"
#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c
msgid "watchdog not initialized"
msgstr "o watchdog não foi inicializado"
@ -4346,6 +4351,48 @@ msgstr "zi deve ser de um tipo float"
msgid "zi must be of shape (n_section, 2)"
msgstr "zi deve estar na forma (n_section, 2)"
#~ msgid "Viper functions don't currently support more than 4 arguments"
#~ msgstr "Atualmente, as funções do Viper não suportam mais de 4 argumentos"
#~ msgid "address %08x is not aligned to %d bytes"
#~ msgstr "endereço %08x não está alinhado com %d bytes"
#~ msgid "function does not take keyword arguments"
#~ msgstr "função não aceita argumentos de palavras-chave"
#~ msgid "parameter annotation must be an identifier"
#~ msgstr "a anotação do parâmetro deve ser um identificador"
#~ msgid "Total data to write is larger than outgoing_packet_length"
#~ msgstr ""
#~ "O total dos dados que serão gravados é maior que outgoing_packet_length"
#~ msgid "IOs 0, 2 & 4 do not support internal pullup in sleep"
#~ msgstr "IOs 0, 2 e 4 não suportam pullup interno em repouso (sleep)"
#~ msgid "buffer must be a bytes-like object"
#~ msgstr "o buffer deve ser um objeto como bytes"
#~ msgid "io must be rtc io"
#~ msgstr "O io deve ser rtc io"
#~ msgid "trigger level must be 0 or 1"
#~ msgstr "nível do gatilho deve ser 0 ou 1"
#~ msgid "wakeup conflict"
#~ msgstr "conflito de wakeup"
#~ msgid "Attempted heap allocation when MicroPython VM not running."
#~ msgstr ""
#~ "A tentativa da área de alocação dinâmica de variáveis (heap) quando o "
#~ "MicroPython VM não está em execução."
#~ msgid "MicroPython NLR jump failed. Likely memory corruption."
#~ msgstr "O salto do MicroPython NLR falhou. Possível corrupção de memória."
#~ msgid "MicroPython fatal error."
#~ msgstr "Houve um erro fatal do MicroPython."
#~ msgid "argument must be ndarray"
#~ msgstr "o argumento deve ser ndarray"
@ -4638,9 +4685,6 @@ msgstr "zi deve estar na forma (n_section, 2)"
#~ msgid "can't convert to float"
#~ msgstr "não é possível converter para float"
#~ msgid "can't convert to int"
#~ msgstr "não é possível converter para int"
#~ msgid "object '%s' is not a tuple or list"
#~ msgstr "o objeto '%s' não é uma tupla ou uma lista"

View File

@ -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-04-06 14:41+0000\n"
"PO-Revision-Date: 2021-04-23 12:37+0000\n"
"Last-Translator: Jonny Bergdahl <jonny@bergdahl.it>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: sv\n"
@ -14,7 +14,7 @@ msgstr ""
"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.6-dev\n"
"X-Generator: Weblate 4.7-dev\n"
#: main.c
msgid ""
@ -446,8 +446,8 @@ msgid "Attempt to allocate %d blocks"
msgstr "Försök att tilldela %d block"
#: supervisor/shared/safe_mode.c
msgid "Attempted heap allocation when MicroPython VM not running."
msgstr "Försökte tilldela heap när MicroPython VM inte körs."
msgid "Attempted heap allocation when VM not running."
msgstr "Försök till heap-allokering när den virtuella maskinen inte är igång."
#: shared-bindings/wifi/Radio.c
msgid "Authentication failure"
@ -896,6 +896,11 @@ msgstr "ESP-IDF-minnetilldelning misslyckades"
msgid "EXTINT channel already in use"
msgstr "EXTINT-kanalen används redan"
#: shared-module/synthio/MidiTrack.c
#, c-format
msgid "Error in MIDI stream at position %d"
msgstr "Fel i MIDI-ström vid position %d"
#: extmod/modure.c
msgid "Error in regex"
msgstr "Fel i regex"
@ -1025,6 +1030,10 @@ msgstr "Det gick inte att frigöra mutex, fel 0x%04x"
msgid "Failed to write internal flash."
msgstr "Det gick inte att skriva till intern flash."
#: supervisor/shared/safe_mode.c
msgid "Fatal error."
msgstr "Fatalt fel."
#: py/moduerrno.c
msgid "File exists"
msgstr "Filen finns redan"
@ -1097,10 +1106,6 @@ msgstr "I2C-enhet används redan"
msgid "I2SOut not available"
msgstr "I2SOut är inte tillgängligt"
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "IOs 0, 2 & 4 do not support internal pullup in sleep"
msgstr "IO 0, 2 & 4 stöder inte intern pullup för sovläge"
#: shared-bindings/aesio/aes.c
#, c-format
msgid "IV must be %d bytes long"
@ -1228,6 +1233,10 @@ msgstr "Ogiltig BSSID"
msgid "Invalid DAC pin supplied"
msgstr "Ogiltig DAC-pinne angiven"
#: shared-bindings/synthio/__init__.c
msgid "Invalid MIDI file"
msgstr "Ogiltig MIDI-fil"
#: ports/atmel-samd/common-hal/pwmio/PWMOut.c
#: ports/cxd56/common-hal/pwmio/PWMOut.c
#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c
@ -1419,14 +1428,6 @@ msgstr "Maximum x-värde vid spegling är %d"
msgid "Messages limited to 8 bytes"
msgstr "Meddelanden begränsad till 8 byte"
#: supervisor/shared/safe_mode.c
msgid "MicroPython NLR jump failed. Likely memory corruption."
msgstr "MicroPython NLR jump misslyckades. Troligen korrupt minne."
#: supervisor/shared/safe_mode.c
msgid "MicroPython fatal error."
msgstr "MicroPython fatalt fel."
#: shared-bindings/audiobusio/PDMIn.c
msgid "Microphone startup delay must be in range 0.0 to 1.0"
msgstr ""
@ -1479,6 +1480,10 @@ msgstr "Måste ange MISO- eller MOSI-pinne"
msgid "Must use a multiple of 6 rgb pins, not %d"
msgstr "Måste använda ett multipel av 6 rgb-pinnar, inte %d"
#: supervisor/shared/safe_mode.c
msgid "NLR jump failed. Likely memory corruption."
msgstr "NLR jump misslyckades. Troligen korrupt minne."
#: ports/esp32s2/common-hal/nvm/ByteArray.c
msgid "NVS Error"
msgstr "NVS-fel"
@ -1623,6 +1628,7 @@ msgstr "Nordic systemfirmware fick slut på minne"
msgid "Not a valid IP string"
msgstr "Inte en giltig IP-sträng"
#: ports/nrf/common-hal/_bleio/PacketBuffer.c
#: ports/nrf/common-hal/_bleio/__init__.c
#: shared-bindings/_bleio/CharacteristicBuffer.c
msgid "Not connected"
@ -2172,8 +2178,8 @@ msgid "Too many displays"
msgstr "För många displayer"
#: ports/nrf/common-hal/_bleio/PacketBuffer.c
msgid "Total data to write is larger than outgoing_packet_length"
msgstr "Total data som ska skrivas är större än outgoing_packet_length"
msgid "Total data to write is larger than %q"
msgstr "Totala data att skriva är större än %q"
#: py/obj.c
msgid "Traceback (most recent call last):\n"
@ -2346,10 +2352,6 @@ msgstr "Värdets längd > max_length"
msgid "Version was invalid"
msgstr "Versionen var ogiltig"
#: py/emitnative.c
msgid "Viper functions don't currently support more than 4 arguments"
msgstr "Viper-funktioner stöder för närvarande inte mer än fyra argument"
#: ports/stm/common-hal/microcontroller/Processor.c
msgid "Voltage read timed out"
msgstr "Avläsning av spänning tog för lång tid"
@ -2435,11 +2437,6 @@ msgstr "ett bytesliknande objekt krävs"
msgid "abort() called"
msgstr "abort() anropad"
#: extmod/machine_mem.c
#, c-format
msgid "address %08x is not aligned to %d bytes"
msgstr "adressen %08x är inte justerad till %d byte"
#: shared-bindings/i2cperipheral/I2CPeripheral.c
msgid "address out of bounds"
msgstr "adress utanför gränsen"
@ -2448,6 +2445,10 @@ msgstr "adress utanför gränsen"
msgid "addresses is empty"
msgstr "adresserna är tomma"
#: py/compile.c
msgid "annotation must be an identifier"
msgstr "Annoteringen måste vara en identifierare"
#: py/modbuiltins.c
msgid "arg is an empty sequence"
msgstr "arg är en tom sekvens"
@ -2547,10 +2548,6 @@ msgstr "branch utanför räckvidd"
msgid "buffer is smaller than requested size"
msgstr "bufferten är mindre än begärd storlek"
#: shared-bindings/audiocore/RawSample.c
msgid "buffer must be a bytes-like object"
msgstr "buffer måste vara en byte-liknande objekt"
#: extmod/ulab/code/ulab_create.c extmod/ulab/code/utils/utils.c
msgid "buffer size must be a multiple of element size"
msgstr "buffertstorlek måste vara en multipel av elementstorlek"
@ -2634,6 +2631,10 @@ msgstr "kan inte tilldela uttryck"
msgid "can't convert %q to %q"
msgstr "kan inte konvertera %q till %q"
#: py/runtime.c
msgid "can't convert %q to int"
msgstr "kan inte konvertera %q till int"
#: py/objstr.c
msgid "can't convert '%q' object to %q implicitly"
msgstr "kan inte konvertera '%q' objekt implicit till %q"
@ -2642,6 +2643,10 @@ msgstr "kan inte konvertera '%q' objekt implicit till %q"
msgid "can't convert to %q"
msgstr "kan inte konvertera till %q"
#: py/runtime.c
msgid "can't convert to int"
msgstr "kan inte konvertera till int"
#: py/objstr.c
msgid "can't convert to str implicitly"
msgstr "kan inte implicit konvertera till str"
@ -2997,7 +3002,7 @@ msgid "f-string: single '}' is not allowed"
msgstr "f-string: singel '}' är inte tillåten"
#: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c
#: shared-bindings/displayio/OnDiskBitmap.c
#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c
msgid "file must be a file opened in byte mode"
msgstr "filen måste vara en fil som öppnats i byte-läge"
@ -3050,7 +3055,7 @@ msgid "full"
msgstr "full"
#: py/argcheck.c
msgid "function does not take keyword arguments"
msgid "function doesn't take keyword arguments"
msgstr "funktionen tar inte nyckelordsargument"
#: py/argcheck.c
@ -3105,6 +3110,10 @@ msgstr "generatorn kör redan"
msgid "generator ignored GeneratorExit"
msgstr "generatorn ignorerade GeneratorExit"
#: py/objgenerator.c
msgid "generator raised StopIteration"
msgstr "generator kastade StopIteration"
#: shared-bindings/_stage/Layer.c
msgid "graphic must be 2048 bytes long"
msgstr "graphic måste vara 2048 byte lång"
@ -3253,6 +3262,10 @@ msgstr "ogiltig bits_per_pixel %d, måste vara 1, 4, 8, 16, 24 eller 32"
msgid "invalid cert"
msgstr "ogiltigt certifikat"
#: py/compile.c
msgid "invalid decorator"
msgstr "ogiltig dekorator"
#: extmod/uos_dupterm.c
msgid "invalid dupterm index"
msgstr "ogiltigt dupterm index"
@ -3308,10 +3321,6 @@ msgstr "ogiltig syntax för heltal med bas %d"
msgid "invalid syntax for number"
msgstr "ogiltig syntax för tal"
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "io must be rtc io"
msgstr "io måste vara rtc io"
#: py/objtype.c
msgid "issubclass() arg 1 must be a class"
msgstr "issubclass() arg 1 måste vara en klass"
@ -3487,6 +3496,10 @@ msgstr "native yield"
msgid "need more than %d values to unpack"
msgstr "behöver mer än %d värden för att packa upp"
#: py/modmath.c
msgid "negative factorial"
msgstr "negativ faktoriell"
#: py/objint_longlong.c py/objint_mpz.c py/runtime.c
msgid "negative power with no float support"
msgstr "negativ exponent utan stöd för flyttal"
@ -3716,10 +3729,6 @@ msgstr "palette måste vara 32 bytes lång"
msgid "palette_index should be an int"
msgstr "palette_index ska vara en int"
#: py/compile.c
msgid "parameter annotation must be an identifier"
msgstr "parametern annotation måste vara en identifierare"
#: py/emitinlinextensa.c
msgid "parameters must be registers in sequence a2 to a5"
msgstr "parametrarna måste registreras i följd a2-a5"
@ -3775,6 +3784,8 @@ msgstr "pow() med 3 argument kräver heltal"
#: ports/esp32s2/boards/adafruit_funhouse/mpconfigboard.h
#: ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h
#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h
#: ports/esp32s2/boards/artisense_rd00/mpconfigboard.h
#: ports/esp32s2/boards/atmegazero_esp32s2/mpconfigboard.h
#: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h
#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h
#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h
@ -3800,6 +3811,10 @@ msgstr "trycka på startknappen vid start.\n"
msgid "pressing both buttons at start up.\n"
msgstr "trycka båda knapparna vid uppstart.\n"
#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h
msgid "pressing the left button at start up\n"
msgstr "håll ner vänster knapp vid start\n"
#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
msgid "pull masks conflict with direction masks"
msgstr "pull-mask är i konflikt med riktnings-mask"
@ -4075,10 +4090,6 @@ msgstr "trapz är definierat för 1D-matriser"
msgid "trapz is defined for 1D arrays of equal length"
msgstr "trapz är definierad för 1D-matriser med samma längd"
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "trigger level must be 0 or 1"
msgstr "triggernivå måste vara 0 eller 1"
#: py/obj.c
msgid "tuple/list has wrong length"
msgstr "tupel/lista har fel längd"
@ -4160,7 +4171,7 @@ msgstr "okänd formatkod '%c' för objekt av typ '%q'"
msgid "unknown type"
msgstr "okänd typ"
#: py/emitnative.c
#: py/compile.c
msgid "unknown type '%q'"
msgstr "okänd typ '%q'"
@ -4213,10 +4224,6 @@ msgstr "värdet måste passa i %d byte(s)"
msgid "value_count must be > 0"
msgstr "value_count måste vara > 0"
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "wakeup conflict"
msgstr "wakeup-konflikt"
#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c
msgid "watchdog not initialized"
msgstr "watchdog är inte initierad"
@ -4303,6 +4310,45 @@ msgstr "zi måste vara av typ float"
msgid "zi must be of shape (n_section, 2)"
msgstr "zi måste vara i formen (n_section, 2)"
#~ msgid "Viper functions don't currently support more than 4 arguments"
#~ msgstr "Viper-funktioner stöder för närvarande inte mer än fyra argument"
#~ msgid "address %08x is not aligned to %d bytes"
#~ msgstr "adressen %08x är inte justerad till %d byte"
#~ msgid "function does not take keyword arguments"
#~ msgstr "funktionen tar inte nyckelordsargument"
#~ msgid "parameter annotation must be an identifier"
#~ msgstr "parametern annotation måste vara en identifierare"
#~ msgid "Total data to write is larger than outgoing_packet_length"
#~ msgstr "Total data som ska skrivas är större än outgoing_packet_length"
#~ msgid "IOs 0, 2 & 4 do not support internal pullup in sleep"
#~ msgstr "IO 0, 2 & 4 stöder inte intern pullup för sovläge"
#~ msgid "buffer must be a bytes-like object"
#~ msgstr "buffer måste vara en byte-liknande objekt"
#~ msgid "io must be rtc io"
#~ msgstr "io måste vara rtc io"
#~ msgid "trigger level must be 0 or 1"
#~ msgstr "triggernivå måste vara 0 eller 1"
#~ msgid "wakeup conflict"
#~ msgstr "wakeup-konflikt"
#~ msgid "Attempted heap allocation when MicroPython VM not running."
#~ msgstr "Försökte tilldela heap när MicroPython VM inte körs."
#~ msgid "MicroPython NLR jump failed. Likely memory corruption."
#~ msgstr "MicroPython NLR jump misslyckades. Troligen korrupt minne."
#~ msgid "MicroPython fatal error."
#~ msgstr "MicroPython fatalt fel."
#~ msgid "argument must be ndarray"
#~ msgstr "argument måste vara ndarray"
@ -4578,9 +4624,6 @@ msgstr "zi måste vara i formen (n_section, 2)"
#~ msgid "can't convert to float"
#~ msgstr "kan inte konvertera till float"
#~ msgid "can't convert to int"
#~ msgstr "kan inte konvertera till int"
#~ msgid "object '%s' is not a tuple or list"
#~ msgstr "objektet '%s' är inte en tupel eller lista"

View File

@ -7,7 +7,7 @@ msgstr ""
"Project-Id-Version: circuitpython-cn\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-01-04 12:55-0600\n"
"PO-Revision-Date: 2021-03-29 08:26+0000\n"
"PO-Revision-Date: 2021-04-19 19:15+0000\n"
"Last-Translator: hexthat <hexthat@gmail.com>\n"
"Language-Team: Chinese Hanyu Pinyin\n"
"Language: zh_Latn_pinyin\n"
@ -15,7 +15,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Weblate 4.6-dev\n"
"X-Generator: Weblate 4.7-dev\n"
#: main.c
msgid ""
@ -423,7 +423,7 @@ msgstr "Wèi zhīchí zhǐdìng de yǐn jiǎo AnalogOut"
#: ports/stm/common-hal/audiopwmio/PWMAudioOut.c
msgid "Another PWMAudioOut is already active"
msgstr ""
msgstr "lìng yí gè PWMAudioOut yǐ jīng chǔ yú huó dòng zhuàng tài"
#: ports/atmel-samd/common-hal/pulseio/PulseOut.c
#: ports/cxd56/common-hal/pulseio/PulseOut.c
@ -448,8 +448,8 @@ msgid "Attempt to allocate %d blocks"
msgstr "cháng shì fēn pèi %d kuài"
#: supervisor/shared/safe_mode.c
msgid "Attempted heap allocation when MicroPython VM not running."
msgstr "MicroPython VM zài wèi yùnxíng shí chángshì fēnpèi duī."
msgid "Attempted heap allocation when VM not running."
msgstr "dāng VM bú yùn xíng shí, cháng shì duī fēn pèi."
#: shared-bindings/wifi/Radio.c
msgid "Authentication failure"
@ -895,6 +895,11 @@ msgstr "ESP-IDF nèicún fēnpèi shībài"
msgid "EXTINT channel already in use"
msgstr "EXTINT píndào yǐjīng shǐyòng"
#: shared-module/synthio/MidiTrack.c
#, c-format
msgid "Error in MIDI stream at position %d"
msgstr "wèi yú %d wèi zhì de MIDI liú zhōng de cuò wù"
#: extmod/modure.c
msgid "Error in regex"
msgstr "Zhèngzé biǎodá shì cuòwù"
@ -997,7 +1002,7 @@ msgstr "Wúfǎ fēnpèi wifi sǎomiáo nèicún"
#: ports/stm/common-hal/audiopwmio/PWMAudioOut.c
msgid "Failed to buffer the sample"
msgstr ""
msgstr "wèi néng huǎn chōng yàng běn"
#: ports/nrf/common-hal/_bleio/Adapter.c
msgid "Failed to connect: internal error"
@ -1024,6 +1029,10 @@ msgstr "Wúfǎ shìfàng mutex, err 0x%04x"
msgid "Failed to write internal flash."
msgstr "Wúfǎ xiě rù nèibù shǎncún."
#: supervisor/shared/safe_mode.c
msgid "Fatal error."
msgstr "zhì mìng cuò wù."
#: py/moduerrno.c
msgid "File exists"
msgstr "Wénjiàn cúnzài"
@ -1096,10 +1105,6 @@ msgstr "I2C wài shè zhèng zài shǐ yòng zhōng"
msgid "I2SOut not available"
msgstr "I2SOut bù kě yòng"
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "IOs 0, 2 & 4 do not support internal pullup in sleep"
msgstr "IOS 0, 2 + 4 bù zhī chí shuì mián zhōng de nèi bù shàng lā"
#: shared-bindings/aesio/aes.c
#, c-format
msgid "IV must be %d bytes long"
@ -1230,6 +1235,10 @@ msgstr "Wúxiào de BSSID"
msgid "Invalid DAC pin supplied"
msgstr "Tí gōng liǎo wúxiào de DAC yǐn jiǎo"
#: shared-bindings/synthio/__init__.c
msgid "Invalid MIDI file"
msgstr "wú xiào de MIDI wén jiàn"
#: ports/atmel-samd/common-hal/pwmio/PWMOut.c
#: ports/cxd56/common-hal/pwmio/PWMOut.c
#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c
@ -1421,14 +1430,6 @@ msgstr "Jìngxiàng shí de zuìdà X zhí wèi%d"
msgid "Messages limited to 8 bytes"
msgstr "Yóujiàn xiànzhì wèi 8 gè zì jié"
#: supervisor/shared/safe_mode.c
msgid "MicroPython NLR jump failed. Likely memory corruption."
msgstr "MicroPython NLR tiào zhuǎn shībài. Kěnéng shì nèicún sǔnhuài."
#: supervisor/shared/safe_mode.c
msgid "MicroPython fatal error."
msgstr "MicroPython zhìmìng cuòwù."
#: shared-bindings/audiobusio/PDMIn.c
msgid "Microphone startup delay must be in range 0.0 to 1.0"
msgstr "Màikèfēng qǐdòng yánchí bìxū zài 0.0 Dào 1.0 De fànwéi nèi"
@ -1481,6 +1482,10 @@ msgstr "Bìxū tígōng MISO huò MOSI yǐn jiǎo"
msgid "Must use a multiple of 6 rgb pins, not %d"
msgstr "bì xū shǐ yòng 6 RGB yǐn jiǎo de bèi shù, ér bù shì %d"
#: supervisor/shared/safe_mode.c
msgid "NLR jump failed. Likely memory corruption."
msgstr "NLR tiào zhuǎn shī bài. kě néng shì nèi cún sǔn huài."
#: ports/esp32s2/common-hal/nvm/ByteArray.c
msgid "NVS Error"
msgstr "NVS cuò wù"
@ -1615,16 +1620,17 @@ msgstr "Méiyǒu jìshí qì"
#: supervisor/shared/safe_mode.c
msgid "Nordic system firmware failure assertion."
msgstr ""
msgstr "běi ōu xì tǒng gù jiàn gù zhàng duàn yán."
#: ports/nrf/common-hal/_bleio/__init__.c
msgid "Nordic system firmware out of memory"
msgstr ""
msgstr "běi ōu xì tǒng gù jiàn chū nèi cún"
#: shared-bindings/ipaddress/IPv4Address.c shared-bindings/ipaddress/__init__.c
msgid "Not a valid IP string"
msgstr "Wúxiào de IP zìfú chuàn"
#: ports/nrf/common-hal/_bleio/PacketBuffer.c
#: ports/nrf/common-hal/_bleio/__init__.c
#: shared-bindings/_bleio/CharacteristicBuffer.c
msgid "Not connected"
@ -2169,8 +2175,8 @@ msgid "Too many displays"
msgstr "Xiǎnshì tài duō"
#: ports/nrf/common-hal/_bleio/PacketBuffer.c
msgid "Total data to write is larger than outgoing_packet_length"
msgstr "Yào xiě rù de zǒng shùjù dàyú outgoing_packet_length"
msgid "Total data to write is larger than %q"
msgstr ""
#: py/obj.c
msgid "Traceback (most recent call last):\n"
@ -2288,7 +2294,7 @@ msgstr "Wèizhī de ānquán cuòwù: 0x%04x"
#: ports/nrf/common-hal/_bleio/__init__.c
#, c-format
msgid "Unknown system firmware error: %04x"
msgstr ""
msgstr "wèi zhī xì tǒng gù jiàn cuò wù: %04x"
#: shared-bindings/_pixelbuf/PixelBuf.c
#, c-format
@ -2343,10 +2349,6 @@ msgstr "Zhí chángdù > zuìdà chángdù"
msgid "Version was invalid"
msgstr "bǎn běn wú xiào"
#: py/emitnative.c
msgid "Viper functions don't currently support more than 4 arguments"
msgstr "Viper hánshù mùqián bù zhīchí chāoguò 4 gè cānshù"
#: ports/stm/common-hal/microcontroller/Processor.c
msgid "Voltage read timed out"
msgstr "Diànyā dòu qǔ chāoshí"
@ -2433,11 +2435,6 @@ msgstr "xūyào yīgè zì jié lèi duìxiàng"
msgid "abort() called"
msgstr "zhōngzhǐ () diàoyòng"
#: extmod/machine_mem.c
#, c-format
msgid "address %08x is not aligned to %d bytes"
msgstr "wèi zhǐ %08x wèi yǔ %d wèi yuán zǔ duìqí"
#: shared-bindings/i2cperipheral/I2CPeripheral.c
msgid "address out of bounds"
msgstr "dìzhǐ chāochū biānjiè"
@ -2446,6 +2443,10 @@ msgstr "dìzhǐ chāochū biānjiè"
msgid "addresses is empty"
msgstr "dìzhǐ wèi kōng"
#: py/compile.c
msgid "annotation must be an identifier"
msgstr ""
#: py/modbuiltins.c
msgid "arg is an empty sequence"
msgstr "cānshù shì yīgè kōng de xùliè"
@ -2545,10 +2546,6 @@ msgstr "fēnzhī bùzài fànwéi nèi"
msgid "buffer is smaller than requested size"
msgstr "huǎn chōng qū xiǎo yú qǐng qiú de dà xiǎo"
#: shared-bindings/audiocore/RawSample.c
msgid "buffer must be a bytes-like object"
msgstr "huǎnchōng qū bìxū shì zì jié lèi duìxiàng"
#: extmod/ulab/code/ulab_create.c extmod/ulab/code/utils/utils.c
msgid "buffer size must be a multiple of element size"
msgstr "huǎn chōng qū dà xiǎo bì xū shì yuán sù dà xiǎo de bèi shù"
@ -2632,6 +2629,10 @@ msgstr "bùnéng fēnpèi dào biǎodá shì"
msgid "can't convert %q to %q"
msgstr "Wúfǎ jiāng %q zhuǎnhuàn wèi %q"
#: py/runtime.c
msgid "can't convert %q to int"
msgstr ""
#: py/objstr.c
msgid "can't convert '%q' object to %q implicitly"
msgstr "wúfǎ jiāng '%q' duìxiàng zhuǎnhuàn wèi %q yǐn hán"
@ -2640,6 +2641,10 @@ msgstr "wúfǎ jiāng '%q' duìxiàng zhuǎnhuàn wèi %q yǐn hán"
msgid "can't convert to %q"
msgstr "wúfǎ zhuǎnhuàn wèi %q"
#: py/runtime.c
msgid "can't convert to int"
msgstr "bùnéng zhuǎnhuàn wèi int"
#: py/objstr.c
msgid "can't convert to str implicitly"
msgstr "bùnéng mò shì zhuǎnhuàn wèi str"
@ -2996,7 +3001,7 @@ msgid "f-string: single '}' is not allowed"
msgstr "f-string: bù yǔnxǔ shǐyòng dāngè '}'"
#: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c
#: shared-bindings/displayio/OnDiskBitmap.c
#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c
msgid "file must be a file opened in byte mode"
msgstr "wénjiàn bìxū shì zài zì jié móshì xià dǎkāi de wénjiàn"
@ -3049,8 +3054,8 @@ msgid "full"
msgstr "chōngfèn"
#: py/argcheck.c
msgid "function does not take keyword arguments"
msgstr "hánshù méiyǒu guānjiàn cí cānshù"
msgid "function doesn't take keyword arguments"
msgstr ""
#: py/argcheck.c
#, c-format
@ -3104,6 +3109,10 @@ msgstr "shēngchéng qì yǐjīng zhíxíng"
msgid "generator ignored GeneratorExit"
msgstr "shēngchéng qì hūlüè shēngchéng qì tuìchū"
#: py/objgenerator.c
msgid "generator raised StopIteration"
msgstr ""
#: shared-bindings/_stage/Layer.c
msgid "graphic must be 2048 bytes long"
msgstr "túxíng bìxū wèi 2048 zì jié"
@ -3252,6 +3261,10 @@ msgstr "wú xiào bits_per_pixel %d bì xū shì, 1, 4, 8, 16, 24, huò 32"
msgid "invalid cert"
msgstr "zhèngshū wúxiào"
#: py/compile.c
msgid "invalid decorator"
msgstr "wú xiào zhuāng shì"
#: extmod/uos_dupterm.c
msgid "invalid dupterm index"
msgstr "dupterm suǒyǐn wúxiào"
@ -3307,10 +3320,6 @@ msgstr "jīshù wèi %d de zhěng shǔ de yǔfǎ wúxiào"
msgid "invalid syntax for number"
msgstr "wúxiào de hàomǎ yǔfǎ"
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "io must be rtc io"
msgstr "IO bì xū shì RTC IO"
#: py/objtype.c
msgid "issubclass() arg 1 must be a class"
msgstr "issubclass() cānshù 1 bìxū shì yīgè lèi"
@ -3484,6 +3493,10 @@ msgstr "yuán chǎn"
msgid "need more than %d values to unpack"
msgstr "xūyào chāoguò%d de zhí cáinéng jiědú"
#: py/modmath.c
msgid "negative factorial"
msgstr ""
#: py/objint_longlong.c py/objint_mpz.c py/runtime.c
msgid "negative power with no float support"
msgstr "méiyǒu fú diǎn zhīchí de xiāojí gōnglǜ"
@ -3682,11 +3695,11 @@ msgstr "ord() yùqí zìfú, dàn chángdù zìfú chuàn %d"
#: extmod/ulab/code/utils/utils.c
msgid "out array is too small"
msgstr ""
msgstr "chū zhèn liè tài xiǎo"
#: extmod/ulab/code/utils/utils.c
msgid "out must be a float dense array"
msgstr ""
msgstr "chū bì xū shì yí gè fú dòng mì jí zhèn liè"
#: shared-bindings/displayio/Bitmap.c
msgid "out of range of source"
@ -3713,10 +3726,6 @@ msgstr "yánsè bìxū shì 32 gè zì jié"
msgid "palette_index should be an int"
msgstr "yánsè suǒyǐn yīnggāi shì yīgè zhěngshù"
#: py/compile.c
msgid "parameter annotation must be an identifier"
msgstr "cānshù zhùshì bìxū shì biāozhì fú"
#: py/emitinlinextensa.c
msgid "parameters must be registers in sequence a2 to a5"
msgstr "cānshù bìxū shì xùliè a2 zhì a5 de dēngjì shù"
@ -3771,6 +3780,8 @@ msgstr "pow() yǒu 3 cānshù xūyào zhěngshù"
#: ports/esp32s2/boards/adafruit_funhouse/mpconfigboard.h
#: ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h
#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h
#: ports/esp32s2/boards/artisense_rd00/mpconfigboard.h
#: ports/esp32s2/boards/atmegazero_esp32s2/mpconfigboard.h
#: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h
#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h
#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h
@ -3796,6 +3807,10 @@ msgstr "Zài qǐdòng shí àn qǐdòng ànniǔ.\n"
msgid "pressing both buttons at start up.\n"
msgstr "zài qǐdòng shí tóngshí àn xià liǎng gè ànniǔ.\n"
#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h
msgid "pressing the left button at start up\n"
msgstr ""
#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
msgid "pull masks conflict with direction masks"
msgstr "lā kǒu zhào yǔ fāng xiàng miàn mó chōng tū"
@ -4071,10 +4086,6 @@ msgstr "wéi 1D shù zǔ dìng yì xiàn jǐng"
msgid "trapz is defined for 1D arrays of equal length"
msgstr "Trapz shì wèi děng zhǎng de 1D shùzǔ dìngyì de"
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "trigger level must be 0 or 1"
msgstr "chù fā jí bié bì xū wéi 0 huò 1"
#: py/obj.c
msgid "tuple/list has wrong length"
msgstr "yuán zǔ/lièbiǎo chángdù cuòwù"
@ -4156,7 +4167,7 @@ msgstr "lèixíng '%q' de duìxiàng de wèizhī géshì dàimǎ '%c'"
msgid "unknown type"
msgstr "wèizhī lèixíng"
#: py/emitnative.c
#: py/compile.c
msgid "unknown type '%q'"
msgstr "wèizhī lèixíng '%q'"
@ -4209,10 +4220,6 @@ msgstr "Zhí bìxū fúhé %d zì jié"
msgid "value_count must be > 0"
msgstr "zhí jìshù bìxū wèi > 0"
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "wakeup conflict"
msgstr "huàn xǐng chōng tū"
#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c
msgid "watchdog not initialized"
msgstr "wèi chū shǐ huà jiān shì qì"
@ -4299,6 +4306,45 @@ msgstr "zi bìxū wèi fú diǎn xíng"
msgid "zi must be of shape (n_section, 2)"
msgstr "zi bìxū jùyǒu xíngzhuàng (n_section,2)"
#~ msgid "Viper functions don't currently support more than 4 arguments"
#~ msgstr "Viper hánshù mùqián bù zhīchí chāoguò 4 gè cānshù"
#~ msgid "address %08x is not aligned to %d bytes"
#~ msgstr "wèi zhǐ %08x wèi yǔ %d wèi yuán zǔ duìqí"
#~ msgid "function does not take keyword arguments"
#~ msgstr "hánshù méiyǒu guānjiàn cí cānshù"
#~ msgid "parameter annotation must be an identifier"
#~ msgstr "cānshù zhùshì bìxū shì biāozhì fú"
#~ msgid "Total data to write is larger than outgoing_packet_length"
#~ msgstr "Yào xiě rù de zǒng shùjù dàyú outgoing_packet_length"
#~ msgid "IOs 0, 2 & 4 do not support internal pullup in sleep"
#~ msgstr "IOS 0, 2 + 4 bù zhī chí shuì mián zhōng de nèi bù shàng lā"
#~ msgid "buffer must be a bytes-like object"
#~ msgstr "huǎnchōng qū bìxū shì zì jié lèi duìxiàng"
#~ msgid "io must be rtc io"
#~ msgstr "IO bì xū shì RTC IO"
#~ msgid "trigger level must be 0 or 1"
#~ msgstr "chù fā jí bié bì xū wéi 0 huò 1"
#~ msgid "wakeup conflict"
#~ msgstr "huàn xǐng chōng tū"
#~ msgid "Attempted heap allocation when MicroPython VM not running."
#~ msgstr "MicroPython VM zài wèi yùnxíng shí chángshì fēnpèi duī."
#~ msgid "MicroPython NLR jump failed. Likely memory corruption."
#~ msgstr "MicroPython NLR tiào zhuǎn shībài. Kěnéng shì nèicún sǔnhuài."
#~ msgid "MicroPython fatal error."
#~ msgstr "MicroPython zhìmìng cuòwù."
#~ msgid "argument must be ndarray"
#~ msgstr "Cānshù bìxū shì ndarray"
@ -4548,9 +4594,6 @@ msgstr "zi bìxū jùyǒu xíngzhuàng (n_section,2)"
#~ msgid "can't convert to float"
#~ msgstr "bùnéng zhuǎnhuàn wèi fú diǎn"
#~ msgid "can't convert to int"
#~ msgstr "bùnéng zhuǎnhuàn wèi int"
#~ msgid "object '%s' is not a tuple or list"
#~ msgstr "duìxiàng '%s' bùshì yuán zǔ huò lièbiǎo"

4
main.c
View File

@ -60,6 +60,7 @@
#include "supervisor/shared/translate.h"
#include "supervisor/shared/workflow.h"
#include "supervisor/usb.h"
#include "supervisor/workflow.h"
#include "shared-bindings/microcontroller/__init__.h"
#include "shared-bindings/microcontroller/Processor.h"
@ -210,7 +211,10 @@ STATIC void stop_mp(void) {
#endif
background_callback_reset();
#if CIRCUITPY_USB
usb_background();
#endif
gc_deinit();
}

View File

@ -9,6 +9,8 @@ ifneq ($(findstring undefine,$(.FEATURES)),)
override undefine COPT
override undefine CFLAGS_EXTRA
override undefine LDFLAGS_EXTRA
override undefine MICROPY_FORCE_32BIT
override undefine CROSS_COMPILE
override undefine FROZEN_DIR
override undefine FROZEN_MPY_DIR
override undefine BUILD

View File

@ -2,4 +2,5 @@
//
// SPDX-License-Identifier: MIT
// empty file
// prevent including extmod/virtpin.h
#define mp_hal_pin_obj_t

View File

@ -22,8 +22,8 @@ UNAME_S := $(shell uname -s)
# include py core make definitions
include $(TOP)/py/py.mk
INC += -I.
INC += -I$(TOP)
INC += -I.
INC += -I$(TOP)
INC += -I$(BUILD)
# compiler settings
@ -79,7 +79,7 @@ ifneq (,$(findstring mingw,$(COMPILER_TARGET)))
SRC_C += fmode.c
endif
OBJ = $(PY_O)
OBJ = $(PY_CORE_O)
OBJ += $(addprefix $(BUILD)/, $(SRC_C:.c=.o))
$(BUILD)/supervisor/shared/translate.o: $(HEADER_BUILD)/qstrdefs.generated.h

View File

@ -45,7 +45,15 @@ static volatile bool audio_dma_pending[AUDIO_DMA_CHANNEL_COUNT];
static bool audio_dma_allocated[AUDIO_DMA_CHANNEL_COUNT];
uint8_t audio_dma_allocate_channel(void) {
uint8_t find_sync_event_channel_raise() {
uint8_t event_channel = find_sync_event_channel();
if (event_channel >= EVSYS_SYNCH_NUM) {
mp_raise_RuntimeError(translate("All sync event channels in use"));
}
return event_channel;
}
uint8_t dma_allocate_channel(void) {
uint8_t channel;
for (channel = 0; channel < AUDIO_DMA_CHANNEL_COUNT; channel++) {
if (!audio_dma_allocated[channel]) {
@ -56,7 +64,7 @@ uint8_t audio_dma_allocate_channel(void) {
return channel; // i.e., return failure
}
void audio_dma_free_channel(uint8_t channel) {
void dma_free_channel(uint8_t channel) {
assert(channel < AUDIO_DMA_CHANNEL_COUNT);
assert(audio_dma_allocated[channel]);
audio_dma_disable_channel(channel);
@ -180,7 +188,7 @@ audio_dma_result audio_dma_setup_playback(audio_dma_t *dma,
bool output_signed,
uint32_t output_register_address,
uint8_t dma_trigger_source) {
uint8_t dma_channel = audio_dma_allocate_channel();
uint8_t dma_channel = dma_allocate_channel();
if (dma_channel >= AUDIO_DMA_CHANNEL_COUNT) {
return AUDIO_DMA_DMA_BUSY;
}
@ -230,11 +238,7 @@ audio_dma_result audio_dma_setup_playback(audio_dma_t *dma,
// We're likely double buffering so set up the block interrupts.
turn_on_event_system();
dma->event_channel = find_sync_event_channel();
if (dma->event_channel >= EVSYS_SYNCH_NUM) {
mp_raise_RuntimeError(translate("All sync event channels in use"));
}
dma->event_channel = find_sync_event_channel_raise();
init_event_channel_interrupt(dma->event_channel, CORE_GCLK, EVSYS_ID_GEN_DMAC_CH_0 + dma_channel);
// We keep the audio_dma_t for internal use and the sample as a root pointer because it
@ -302,7 +306,7 @@ void audio_dma_stop(audio_dma_t *dma) {
disable_event_channel(dma->event_channel);
MP_STATE_PORT(playing_audio)[channel] = NULL;
audio_dma_state[channel] = NULL;
audio_dma_free_channel(dma->dma_channel);
dma_free_channel(dma->dma_channel);
}
dma->dma_channel = AUDIO_DMA_CHANNEL_COUNT;
}

View File

@ -66,8 +66,8 @@ uint8_t audiosample_channel_count(mp_obj_t sample_obj);
void audio_dma_init(audio_dma_t *dma);
void audio_dma_reset(void);
uint8_t audio_dma_allocate_channel(void);
void audio_dma_free_channel(uint8_t channel);
uint8_t dma_allocate_channel(void);
void dma_free_channel(uint8_t channel);
// This sets everything up but doesn't start the timer.
// Sample is the python object for the sample to play.
@ -97,4 +97,6 @@ bool audio_dma_get_paused(audio_dma_t *dma);
void audio_dma_background(void);
uint8_t find_sync_event_channel_raise(void);
#endif // MICROPY_INCLUDED_ATMEL_SAMD_AUDIO_DMA_H

View File

@ -0,0 +1,58 @@
#define MICROPY_HW_BOARD_NAME "Adafruit NeoKey Trinkey M0"
#define MICROPY_HW_MCU_NAME "samd21e18"
#define MICROPY_HW_NEOPIXEL (&pin_PA15)
#define MICROPY_PORT_A (0)
#define MICROPY_PORT_B (0)
#define MICROPY_PORT_C (0)
#define IGNORE_PIN_PA00 1
#define IGNORE_PIN_PA01 1
#define IGNORE_PIN_PA02 1
#define IGNORE_PIN_PA03 1
#define IGNORE_PIN_PA04 1
#define IGNORE_PIN_PA05 1
#define IGNORE_PIN_PA06 1
#define IGNORE_PIN_PA08 1
#define IGNORE_PIN_PA09 1
#define IGNORE_PIN_PA10 1
#define IGNORE_PIN_PA11 1
#define IGNORE_PIN_PA12 1
#define IGNORE_PIN_PA13 1
#define IGNORE_PIN_PA14 1
#define IGNORE_PIN_PA16 1
#define IGNORE_PIN_PA17 1
#define IGNORE_PIN_PA18 1
#define IGNORE_PIN_PA19 1
#define IGNORE_PIN_PA20 1
#define IGNORE_PIN_PA21 1
// USB is always used internally so skip the pin objects for it.
#define IGNORE_PIN_PA24 1
#define IGNORE_PIN_PA25 1
#define IGNORE_PIN_PA27 1
#define IGNORE_PIN_PA29 1
#define IGNORE_PIN_PA30 1
#define IGNORE_PIN_PA31 1
#define IGNORE_PIN_PB00 1
#define IGNORE_PIN_PB01 1
#define IGNORE_PIN_PB02 1
#define IGNORE_PIN_PB03 1
#define IGNORE_PIN_PB04 1
#define IGNORE_PIN_PB05 1
#define IGNORE_PIN_PB06 1
#define IGNORE_PIN_PB07 1
#define IGNORE_PIN_PB08 1
#define IGNORE_PIN_PB09 1
#define IGNORE_PIN_PB10 1
#define IGNORE_PIN_PB11 1
#define IGNORE_PIN_PB12 1
#define IGNORE_PIN_PB13 1
#define IGNORE_PIN_PB14 1
#define IGNORE_PIN_PB15 1
#define IGNORE_PIN_PB16 1
#define IGNORE_PIN_PB17 1
#define IGNORE_PIN_PB22 1
#define IGNORE_PIN_PB23 1
#define IGNORE_PIN_PB30 1
#define IGNORE_PIN_PB31 1

View File

@ -0,0 +1,34 @@
USB_VID = 0x239A
USB_PID = 0x8100
USB_PRODUCT = "NeoKey Trinkey M0"
USB_MANUFACTURER = "Adafruit Industries LLC"
CHIP_VARIANT = SAMD21E18A
CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_ANALOGIO = 0
CIRCUITPY_ROTARYIO = 0
CIRCUITPY_RTC = 0
CIRCUITPY_SAMD = 0
CIRCUITPY_PS2IO = 0
CIRCUITPY_PULSEIO = 0
CIRCUITPY_PWMIO = 0
CIRCUITPY_AUDIOCORE = 0
CIRCUITPY_BUSIO = 0
CIRCUITPY_STORAGE = 1
CIRCUITPY_MATH = 1
CIRCUITPY_PIXELBUF = 1
CIRCUITPY_USB_MIDI = 1
CIRCUITPY_TOUCHIO = 1
CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0
SUPEROPT_VM = 0
# Include these Python libraries in firmware.
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_HID

View File

@ -0,0 +1,8 @@
#include "shared-bindings/board/__init__.h"
STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_TOUCH), MP_ROM_PTR(&pin_PA07) },
{ MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PA15) },
{ MP_ROM_QSTR(MP_QSTR_SWITCH), MP_ROM_PTR(&pin_PA28) },
};
MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table);

View File

@ -0,0 +1,40 @@
/*
* This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2017 Scott Shawcroft 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 "supervisor/board.h"
#include "common-hal/microcontroller/Pin.h"
#include "supervisor/shared/board.h"
#include "hal/include/hal_gpio.h"
void board_init(void) {
}
bool board_requests_safe_mode(void) {
return false;
}
void reset_board(void) {
}

View File

@ -0,0 +1,58 @@
#define MICROPY_HW_BOARD_NAME "Adafruit ProxLight Trinkey M0"
#define MICROPY_HW_MCU_NAME "samd21e18"
#define MICROPY_HW_NEOPIXEL (&pin_PA15)
#define MICROPY_PORT_A (0)
#define MICROPY_PORT_B (0)
#define MICROPY_PORT_C (0)
#define IGNORE_PIN_PA01 1
#define IGNORE_PIN_PA02 1
#define IGNORE_PIN_PA04 1
#define IGNORE_PIN_PA05 1
#define IGNORE_PIN_PA06 1
#define IGNORE_PIN_PA08 1
#define IGNORE_PIN_PA09 1
#define IGNORE_PIN_PA10 1
#define IGNORE_PIN_PA11 1
#define IGNORE_PIN_PA12 1
#define IGNORE_PIN_PA13 1
#define IGNORE_PIN_PA14 1
#define IGNORE_PIN_PA18 1
#define IGNORE_PIN_PA19 1
#define IGNORE_PIN_PA20 1
#define IGNORE_PIN_PA21 1
// USB is always used internally so skip the pin objects for it.
#define IGNORE_PIN_PA24 1
#define IGNORE_PIN_PA25 1
#define IGNORE_PIN_PA27 1
#define IGNORE_PIN_PA28 1
#define IGNORE_PIN_PA29 1
#define IGNORE_PIN_PA30 1
#define IGNORE_PIN_PA31 1
#define IGNORE_PIN_PB00 1
#define IGNORE_PIN_PB01 1
#define IGNORE_PIN_PB02 1
#define IGNORE_PIN_PB03 1
#define IGNORE_PIN_PB04 1
#define IGNORE_PIN_PB05 1
#define IGNORE_PIN_PB06 1
#define IGNORE_PIN_PB07 1
#define IGNORE_PIN_PB08 1
#define IGNORE_PIN_PB09 1
#define IGNORE_PIN_PB10 1
#define IGNORE_PIN_PB11 1
#define IGNORE_PIN_PB12 1
#define IGNORE_PIN_PB13 1
#define IGNORE_PIN_PB14 1
#define IGNORE_PIN_PB15 1
#define IGNORE_PIN_PB16 1
#define IGNORE_PIN_PB17 1
#define IGNORE_PIN_PB22 1
#define IGNORE_PIN_PB23 1
#define IGNORE_PIN_PB30 1
#define IGNORE_PIN_PB31 1
#define DEFAULT_I2C_BUS_SCL (&pin_PA17)
#define DEFAULT_I2C_BUS_SDA (&pin_PA16)

Some files were not shown because too many files have changed in this diff Show More