<commit_before>:mod:`machine` --- functions related to the board
=================================================

.. module:: machine
   :synopsis: functions related to the board

The ``machine`` module contains specific functions related to the board.

Reset related functions
-----------------------

.. function:: reset()

   Resets the device in a manner similar to pushing the external RESET
   button.

.. function:: reset_cause()

   Get the reset cause. See :ref:`constants <machine_constants>` for the possible return values.

.. only:: port_wipy

    Interrupt related functions
    ---------------------------

    .. function:: disable_irq()

       Disable interrupt requests.
       Returns the previous IRQ state: ``False``/``True`` for disabled/enabled IRQs
       respectively.  This return value can be passed to enable_irq to restore
       the IRQ to its original state.

    .. function:: enable_irq(state=True)

       Enable interrupt requests.
       If ``state`` is ``True`` (the default value) then IRQs are enabled.
       If ``state`` is ``False`` then IRQs are disabled.  The most common use of
       this function is to pass it the value returned by ``disable_irq`` to
       exit a critical section.

Power related functions
-----------------------

.. function:: freq()

    .. only:: not port_wipy

        Returns CPU frequency in hertz.

    .. only:: port_wipy

        Returns a tuple of clock frequencies: ``(sysclk,)``
        These correspond to:

        - sysclk: frequency of the CPU

.. function:: idle()
<commit_msg>docs/machine: Make disable_irq and enable_irq docs available for all.<commit_after>:mod:`machine` --- functions related to the board
=================================================

.. module:: machine
   :synopsis: functions related to the board

The ``machine`` module contains specific functions related to the board.

Reset related functions
-----------------------

.. function:: reset()

   Resets the device in a manner similar to pushing the external RESET
   button.

.. function:: reset_cause()

   Get the reset cause. See :ref:`constants <machine_constants>` for the possible return values.

Interrupt related functions
---------------------------

.. function:: disable_irq()

   Disable interrupt requests.
   Returns the previous IRQ state: ``False``/``True`` for disabled/enabled IRQs
   respectively.  This return value can be passed to enable_irq to restore
   the IRQ to its original state.

.. function:: enable_irq(state=True)

   Enable interrupt requests.
   If ``state`` is ``True`` (the default value) then IRQs are enabled.
   If ``state`` is ``False`` then IRQs are disabled.  The most common use of
   this function is to pass it the value returned by ``disable_irq`` to
   exit a critical section.

Power related functions
-----------------------

.. function:: freq()

    .. only:: not port_wipy

        Returns CPU frequency in hertz.

    .. only:: port_wipy

        Returns a tuple of clock frequencies: ``(sysclk,)``
        These correspond to:

        - sysclk: frequency of the CPU

.. function:: idle()

{'fraction_non_alphanumeric': 0.16232722597235616, 'fraction_numerical': 0.0, 'mean_word_length': 2.648300117233294, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1969380', 'n_tokens_mistral': 791, 'n_tokens_neox': 760, 'n_words': 344}