X-Git-Url: https://rtime.felk.cvut.cz/gitweb/arc.git/blobdiff_plain/79f7f49af39353dd43eedf246e757857c44a9dc5..07bbcb79799c461e4dc58be060a0c3e01f466c97:/boards/ti_tms570ls/examples/tms570_hdk_led/config/Port_Cfg.h diff --git a/boards/ti_tms570ls/examples/tms570_hdk_led/config/Port_Cfg.h b/boards/ti_tms570ls/examples/tms570_hdk_led/config/Port_Cfg.h new file mode 100644 index 00000000..d6f83ed5 --- /dev/null +++ b/boards/ti_tms570ls/examples/tms570_hdk_led/config/Port_Cfg.h @@ -0,0 +1,103 @@ +/* +* Configuration of module: Port (Port_Cfg.h) +* +* Created by: +* Copyright: +* +* Configured for (MCU): TMS570 +* +* Module vendor: ArcCore +* Generator version: 2.0.2 +* +* Generated by Arctic Studio (http://arccore.com) +*/ + + +#if !(((PORT_SW_MAJOR_VERSION == 1) && (PORT_SW_MINOR_VERSION == 0)) ) +#error Port: Configuration file expected BSW module version to be 1.0.* +#endif + + +#ifndef PORT_CFG_H_ +#define PORT_CFG_H_ + +#include "Std_Types.h" + +// TODO - check if should change to STD_ON +/** Build version info API */ +#define PORT_VERSION_INFO_API STD_ON +/** Enable Development Error Trace */ +#define PORT_DEV_ERROR_DETECT STD_OFF +/** Build change pin direction API */ +#define PORT_SET_PIN_DIRECTION_API STD_ON +/** Allow Pin mode changes during runtime */ +#define PORT_SET_PIN_MODE_API STD_ON + +#define PORT_NUMBER_OF_PINS 1 + +#define PORT_FUNC_NO (0 << 1) +#define PORT_FUNC (1 << 1) +#define PORT_PULL_NONE (1 << 2) +#define PORT_PULL_UP (1 << 3) +#define PORT_PULL_DOWN (0 << 3) +#define PORT_ODE_ENABLE (1 << 4) +#define PORT_DIRECTION_CHANGEABLE (1 << 5) + +/** pins on the base PINMUX0 */ +/* TODO: add all remaining bases */ + +/* see TMS570LS31x Tech. Ref. Manual - 4.6. Signal Multiplexing and Control (pg. 240 - 243) */ +typedef enum +{ + PINMUX_BALL_W10_SHIFT = 0, // GIOB[3] - default function + PINMUX_BALL_A5_SHIFT = 8, // GIOA[0] - default function + PINMUX_BALL_C3_SHIFT = 16, // MIBSPI3NCS[3] - default function + PINMUX_BALL_B2_SHIFT = 24, // MIBSPI3NCS[2] - deafult function +} PinMux_Ball; + +typedef enum +{ + PINMUX_BALL_DEFAULT = 0x1, + PINMUX_BALL_ALTERNATE1 = 0x2, + PINMUX_BALL_ALTERNATE2 = 0x4, + PINMUX_BALL_ALTERNATE3 = 0x8, + PINMUX_BALL_ALTERNATE4 = 0x10 +} PinMux_FunctionNumber; + + +/** HW specific symbolic names of pins */ +/** @req PORT013, PORT076 */ +/** @req PORT219: Port_PinType shall be uint8, uint16 or uint32 */ +typedef enum +{ + PORT_PIN_DCAN1_TX = 0x0800, + PORT_PIN_DCAN1_RX = 0x0801, + PORT_PIN_LED1 = 0x021b, +} Port_PinType; + +/** Port pad mappings */ +#define PORT_PAD_106 0x0800 // PORT_PIN_DCAN1_TX +#define PORT_PAD_107 0x0801 // PORT_PIN_DCAN1_RX +#define PORT_PAD_3 0x0003 // PORT_PIN_LED1 + +typedef struct { + Port_PinType pin; + uint8 conf; + PinMux_Ball pinmux; + PinMux_FunctionNumber pinmuxFunctionNum; + uint16 pinmuxBaseNum; + +} Port_ConfiguredPinType; + +/** Top level configuration container */ +/** @req PORT073 */ +typedef struct +{ + const Port_ConfiguredPinType pins[PORT_NUMBER_OF_PINS]; +} Port_ConfigType; + +/** Instance of the top level configuration container */ +extern const Port_ConfigType PortConfigData; + + +#endif /*PORT_CFG_H_*/