# pyOCD debugger
# Copyright (c) 2018 Arm Limited
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from enum import Enum

class DebugProbe(object):
    """! @brief Abstract debug probe class."""

    class Protocol(Enum):
        """! @brief Debug wire protocols."""
        DEFAULT = 0
        SWD = 1
        JTAG = 2
    
    @classmethod
    def get_all_connected_probes(cls):
        raise NotImplementedError()
    
    @classmethod
    def get_probe_with_id(cls, unique_id):
        raise NotImplementedError()
    
    @property
    def description(self):
        return self.vendor_name + " " + self.product_name
    
    @property
    def vendor_name(self):
        raise NotImplementedError()
    
    @property
    def product_name(self):
        raise NotImplementedError()
    
    @property
    def supported_wire_protocols(self):
        raise NotImplementedError()

    @property
    def unique_id(self):
        """! @brief The unique ID of this device.
        
        This property will be valid before open() is called. This value can be passed to
        get_probe_with_id().
        """
        raise NotImplementedError()

    @property
    def wire_protocol(self):
        """! @brief Currently selected wire protocol.
        
        If the probe is not connected, i.e., connect() has not been called, then this
        property will be None.
        """
        raise NotImplementedError()
    
    @property
    def is_open(self):
        raise NotImplementedError()

    def create_associated_board(self, session):
        """! @brief Create a board instance representing the board of which the probe is a component.
        
        If the probe is part of a board, then this property will be a Board instance that represents
        the associated board. Usually, for an on-board debug probe, this would be the Board that
        the probe physically is part of. If the probe does not have an associated board, then this
        method returns None.
        
        @param session Session to pass to the board upon construction.
        """
        return None

    def open(self):
        raise NotImplementedError()
    
    def close(self):
        raise NotImplementedError()

    # ------------------------------------------- #
    #          Target control functions
    # ------------------------------------------- #
    def connect(self, protocol=None):
        """! @brief Initailize DAP IO pins for JTAG or SWD"""
        raise NotImplementedError()

    def disconnect(self):
        """! @brief Deinitialize the DAP I/O pins"""
        raise NotImplementedError()

    def set_clock(self, frequency):
        """! @brief Set the frequency for JTAG and SWD in Hz

        This function is safe to call before connect is called.
        """
        raise NotImplementedError()

    def reset(self):
        """! @brief Reset the target"""
        raise NotImplementedError()

    def assert_reset(self, asserted):
        """! @brief Assert or de-assert target reset line"""
        raise NotImplementedError()
    
    def is_reset_asserted(self):
        """! @brief Returns True if the target reset line is asserted or False if de-asserted"""
        raise NotImplementedError()

    def flush(self):
        """! @brief Write out all unsent commands"""
        raise NotImplementedError()

    def read_dp(self, addr, now=True):
        raise NotImplementedError()

    def write_dp(self, addr, data):
        raise NotImplementedError()

    def read_ap(self, addr, now=True):
        raise NotImplementedError()

    def write_ap(self, addr, data):
        raise NotImplementedError()

    def read_ap_multiple(self, addr, count=1, now=True):
        raise NotImplementedError()

    def write_ap_multiple(self, addr, values):
        raise NotImplementedError()
    
    def get_memory_interface_for_ap(self, apsel):
        return None
    
    def has_swo(self):
        """! @brief Returns bool indicating whether the link supports SWO."""
        raise NotImplementedError()

    def swo_start(self, baudrate):
        """! @brief Start receiving SWO data at the given baudrate."""
        raise NotImplementedError()

    def swo_stop(self):
        """! @brief Stop receiving SWO data."""
        raise NotImplementedError()

    def swo_read(self):
        """! @brief Read buffered SWO data from the target.
        
        @eturn Bytearray of the received data.
        """
        raise NotImplementedError()
    
    def __repr__(self):
        return "<{}@{:x} {}>".format(self.__class__.__name__, id(self), self.description)
  


@@ -2237,31 +2237,33 @@
 en this 
-property
+method
  will 
-b
+creat
 e a Boar
@@ -2277,16 +2277,24 @@
 nce that
+%0A       
  represe
@@ -2296,24 +2296,16 @@
 presents
-%0A       
  the ass
@@ -2374,16 +2374,24 @@
 d be the
+%0A       
  Board t
@@ -2393,24 +2393,16 @@
 ard that
-%0A       
  the pro
@@ -2425,16 +2425,51 @@
  part of
+, and will also set the target type
 . If the
@@ -2474,16 +2474,24 @@
 he probe
+%0A       
  does no
@@ -2527,24 +2527,16 @@
 hen this
-%0A       
  method 
@@ -2550,32 +2550,52 @@
  None.%0A        %0A
+        @param self%0A
         @param s
@@ -3007,18 +3007,18 @@
 ief Init
-a
 i
+a
 lize DAP

Correct some DebugProbe doc comments.