<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def swo_enable(self, cpu_speed, swo_speed=9600, port_mask=0x01):
 """Enables SWO output on the target device. Configures the output protocol, the SWO output speed, and enables any ITM & stimulus ports. This is equivalent to calling ``.swo_start()``. Note: If SWO is already enabled, it will first stop SWO before enabling it again. Args: self (JLink):
 the ``JLink`` instance cpu_speed (int):
 the target CPU frequency in Hz swo_speed (int):
 the frequency in Hz used by the target to communicate port_mask (int):
 port mask specifying which stimulus ports to enable Returns: ``None`` Raises: JLinkException: on error """

        if self.swo_enabled():
            self.swo_stop()

        res = self._dll.JLINKARM_SWO_EnableTarget(cpu_speed,
                                                  swo_speed,
                                                  enums.JLinkSWOInterfaces.UART,
                                                  port_mask)
        if res != 0:
            raise errors.JLinkException(res)

        self._swo_enabled = True

        return None