]> rtime.felk.cvut.cz Git - arc.git/blob - boards/ti_tms570ls/examples/tms570_hdk_can/config/Port_Cfg.h
Merge branch 'mikulka' of git@rtime.felk.cvut.cz:arc into mikulka
[arc.git] / boards / ti_tms570ls / examples / tms570_hdk_can / config / Port_Cfg.h
1 /*\r
2 * Configuration of module: Port (Port_Cfg.h)\r
3 *\r
4 * Created by:              \r
5 * Copyright:               \r
6 *\r
7 * Configured for (MCU):    TMS570\r
8 *\r
9 * Module vendor:           ArcCore\r
10 * Generator version:       2.0.2\r
11 *\r
12 * Generated by Arctic Studio (http://arccore.com) \r
13 */\r
14 \r
15 \r
16 #if !(((PORT_SW_MAJOR_VERSION == 1) && (PORT_SW_MINOR_VERSION == 0)) )\r
17 #error Port: Configuration file expected BSW module version to be 1.0.*\r
18 #endif\r
19 \r
20 \r
21 #ifndef PORT_CFG_H_\r
22 #define PORT_CFG_H_\r
23 \r
24 #include "Std_Types.h"\r
25 \r
26 // TODO - check if should change to STD_ON\r
27 /** Build version info API */\r
28 #define PORT_VERSION_INFO_API                           STD_ON\r
29 /** Enable Development Error Trace */\r
30 #define PORT_DEV_ERROR_DETECT                           STD_OFF\r
31 /** Build change pin direction API */\r
32 #define PORT_SET_PIN_DIRECTION_API              STD_ON\r
33 /** Allow Pin mode changes during runtime */\r
34 #define PORT_SET_PIN_MODE_API               STD_ON\r
35 \r
36 #define PORT_NUMBER_OF_PINS     5\r
37 \r
38 #define PORT_FUNC_NO    (0 << 1)\r
39 #define PORT_FUNC               (1 << 1)\r
40 #define PORT_PULL_NONE  (1 << 2)\r
41 #define PORT_PULL_UP    (1 << 3)\r
42 #define PORT_PULL_DOWN  (0 << 3)\r
43 #define PORT_ODE_ENABLE (1 << 4)\r
44 #define PORT_DIRECTION_CHANGEABLE (1 << 5)\r
45 #define DMM_USED                0\r
46 \r
47 /** pins on the base PINMUX0 */\r
48 /* TODO: add all remaining bases */\r
49 \r
50 /* see TMS570LS31x Tech. Ref. Manual - 4.6. Signal Multiplexing and Control (pg. 240 - 243) */\r
51 // TODO: change\r
52 typedef enum\r
53 {\r
54         PINMUX_BALL_W10_SHIFT =  0,             // GIOB[3] - default function\r
55         PINMUX_BALL_A5_SHIFT  =  8,             // GIOA[0] - default function\r
56         PINMUX_BALL_C3_SHIFT  =  16,    // MIBSPI3NCS[3] - default function\r
57         PINMUX_BALL_B2_SHIFT  =  24,    // MIBSPI3NCS[2] - deafult function\r
58 } PinMux_Ball;\r
59 \r
60 typedef enum\r
61 {\r
62         PINMUX_BALL_DEFAULT             =  0x1,\r
63         PINMUX_BALL_ALTERNATE1  =  0x2,\r
64         PINMUX_BALL_ALTERNATE2  =  0x4,\r
65         PINMUX_BALL_ALTERNATE3  =  0x8,\r
66         PINMUX_BALL_ALTERNATE4  =  0x10\r
67 }       PinMux_FunctionNumber;\r
68 \r
69 \r
70 /** HW specific symbolic names of pins */\r
71 /** @req PORT013, PORT076 */\r
72 /** @req PORT219: Port_PinType shall be uint8, uint16 or uint32 */\r
73 typedef enum\r
74 {       // TODO: check if correct\r
75         PORT_PIN_DCAN1_TX = 0x0800,\r
76         PORT_PIN_DCAN1_RX = 0x0801,\r
77         PORT_PIN_DCAN2_TX = 0x0900,\r
78         PORT_PIN_DCAN2_RX = 0x0901,\r
79         PORT_PIN_LED1 = 0x021b,\r
80 } Port_PinType;\r
81 \r
82 /** Port pad mappings */\r
83 #define PORT_PAD_106    0x0800 // PORT_PIN_DCAN1_TX\r
84 #define PORT_PAD_107    0x0801 // PORT_PIN_DCAN1_RX\r
85 #define PORT_PAD_3              0x0003 // PORT_PIN_LED1\r
86 \r
87 typedef struct {\r
88         Port_PinType pin;\r
89         uint8 conf;\r
90         PinMux_Ball pinmux;\r
91         PinMux_FunctionNumber pinmuxFunctionNum;\r
92         uint16 pinmuxBaseNum;\r
93 \r
94 } Port_ConfiguredPinType;\r
95 \r
96 /** Top level configuration container */\r
97 /** @req PORT073 */\r
98 typedef struct\r
99 {\r
100   const Port_ConfiguredPinType pins[PORT_NUMBER_OF_PINS];\r
101 } Port_ConfigType;\r
102 \r
103 /** Instance of the top level configuration container */\r
104 extern const Port_ConfigType PortConfigData;\r
105 \r
106 \r
107 #endif /*PORT_CFG_H_*/\r