Hi,
The default configuration of SWT is described in reference manual in Table 17-1. SWT Memory Map. In column Reset Value you can read the configuration for your SWT.
By default SWT is enabled and will generate a reset on a time-out.
There is no need for sample code as the SWT is by default enabled and it is really simple.
If you want to configure it, then this is application specific.
One last remark:
If you are writing to protected SWT registers make sure you didn't forget unlock them. But this is written for every protected register:
The SWT_MCR contains fields for configuring and controlling the SWT. This register is read only if either the SWT_MCR[HLK] or SWT_MCR[SLK] bits are set.
Peter