]> rtime.felk.cvut.cz Git - arc.git/blobdiff - include/Port.h
LED Blinker example made running for the RPP Board.
[arc.git] / include / Port.h
index 74a94e28fc7de85c397a087f485f748452e9c4f6..b393437e37948eaae071e3787270bf927239364e 100644 (file)
-/* -------------------------------- Arctic Core ------------------------------\r
- * Arctic Core - the open source AUTOSAR platform http://arccore.com\r
- *\r
- * Copyright (C) 2009  ArcCore AB <contact@arccore.com>\r
- *\r
- * This source code is free software; you can redistribute it and/or modify it\r
- * under the terms of the GNU General Public License version 2 as published by the\r
- * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.\r
- *\r
- * This program is distributed in the hope that it will be useful, but\r
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License\r
- * for more details.\r
- * -------------------------------- Arctic Core ------------------------------*/\r
-\r
-/** @addtogroup Port Port Driver\r
- *  @{ */\r
-\r
-/** @file Port.h\r
- * API and type definitions for Port Driver.\r
- */\r
-\r
-#ifndef PORT_H_\r
-#define PORT_H_\r
-\r
-#define PORT_SW_MAJOR_VERSION  1\r
-#define PORT_SW_MINOR_VERSION  0\r
-#define PORT_SW_PATCH_VERSION  0\r
-\r
-#define PORT_AR_MAJOR_VERSION  3\r
-#define PORT_AR_MINOR_VERSION  0\r
-#define PORT_AR_PATCH_VERSION  2\r
-\r
-#include "Port_Cfg.h" /** @req PORT130 */\r
-\r
-#if (PORT_VERSION_INFO_API == STD_ON)\r
-void Port_GetVersionInfo(Std_VersionInfoType *versionInfo);\r
-#endif\r
-\r
-/** @name Error Codes */\r
-/** @req PORT051 */\r
-/** @req PORT116 */\r
-#define PORT_E_PARAM_PIN                               0x0a\r
-#define PORT_E_DIRECTION_UNCHANGEABLE  0x0b\r
-#define PORT_E_PARAM_CONFIG                            0x0c\r
-#define PORT_E_PARAM_INVALID_MODE              0x0d\r
-#define PORT_E_MODE_UNCHANGEABLE               0x0e\r
-#define PORT_E_UNINIT                                  0x0f\r
-//@}\r
-\r
-/** @name Service id's */\r
-//@{\r
-#define PORT_INIT_ID                                   0x00\r
-#define PORT_SET_PIN_DIRECTION_ID              0x01\r
-#define PORT_REFRESH_PORT_DIRECTION_ID 0x02\r
-#define PORT_GET_VERSION_INFO_ID               0x03\r
-#define PORT_SET_PIN_MODE_ID                   0x04\r
-//@}\r
-\r
-/** @req PORT046\r
- * The type Port_PinDirectionType is a type for defining the direction of a Port Pin.\r
- * PORT_PIN_IN Sets port pin as input.\r
- * PORT_PIN_OUT  Sets port pin as output.\r
- */\r
-typedef enum\r
-{\r
-       PORT_PIN_IN = 0,\r
-       PORT_PIN_OUT,\r
-} Port_PinDirectionType;\r
-\r
-#if defined(CFG_HC1X)\r
-/** @req PORT124 */\r
-typedef uint8 Port_PinModeType;\r
-\r
-#else  // CFG_PPC, CFG_STM32_STAMP and others\r
-typedef uint32 Port_PinModeType;\r
-#endif\r
-\r
-void Port_Init(const Port_ConfigType *configType);\r
-#if (PORT_SET_PIN_DIRECTION_API == STD_ON)\r
-void Port_SetPinDirection(Port_PinType pin, Port_PinDirectionType direction);\r
-#endif\r
-void Port_RefreshPortDirection(void);\r
-#if (PORT_SET_PIN_MODE_API == STD_ON)\r
-void Port_SetPinMode(Port_PinType Pin, Port_PinModeType Mode);\r
-#endif\r
-\r
-#endif /*PORT_H_*/\r
-/** @} */\r
+/* -------------------------------- Arctic Core ------------------------------
+ * Arctic Core - the open source AUTOSAR platform http://arccore.com
+ *
+ * Copyright (C) 2009  ArcCore AB <contact@arccore.com>
+ *
+ * This source code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by the
+ * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * for more details.
+ * -------------------------------- Arctic Core ------------------------------*/
+
+/** @addtogroup Port Port Driver
+ *  @{ */
+
+/** @file Port.h
+ * API and type definitions for Port Driver.
+ */
+
+#ifndef PORT_H_
+#define PORT_H_
+
+#define PORT_SW_MAJOR_VERSION 1
+#define PORT_SW_MINOR_VERSION 0
+#define PORT_SW_PATCH_VERSION 0
+
+/** @req PORT114 */
+#define PORT_AR_MAJOR_VERSION 3
+#define PORT_AR_MINOR_VERSION 1
+#define PORT_AR_PATCH_VERSION 0
+
+#include "Modules.h"
+#include "Port_Cfg.h" /** @req PORT130 */
+
+#if (PORT_VERSION_INFO_API == STD_ON)
+void Port_GetVersionInfo(Std_VersionInfoType *versionInfo);
+#endif 
+
+/** @name Error Codes */
+/** @req PORT051 */
+/** @req PORT116 */
+#define PORT_E_PARAM_PIN              0x0a
+#define PORT_E_DIRECTION_UNCHANGEABLE 0x0b
+#define PORT_E_PARAM_CONFIG           0x0c
+#define PORT_E_PARAM_INVALID_MODE     0x0d
+#define PORT_E_MODE_UNCHANGEABLE      0x0e
+#define PORT_E_UNINIT                 0x0f
+#define PORT_E_PARAM_POINTER             0x10
+//@}
+
+/** @name Service id's */
+//@{
+#define PORT_INIT_ID                    0x00
+#define PORT_SET_PIN_DIRECTION_ID       0x01
+#define PORT_REFRESH_PORT_DIRECTION_ID  0x02
+#define PORT_GET_VERSION_INFO_ID        0x03
+#define PORT_SET_PIN_MODE_ID            0x04
+//@}
+
+/** @name DMM defines */
+#define DMM_SYNC               0
+#define DMM_CLK                        1
+#define DMM_DATA0              2
+#define DMM_DATA1              3
+#define DMM_DATA2              4
+#define DMM_DATA3              5
+#define DMM_DATA4              6
+#define DMM_DATA5              7
+#define DMM_DATA6              8
+#define DMM_DATA7              9
+#define DMM_DATA8              10
+#define DMM_DATA9              11
+#define DMM_DATA10             12
+#define DMM_DATA11             13
+#define DMM_DATA12             14
+#define DMM_DATA13             15
+#define DMM_DATA14             16
+#define DMM_DATA15             17
+#define DMM_ENA                        18
+
+/** @req PORT046
+ * The type Port_PinDirectionType is a type for defining the direction of a Port Pin.
+ * PORT_PIN_IN Sets port pin as input. 
+ * PORT_PIN_OUT  Sets port pin as output. 
+ */
+typedef enum
+{
+    PORT_PIN_IN = 0, PORT_PIN_OUT,
+} Port_PinDirectionType;
+
+#if defined(CFG_HC1X)
+/** @req PORT124 */
+typedef uint8 Port_PinModeType;
+#else  // CFG_PPC, CFG_STM32_STAMP and others
+typedef uint32 Port_PinModeType;
+#endif
+
+void Port_Init(const Port_ConfigType *configType);
+
+void Dmm_Init(uint16 pinNumber);       // Dmm will be used as a GIO
+void Dmm_Reset(const Port_ConfigType *configType);
+
+#if ( PORT_SET_PIN_DIRECTION_API == STD_ON )
+void Port_SetPinDirection(Port_PinType pin, Port_PinDirectionType direction);
+#endif
+
+void Port_RefreshPortDirection(void);
+
+#if (PORT_SET_PIN_MODE_API == STD_ON)
+void Port_SetPinMode(Port_PinType Pin, Port_PinModeType Mode);
+#endif
+
+typedef volatile struct pinMuxKicker
+{
+    uint32 KICKER0;       /* kicker 0 register */
+    uint32 KICKER1;       /* kicker 1 register */
+} pinMuxKICKER;
+
+/** @def kickerReg
+*   @brief Pin Muxing Kicker Register Frame Pointer
+*      - used to enable and disable muxing across the device.
+*/
+#define kickerReg ((pinMuxKICKER *) 0xFFFFEA38)
+
+#endif /*PORT_H_*/
+/** @} */