From: Niclas Date: Mon, 7 May 2012 12:39:58 +0000 (+0200) Subject: updated led example for new IoHwAb X-Git-Url: http://rtime.felk.cvut.cz/gitweb/arc.git/commitdiff_plain/2772d75358f78c5124027856dd75755278d464b0 updated led example for new IoHwAb --- diff --git a/boards/mpc5516it/examples/led_rte/README b/boards/mpc5516it/examples/led_rte/README new file mode 100644 index 00000000..0c8564f8 --- /dev/null +++ b/boards/mpc5516it/examples/led_rte/README @@ -0,0 +1,5 @@ +If you want to use BSW Builder to regenerate code, follow the steps: +1. Copy the contents of led_rte to a new project +2. Make sure BOARDDIR is set to mpc5516it (right click on your project select properties->C/C++ Build->Environment) +3. Load the interface definitions needed by IoHwAb (right click on your project select properties ->Arccore Tools->BSW Service components->IoHwAb select load) +4. Now you can regenerate code from BSW Builder \ No newline at end of file diff --git a/boards/mpc5516it/examples/led_rte/config/IoHwAb_Analog.c b/boards/mpc5516it/examples/led_rte/config/IoHwAb_Analog.c index 1b3e5d82..80a5efe1 100644 --- a/boards/mpc5516it/examples/led_rte/config/IoHwAb_Analog.c +++ b/boards/mpc5516it/examples/led_rte/config/IoHwAb_Analog.c @@ -13,19 +13,9 @@ */ /******************************************** Includes ********************************************/ -#if defined(USE_ADC) + #include "IoHwAb.h" #include "IoHwAb_Internal.h" -#include "Adc.h" -#if defined(USE_DET) - #include "Det.h" -#endif - -/******************************************* Externals ********************************************/ - -Adc_ValueGroupType IoHwAb_Adc_ReadSignal ( Adc_GroupType group, Adc_ChannelType channel, IoHwAb_StatusType * status ); -void IoHwAb_Adc_Notification ( Adc_GroupType group ); - /***************************************** Private macros *****************************************/ #define IOHWAB_ADC_MAX_MILLIVOLTS ( 5000 ) @@ -41,4 +31,3 @@ void IoHwAb_Adc_Notification ( Adc_GroupType group ); /************************************** Adc group callbacks ***************************************/ -#endif diff --git a/boards/mpc5516it/examples/led_rte/config/IoHwAb_Digital.c b/boards/mpc5516it/examples/led_rte/config/IoHwAb_Digital.c index d7803057..c3ce15f9 100644 --- a/boards/mpc5516it/examples/led_rte/config/IoHwAb_Digital.c +++ b/boards/mpc5516it/examples/led_rte/config/IoHwAb_Digital.c @@ -11,14 +11,19 @@ * * Generated by Arctic Studio (http://arccore.com) */ -#if defined(USE_DIO) + #include "IoHwAb.h" #include "IoHwAb_Internal.h" +#if defined(USE_DIO) #include "Dio.h" +#else + #if defined(USE_DET) #include "Det.h" #endif +#error "DIO Module is needed by IOHWAB" +#endif /************************************ External Device Drivers *************************************/ /***************************************** Signal states ******************************************/ @@ -129,4 +134,4 @@ Std_ReturnType IoHwAb_Get_Digital( IoHwAb_SignalType signal, IoHwAb_LevelType *v } } -#endif + diff --git a/boards/mpc5516it/examples/led_rte/config/IoHwAb_Pwm.c b/boards/mpc5516it/examples/led_rte/config/IoHwAb_Pwm.c index 9ed35b72..5b363456 100644 --- a/boards/mpc5516it/examples/led_rte/config/IoHwAb_Pwm.c +++ b/boards/mpc5516it/examples/led_rte/config/IoHwAb_Pwm.c @@ -11,16 +11,9 @@ * * Generated by Arctic Studio (http://arccore.com) */ -#if defined(USE_PWM) + #include "IoHwAb.h" #include "IoHwAb_Internal.h" -#include "Pwm.h" -#if defined(USE_DET) - #include "Det.h" -#endif - -extern Pwm_PeriodType IoHwAb_Pwm_ConvertToPeriod( Pwm_NamedChannelsType , IoHwAb_FrequencyType ); - /****************************************** Pwm outputs *******************************************/ /************************************ Parameterized Pwm output ************************************/ @@ -56,4 +49,4 @@ Std_ReturnType IoHwAb_Set_FrequencyAndDuty( IoHwAb_SignalType signal, IoHwAb_Fre } break; } } -#endif + diff --git a/boards/mpc5516it/examples/led_rte/config/Rte_Type.h b/boards/mpc5516it/examples/led_rte/config/Rte_Type.h index d183c8fd..4f5781e7 100644 --- a/boards/mpc5516it/examples/led_rte/config/Rte_Type.h +++ b/boards/mpc5516it/examples/led_rte/config/Rte_Type.h @@ -27,18 +27,18 @@ typedef sint32 SInt32; #define _DEFINED_TYPEDEF_FOR_SInt32_ -typedef uint32 UInt32; -#define UInt32_LowerLimit 0 -#define UInt32_UpperLimit 4294967295 - -#define _DEFINED_TYPEDEF_FOR_UInt32_ - typedef uint8 UInt8; #define UInt8_LowerLimit 0 #define UInt8_UpperLimit 255 #define _DEFINED_TYPEDEF_FOR_UInt8_ +typedef uint32 UInt32; +#define UInt32_LowerLimit 0 +#define UInt32_UpperLimit 4294967295 + +#define _DEFINED_TYPEDEF_FOR_UInt32_ + typedef sint32 MilliOhm; #define MilliOhm_LowerLimit -2147483647 #define MilliOhm_UpperLimit 2147483647 @@ -85,12 +85,6 @@ typedef sint32 MilliVolt; #define _DEFINED_TYPEDEF_FOR_MilliVolt_ -typedef sint32 Hertz; -#define Hertz_LowerLimit -2147483647 -#define Hertz_UpperLimit 2147483647 - -#define _DEFINED_TYPEDEF_FOR_Hertz_ - typedef uint8 SignalQuality; #ifndef SignalQuality_InitialValue #define SignalQuality_InitialValue ((SignalQuality)0) @@ -109,6 +103,12 @@ typedef uint8 SignalQuality; #define _DEFINED_TYPEDEF_FOR_SignalQuality_ +typedef sint32 Hertz; +#define Hertz_LowerLimit -2147483647 +#define Hertz_UpperLimit 2147483647 + +#define _DEFINED_TYPEDEF_FOR_Hertz_ + typedef sint32 Percent; #define Percent_LowerLimit -2147483647 #define Percent_UpperLimit 2147483647 @@ -131,14 +131,14 @@ typedef struct { SInt32 value; } Rte_DE_SInt32; -typedef struct { - UInt32 value; -} Rte_DE_UInt32; - typedef struct { UInt8 value; } Rte_DE_UInt8; +typedef struct { + UInt32 value; +} Rte_DE_UInt32; + typedef struct { MilliOhm value; } Rte_DE_MilliOhm; @@ -167,14 +167,14 @@ typedef struct { MilliVolt value; } Rte_DE_MilliVolt; -typedef struct { - Hertz value; -} Rte_DE_Hertz; - typedef struct { SignalQuality value; } Rte_DE_SignalQuality; +typedef struct { + Hertz value; +} Rte_DE_Hertz; + typedef struct { Percent value; } Rte_DE_Percent;