source: rtems/bsps/arm/tms570/start/init_esm.c @ 350b07a0

5
Last change on this file since 350b07a0 was a62c75c1, checked in by Sebastian Huber <sebastian.huber@…>, on 04/22/18 at 13:38:55

bsp/tms570: Move more start to bsps

This patch is a part of the BSP source reorganization.

Update #3285.

  • Property mode set to 100644
File size: 1.3 KB
Line 
1/**
2 * @file init_esm.c
3 *
4 * @ingroup tms570
5 *
6 * @brief Error signaling module initialization
7 */
8
9#include <stdint.h>
10#include <bsp/tms570.h>
11#include "tms570_hwinit.h"
12
13/**
14 * @brief Error signaling module initialization (HCG:esmInit)
15 *
16 */
17void tms570_esm_init( void )
18{
19  /** - Disable error pin channels */
20  TMS570_ESM.DEPAPR1 = 0xFFFFFFFFU;
21  TMS570_ESM.IEPCR4 = 0xFFFFFFFFU;
22
23  /** - Disable interrupts */
24  TMS570_ESM.IECR1 = 0xFFFFFFFFU;
25  TMS570_ESM.IECR4 = 0xFFFFFFFFU;
26
27  /** - Clear error status flags */
28  TMS570_ESM.SR[0U] = 0xFFFFFFFFU;
29  TMS570_ESM.SR[1U] = 0xFFFFFFFFU;
30  TMS570_ESM.SSR2   = 0xFFFFFFFFU;
31  TMS570_ESM.SR[2U] = 0xFFFFFFFFU;
32  TMS570_ESM.SR4    = 0xFFFFFFFFU;
33
34  /** - Setup LPC preload */
35  TMS570_ESM.LTCPR = 16384U - 1U;
36
37  /** - Reset error pin */
38  if (TMS570_ESM.EPSR == 0U) {
39    TMS570_ESM.EKR = 0x00000005U;
40  } else {
41    TMS570_ESM.EKR = 0x00000000U;
42  }
43
44  /** - Clear interrupt level */
45  TMS570_ESM.ILCR1 = 0xFFFFFFFFU;
46  TMS570_ESM.ILCR4 = 0xFFFFFFFFU;
47
48  /** - Set interrupt level */
49  TMS570_ESM.ILSR1 = 0x00000000;
50
51  TMS570_ESM.ILSR4 = 0x00000000;
52
53  /** - Enable error pin channels */
54  TMS570_ESM.EEPAPR1 = 0x00000000;
55
56  TMS570_ESM.IEPSR4 = 0x00000000;
57
58  /** - Enable interrupts */
59  TMS570_ESM.IESR1 = 0x00000000;
60
61  TMS570_ESM.IESR4 = 0x00000000;
62}
Note: See TracBrowser for help on using the repository browser.