From: joek Date: Fri, 17 Jun 2011 13:38:13 +0000 (+0200) Subject: Added blinker example for HCS12. X-Git-Url: http://rtime.felk.cvut.cz/gitweb/arc.git/commitdiff_plain/f4dfafbe61437f43e612c5be1fcf6903644c3f64 Added blinker example for HCS12. --- diff --git a/boards/hcs12_elmicro_card12/examples/blinker/Tasks.c b/boards/hcs12_elmicro_card12/examples/blinker/Tasks.c new file mode 100644 index 00000000..40478dfc --- /dev/null +++ b/boards/hcs12_elmicro_card12/examples/blinker/Tasks.c @@ -0,0 +1,105 @@ +/* +* Configuration of module: Os (Tasks.c) +* +* Created by: +* Copyright: +* +* Configured for (MCU): HCS12 +* +* Module vendor: ArcCore +* Generator version: 2.0.34 +* +* Generated by Arctic Studio (http://arccore.com) +* on Tue Jun 14 20:14:11 CEST 2011 +*/ + +#include "Os.h" +#include "Dio.h" +#include "Com.h" + +// #define USE_LDEBUG_PRINTF // Uncomment this to turn debug statements on. +#include "debug.h" + +// Callback when the FreqReq PDU has arrived on COM +boolean IncommingFreqReq(PduIdType PduId, const uint8 *IPduData) +{ + SetEvent(TASK_ID_ComReceiveTask, EVENT_MASK_FreqReciveEvent); +} + +// Task that changes the frequency of the LED when a new +// request is recieved from COM +void ComReceiveTask( void ) +{ + uint32 freqreq; + + for(;;) + { + WaitEvent(EVENT_MASK_FreqReciveEvent); + + Com_ReceiveSignal(FreqReqSig, &freqreq); + + CancelAlarm(ALARM_ID_MainAlarm); + SetRelAlarm(ALARM_ID_MainAlarm, 1, freqreq); + + Com_SendSignal(FreqIndSig, &freqreq); + } +} + +// Task that toggles the LED +Dio_LevelType level = 1; +void BlinkerTask( void ) { + level = !level; + Dio_WriteChannel(DIO_CHANNEL_NAME_LED_CHANNEL, level); + TerminateTask(); +} + +// Simple task that drives the COM stack. +void ComTask( void ) { + Com_MainFunctionRx(); + Com_MainFunctionTx(); + + TerminateTask(); +} + +void OsIdle( void ) { + while(1); +} + + +// Hooks +#define ERROR_LOG_SIZE 20 + +struct LogBad_s { + uint32_t param1; + uint32_t param2; + uint32_t param3; + TaskType taskId; + OsServiceIdType serviceId; + StatusType error; +}; + +void ErrorHook ( StatusType Error ) { + + TaskType task; + static struct LogBad_s LogBad[ERROR_LOG_SIZE]; + static uint8_t ErrorCount = 0; + GetTaskID(&task); + OsServiceIdType service = OSErrorGetServiceId(); + + LDEBUG_PRINTF("## ErrorHook err=%d\n",Error); + + /* Log the errors in a buffer for later review */ + LogBad[ErrorCount].param1 = os_error.param1; + LogBad[ErrorCount].param2 = os_error.param2; + LogBad[ErrorCount].param3 = os_error.param3; + LogBad[ErrorCount].serviceId = service; + LogBad[ErrorCount].taskId = task; + LogBad[ErrorCount].error = Error; + + ErrorCount++; + + // Stall if buffer is full. + while(ErrorCount >= ERROR_LOG_SIZE); + +} + diff --git a/boards/hcs12_elmicro_card12/examples/blinker/blinker_hcs12_card12.arxml b/boards/hcs12_elmicro_card12/examples/blinker/blinker_hcs12_card12.arxml new file mode 100644 index 00000000..c15f83e7 --- /dev/null +++ b/boards/hcs12_elmicro_card12/examples/blinker/blinker_hcs12_card12.arxml @@ -0,0 +1,2024 @@ + + + + + blinker_hcs12_card12 + + + blinker_hcs12_card12 + + + + + + + HCS12 + ${RESOURCE_LOC}/config + + + + /blinker_hcs12_card12/SwComposition_blinker_hcs12_card12 + + /blinker_hcs12_card12/Can + /blinker_hcs12_card12/CanIf + /blinker_hcs12_card12/Com + /blinker_hcs12_card12/EcuM + /blinker_hcs12_card12/Dio + /blinker_hcs12_card12/Det + /blinker_hcs12_card12/Os + /blinker_hcs12_card12/Port + /blinker_hcs12_card12/PduR + /blinker_hcs12_card12/Mcu + /blinker_hcs12_card12/EcuC + + + + SwComposition_blinker_hcs12_card12 + + + Can + + + + + true + 2.0.2 + + + + /ArcCore/Can + + + CanConfigSet + /ArcCore/Can/CanConfigSet + + + CAN0 + + + + + + /ArcCore/Can/CanConfigSet/CanController + + + /ArcCore/Can/CanConfigSet/CanController/CanControllerActivation + false + + + /ArcCore/Can/CanConfigSet/CanController/CanControllerLoopback + false + + + /ArcCore/Can/CanConfigSet/CanController/CanControllerBaudRate + 250 + + + /ArcCore/Can/CanConfigSet/CanController/CanHWControllerId + CAN_CTRL_0 + + + /ArcCore/Can/CanConfigSet/CanController/CanControllerPropSeg + 4 + + + /ArcCore/Can/CanConfigSet/CanController/CanControllerSeg1 + 4 + + + /ArcCore/Can/CanConfigSet/CanController/CanControllerSeg2 + 5 + + + + + Mask + + + + + + /ArcCore/Can/CanConfigSet/CanController/CanFilterMask + + + /ArcCore/Can/CanConfigSet/CanController/CanFilterMask/ArcCanHcs12IdamMaskType + CAN_ARC_IDAM_2_32BIT + + + /ArcCore/Can/CanConfigSet/CanController/CanFilterMask/ArcCanHcs12ArcIdmrValue + 18446744073709551615 + + + /ArcCore/Can/CanConfigSet/CanController/CanFilterMask/ArcCanHcs12ArcIdarValue + 0 + + + + + + + TxBox + + + + + + /ArcCore/Can/CanConfigSet/CanHardwareObject + + + /ArcCore/Can/CanConfigSet/CanHardwareObject/CanIdType + STANDARD + + + /ArcCore/Can/CanConfigSet/CanHardwareObject/CanObjectType + TRANSMIT + + + /ArcCore/Can/CanConfigSet/CanHardwareObject/CanMBMask + 0 + + + + + /ArcCore/Can/CanConfigSet/CanHardwareObject/CanControllerRef + /blinker_hcs12_card12/Can/CanConfigSet/CAN0 + + + /ArcCore/Can/CanConfigSet/CanHardwareObject/CanFilterMaskRef + /blinker_hcs12_card12/Can/CanConfigSet/CAN0/Mask + + + + + RxBox + + + + + + /ArcCore/Can/CanConfigSet/CanHardwareObject + + + /ArcCore/Can/CanConfigSet/CanHardwareObject/CanIdType + STANDARD + + + /ArcCore/Can/CanConfigSet/CanHardwareObject/CanObjectType + RECEIVE + + + /ArcCore/Can/CanConfigSet/CanHardwareObject/CanMBMask + 0 + + + + + /ArcCore/Can/CanConfigSet/CanHardwareObject/CanControllerRef + /blinker_hcs12_card12/Can/CanConfigSet/CAN0 + + + /ArcCore/Can/CanConfigSet/CanHardwareObject/CanFilterMaskRef + /blinker_hcs12_card12/Can/CanConfigSet/CAN0/Mask + + + + + + + CanGeneral + /ArcCore/Can/CanGeneral + + + /ArcCore/Can/CanGeneral/CanDevErrorDetection + false + + + /ArcCore/Can/CanGeneral/CanMultiplexedTransmission + false + + + /ArcCore/Can/CanGeneral/CanVersionInfoApi + false + + + + + + + CanIf + + + + + true + 2.0.5 + + + + /ArcCore/CanIf + + + CanIfDispatchConfig + /ArcCore/CanIf/CanIfDispatchConfig + + + /ArcCore/CanIf/CanIfDispatchConfig/CanIfBusOffNotification + + + + /ArcCore/CanIf/CanIfDispatchConfig/CanIfErrorNotificaton + + + + /ArcCore/CanIf/CanIfDispatchConfig/CanIfWakeupNotification + + + + /ArcCore/CanIf/CanIfDispatchConfig/CanIfWakeupValidNotification + + + + + + CanIfDriverConfig + /ArcCore/CanIf/CanIfDriverConfig + + + /ArcCore/CanIf/CanIfDriverConfig/CanIfBusoffNotification + true + + + /ArcCore/CanIf/CanIfDriverConfig/CanIfReceiveIndication + false + + + /ArcCore/CanIf/CanIfDriverConfig/CanIfTransmitCancellation + false + + + /ArcCore/CanIf/CanIfDriverConfig/CanIfTxConfirmation + false + + + /ArcCore/CanIf/CanIfDriverConfig/CanIfWakeupNotification + true + + + + + CanIfInitConfiguration + /ArcCore/CanIf/CanIfInitConfiguration + + + /ArcCore/CanIf/CanIfInitConfiguration/CanIfConfigSet + + + + /ArcCore/CanIf/CanIfInitConfiguration/CanIfNumberOfCanRxPduIds + 0 + + + /ArcCore/CanIf/CanIfInitConfiguration/CanIfNumberOfCanTXPduIds + 0 + + + /ArcCore/CanIf/CanIfInitConfiguration/CanIfNumberOfDynamicCanTXPduIds + 0 + + + + + HardwareObject + + + + + + /ArcCore/CanIf/CanIfInitConfiguration/CanIfInitHohConfig + + + RxBox + + + + + + /ArcCore/CanIf/CanIfInitConfiguration/CanIfInitHohConfig/CanIfHrhConfig + + + /ArcCore/CanIf/CanIfInitConfiguration/CanIfInitHohConfig/CanIfHrhConfig/CanIfHrhType + BASIC_CAN + + + /ArcCore/CanIf/CanIfInitConfiguration/CanIfInitHohConfig/CanIfHrhConfig/CanIfSoftwareFilterHrh + true + + + + + /ArcCore/CanIf/CanIfInitConfiguration/CanIfInitHohConfig/CanIfHrhConfig/CanIfCanControllerHrhIdRef + /blinker_hcs12_card12/CanIf/Channel0 + + + /ArcCore/CanIf/CanIfInitConfiguration/CanIfInitHohConfig/CanIfHrhConfig/CanIfHrhIdSymRef + /blinker_hcs12_card12/Can/CanConfigSet/RxBox + + + + + TxBox + + + + + + /ArcCore/CanIf/CanIfInitConfiguration/CanIfInitHohConfig/CanIfHthConfig + + + /ArcCore/CanIf/CanIfInitConfiguration/CanIfInitHohConfig/CanIfHthConfig/CanIfHthType + BASIC_CAN + + + + + /ArcCore/CanIf/CanIfInitConfiguration/CanIfInitHohConfig/CanIfHthConfig/CanIfCanControllerIdRef + /blinker_hcs12_card12/CanIf/Channel0 + + + /ArcCore/CanIf/CanIfInitConfiguration/CanIfInitHohConfig/CanIfHthConfig/CanIfHthIdSymRef + /blinker_hcs12_card12/Can/CanConfigSet/TxBox + + + + + + + Rx_FreqReq + + + + + + /ArcCore/CanIf/CanIfInitConfiguration/CanIfRxPduConfig + + + /ArcCore/CanIf/CanIfInitConfiguration/CanIfRxPduConfig/CanIfCanRxPduCanId + 256 + + + /ArcCore/CanIf/CanIfInitConfiguration/CanIfRxPduConfig/CanIfCanRxPduDlc + 8 + + + /ArcCore/CanIf/CanIfInitConfiguration/CanIfRxPduConfig/CanIfCanRxPduId + 0 + + + /ArcCore/CanIf/CanIfInitConfiguration/CanIfRxPduConfig/CanIfReadRxPduData + false + + + /ArcCore/CanIf/CanIfInitConfiguration/CanIfRxPduConfig/CanIfReadRxPduNotifyStatus + false + + + /ArcCore/CanIf/CanIfInitConfiguration/CanIfRxPduConfig/CanIfRxPduIdCanIdType + STANDARD_CAN + + + /ArcCore/CanIf/CanIfInitConfiguration/CanIfRxPduConfig/CanIfRxUserType + PDUR + + + /ArcCore/CanIf/CanIfInitConfiguration/CanIfRxPduConfig/CanIfUserRxIndication + + + + + + /ArcCore/CanIf/CanIfInitConfiguration/CanIfRxPduConfig/CanIfCanRxPduHrhRef + /blinker_hcs12_card12/CanIf/CanIfInitConfiguration/HardwareObject/RxBox + + + /ArcCore/CanIf/CanIfInitConfiguration/CanIfRxPduConfig/PduIdRef + /blinker_hcs12_card12/EcuC/PduCollection/FreqReq + + + + + Tx_FreqInd + + + + + + /ArcCore/CanIf/CanIfInitConfiguration/CanIfTxPduConfig + + + /ArcCore/CanIf/CanIfInitConfiguration/CanIfTxPduConfig/CanIfCanTxPduId + 0 + + + /ArcCore/CanIf/CanIfInitConfiguration/CanIfTxPduConfig/CanIfCanTxPduIdCanId + 258 + + + /ArcCore/CanIf/CanIfInitConfiguration/CanIfTxPduConfig/CanIfCanTxPduIdDlc + 8 + + + /ArcCore/CanIf/CanIfInitConfiguration/CanIfTxPduConfig/CanIfCanTxPduType + STATIC + + + /ArcCore/CanIf/CanIfInitConfiguration/CanIfTxPduConfig/CanIfReadTxPduNotifyStatus + false + + + /ArcCore/CanIf/CanIfInitConfiguration/CanIfTxPduConfig/CanIfTxPduIdCanIdType + STANDARD_CAN + + + /ArcCore/CanIf/CanIfInitConfiguration/CanIfTxPduConfig/CanIfTxUserType + PDUR + + + /ArcCore/CanIf/CanIfInitConfiguration/CanIfTxPduConfig/CanIfUserTxConfirmation + + + + + + /ArcCore/CanIf/CanIfInitConfiguration/CanIfTxPduConfig/CanIfCanTxPduHthRef + /blinker_hcs12_card12/CanIf/CanIfInitConfiguration/HardwareObject/TxBox + + + /ArcCore/CanIf/CanIfInitConfiguration/CanIfTxPduConfig/PduIdRef + /blinker_hcs12_card12/EcuC/PduCollection/FreqInd + + + + + + + CanIfPrivateConfiguration + /ArcCore/CanIf/CanIfPrivateConfiguration + + + /ArcCore/CanIf/CanIfPrivateConfiguration/CanIfDlcCheck + true + + + /ArcCore/CanIf/CanIfPrivateConfiguration/CanIfNumberOfTxBuffers + 0 + + + /ArcCore/CanIf/CanIfPrivateConfiguration/CanIfSoftwareFilterType + TABLE + + + + + CanIfPublicConfiguration + /ArcCore/CanIf/CanIfPublicConfiguration + + + /ArcCore/CanIf/CanIfPublicConfiguration/CanIfDevErrorDetect + false + + + /ArcCore/CanIf/CanIfPublicConfiguration/ArcCanIfDynamicPduConfiguration + false + + + /ArcCore/CanIf/CanIfPublicConfiguration/CanIfMultipleDriverSupport + true + + + /ArcCore/CanIf/CanIfPublicConfiguration/CanIfNumberOfCanHwUnits + 1 + + + /ArcCore/CanIf/CanIfPublicConfiguration/CanIfReadRxPduDataApi + false + + + /ArcCore/CanIf/CanIfPublicConfiguration/CanIfReadRxPduNotifyStatusApi + false + + + /ArcCore/CanIf/CanIfPublicConfiguration/CanIfReadTxPduNotifyStatusApi + false + + + /ArcCore/CanIf/CanIfPublicConfiguration/CanIfSetDynamicTxIdApi + false + + + /ArcCore/CanIf/CanIfPublicConfiguration/CanIfVersionInfoApi + true + + + /ArcCore/CanIf/CanIfPublicConfiguration/CanIfWakeupEventApi + false + + + + + Channel0 + + + + + + /ArcCore/CanIf/CanIfControllerConfig + + + /ArcCore/CanIf/CanIfControllerConfig/CanIfWakeupSupport + NO_WAKEUP + + + + + /ArcCore/CanIf/CanIfControllerConfig/CanIfControllerIdRef + /blinker_hcs12_card12/Can/CanConfigSet/CAN0 + + + + + + + Com + + + + + true + 2.0.5 + + + + /ArcCore/Com + + + ComConfig + /ArcCore/Com/ComConfig + + + /ArcCore/Com/ComConfig/ComConfigurationId + 0 + + + + + ComPduGroup + + + + + + /ArcCore/Com/ComConfig/ComIPduGroup + + + /ArcCore/Com/ComConfig/ComIPduGroup/ComIPduGroupHandleId + 0 + + + + + FreqReq + + + + + + /ArcCore/Com/ComConfig/ComIPdu + + + /ArcCore/Com/ComConfig/ComIPdu/ComIPduCallout + IncommingFreqReq + + + /ArcCore/Com/ComConfig/ComIPdu/ComIPduRxHandleId + 0 + + + /ArcCore/Com/ComConfig/ComIPdu/ComIPduSignalProcessing + DEFERRED + + + /ArcCore/Com/ComConfig/ComIPdu/ComIPduDirection + RECEIVE + + + + + /ArcCore/Com/ComConfig/ComIPdu/ComIPduGroupRef + /blinker_hcs12_card12/Com/ComConfig/ComPduGroup + + + /ArcCore/Com/ComConfig/ComIPdu/PduIdRef + /blinker_hcs12_card12/EcuC/PduCollection/FreqReq + + + /ArcCore/Com/ComConfig/ComIPdu/ComIPduSignalRef + /blinker_hcs12_card12/Com/ComConfig/FreqReqSig + + + + + ComTxIPdu + /ArcCore/Com/ComConfig/ComIPdu/ComTxIPdu + + + /ArcCore/Com/ComConfig/ComIPdu/ComTxIPdu/ComTxIPduMinimumDelayTimeFactor + 0 + + + /ArcCore/Com/ComConfig/ComIPdu/ComTxIPdu/ComTxIPduUnusedAreasDefault + 0 + + + + + ComTxModeTrue + /ArcCore/Com/ComConfig/ComIPdu/ComTxIPdu/ComTxModeTrue + + + ComTxMode + /ArcCore/Com/ComConfig/ComIPdu/ComTxIPdu/ComTxModeTrue/ComTxMode + + + /ArcCore/Com/ComConfig/ComIPdu/ComTxIPdu/ComTxModeTrue/ComTxMode/ComTxModeMode + DIRECT + + + /ArcCore/Com/ComConfig/ComIPdu/ComTxIPdu/ComTxModeTrue/ComTxMode/ComTxModeNumberOfRepetitions + 0 + + + /ArcCore/Com/ComConfig/ComIPdu/ComTxIPdu/ComTxModeTrue/ComTxMode/ComTxModeRepetitionPeriodFactor + 0 + + + /ArcCore/Com/ComConfig/ComIPdu/ComTxIPdu/ComTxModeTrue/ComTxMode/ComTxModeTimeOffsetFactor + 0 + + + /ArcCore/Com/ComConfig/ComIPdu/ComTxIPdu/ComTxModeTrue/ComTxMode/ComTxModeTimePeriodFactor + 0 + + + + + + + + + + + FreqInd + + + + + + /ArcCore/Com/ComConfig/ComIPdu + + + /ArcCore/Com/ComConfig/ComIPdu/ComIPduCallout + + + + /ArcCore/Com/ComConfig/ComIPdu/ComIPduRxHandleId + 0 + + + /ArcCore/Com/ComConfig/ComIPdu/ComIPduSignalProcessing + DEFERRED + + + /ArcCore/Com/ComConfig/ComIPdu/ComIPduDirection + SEND + + + + + /ArcCore/Com/ComConfig/ComIPdu/ComIPduGroupRef + /blinker_hcs12_card12/Com/ComConfig/ComPduGroup + + + /ArcCore/Com/ComConfig/ComIPdu/PduIdRef + /blinker_hcs12_card12/EcuC/PduCollection/FreqInd + + + /ArcCore/Com/ComConfig/ComIPdu/ComIPduSignalRef + /blinker_hcs12_card12/Com/ComConfig/FreqIndSig + + + + + ComTxIPdu + /ArcCore/Com/ComConfig/ComIPdu/ComTxIPdu + + + /ArcCore/Com/ComConfig/ComIPdu/ComTxIPdu/ComTxIPduMinimumDelayTimeFactor + 0 + + + /ArcCore/Com/ComConfig/ComIPdu/ComTxIPdu/ComTxIPduUnusedAreasDefault + 0 + + + + + ComTxModeTrue + /ArcCore/Com/ComConfig/ComIPdu/ComTxIPdu/ComTxModeTrue + + + ComTxMode + /ArcCore/Com/ComConfig/ComIPdu/ComTxIPdu/ComTxModeTrue/ComTxMode + + + /ArcCore/Com/ComConfig/ComIPdu/ComTxIPdu/ComTxModeTrue/ComTxMode/ComTxModeMode + PERIODIC + + + /ArcCore/Com/ComConfig/ComIPdu/ComTxIPdu/ComTxModeTrue/ComTxMode/ComTxModeNumberOfRepetitions + 0 + + + /ArcCore/Com/ComConfig/ComIPdu/ComTxIPdu/ComTxModeTrue/ComTxMode/ComTxModeRepetitionPeriodFactor + 0 + + + /ArcCore/Com/ComConfig/ComIPdu/ComTxIPdu/ComTxModeTrue/ComTxMode/ComTxModeTimeOffsetFactor + 0 + + + /ArcCore/Com/ComConfig/ComIPdu/ComTxIPdu/ComTxModeTrue/ComTxMode/ComTxModeTimePeriodFactor + 100 + + + + + + + + + + + FreqIndSig + + + + + + /ArcCore/Com/ComConfig/ComSignal + + + /ArcCore/Com/ComConfig/ComSignal/ComBitPosition + 0 + + + /ArcCore/Com/ComConfig/ComSignal/ComBitSize + 32 + + + /ArcCore/Com/ComConfig/ComSignal/ComFirstTimeoutFactor + 0 + + + /ArcCore/Com/ComConfig/ComSignal/ComHandleId + 0 + + + /ArcCore/Com/ComConfig/ComSignal/ComNotification + + + + /ArcCore/Com/ComConfig/ComSignal/ComSignalEndianess + BIG_ENDIAN + + + /ArcCore/Com/ComConfig/ComSignal/ComSignalInitValue + 0 + + + /ArcCore/Com/ComConfig/ComSignal/ComSignalLength + 0 + + + /ArcCore/Com/ComConfig/ComSignal/ComSignalType + UINT32 + + + /ArcCore/Com/ComConfig/ComSignal/ComTimeoutFactor + 0 + + + /ArcCore/Com/ComConfig/ComSignal/ComTimeoutNotification + + + + /ArcCore/Com/ComConfig/ComSignal/ComTransferProperty + PENDING + + + + + FreqReqSig + + + + + + /ArcCore/Com/ComConfig/ComSignal + + + /ArcCore/Com/ComConfig/ComSignal/ComBitPosition + 0 + + + /ArcCore/Com/ComConfig/ComSignal/ComBitSize + 32 + + + /ArcCore/Com/ComConfig/ComSignal/ComFirstTimeoutFactor + 0 + + + /ArcCore/Com/ComConfig/ComSignal/ComHandleId + 0 + + + /ArcCore/Com/ComConfig/ComSignal/ComNotification + + + + /ArcCore/Com/ComConfig/ComSignal/ComSignalEndianess + BIG_ENDIAN + + + /ArcCore/Com/ComConfig/ComSignal/ComSignalInitValue + 1000 + + + /ArcCore/Com/ComConfig/ComSignal/ComSignalLength + 0 + + + /ArcCore/Com/ComConfig/ComSignal/ComSignalType + UINT32 + + + /ArcCore/Com/ComConfig/ComSignal/ComTimeoutFactor + 0 + + + /ArcCore/Com/ComConfig/ComSignal/ComTimeoutNotification + + + + /ArcCore/Com/ComConfig/ComSignal/ComTransferProperty + PENDING + + + + + + + ComGeneral + /ArcCore/Com/ComGeneral + + + /ArcCore/Com/ComGeneral/ComConfigurationTimeBase + 0.0 + + + /ArcCore/Com/ComGeneral/ComConfigurationUseDet + false + + + + + + + EcuM + + + + + true + 2.0.2 + + + + /ArcCore/EcuM + + + EcuMGeneral + /ArcCore/EcuM/EcuMGeneral + + + /ArcCore/EcuM/EcuMGeneral/EcuMDevErrorDetect + false + + + /ArcCore/EcuM/EcuMGeneral/EcuMIncludeNvramMgr + false + + + /ArcCore/EcuM/EcuMGeneral/EcuMVersionInfoApi + false + + + /ArcCore/EcuM/EcuMGeneral/EcuMMainFunctionPeriod + 0.2 + + + + + EcuMConfiguration + /ArcCore/EcuM/EcuMConfiguration + + + /ArcCore/EcuM/EcuMConfiguration/EcuMNvramReadallTimeout + 10.0 + + + /ArcCore/EcuM/EcuMConfiguration/EcuMRunMinimumDuration + 10.0 + + + /ArcCore/EcuM/EcuMConfiguration/EcuMNvramWriteallTimeout + 10.0 + + + + + User_1 + /ArcCore/EcuM/EcuMConfiguration/EcuMUserConfig + + + + + + + Dio + + + + + true + 2.0.0 + + + + /ArcCore/Dio + + + DioGeneral + /ArcCore/Dio/DioGeneral + + + /ArcCore/Dio/DioGeneral/DioDevErrorDetect + false + + + /ArcCore/Dio/DioGeneral/DioVersionInfoApi + false + + + + + HPort + + + + + + /ArcCore/Dio/DioPort + + + /ArcCore/Dio/DioPort/DioPortId + 0 + + + /ArcCore/Dio/DioPort/ArcCoreDioPhysicalPort + DIO_PORT_H + + + + + LED_CHANNEL + + + + + + /ArcCore/Dio/DioPort/DioChannel + + + /ArcCore/Dio/DioPort/DioChannel/DioChannelId + 31 + + + + + + + + + Det + + + + + true + 2.0.1 + + + + /ArcCore/Det + + + DetGeneral + /ArcCore/Det/DetGeneral + + + /ArcCore/Det/DetGeneral/DetEnableCallbacks + false + + + /ArcCore/Det/DetGeneral/DetUseRamlog + true + + + /ArcCore/Det/DetGeneral/DetWrapRamlog + true + + + /ArcCore/Det/DetGeneral/DetUseStdErr + false + + + /ArcCore/Det/DetGeneral/DetDeInitAPI + false + + + /ArcCore/Det/DetGeneral/DetNumberOfCallbacks + 5 + + + /ArcCore/Det/DetGeneral/DetRamlogSize + 16 + + + + + + + Os + + + + + true + 2.0.34 + + + + /ArcCore/Os + + + OsOS + /ArcCore/Os/OsOS + + + /ArcCore/Os/OsOS/OsStackMonitoring + true + + + /ArcCore/Os/OsOS/OsStatus + EXTENDED + + + /ArcCore/Os/OsOS/OsUseGetServiceId + true + + + /ArcCore/Os/OsOS/OsUseParameterAccess + true + + + /ArcCore/Os/OsOS/OsUseResScheduler + true + + + /ArcCore/Os/OsOS/OsTickFrequency + 1000 + + + /ArcCore/Os/OsOS/OsInterruptStackSize + 512 + + + /ArcCore/Os/OsOS/OsIdleStackSize + 512 + + + /ArcCore/Os/OsOS/OsNumberOfCores + 1 + + + /ArcCore/Os/OsOS/ArcOsIsrMaxCount + 10 + + + /ArcCore/Os/OsOS/ArcCoreOsUseDebug + false + + + /ArcCore/Os/OsOS/ArcCoreOsDebugTask + false + + + /ArcCore/Os/OsOS/ArcCoreOsDebugAlarm + false + + + /ArcCore/Os/OsOS/ArcCoreOsDebugResource + false + + + /ArcCore/Os/OsOS/ArcCoreOsDebugScheduleTable + false + + + /ArcCore/Os/OsOS/ArcCoreOsDebugEvent + false + + + + + OsHooks + /ArcCore/Os/OsOS/OsHooks + + + /ArcCore/Os/OsOS/OsHooks/OsErrorHook + true + + + /ArcCore/Os/OsOS/OsHooks/OsPostTaskHook + false + + + /ArcCore/Os/OsOS/OsHooks/OsPreTaskHook + false + + + /ArcCore/Os/OsOS/OsHooks/OsProtectionHook + false + + + /ArcCore/Os/OsOS/OsHooks/OsShutdownHook + false + + + /ArcCore/Os/OsOS/OsHooks/OsStartupHook + false + + + + + + + MainAlarm + + + + + + /ArcCore/Os/OsAlarm + + + /ArcCore/Os/OsAlarm/OsAlarmCounterRef + /blinker_hcs12_card12/Os/MainCounter + + + + + OsAlarmActivateTask + /ArcCore/Os/OsAlarm/OsAlarmAction/OsAlarmActivateTask + + + /ArcCore/Os/OsAlarm/OsAlarmAction/OsAlarmActivateTask/OsAlarmActivateTaskRef + /blinker_hcs12_card12/Os/BlinkerTask + + + + + OsAlarmAutostart + /ArcCore/Os/OsAlarm/OsAlarmAutostart + + + /ArcCore/Os/OsAlarm/OsAlarmAutostart/OsAlarmAlarmTime + 1 + + + /ArcCore/Os/OsAlarm/OsAlarmAutostart/OsAlarmAutostartType + ABSOLUTE + + + /ArcCore/Os/OsAlarm/OsAlarmAutostart/OsAlarmCycleTime + 100 + + + + + + + MainCounter + + + + + + /ArcCore/Os/OsCounter + + + /ArcCore/Os/OsCounter/OsCounterMaxAllowedValue + 65535 + + + /ArcCore/Os/OsCounter/OsCounterMinCycle + 1 + + + /ArcCore/Os/OsCounter/OsCounterTicksPerBase + 0 + + + /ArcCore/Os/OsCounter/OsCounterType + OS_TICK + + + + + MainApplication + + + + + + /ArcCore/Os/OsApplication + + + /ArcCore/Os/OsApplication/ArcOsAppCoreId + 0 + + + /ArcCore/Os/OsApplication/OsTrusted + false + + + + + /ArcCore/Os/OsApplication/OsAppAlarmRef + /blinker_hcs12_card12/Os/MainAlarm + + + /ArcCore/Os/OsApplication/OsAppCounterRef + /blinker_hcs12_card12/Os/MainCounter + + + /ArcCore/Os/OsApplication/OsAppTaskRef + /blinker_hcs12_card12/Os/BlinkerTask + + + /ArcCore/Os/OsApplication/OsAppTaskRef + /blinker_hcs12_card12/Os/ComTask + + + /ArcCore/Os/OsApplication/OsAppTaskRef + /blinker_hcs12_card12/Os/ComReceiveTask + + + /ArcCore/Os/OsApplication/OsAppAlarmRef + /blinker_hcs12_card12/Os/ComAlarm + + + + + OsApplicationHooks + /ArcCore/Os/OsApplication/OsApplicationHooks + + + /ArcCore/Os/OsApplication/OsApplicationHooks/OsAppErrorHook + false + + + /ArcCore/Os/OsApplication/OsApplicationHooks/OsAppShutdownHook + false + + + /ArcCore/Os/OsApplication/OsApplicationHooks/OsAppStartupHook + false + + + + + + + BlinkerTask + + + + + + /ArcCore/Os/OsTask + + + /ArcCore/Os/OsTask/OsTaskActivation + 1 + + + /ArcCore/Os/OsTask/OsTaskPriority + 1 + + + /ArcCore/Os/OsTask/OsTaskProcessType + BASIC + + + /ArcCore/Os/OsTask/ArcCoreOsTaskStackSize + 512 + + + /ArcCore/Os/OsTask/OsTaskSchedule + FULL + + + + + ComTask + + + + + + /ArcCore/Os/OsTask + + + /ArcCore/Os/OsTask/OsTaskActivation + 1 + + + /ArcCore/Os/OsTask/OsTaskPriority + 4 + + + /ArcCore/Os/OsTask/OsTaskProcessType + BASIC + + + /ArcCore/Os/OsTask/ArcCoreOsTaskStackSize + 512 + + + /ArcCore/Os/OsTask/OsTaskSchedule + FULL + + + + + ComReceiveTask + + + + + + /ArcCore/Os/OsTask + + + /ArcCore/Os/OsTask/OsTaskActivation + 1 + + + /ArcCore/Os/OsTask/OsTaskPriority + 1 + + + /ArcCore/Os/OsTask/OsTaskProcessType + EXTENDED + + + /ArcCore/Os/OsTask/ArcCoreOsTaskStackSize + 512 + + + /ArcCore/Os/OsTask/OsTaskSchedule + FULL + + + + + /ArcCore/Os/OsTask/OsTaskEventRef + /blinker_hcs12_card12/Os/FreqReciveEvent + + + + + OsTaskAutostart + /ArcCore/Os/OsTask/OsTaskAutostart + + + + + FreqReciveEvent + + + + + + /ArcCore/Os/OsEvent + + + /ArcCore/Os/OsEvent/ArcOsEventId + 0 + + + /ArcCore/Os/OsEvent/ArcOsEventAutoMask + true + + + + + ComAlarm + + + + + + /ArcCore/Os/OsAlarm + + + /ArcCore/Os/OsAlarm/OsAlarmCounterRef + /blinker_hcs12_card12/Os/MainCounter + + + + + OsAlarmAutostart + /ArcCore/Os/OsAlarm/OsAlarmAutostart + + + /ArcCore/Os/OsAlarm/OsAlarmAutostart/OsAlarmAlarmTime + 1 + + + /ArcCore/Os/OsAlarm/OsAlarmAutostart/OsAlarmAutostartType + ABSOLUTE + + + /ArcCore/Os/OsAlarm/OsAlarmAutostart/OsAlarmCycleTime + 100 + + + + + OsAlarmActivateTask + /ArcCore/Os/OsAlarm/OsAlarmAction/OsAlarmActivateTask + + + /ArcCore/Os/OsAlarm/OsAlarmAction/OsAlarmActivateTask/OsAlarmActivateTaskRef + /blinker_hcs12_card12/Os/ComTask + + + + + + + + + Port + + + + + true + 2.0.2 + + + + /ArcCore/Port + + + PortConfigSet + /ArcCore/Port/PortConfigSet + + + DIO_Container + + + + + + /ArcCore/Port/PortConfigSet/PortContainer + + + PH7 + + + + + + /ArcCore/Port/PortConfigSet/PortContainer/PortPin + + + /ArcCore/Port/PortConfigSet/PortContainer/PortPin/PortPinPullMode + PULL_NONE + + + /ArcCore/Port/PortConfigSet/PortContainer/PortPin/PortPinDirection + PORT_PIN_OUT + + + /ArcCore/Port/PortConfigSet/PortContainer/PortPin/PortPinDirectionChangeable + false + + + /ArcCore/Port/PortConfigSet/PortContainer/PortPin/PortPinHysteresisEnabled + false + + + /ArcCore/Port/PortConfigSet/PortContainer/PortPin/PortPinOpenDrainEnabled + false + + + /ArcCore/Port/PortConfigSet/PortContainer/PortPin/ArcReducedDrive + false + + + /ArcCore/Port/PortConfigSet/PortContainer/PortPin/ArcPortPinName + PH7 + + + /ArcCore/Port/PortConfigSet/PortContainer/PortPin/PortPinId + 31 + + + /ArcCore/Port/PortConfigSet/PortContainer/PortPin/PortPinLevelValue + PORT_PIN_LEVEL_LOW + + + /ArcCore/Port/PortConfigSet/PortContainer/PortPin/PortPinMode + + + + + + + + + + PortGeneral + /ArcCore/Port/PortGeneral + + + /ArcCore/Port/PortGeneral/PortDevErrorDetect + false + + + /ArcCore/Port/PortGeneral/PortSetPinDirectionApi + false + + + /ArcCore/Port/PortGeneral/PortSetPinModeApi + false + + + /ArcCore/Port/PortGeneral/PortVersionInfoApi + false + + + + + + + PduR + + + + + true + 3.0.8 + + + + /ArcCore/PduR + + + PduRGeneral + /ArcCore/PduR/PduRGeneral + + + /ArcCore/PduR/PduRGeneral/PduRCanIfSupport + true + + + /ArcCore/PduR/PduRGeneral/PduRCanTpSupport + false + + + /ArcCore/PduR/PduRGeneral/PduRComSupport + true + + + /ArcCore/PduR/PduRGeneral/PduRDcmSupport + false + + + /ArcCore/PduR/PduRGeneral/ArcPduRSoAdSupport + false + + + /ArcCore/PduR/PduRGeneral/PduRDevErrorDetect + false + + + /ArcCore/PduR/PduRGeneral/PduRFifoTxBufferSupport + false + + + /ArcCore/PduR/PduRGeneral/PduRFrIfSupport + false + + + /ArcCore/PduR/PduRGeneral/PduRFrTpSupport + false + + + /ArcCore/PduR/PduRGeneral/PduRGatewayOperation + false + + + /ArcCore/PduR/PduRGeneral/PduRIPduMSupport + false + + + /ArcCore/PduR/PduRGeneral/PduRLinIfSupport + false + + + /ArcCore/PduR/PduRGeneral/PduRLinTpSupport + false + + + /ArcCore/PduR/PduRGeneral/PduRMemorySize + 0 + + + /ArcCore/PduR/PduRGeneral/PduRMinimumRoutingLoModule + + + + /ArcCore/PduR/PduRGeneral/PduRMinimumRoutingLoRxPduId + 0 + + + /ArcCore/PduR/PduRGeneral/PduRMinimumRoutingLoTxPduId + 0 + + + /ArcCore/PduR/PduRGeneral/PduRMinimumRoutingUpModule + + + + /ArcCore/PduR/PduRGeneral/PduRMinimumRoutingUpRxPduId + 0 + + + /ArcCore/PduR/PduRGeneral/PduRMinimumRoutingUpTxPduId + 0 + + + /ArcCore/PduR/PduRGeneral/PduRMulticastFromIfSupport + false + + + /ArcCore/PduR/PduRGeneral/PduRMulticastFromTpSupport + false + + + /ArcCore/PduR/PduRGeneral/PduRMulticastToIfSupport + false + + + /ArcCore/PduR/PduRGeneral/PduRMulticastToTpSupport + false + + + /ArcCore/PduR/PduRGeneral/PduRSbTxBufferSupport + false + + + /ArcCore/PduR/PduRGeneral/PduRSingleIf + CAN_IF + + + /ArcCore/PduR/PduRGeneral/PduRSingleTp + CAN_TP + + + /ArcCore/PduR/PduRGeneral/PduRVersionInfoApi + false + + + /ArcCore/PduR/PduRGeneral/PduRZeroCostOperation + true + + + + + PduRGlobalConfig + /ArcCore/PduR/PduRGlobalConfig + + + /ArcCore/PduR/PduRGlobalConfig/PduRConfigurationId + 0 + + + + + PduRRoutingTable + /ArcCore/PduR/PduRGlobalConfig/PduRRoutingTable + + + PduRTpBufferTable + /ArcCore/PduR/PduRGlobalConfig/PduRTpBufferTable + + + /ArcCore/PduR/PduRGlobalConfig/PduRTpBufferTable/PduRMaxTpBufferNumber + 0 + + + + + + + + + Mcu + + + + + true + 2.0.3 + + + + /ArcCore/Mcu + + + McuGeneralConfiguration + /ArcCore/Mcu/McuGeneralConfiguration + + + /ArcCore/Mcu/McuGeneralConfiguration/McuDevErrorDetect + false + + + /ArcCore/Mcu/McuGeneralConfiguration/McuPerformResetApi + false + + + /ArcCore/Mcu/McuGeneralConfiguration/McuVersionInfoApi + true + + + + + McuModuleConfiguration + /ArcCore/Mcu/McuModuleConfiguration + + + /ArcCore/Mcu/McuModuleConfiguration/McuClockSrcFailureNotification + DISABLED + + + /ArcCore/Mcu/McuModuleConfiguration/McuNumberOfMcuModes + 0 + + + /ArcCore/Mcu/McuModuleConfiguration/McuRamSectors + 1 + + + /ArcCore/Mcu/McuModuleConfiguration/McuResetSetting + 0 + + + + + McuClockSettingConfig + /ArcCore/Mcu/McuModuleConfiguration/McuClockSettingConfig + + + /ArcCore/Mcu/McuModuleConfiguration/McuClockSettingConfig/McuDefaultClockReference + /blinker_hcs12_card12/Mcu/McuModuleConfiguration/McuClockSettingConfig/EXT_REF_16MHZ + + + + + EXT_REF_16MHZ + + + + + + /ArcCore/Mcu/McuModuleConfiguration/McuClockSettingConfig/McuClockReferencePoint + + + /ArcCore/Mcu/McuModuleConfiguration/McuClockSettingConfig/McuClockReferencePoint/McuClockReferencePointFrequency + 1.6E7 + + + /ArcCore/Mcu/McuModuleConfiguration/McuClockSettingConfig/McuClockReferencePoint/McuClockReferencePointPllClock + 48000000 + + + + + + + McuModeSettingConf + /ArcCore/Mcu/McuModuleConfiguration/McuModeSettingConf + + + /ArcCore/Mcu/McuModuleConfiguration/McuModeSettingConf/McuMode + 0 + + + + + + + + + EcuC + + + + + true + 2.0.0 + + + + /ArcCore/EcuC + + + PduCollection + /ArcCore/EcuC/PduCollection + + + FreqReq + + + + + + /ArcCore/EcuC/PduCollection/Pdu + + + /ArcCore/EcuC/PduCollection/Pdu/PduLength + 64 + + + + + FreqInd + + + + + + /ArcCore/EcuC/PduCollection/Pdu + + + /ArcCore/EcuC/PduCollection/Pdu/PduLength + 64 + + + + + + + + + + + GeneratedSystemSignals + + + FreqIndSig + + + + TRUE + + + + /blinker_hcs12_card12/GeneratedSystemSignals/Data/IntegerLiterals/FreqIndSigInitValue/FreqIndSigInitValueLiteral + 32 + + + FreqReqSig + + + + TRUE + + + + /blinker_hcs12_card12/GeneratedSystemSignals/Data/IntegerLiterals/FreqReqSigInitValue/FreqReqSigInitValueLiteral + 32 + + + + + Data + + + UInt8 + + 0 + 255 + + + UInt16 + + 0 + 65535 + + + UInt32 + + 0 + 4294967295 + + + SInt8 + + -128 + 127 + + + SInt16 + + -32768 + 32767 + + + SInt32 + + -2147483648 + 2147483647 + + + + + IntegerLiterals + + + FreqIndSigInitValue + + + FreqIndSigInitValueLiteral + 0 + + + + + FreqReqSigInitValue + + + FreqReqSigInitValueLiteral + 1000 + + + + + + + + + + + + + + diff --git a/boards/hcs12_elmicro_card12/examples/blinker/build_config.mk b/boards/hcs12_elmicro_card12/examples/blinker/build_config.mk new file mode 100644 index 00000000..407e518f --- /dev/null +++ b/boards/hcs12_elmicro_card12/examples/blinker/build_config.mk @@ -0,0 +1,7 @@ +include $(CURDIR)/../config/EcuM.mk + +#CFG+=VLE +MOD_USE+= DET ECUM MCU KERNEL RAMLOG + +def-y += CFG_RAMLOG_SIZE=1024 +def-y += HEAPSIZE=512 \ No newline at end of file diff --git a/boards/hcs12_elmicro_card12/examples/blinker/config/CanIf_Cfg.c b/boards/hcs12_elmicro_card12/examples/blinker/config/CanIf_Cfg.c new file mode 100644 index 00000000..c2ad0586 --- /dev/null +++ b/boards/hcs12_elmicro_card12/examples/blinker/config/CanIf_Cfg.c @@ -0,0 +1,176 @@ +/* +* Configuration of module: CanIf (CanIf_Cfg.c) +* +* Created by: +* Copyright: +* +* Configured for (MCU): HCS12 +* +* Module vendor: ArcCore +* Generator version: 2.0.5 +* +* Generated by Arctic Studio (http://arccore.com) +* on Fri Jun 17 15:35:48 CEST 2011 +*/ + + + +#include "CanIf.h" +#if defined(USE_CANTP) +#include "CanTp.h" +#include "CanTp_Cbk.h" +#endif +#if defined(USE_PDUR) +#include "PduR.h" +#endif +#if defined(USE_CANNM) +#include "CanNm_Cbk.h" +#endif +#include + + +// Imported structs from Can_Lcfg.c +extern const Can_ControllerConfigType CanControllerConfigData[]; +extern const Can_ConfigSetType CanConfigSetData; + + + + +// Contains the mapping from CanIf-specific Channels to Can Controllers +const CanControllerIdType CanIf_Arc_ChannelToControllerMap[CANIF_CHANNEL_CNT] = { + CAN_CTRL_0, // Channel0 +}; + +const uint8 CanIf_Arc_ChannelDefaultConfIndex[CANIF_CHANNEL_CNT] = { + CANIF_Channel0_CONFIG_0, +}; + +// Container that gets slamed into CanIf_InitController() +// Inits ALL controllers +// Multiplicity 1..* +const CanIf_ControllerConfigType CanIfControllerConfig[] = { + // This is the ConfigurationIndex in CanIf_InitController() + + + { + .WakeupSupport = CANIF_WAKEUP_SUPPORT_NO_WAKEUP, + .CanIfControllerIdRef = CANIF_Channel0, + .CanIfDriverNameRef = "FLEXCAN", // Not used + .CanIfInitControllerRef = &CanControllerConfigData[0], + }, + +}; + +// Function callbacks for higher layers +const CanIf_DispatchConfigType CanIfDispatchConfig = +{ + .CanIfBusOffNotification = NULL, + .CanIfWakeUpNotification = NULL, // Not used + .CanIfWakeupValidNotification = NULL, // Not used + .CanIfErrorNotificaton = NULL, +}; + + +// Data for init configuration CanIfInitConfiguration + + + +const CanIf_HthConfigType CanIfHthConfigData_HardwareObject[] = +{ + + { + .CanIfHthType = CAN_ARC_HANDLE_TYPE_BASIC, + .CanIfCanControllerIdRef = CANIF_Channel0, + .CanIfHthIdSymRef = TxBox, + .CanIf_Arc_EOL = 1, + }, +}; + +const CanIf_HrhConfigType CanIfHrhConfigData_HardwareObject[] = +{ + + { + .CanIfHrhType = CAN_ARC_HANDLE_TYPE_BASIC, + .CanIfSoftwareFilterHrh = TRUE, + .CanIfCanControllerHrhIdRef = CANIF_Channel0, + .CanIfHrhIdSymRef = RxBox, + .CanIf_Arc_EOL = 1, + }, +}; + + +const CanIf_InitHohConfigType CanIfHohConfigData[] = { + + { + .CanConfigSet = &CanConfigSetData, + .CanIfHrhConfig = CanIfHrhConfigData_HardwareObject, + .CanIfHthConfig = CanIfHthConfigData_HardwareObject, + .CanIf_Arc_EOL = 1, + }, +}; + +const CanIf_TxPduConfigType CanIfTxPduConfigData[] = { + { + .CanIfTxPduId = PDUR_REVERSE_PDU_ID_FreqInd, + .CanIfCanTxPduIdCanId = 258, + .CanIfCanTxPduIdDlc = 8, + .CanIfCanTxPduType = CANIF_PDU_TYPE_STATIC, +#if ( CANIF_READTXPDU_NOTIFY_STATUS_API == STD_ON ) + .CanIfReadTxPduNotifyStatus = false, +#endif + .CanIfTxPduIdCanIdType = CANIF_CAN_ID_TYPE_11, + .CanIfUserTxConfirmation = PduR_CanIfTxConfirmation, + .CanIfCanTxPduHthRef = &CanIfHthConfigData_HardwareObject[0], + .PduIdRef = NULL, + }, +}; + +const CanIf_RxPduConfigType CanIfRxPduConfigData[] = { + { + .CanIfCanRxPduId = PDUR_PDU_ID_FreqReq, + .CanIfCanRxPduCanId = 256, + .CanIfCanRxPduDlc = 8, +#if ( CANIF_CANPDUID_READDATA_API == STD_ON ) + .CanIfReadRxPduData = false, +#endif +#if ( CANIF_READTXPDU_NOTIFY_STATUS_API == STD_ON ) + .CanIfReadRxPduNotifyStatus = false, +#endif + .CanIfRxPduIdCanIdType = CANIF_CAN_ID_TYPE_11, + .CanIfRxUserType = CANIF_USER_TYPE_CAN_PDUR, + .CanIfCanRxPduHrhRef = &CanIfHrhConfigData_HardwareObject[0], + .CanIfRxPduIdCanIdType = CANIF_CAN_ID_TYPE_11, + .CanIfUserRxIndication = NULL, + .CanIfSoftwareFilterType = CANIF_SOFTFILTER_TYPE_MASK, + .CanIfCanRxPduCanIdMask = 0xFFF, + .PduIdRef = NULL, + }, +}; + +// This container contains the init parameters of the CAN +// Multiplicity 1..* +const CanIf_InitConfigType CanIfInitConfig = +{ + .CanIfConfigSet = 0, // Not used + .CanIfNumberOfCanRxPduIds = sizeof(CanIfRxPduConfigData)/sizeof(CanIf_RxPduConfigType), + .CanIfNumberOfCanTXPduIds = sizeof(CanIfTxPduConfigData)/sizeof(CanIf_TxPduConfigType), + .CanIfNumberOfDynamicCanTXPduIds = 0, // Not used + + // Containers + .CanIfHohConfigPtr = CanIfHohConfigData, + .CanIfRxPduConfigPtr = CanIfRxPduConfigData, + .CanIfTxPduConfigPtr = CanIfTxPduConfigData, +}; + + // This container includes all necessary configuration sub-containers +// according the CAN Interface configuration structure. +CanIf_ConfigType CanIf_Config = +{ + .ControllerConfig = CanIfControllerConfig, + .DispatchConfig = &CanIfDispatchConfig, + .InitConfig = &CanIfInitConfig, + .TransceiverConfig = NULL, // Not used + .Arc_ChannelToControllerMap = CanIf_Arc_ChannelToControllerMap, + .Arc_ChannelDefaultConfIndex = CanIf_Arc_ChannelDefaultConfIndex, +}; + diff --git a/boards/hcs12_elmicro_card12/examples/blinker/config/CanIf_Cfg.h b/boards/hcs12_elmicro_card12/examples/blinker/config/CanIf_Cfg.h new file mode 100644 index 00000000..d855bdec --- /dev/null +++ b/boards/hcs12_elmicro_card12/examples/blinker/config/CanIf_Cfg.h @@ -0,0 +1,67 @@ +/* +* Configuration of module: CanIf (CanIf_Cfg.h) +* +* Created by: +* Copyright: +* +* Configured for (MCU): HCS12 +* +* Module vendor: ArcCore +* Generator version: 2.0.5 +* +* Generated by Arctic Studio (http://arccore.com) +* on Fri Jun 17 15:35:48 CEST 2011 +*/ + + +#if !(((CANIF_SW_MAJOR_VERSION == 1) && (CANIF_SW_MINOR_VERSION == 3)) ) +#error CanIf: Configuration file expected BSW module version to be 1.3.* +#endif + + +#ifndef CANIF_CFG_H_ +#define CANIF_CFG_H_ + +#include "Can.h" + + +#define CANIF_VERSION_INFO_API STD_ON +#define CANIF_DEV_ERROR_DETECT STD_OFF +#define CANIF_DLC_CHECK STD_ON +#define CANIF_ARC_RUNTIME_PDU_CONFIGURATION STD_OFF +#define CANIF_MULITPLE_DRIVER_SUPPORT STD_OFF // Not supported +#define CANIF_READRXPDU_DATA_API STD_OFF // Not supported +#define CANIF_READRXPDU_NOTIFY_STATUS_API STD_OFF // Not supported +#define CANIF_READTXPDU_NOTIFY_STATUS_API STD_OFF // Not supported +#define CANIF_SETDYNAMICTXID_API STD_OFF // Not supported +#define CANIF_WAKEUP_EVENT_API STD_OFF // Not supported +#define CANIF_TRANSCEIVER_API STD_OFF // Not supported +#define CANIF_TRANSMIT_CANCELLATION STD_OFF // Not supported + + +#define CANIF_PDU_ID_FreqReq 0 + +#define CANIF_PDU_ID_FreqInd 0 + +// Identifiers for the elements in CanIfControllerConfig[] +// This is the ConfigurationIndex in CanIf_InitController() +typedef enum { + CANIF_Channel0_CONFIG_0, + CANIF_CHANNEL_CONFIGURATION_CNT +} CanIf_Arc_ConfigurationIndexType; + +typedef enum { + CANIF_Channel0, + CANIF_CHANNEL_CNT +} CanIf_Arc_ChannelIdType; + +#define CANIF_CONTROLLER_ID_CAN0 CANIF_Channel0 + + +#include "CanIf_ConfigTypes.h" + + +extern CanIf_ConfigType CanIf_Config; + +#endif + diff --git a/boards/hcs12_elmicro_card12/examples/blinker/config/CanIf_SpecialPdus.h b/boards/hcs12_elmicro_card12/examples/blinker/config/CanIf_SpecialPdus.h new file mode 100644 index 00000000..2fc186f0 --- /dev/null +++ b/boards/hcs12_elmicro_card12/examples/blinker/config/CanIf_SpecialPdus.h @@ -0,0 +1,28 @@ +/* +* Configuration of module: CanIf (CanIf_SpecialPdus.h) +* +* Created by: +* Copyright: +* +* Configured for (MCU): HCS12 +* +* Module vendor: ArcCore +* Generator version: 2.0.5 +* +* Generated by Arctic Studio (http://arccore.com) +* on Fri Jun 17 15:35:48 CEST 2011 +*/ + + +#if !(((CANIF_SW_MAJOR_VERSION == 1) && (CANIF_SW_MINOR_VERSION == 3)) ) +#error CanIf: Configuration file expected BSW module version to be 1.3.* +#endif + + +#ifndef CANIF_SPECIALPDUS_H_ +#define CANIF_SPECIALPDUS_H_ + + + +#endif + diff --git a/boards/hcs12_elmicro_card12/examples/blinker/config/Can_Cfg.h b/boards/hcs12_elmicro_card12/examples/blinker/config/Can_Cfg.h new file mode 100644 index 00000000..990dd7b4 --- /dev/null +++ b/boards/hcs12_elmicro_card12/examples/blinker/config/Can_Cfg.h @@ -0,0 +1,230 @@ +/* +* Configuration of module: Can (Can_Cfg.h) +* +* Created by: +* Copyright: +* +* Configured for (MCU): HCS12 +* +* Module vendor: ArcCore +* Generator version: 2.0.2 +* +* Generated by Arctic Studio (http://arccore.com) +* on Fri Jun 17 15:35:48 CEST 2011 +*/ + + +#if !(((CAN_SW_MAJOR_VERSION == 1) && (CAN_SW_MINOR_VERSION == 0)) ) +#error Can: Configuration file expected BSW module version to be 1.0.* +#endif + + + +#ifndef CAN_CFG_H_ +#define CAN_CFG_H_ + +// Number of controller configs +#define CAN_ARC_CTRL_CONFIG_CNT 1 + +#define CAN_DEV_ERROR_DETECT STD_OFF +#define CAN_VERSION_INFO_API STD_OFF +#define CAN_MULTIPLEXED_TRANSMISSION STD_OFF // Not supported +#define CAN_WAKEUP_SUPPORT STD_OFF // Not supported +#define CAN_HW_TRANSMIT_CANCELLATION STD_OFF // Not supported + +typedef enum { + CAN_CTRL_0 = 0, + CAN_CTRL_1 = 1, + CAN_CTRL_2 = 2, + CAN_CTRL_3 = 3, + CAN_CTRL_4 = 4, + CAN_CONTROLLER_CNT = 5 +}CanControllerIdType; + + +typedef enum { + CAN_ID_TYPE_EXTENDED, + CAN_ID_TYPE_MIXED, + CAN_ID_TYPE_STANDARD +} Can_IdTypeType; + +typedef enum { + CAN_OBJECT_TYPE_RECEIVE, + CAN_OBJECT_TYPE_TRANSMIT +} Can_ObjectTypeType; + + +typedef enum { + CAN_ARC_HANDLE_TYPE_BASIC, + CAN_ARC_HANDLE_TYPE_FULL +} Can_Arc_HohType; + + +typedef enum { + TxBox, + NUM_OF_HTHS +} Can_Arc_HTHType; + + +typedef enum { + RxBox, + NUM_OF_HRHS +} Can_Arc_HRHType; + + +typedef struct { + void (*CancelTxConfirmation)( const Can_PduType *); + void (*RxIndication)( uint8 ,Can_IdType ,uint8 , const uint8 * ); + void (*ControllerBusOff)(uint8); + void (*TxConfirmation)(PduIdType); + void (*ControllerWakeup)(uint8); + void (*Arc_Error)(uint8,Can_Arc_ErrorType); +} Can_CallbackType; + + +typedef struct { + // Specifies the InstanceId of this module instance. If only one instance is + // present it shall have the Id 0 + uint8 CanIndex; +} Can_GeneralType; + +// Start mc9s12 unique +typedef enum { + CAN_ARC_IDAM_2_32BIT, + CAN_ARC_IDAM_4_16BIT, + CAN_ARC_IDAM_8_8BIT, + CAN_ARC_IDAM_FILTER_CLOSED, +} Can_Arc_IDAMType; + +typedef struct +{ + uint8 idmr[8]; // Identifier Mask Register, 1 = ignore corresponding acceptance code register bit + uint8 idar[8]; // Identifier Acceptance Register + Can_Arc_IDAMType idam; +} Can_FilterMaskType; + +typedef struct Can_HardwareObjectStruct { + // Specifies the type (Full-CAN or Basic-CAN) of a hardware object. + Can_Arc_HohType CanHandleType; + + // Specifies whether the IdValue is of type - standard identifier - extended + // identifier - mixed mode ImplementationType: Can_IdType + Can_IdTypeType CanIdType; + + // Specifies (together with the filter mask) the identifiers range that passes + // the hardware filter. + uint32 CanIdValue; + + // Holds the handle ID of HRH or HTH. The value of this parameter is unique + // in a given CAN Driver, and it should start with 0 and continue without any + // gaps. The HRH and HTH Ids are defined under two different name-spaces. + // Example: HRH0-0, HRH1-1, HTH0-2, HTH1-3 + uint32 CanObjectId; + + // Specifies if the HardwareObject is used as Transmit or as Receive object + Can_ObjectTypeType CanObjectType; + + // Reference to the filter mask that is used for hardware filtering togerther + // with the CAN_ID_VALUE + Can_FilterMaskType *CanFilterMaskRef; + + // A "1" in this mask tells the driver that that HW Message Box should be + // occupied by this Hoh. A "1" in bit 31(ppc) occupies Mb 0 in HW. + uint32 Can_Arc_MbMask; + + // End Of List. Set to TRUE is this is the last object in the list. + boolean Can_Arc_EOL; +} Can_HardwareObjectType; + +typedef enum { + CAN_ARC_PROCESS_TYPE_INTERRUPT, + CAN_ARC_PROCESS_TYPE_POLLING +} Can_Arc_ProcessType; + +typedef struct { + + // Enables / disables API Can_MainFunction_BusOff() for handling busoff + // events in polling mode. + // INTERRUPT or POLLING + Can_Arc_ProcessType CanBusOffProcessing; + + // Defines if a CAN controller is used in the configuration. + boolean CanControllerActivation; + + // Specifies the buadrate of the controller in kbps. + uint32 CanControllerBaudRate; + + // This parameter provides the controller ID which is unique in a given CAN + // Driver. The value for this parameter starts with 0 and continue without any + // gaps. + CanControllerIdType CanControllerId; + + // Specifies propagation delay in time quantas. + uint32 CanControllerPropSeg; + + // Specifies phase segment 1 in time quantas. + uint32 CanControllerSeg1; + + // Specifies phase segment 2 in time quantas. + uint32 CanControllerSeg2; + + // Specifies the time quanta for the controller. The calculation of the resulting + // prescaler value depending on module clocking and time quanta shall be + // done offline Hardware specific. + uint32 CanControllerTimeQuanta; + + // Enables / disables API Can_MainFunction_Read() for handling PDU + // reception events in polling mode. + Can_Arc_ProcessType CanRxProcessing; + + // Enables / disables API Can_MainFunction_Write() for handling PDU + // transmission events in polling mode. + Can_Arc_ProcessType CanTxProcessing; + + // Enables / disables API Can_MainFunction_Wakeup() for handling wakeup + // events in polling mode. + Can_Arc_ProcessType CanWakeupProcessing; + + // Reference to the CPU clock configuration, which is set in the MCU driver + // configuration + uint32 CanCpuClockRef; + + // This parameter contains a reference to the Wakeup Source for this + // controller as defined in the ECU State Manager. Implementation Type: + // reference to EcuM_WakeupSourceType + uint32 CanWakeupSourceRef; + + // List of Hoh id's that belong to this controller + const Can_HardwareObjectType *Can_Arc_Hoh; + + boolean Can_Arc_Loopback; + + // Set this to use the fifo + boolean Can_Arc_Fifo; +} Can_ControllerConfigType; + + +typedef struct { + const Can_ControllerConfigType *CanController; + + // Callbacks( Extension ) + const Can_CallbackType *CanCallbacks; +} Can_ConfigSetType; + + +typedef struct { + // This is the multiple configuration set container for CAN Driver + // Multiplicity 1..* + const Can_ConfigSetType *CanConfigSet; + // This container contains the parameters related each CAN + // Driver Unit. + // Multiplicity 1..* + const Can_GeneralType *CanGeneral; +} Can_ConfigType; + + +extern const Can_ConfigType CanConfigData; +extern const Can_ControllerConfigType CanControllerConfigData[]; +extern const Can_ConfigSetType Can_ConfigSet; + +#endif /*CAN_CFG_H_*/ diff --git a/boards/hcs12_elmicro_card12/examples/blinker/config/Can_Lcfg.c b/boards/hcs12_elmicro_card12/examples/blinker/config/Can_Lcfg.c new file mode 100644 index 00000000..85b16200 --- /dev/null +++ b/boards/hcs12_elmicro_card12/examples/blinker/config/Can_Lcfg.c @@ -0,0 +1,92 @@ +/* +* Configuration of module: Can (Can_Lcfg.c) +* +* Created by: +* Copyright: +* +* Configured for (MCU): HCS12 +* +* Module vendor: ArcCore +* Generator version: 2.0.2 +* +* Generated by Arctic Studio (http://arccore.com) +* on Fri Jun 17 15:35:48 CEST 2011 +*/ + + + +#include +#include "Can.h" +#include "CanIf_Cbk.h" + + +Can_FilterMaskType Can_FilterMaskConfigData_CAN0_Mask = { + {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}, + {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}, + CAN_ARC_IDAM_2_32BIT +}; + + +const Can_HardwareObjectType CanHardwareObjectConfig_CAN0[] = { + { + .CanObjectId = TxBox, + .CanHandleType = CAN_ARC_HANDLE_TYPE_BASIC, + .CanIdType = CAN_ID_TYPE_STANDARD, + .CanObjectType = CAN_OBJECT_TYPE_TRANSMIT, + .CanFilterMaskRef = &Can_FilterMaskConfigData_CAN0_Mask, + + .Can_Arc_MbMask = 0x0, + .Can_Arc_EOL = 0, + }, + { + .CanObjectId = RxBox, + .CanHandleType = CAN_ARC_HANDLE_TYPE_BASIC, + .CanIdType = CAN_ID_TYPE_STANDARD, + .CanObjectType = CAN_OBJECT_TYPE_RECEIVE, + .CanFilterMaskRef = &Can_FilterMaskConfigData_CAN0_Mask, + + .Can_Arc_MbMask = 0x0, + .Can_Arc_EOL = 1, + }, +}; + + +const Can_ControllerConfigType CanControllerConfigData[] = +{ + { + .CanControllerActivation = FALSE, + .CanControllerBaudRate = 250, + .CanControllerId = CAN_CTRL_0, + .CanControllerPropSeg = 4, + .CanControllerSeg1 = 4, + .CanControllerSeg2 = 5, + .CanBusOffProcessing = CAN_ARC_PROCESS_TYPE_INTERRUPT, + .CanRxProcessing = CAN_ARC_PROCESS_TYPE_INTERRUPT, + .CanTxProcessing = CAN_ARC_PROCESS_TYPE_INTERRUPT, + .CanWakeupProcessing = CAN_ARC_PROCESS_TYPE_INTERRUPT, + .CanCpuClockRef = 0, + .Can_Arc_Hoh = &CanHardwareObjectConfig_CAN0[0], + .Can_Arc_Loopback = FALSE, + .Can_Arc_Fifo = 0, + }, +}; + +const Can_CallbackType CanCallbackConfigData = { + NULL, //CanIf_CancelTxConfirmation, + CanIf_RxIndication, + CanIf_ControllerBusOff, + CanIf_TxConfirmation, + NULL, //CanIf_ControllerWakeup, + CanIf_Arc_Error, +}; + +const Can_ConfigSetType CanConfigSetData = +{ + .CanController = CanControllerConfigData, + .CanCallbacks = &CanCallbackConfigData, +}; + +const Can_ConfigType CanConfigData = { + .CanConfigSet = &CanConfigSetData, +}; + diff --git a/boards/hcs12_elmicro_card12/examples/blinker/config/Com_Cfg.h b/boards/hcs12_elmicro_card12/examples/blinker/config/Com_Cfg.h new file mode 100644 index 00000000..3819358b --- /dev/null +++ b/boards/hcs12_elmicro_card12/examples/blinker/config/Com_Cfg.h @@ -0,0 +1,50 @@ +/* +* Configuration of module: Com (Com_Cfg.h) +* +* Created by: +* Copyright: +* +* Configured for (MCU): HCS12 +* +* Module vendor: ArcCore +* Generator version: 2.0.5 +* +* Generated by Arctic Studio (http://arccore.com) +* on Fri Jun 17 15:35:48 CEST 2011 +*/ + + +#if !(((COM_SW_MAJOR_VERSION == 1) && (COM_SW_MINOR_VERSION == 2)) ) +#error Com: Configuration file expected BSW module version to be 1.2.* +#endif + + +#ifndef COM_CFG_H +#define COM_CFG_H + +#define COM_MODULE_ID 20 +#define COM_INSTANCE_ID 1 + +#define COM_DEV_ERROR_DETECT STD_OFF + +#define COM_N_IPDUS 2 +#define COM_N_SIGNALS 2 +#define COM_N_GROUP_SIGNALS 0 + +#define COM_E_INVALID_FILTER_CONFIGURATION 101 +#define COM_E_INITIALIZATION_FAILED 102 +#define COM_E_INVALID_SIGNAL_CONFIGURATION 103 +#define COM_INVALID_PDU_ID 104 +#define COM_INVALID_SIGNAL_ID 109 +#define COM_ERROR_SIGNAL_IS_SIGNALGROUP 105 + +#define COM_E_TOO_MANY_IPDU 106 +#define COM_E_TOO_MANY_SIGNAL 107 +#define COM_E_TOO_MANY_GROUPSIGNAL 108 + +#define CPU_ENDIANESS COM_BIG_ENDIAN + +#define ComConfigurationTimeBase 0.0 +#define ComVersionInfoApi + +#endif /*COM_CFG_H*/ diff --git a/boards/hcs12_elmicro_card12/examples/blinker/config/Com_PbCfg.c b/boards/hcs12_elmicro_card12/examples/blinker/config/Com_PbCfg.c new file mode 100644 index 00000000..f3010d5d --- /dev/null +++ b/boards/hcs12_elmicro_card12/examples/blinker/config/Com_PbCfg.c @@ -0,0 +1,250 @@ +/* +* Configuration of module: Com (Com_PbCfg.c) +* +* Created by: +* Copyright: +* +* Configured for (MCU): HCS12 +* +* Module vendor: ArcCore +* Generator version: 2.0.5 +* +* Generated by Arctic Studio (http://arccore.com) +* on Fri Jun 17 15:35:48 CEST 2011 +*/ + + +#include "Com.h" +#include "Com_Internal.h" +#include +#if defined(USE_PDUR) +#include "PduR.h" +#endif + + +/* + * Signal init values. + */ +const uint32 Com_SignalInitValue_FreqIndSig = 0; +const uint32 Com_SignalInitValue_FreqReqSig = 1000; + + +/* + * Group signal definitions + */ +const ComGroupSignal_type ComGroupSignal[] = { + { + .Com_Arc_EOL = 1 + } +}; + + +/* SignalGroup GroupSignals lists. */ + +/* + * Signal definitions + */ +const ComSignal_type ComSignal[] = { + { + .ComHandleId = FreqIndSig, + .ComFirstTimeoutFactor = 0, + .ComNotification = NULL, + .ComTimeoutFactor = 0, + .ComTimeoutNotification = NULL, + .ComErrorNotification = NULL, + .ComTransferProperty = PENDING, + + .ComUpdateBitPosition = 0, + .ComSignalArcUseUpdateBit = 0, + + + .ComSignalInitValue = &Com_SignalInitValue_FreqIndSig, + .ComBitPosition = 0, + .ComBitSize = 32, + .ComSignalEndianess = COM_BIG_ENDIAN, + .ComSignalType = UINT32, + .Com_Arc_IsSignalGroup = 0, + .ComGroupSignal = NULL, + + .ComRxDataTimeoutAction = COM_TIMEOUT_DATA_ACTION_NONE, + .Com_Arc_EOL = 0 + }, + { + .ComHandleId = FreqReqSig, + .ComFirstTimeoutFactor = 0, + .ComNotification = NULL, + .ComTimeoutFactor = 0, + .ComTimeoutNotification = NULL, + .ComErrorNotification = NULL, + .ComTransferProperty = PENDING, + + .ComUpdateBitPosition = 0, + .ComSignalArcUseUpdateBit = 0, + + + .ComSignalInitValue = &Com_SignalInitValue_FreqReqSig, + .ComBitPosition = 0, + .ComBitSize = 32, + .ComSignalEndianess = COM_BIG_ENDIAN, + .ComSignalType = UINT32, + .Com_Arc_IsSignalGroup = 0, + .ComGroupSignal = NULL, + + .ComRxDataTimeoutAction = COM_TIMEOUT_DATA_ACTION_NONE, + .Com_Arc_EOL = 0 + }, + { + .Com_Arc_EOL = 1 + } +}; + + +/* + * I-PDU group definitions + */ +const ComIPduGroup_type ComIPduGroup[] = { + { + .ComIPduGroupHandleId = ComPduGroup, + .Com_Arc_EOL = 0 + }, + + { + .Com_Arc_EOL = 1 + } +}; + +/* IPdu signal lists. */ +const ComSignal_type * const ComIPduSignalRefs_FreqInd[] = { + &ComSignal[ FreqIndSig ], + NULL, +}; +const ComSignal_type * const ComIPduSignalRefs_FreqReq[] = { + &ComSignal[ FreqReqSig ], + NULL, +}; + +/* + * I-PDU definitions + */ +const ComIPdu_type ComIPdu[] = { + + { // FreqInd + .ArcIPduOutgoingId = PDUR_PDU_ID_FreqInd, + .ComIPduCallout = NULL, + .ComIPduSignalProcessing = DEFERRED, + .ComIPduSize = 8, + .ComIPduDirection = SEND, + .ComIPduGroupRef = ComPduGroup, + + .ComTxIPdu = { + .ComTxIPduMinimumDelayFactor = 0, + .ComTxIPduUnusedAreasDefault = 0, + .ComTxModeTrue = { + .ComTxModeMode = PERIODIC, + .ComTxModeNumberOfRepetitions = 0, + .ComTxModeRepetitionPeriodFactor = 0, + .ComTxModeTimeOffsetFactor = 0, + .ComTxModeTimePeriodFactor = 100, + }, + }, + + .ComIPduSignalRef = ComIPduSignalRefs_FreqInd, + .Com_Arc_EOL = 0 + }, + { // FreqReq + .ArcIPduOutgoingId = PDUR_REVERSE_PDU_ID_FreqReq, + .ComIPduCallout = IncommingFreqReq, + .ComIPduSignalProcessing = DEFERRED, + .ComIPduSize = 8, + .ComIPduDirection = RECEIVE, + .ComIPduGroupRef = ComPduGroup, + + .ComTxIPdu = { + .ComTxIPduMinimumDelayFactor = 0, + .ComTxIPduUnusedAreasDefault = 0, + .ComTxModeTrue = { + .ComTxModeMode = NONE, + .ComTxModeNumberOfRepetitions = 0, + .ComTxModeRepetitionPeriodFactor = 0, + .ComTxModeTimeOffsetFactor = 0, + .ComTxModeTimePeriodFactor = 0, + }, + }, + + .ComIPduSignalRef = ComIPduSignalRefs_FreqReq, + .Com_Arc_EOL = 0 + }, + { + .Com_Arc_EOL = 1 + } +}; + +const Com_ConfigType ComConfiguration = { + .ComConfigurationId = 1, + .ComIPdu = ComIPdu, + .ComIPduGroup = ComIPduGroup, + .ComSignal = ComSignal, + .ComGroupSignal = ComGroupSignal +}; + +/* IPdu buffers and signal group buffers */ +uint8 ComArcIPduBuffer_FreqInd[8]; + +uint8 ComArcIPduBuffer_FreqReq[8]; + + +Com_Arc_IPdu_type Com_Arc_IPdu[] = { + { // FreqInd + .Com_Arc_TxIPduTimers = { + .ComTxIPduNumberOfRepetitionsLeft = 0, + .ComTxModeRepetitionPeriodTimer = 0, + .ComTxIPduMinimumDelayTimer = 0, + .ComTxModeTimePeriodTimer = 0 + }, + .ComIPduDataPtr = ComArcIPduBuffer_FreqInd, + .Com_Arc_IpduStarted = 0 + }, + { // FreqReq + .Com_Arc_TxIPduTimers = { + .ComTxIPduNumberOfRepetitionsLeft = 0, + .ComTxModeRepetitionPeriodTimer = 0, + .ComTxIPduMinimumDelayTimer = 0, + .ComTxModeTimePeriodTimer = 0 + }, + .ComIPduDataPtr = ComArcIPduBuffer_FreqReq, + .Com_Arc_IpduStarted = 0 + }, +}; + +Com_Arc_Signal_type Com_Arc_Signal[] = { + { // FreqIndSig + .Com_Arc_DeadlineCounter = 0, + .ComTimeoutFactor = 0, + .ComIPduHandleId = 0, + .ComSignalUpdated = 0, + .ComIPduDataPtr = NULL, + + .Com_Arc_ShadowBuffer = NULL + + }, + + { // FreqReqSig + .Com_Arc_DeadlineCounter = 0, + .ComTimeoutFactor = 0, + .ComIPduHandleId = 0, + .ComSignalUpdated = 0, + .ComIPduDataPtr = NULL, + + .Com_Arc_ShadowBuffer = NULL + + }, + +}; + + +Com_Arc_Config_type Com_Arc_Config = { + .ComIPdu = Com_Arc_IPdu, + .ComSignal = Com_Arc_Signal, + .ComGroupSignal = NULL +}; + diff --git a/boards/hcs12_elmicro_card12/examples/blinker/config/Com_PbCfg.h b/boards/hcs12_elmicro_card12/examples/blinker/config/Com_PbCfg.h new file mode 100644 index 00000000..a73c0d87 --- /dev/null +++ b/boards/hcs12_elmicro_card12/examples/blinker/config/Com_PbCfg.h @@ -0,0 +1,52 @@ +/* +* Configuration of module: Com (Com_PbCfg.h) +* +* Created by: +* Copyright: +* +* Configured for (MCU): HCS12 +* +* Module vendor: ArcCore +* Generator version: 2.0.5 +* +* Generated by Arctic Studio (http://arccore.com) +* on Fri Jun 17 15:35:48 CEST 2011 +*/ + + +#if !(((COM_SW_MAJOR_VERSION == 1) && (COM_SW_MINOR_VERSION == 2)) ) +#error Com: Configuration file expected BSW module version to be 1.2.* +#endif + +#ifndef COM_PBCFG_H +#define COM_PBCFG_H + +#include "Com_Types.h" + +extern const Com_ConfigType ComConfiguration; + +// COM Polite Defines. +#define COM_PDU_ID_FreqInd 0 +#define COM_PDU_ID_FreqReq 1 + + + +// PDU group definitions +#define ComPduGroup 0 + + +// Signal definitions +#define FreqIndSig 0 +#define FreqReqSig 1 + + + +// Notifications + + + +// Callouts +boolean IncommingFreqReq(PduIdType PduId, const uint8 *IPduData); + + +#endif /* COM_PBCFG_H */ diff --git a/boards/hcs12_elmicro_card12/examples/blinker/config/Det_Cfg.h b/boards/hcs12_elmicro_card12/examples/blinker/config/Det_Cfg.h new file mode 100644 index 00000000..a7bdbf57 --- /dev/null +++ b/boards/hcs12_elmicro_card12/examples/blinker/config/Det_Cfg.h @@ -0,0 +1,38 @@ +/* +* Configuration of module: Det (Det_Cfg.h) +* +* Created by: +* Copyright: +* +* Configured for (MCU): HCS12 +* +* Module vendor: ArcCore +* Generator version: 2.0.1 +* +* Generated by Arctic Studio (http://arccore.com) +* on Fri Jun 17 15:35:49 CEST 2011 +*/ + + +#if !(((DET_SW_MAJOR_VERSION == 1) && (DET_SW_MINOR_VERSION == 0)) ) +#error Det: Configuration file expected BSW module version to be 1.0.* +#endif + +/* + * Development Error Tracer driver + * + * Specification: Autosar v2.0.1, Final + * + */ +#ifndef DET_CFG_H +#define DET_CFG_H + +#define DET_ENABLE_CALLBACKS STD_OFF // Enable to use callback on errors +#define DET_USE_RAMLOG STD_ON // Enable to log DET errors to ramlog +#define DET_WRAP_RAMLOG STD_ON // The ramlog wraps around when reaching the end +#define DET_USE_STDERR STD_OFF // Enable to get DET errors on stderr +#define DET_DEINIT_API STD_OFF // Enable/Disable the Det_DeInit function +#define DET_RAMLOG_SIZE (16) // Number of entries in ramlog +#define DET_NUMBER_OF_CALLBACKS (5) // Number of callbacks + +#endif /* DET_CFG_H */ diff --git a/boards/hcs12_elmicro_card12/examples/blinker/config/Dio_Cfg.h b/boards/hcs12_elmicro_card12/examples/blinker/config/Dio_Cfg.h new file mode 100644 index 00000000..c5fac130 --- /dev/null +++ b/boards/hcs12_elmicro_card12/examples/blinker/config/Dio_Cfg.h @@ -0,0 +1,65 @@ +/* +* Configuration of module: Dio (Dio_Cfg.h) +* +* Created by: +* Copyright: +* +* Configured for (MCU): HCS12 +* +* Module vendor: ArcCore +* Generator version: 2.0.0 +* +* Generated by Arctic Studio (http://arccore.com) +* on Fri Jun 17 15:35:48 CEST 2011 +*/ + + +#if !(((DIO_SW_MAJOR_VERSION == 1) && (DIO_SW_MINOR_VERSION == 0)) ) +#error Dio: Configuration file expected BSW module version to be 1.0.* +#endif + + +#ifndef DIO_CFG_H_ +#define DIO_CFG_H_ + +#define DIO_VERSION_INFO_API STD_OFF +#define DIO_DEV_ERROR_DETECT STD_OFF + +#define DIO_END_OF_LIST -1 + +// Physical ports +typedef enum +{ + DIO_PORT_A = 0, + DIO_PORT_E = 1, + DIO_PORT_B = 2, + DIO_PORT_H = 3, + DIO_PORT_J = 4, + DIO_PORT_K = 5, + DIO_PORT_M = 6, + DIO_PORT_P = 7, + DIO_PORT_S = 8, + DIO_PORT_T = 9, +} Dio_PortTypesType; + + +// Channels +#define DIO_CHANNEL_NAME_LED_CHANNEL 31 + +// Channel group + +// Ports +#define DIO_PORT_NAME_HPort (DIO_PORT_H) + + + + +// Pointers for convenience. +// Channels +extern const Dio_ChannelType DioChannelConfigData[]; +// Channel group +extern const Dio_ChannelGroupType DioConfigData[]; +// Port +extern const Dio_PortType DioPortConfigData[]; + +#endif /*DIO_CFG_H_*/ diff --git a/boards/hcs12_elmicro_card12/examples/blinker/config/Dio_Lcfg.c b/boards/hcs12_elmicro_card12/examples/blinker/config/Dio_Lcfg.c new file mode 100644 index 00000000..95772aa0 --- /dev/null +++ b/boards/hcs12_elmicro_card12/examples/blinker/config/Dio_Lcfg.c @@ -0,0 +1,43 @@ +/* +* Configuration of module: Dio (Dio_Lcfg.c) +* +* Created by: +* Copyright: +* +* Configured for (MCU): HCS12 +* +* Module vendor: ArcCore +* Generator version: 2.0.0 +* +* Generated by Arctic Studio (http://arccore.com) +* on Fri Jun 17 15:35:49 CEST 2011 +*/ + + + +#include "Dio.h" +#include "Dio_Cfg.h" + +const Dio_ChannelType DioChannelConfigData[] = { + DIO_CHANNEL_NAME_LED_CHANNEL, + DIO_END_OF_LIST +}; + +const Dio_PortType DioPortConfigData[] = { + DIO_PORT_NAME_HPort, + DIO_END_OF_LIST +}; + +const Dio_ChannelGroupType DioConfigData[] = { + { + .port = DIO_END_OF_LIST, + .offset = DIO_END_OF_LIST, + .mask = DIO_END_OF_LIST, + } +}; + + +uint32 Dio_GetPortConfigSize(void) +{ + return sizeof(DioConfigData); +} diff --git a/boards/hcs12_elmicro_card12/examples/blinker/config/EcuM.mk b/boards/hcs12_elmicro_card12/examples/blinker/config/EcuM.mk new file mode 100644 index 00000000..345dedf6 --- /dev/null +++ b/boards/hcs12_elmicro_card12/examples/blinker/config/EcuM.mk @@ -0,0 +1,3 @@ + +MOD_USE += CAN CANIF COM DIO PORT PDUR MCU + diff --git a/boards/hcs12_elmicro_card12/examples/blinker/config/EcuM_Callout_template.c b/boards/hcs12_elmicro_card12/examples/blinker/config/EcuM_Callout_template.c new file mode 100644 index 00000000..49f0a75b --- /dev/null +++ b/boards/hcs12_elmicro_card12/examples/blinker/config/EcuM_Callout_template.c @@ -0,0 +1,302 @@ +/* +* Configuration of module: EcuM (EcuM_Callout_template.c) +* +* Created by: +* Copyright: +* +* Configured for (MCU): HCS12 +* +* Module vendor: ArcCore +* Generator version: 2.0.2 +* +* Generated by Arctic Studio (http://arccore.com) +* on Fri Jun 17 15:35:45 CEST 2011 +*/ + + +#include "EcuM.h" +#include "EcuM_Cbk.h" +#include "Det.h" +#if defined(USE_DEM) +#include "Dem.h" +#endif +#if defined(USE_MCU) +#include "Mcu.h" +#endif +#if defined(USE_GPT) +#include "Gpt.h" +#endif +#if defined(USE_CAN) +#include "Can.h" +#endif +#if defined(USE_CANIF) +#include "CanIf.h" +#endif +#if defined(USE_PDUR) +#include "PduR.h" +#endif +#if defined(USE_COM) +#include "Com.h" +#endif +#if defined(USE_CANTP) +#include "CanTp.h" +#endif +#if defined(USE_DCM) +#include "Dcm.h" +#endif +#if defined(USE_PWM) +#include "Pwm.h" +#endif +#if defined(USE_IOHWAB) +#include "IoHwAb.h" +#endif +#if defined(USE_FLS) +#include "Fls.h" +#endif +#if defined(USE_EEP) +#include "Eep.h" +#endif +#if defined(USE_FEE) +#include "Fee.h" +#endif +#if defined(USE_EA) +#include "Ea.h" +#endif +#if defined(USE_NVM) +#include "NvM.h" +#endif +#if defined(USE_COMM) +#include "ComM.h" +#endif +#if defined(USE_NM) +#include "Nm.h" +#endif +#if defined(USE_CANNM) +#include "CanNm.h" +#endif +#if defined(USE_CANSM) +#include "CanSM.h" +#endif +#if defined(USE_LINSM) +#include "LinSM.h" +#endif +#if defined(USE_SPI) +#include "Spi.h" +#endif + +void EcuM_AL_DriverInitZero(void) +{ +#if defined(USE_DET) + Det_Init(); + Det_Start(); +#endif +} + +EcuM_ConfigType* EcuM_DeterminePbConfiguration(void) +{ + return &EcuMConfig; +} + +void EcuM_AL_DriverInitOne(const EcuM_ConfigType *ConfigPtr) +{ + //lint --e{715} PC-Lint (715) - ConfigPtr usage depends on configuration of modules + +#if defined(USE_MCU) + Mcu_Init(ConfigPtr->McuConfig); + + // Set up default clock (Mcu_InitClock requires initRun==1) + // Ignoring return value + (void) Mcu_InitClock( ConfigPtr->McuConfig->McuDefaultClockSettings ); + + // Wait for PLL to sync. + while (Mcu_GetPllStatus() != MCU_PLL_LOCKED) + { + ; + } +#endif + +#if defined(USE_DEM) + // Preinitialize DEM + Dem_PreInit(); +#endif + +#if defined(USE_PORT) + // Setup Port + Port_Init(ConfigPtr->PortConfig); +#endif + + +#if defined(USE_GPT) + // Setup the GPT + Gpt_Init(ConfigPtr->GptConfig); +#endif + + // Setup watchdog + // TODO + +#if defined(USE_DMA) + // Setup DMA + Dma_Init(ConfigPtr->DmaConfig); +#endif + +#if defined(USE_ADC) + // Setup ADC + Adc_Init(ConfigPtr->AdcConfig); +#endif + + // Setup ICU + // TODO + + // Setup PWM +#if defined(USE_PWM) + // Setup PWM + Pwm_Init(ConfigPtr->PwmConfig); +#endif +} + +void EcuM_AL_DriverInitTwo(const EcuM_ConfigType* ConfigPtr) +{ + //lint --e{715} PC-Lint (715) - ConfigPtr usage depends on configuration of modules + +#if defined(USE_SPI) + // Setup SPI + Spi_Init(ConfigPtr->SpiConfig); +#endif + +#if defined(USE_EEP) + // Setup EEP + Eep_Init(ConfigPtr->EepConfig); +#endif + +#if defined(USE_FLS) + // Setup Flash + Fls_Init(ConfigPtr->FlashConfig); +#endif + +#if defined(USE_FEE) + // Setup FEE + Fee_Init(); +#endif + +#if defined(USE_EA) + // Setup EA + Ea_init(); +#endif + +#if defined(USE_NVM) + // Setup NVRAM Manager and start the read all job + NvM_Init(); + NvM_ReadAll(); +#endif + + // Setup CAN tranceiver + // TODO + +#if defined(USE_CAN) + // Setup Can driver + Can_Init(ConfigPtr->CanConfig); +#endif + +#if defined(USE_CANIF) + // Setup CanIf + CanIf_Init(ConfigPtr->CanIfConfig); +#endif + +#if defined(USE_CANTP) + // Setup CAN TP + CanTp_Init(); +#endif + +#if defined(USE_CANSM) + CanSM_Init(ConfigPtr->CanSMConfig); +#endif + + // Setup LIN + // TODO + +#if defined(USE_PDUR) + // Setup PDU Router + PduR_Init(ConfigPtr->PduRConfig); +#endif + +#if defined(USE_CANNM) + // Setup Can Network Manager + CanNm_Init(ConfigPtr->CanNmConfig); +#endif + +#if defined(USE_NM) + // Setup Network Management Interface + Nm_Init(ConfigPtr->NmConfig); +#endif + +#if defined(USE_COM) + // Setup COM layer + Com_Init(ConfigPtr->ComConfig); +#endif + +#if defined(USE_DCM) + // Setup DCM + Dcm_Init(); +#endif + +#if defined(USE_IOHWAB) + // Setup IO hardware abstraction layer + IoHwAb_Init(); +#endif + +} + +void EcuM_AL_DriverInitThree(const EcuM_ConfigType* ConfigPtr) +{ + //lint --e{715} PC-Lint (715) - ConfigPtr usage depends on configuration of modules + +#if defined(USE_DEM) + // Setup DEM + Dem_Init(); +#endif + +#if defined(USE_COMM) + // Setup Communication Manager + ComM_Init(ConfigPtr->ComMConfig); +#endif +} + +void EcuM_OnEnterRUN(void) +{ + +} + +void EcuM_OnExitRun(void) +{ + +} + +void EcuM_OnExitPostRun(void) +{ + +} + +void EcuM_OnPrepShutdown(void) +{ + +} + +void EcuM_OnGoSleep(void) +{ + +} + +void EcuM_OnGoOffOne(void) +{ + +} + +void EcuM_OnGoOffTwo(void) +{ + +} + +void EcuM_AL_SwitchOff(void) +{ + +} diff --git a/boards/hcs12_elmicro_card12/examples/blinker/config/EcuM_Cfg.c b/boards/hcs12_elmicro_card12/examples/blinker/config/EcuM_Cfg.c new file mode 100644 index 00000000..8740dc72 --- /dev/null +++ b/boards/hcs12_elmicro_card12/examples/blinker/config/EcuM_Cfg.c @@ -0,0 +1,89 @@ +/* +* Configuration of module: EcuM (EcuM_Cfg.c) +* +* Created by: +* Copyright: +* +* Configured for (MCU): HCS12 +* +* Module vendor: ArcCore +* Generator version: 2.0.2 +* +* Generated by Arctic Studio (http://arccore.com) +* on Fri Jun 17 15:35:45 CEST 2011 +*/ + + + +#include "EcuM.h" + + +#if defined(USE_CANSM) +extern const CanSM_ConfigType CanSM_Config; +#endif +#if defined(USE_NM) +extern const Nm_ConfigType Nm_Config; +#endif +#if defined(USE_CANNM) +extern const CanNm_ConfigType CanNm_Config; +#endif +#if defined(USE_COMM) +extern const ComM_ConfigType ComM_Config; +#endif + + +EcuM_ConfigType EcuMConfig = +{ + .EcuMDefaultShutdownTarget = ECUM_STATE_RESET, + .EcuMDefaultSleepMode = 0, // Don't care + .EcuMDefaultAppMode = OSDEFAULTAPPMODE, + .EcuMNvramReadAllTimeout = ECUM_NVRAM_READALL_TIMEOUT, + .EcuMNvramWriteAllTimeout = ECUM_NVRAM_WRITEALL_TIMEOUT, + .EcuMRunMinimumDuration = ECUM_NVRAM_MIN_RUN_DURATION, + +#if defined(USE_MCU) + .McuConfig = McuConfigData, +#endif +#if defined(USE_PORT) + .PortConfig = &PortConfigData, +#endif +#if defined(USE_CAN) + .CanConfig = &CanConfigData, +#endif +#if defined(USE_CANIF) + .CanIfConfig = &CanIf_Config, +#endif +#if defined(USE_CANSM) + .CanSMConfig = &CanSM_Config, +#endif +#if defined(USE_CANNM) + .CanNmConfig = &CanNm_Config, +#endif +#if defined(USE_COM) + .ComConfig = &ComConfiguration, +#endif +#if defined(USE_COMM) + .ComMConfig = &ComM_Config, +#endif +#if defined(USE_NM) + .NmConfig = &Nm_Config, +#endif +#if defined(USE_PDUR) + .PduRConfig = &PduR_Config, +#endif +#if defined(USE_DMA) + .DmaConfig = DmaConfig, +#endif +#if defined(USE_ADC) + .AdcConfig = AdcConfig, +#endif +#if defined(USE_PWM) + .PwmConfig = &PwmConfig, +#endif +#if defined(USE_GPT) + .GptConfig = GptConfigData, +#endif +#if defined(USE_FLS) + .FlashConfig = FlsConfigSet, +#endif +}; diff --git a/boards/hcs12_elmicro_card12/examples/blinker/config/EcuM_Cfg.h b/boards/hcs12_elmicro_card12/examples/blinker/config/EcuM_Cfg.h new file mode 100644 index 00000000..a2660aef --- /dev/null +++ b/boards/hcs12_elmicro_card12/examples/blinker/config/EcuM_Cfg.h @@ -0,0 +1,46 @@ +/* +* Configuration of module: EcuM (EcuM_Cfg.h) +* +* Created by: +* Copyright: +* +* Configured for (MCU): HCS12 +* +* Module vendor: ArcCore +* Generator version: 2.0.2 +* +* Generated by Arctic Studio (http://arccore.com) +* on Fri Jun 17 15:35:48 CEST 2011 +*/ + + +#if !(((ECUM_SW_MAJOR_VERSION == 2) && (ECUM_SW_MINOR_VERSION == 0)) ) +#error EcuM: Configuration file expected BSW module version to be 2.0.* +#endif + + + +#ifndef ECUM_CFG_H_ +#define ECUM_CFG_H_ + +#define ECUM_VERSION_INFO_API STD_OFF +#define ECUM_DEV_ERROR_DETECT STD_OFF + +#include "EcuM_Generated_Types.h" + +#define ECUM_MAIN_FUNCTION_PERIOD (200) +#define ECUM_NVRAM_READALL_TIMEOUT (10000) +#define ECUM_NVRAM_WRITEALL_TIMEOUT (10000) +#define ECUM_NVRAM_MIN_RUN_DURATION (10000) + + +typedef enum { + ECUM_USER_User_1, + ECUM_USER_ENDMARK // Must be the last in list! +} EcuM_UserList; + + +extern EcuM_ConfigType EcuMConfig; + +#endif /*ECUM_CFG_H_*/ + diff --git a/boards/hcs12_elmicro_card12/examples/blinker/config/EcuM_Generated_Types.h b/boards/hcs12_elmicro_card12/examples/blinker/config/EcuM_Generated_Types.h new file mode 100644 index 00000000..a5b058df --- /dev/null +++ b/boards/hcs12_elmicro_card12/examples/blinker/config/EcuM_Generated_Types.h @@ -0,0 +1,142 @@ +/* +* Configuration of module: EcuM (EcuM_Generated_Types.h) +* +* Created by: +* Copyright: +* +* Configured for (MCU): HCS12 +* +* Module vendor: ArcCore +* Generator version: 2.0.2 +* +* Generated by Arctic Studio (http://arccore.com) +* on Fri Jun 17 15:35:45 CEST 2011 +*/ + + +#if !(((ECUM_SW_MAJOR_VERSION == 2) && (ECUM_SW_MINOR_VERSION == 0)) ) +#error EcuM: Configuration file expected BSW module version to be 2.0.* +#endif + + +#ifndef _ECUM_GENERATED_TYPES_H_ +#define _ECUM_GENERATED_TYPES_H_ + +#if defined(USE_MCU) +#include "Mcu.h" +#endif +#if defined(USE_PORT) +#include "Port.h" +#endif +#if defined(USE_CAN) +#include "Can.h" +#endif +#if defined(USE_CANIF) +#include "CanIf.h" +#endif +#if defined(USE_PWM) +#include "Pwm.h" +#endif +#if defined(USE_COM) +#include "Com.h" +#endif +#if defined(USE_PDUR) +#include "PduR.h" +#endif +#if defined(USE_DMA) +#include "Dma.h" +#endif +#if defined(USE_ADC) +#include "Adc.h" +#endif +#if defined(USE_GPT) +#include "Gpt.h" +#endif +#if defined(USE_COMM) +#include "ComM.h" +#endif +#if defined(USE_NM) +#include "Nm.h" +#endif +#if defined(USE_CANNM) +#include "CanNm.h" +#endif +#if defined(USE_CANSM) +#include "CanSM.h" +#endif +#if defined(USE_LINSM) +#include "LinSM.h" +#endif +#if defined(USE_FLS) +#include "Fls.h" +#endif +#if defined(USE_EEP) +#include "Eep.h" +#endif +#if defined(USE_SPI) +#include "Spi.h" +#endif + +typedef struct +{ + EcuM_StateType EcuMDefaultShutdownTarget; + uint8 EcuMDefaultSleepMode; + AppModeType EcuMDefaultAppMode; + uint32 EcuMRunMinimumDuration; + uint32 EcuMNvramReadAllTimeout; + uint32 EcuMNvramWriteAllTimeout; + +#if defined(USE_MCU) + const Mcu_ConfigType* McuConfig; +#endif +#if defined(USE_PORT) + const Port_ConfigType* PortConfig; +#endif +#if defined(USE_CAN) + const Can_ConfigType* CanConfig; +#endif +#if defined(USE_CANIF) + const CanIf_ConfigType* CanIfConfig; +#endif +#if defined(USE_CANSM) + const CanSM_ConfigType* CanSMConfig; +#endif +#if defined(USE_NM) + const Nm_ConfigType* NmConfig; +#endif +#if defined(USE_CANNM) + const CanNm_ConfigType* CanNmConfig; +#endif +#if defined(USE_COMM) + const ComM_ConfigType* ComMConfig; +#endif +#if defined(USE_COM) + const Com_ConfigType* ComConfig; +#endif +#if defined(USE_PDUR) + const PduR_PBConfigType* PduRConfig; +#endif +#if defined(USE_PWM) + const Pwm_ConfigType* PwmConfig; +#endif +#if defined(USE_DMA) + const Dma_ConfigType* DmaConfig; +#endif +#if defined(USE_ADC) + const Adc_ConfigType* AdcConfig; +#endif +#if defined(USE_GPT) + const Gpt_ConfigType* GptConfig; +#endif +#if defined(USE_FLS) + const Fls_ConfigType* FlashConfig; +#endif +#if defined(USE_EEP) + const Eep_ConfigType* EepConfig; +#endif +#if defined(USE_SPI) + const Spi_ConfigType* SpiConfig; +#endif +} EcuM_ConfigType; + +#endif /*_ECUM_GENERATED_TYPES_H_*/ diff --git a/boards/hcs12_elmicro_card12/examples/blinker/config/Mcu_Cfg.c b/boards/hcs12_elmicro_card12/examples/blinker/config/Mcu_Cfg.c new file mode 100644 index 00000000..40e680ae --- /dev/null +++ b/boards/hcs12_elmicro_card12/examples/blinker/config/Mcu_Cfg.c @@ -0,0 +1,47 @@ +/* +* Configuration of module: Mcu (Mcu_Cfg.c) +* +* Created by: +* Copyright: +* +* Configured for (MCU): HCS12 +* +* Module vendor: ArcCore +* Generator version: 2.0.3 +* +* Generated by Arctic Studio (http://arccore.com) +* on Fri Jun 17 15:35:49 CEST 2011 +*/ + + +#ifndef MCU_CFG_C_ +#define MCU_CFG_C_ + +#include "Mcu.h" + + +Mcu_RamSectorSettingConfigType Mcu_RamSectorSettingConfigData[] = { +}; + +Mcu_ClockSettingConfigType Mcu_ClockSettingConfigData[] = +{ + { + .McuClockReferencePointFrequency = 16000000UL, + .Pll1 = 1, + .Pll2 = 2, + }, +}; + + +const Mcu_ConfigType McuConfigData[] = { + { + .McuClockSrcFailureNotification = 0, + .McuRamSectors = MCU_NBR_OF_RAM_SECTIONS, + .McuClockSettings = 1, + .McuDefaultClockSettings = 0, + .McuClockSettingConfig = &Mcu_ClockSettingConfigData[0], + .McuRamSectorSettingConfig = &Mcu_RamSectorSettingConfigData[0], + } +}; + +#endif /*MCU_CFG_C_*/ diff --git a/boards/hcs12_elmicro_card12/examples/blinker/config/Mcu_Cfg.h b/boards/hcs12_elmicro_card12/examples/blinker/config/Mcu_Cfg.h new file mode 100644 index 00000000..15376bf9 --- /dev/null +++ b/boards/hcs12_elmicro_card12/examples/blinker/config/Mcu_Cfg.h @@ -0,0 +1,41 @@ +/* +* Configuration of module: Mcu (Mcu_Cfg.h) +* +* Created by: +* Copyright: +* +* Configured for (MCU): HCS12 +* +* Module vendor: ArcCore +* Generator version: 2.0.3 +* +* Generated by Arctic Studio (http://arccore.com) +* on Fri Jun 17 15:35:49 CEST 2011 +*/ + + +#if !(((MCU_SW_MAJOR_VERSION == 2) && (MCU_SW_MINOR_VERSION == 0)) ) +#error Mcu: Configuration file expected BSW module version to be 2.0.* +#endif + + +#ifndef MCU_CFG_H_ +#define MCU_CFG_H_ + + +#define MCU_DEV_ERROR_DETECT STD_OFF +#define MCU_PERFORM_RESET_API STD_OFF +#define MCU_VERSION_INFO_API STD_ON + +typedef enum { + MCU_CLOCKTYPE_EXT_REF_16MHZ = 0, + MCU_NBR_OF_CLOCKS, +} Mcu_ClockType; + + +#define MCU_NBR_OF_RAM_SECTIONS 0 + + +#define MCU_DEFAULT_CONFIG McuConfigData[0] + +#endif /*MCU_CFG_H_*/ diff --git a/boards/hcs12_elmicro_card12/examples/blinker/config/Os_Cfg.c b/boards/hcs12_elmicro_card12/examples/blinker/config/Os_Cfg.c new file mode 100644 index 00000000..190fb6f1 --- /dev/null +++ b/boards/hcs12_elmicro_card12/examples/blinker/config/Os_Cfg.c @@ -0,0 +1,176 @@ +/* +* Configuration of module: Os (Os_Cfg.c) +* +* Created by: +* Copyright: +* +* Configured for (MCU): HCS12 +* +* Module vendor: ArcCore +* Generator version: 2.0.34 +* +* Generated by Arctic Studio (http://arccore.com) +* on Fri Jun 17 15:35:49 CEST 2011 +*/ + + + +#include "kernel.h" + + +// ############################### EXTERNAL REFERENCES ############################# + +/* Application externals */ + +/* Interrupt externals */ + + +// Set the os tick frequency +OsTickType OsTickFreq = 1000; + + +// ############################### DEBUG OUTPUT ############################# +uint32 os_dbg_mask = 0; + +// ############################### APPLICATIONS ############################# +GEN_APPLICATION_HEAD = { + GEN_APPLICATION( + /* id */ APPLICATION_ID_MainApplication, + /* name */ "MainApplication", + /* trusted */ true, /* NOT CONFIGURABLE IN TOOLS */ + /* core */ 0, /* Default value, multicore not enabled.*/ + /* StartupHook */ NULL, + /* ShutdownHook */ NULL, + /* ErrorHook */ NULL, + /* rstrtTaskId */ 0 /* NOT CONFIGURABLE IN TOOLS */ + ), +}; +// ################################# COUNTERS ############################### +GEN_COUNTER_HEAD = { + GEN_COUNTER( COUNTER_ID_MainCounter, + "MainCounter", + COUNTER_TYPE_HARD, + COUNTER_UNIT_NANO, + 0xffff, + 1, + 1, + 0, + APPLICATION_ID_MainApplication, /* Application owner */ + 1 /* Accessing application mask */ + ), +}; + + CounterType Os_Arc_OsTickCounter = COUNTER_ID_MainCounter; + + +// ################################## ALARMS ################################ +GEN_ALARM_AUTOSTART(ALARM_ID_ComAlarm, ALARM_AUTOSTART_ABSOLUTE, 1, 100, OSDEFAULTAPPMODE ); + +GEN_ALARM_AUTOSTART(ALARM_ID_MainAlarm, ALARM_AUTOSTART_ABSOLUTE, 1, 100, OSDEFAULTAPPMODE ); + + +GEN_ALARM_HEAD = { + GEN_ALARM( ALARM_ID_ComAlarm, + "ComAlarm", + COUNTER_ID_MainCounter, + GEN_ALARM_AUTOSTART_NAME(ALARM_ID_ComAlarm), + ALARM_ACTION_ACTIVATETASK, + TASK_ID_ComTask, + 0, + 0, + APPLICATION_ID_MainApplication, /* Application owner */ + 1 /* Accessing application mask */ + ), + GEN_ALARM( ALARM_ID_MainAlarm, + "MainAlarm", + COUNTER_ID_MainCounter, + GEN_ALARM_AUTOSTART_NAME(ALARM_ID_MainAlarm), + ALARM_ACTION_ACTIVATETASK, + TASK_ID_BlinkerTask, + 0, + 0, + APPLICATION_ID_MainApplication, /* Application owner */ + 1 /* Accessing application mask */ + ), +}; + +// ################################ RESOURCES ############################### + +// ############################## STACKS (TASKS) ############################ + +DECLARE_STACK(OsIdle,OS_OSIDLE_STACK_SIZE); + +DECLARE_STACK(BlinkerTask,512); +DECLARE_STACK(ComReceiveTask,512); +DECLARE_STACK(ComTask,512); + +// ################################## TASKS ################################# +GEN_TASK_HEAD = { + GEN_BTASK( /* */OsIdle, + /* name */"OsIdle", + /* priority */0, + /* schedule */FULL, + /* autostart */TRUE, + /* resource_int_p */NULL, + /* resource mask */0, + /* activation lim. */1, + /* App owner */0, + /* Accessing apps */1 + ), + GEN_BTASK( + /* */BlinkerTask, + /* name */"BlinkerTask", + /* priority */1, + /* schedule */FULL, + /* autostart */FALSE, + /* resource_int_p */NULL, + /* resource mask */0, + /* activation lim. */1, + /* App owner */APPLICATION_ID_MainApplication, + /* Accessing apps */1 + ), + GEN_ETASK( + /* */ComReceiveTask, + /* name */"ComReceiveTask", + /* priority */1, + /* schedule */FULL, + /* name */TRUE, + /* resource_int_p */NULL, + /* resource mask */0, + /* event mask */1, + /* App owner */APPLICATION_ID_MainApplication, + /* Accessing apps */1 + ), + GEN_BTASK( + /* */ComTask, + /* name */"ComTask", + /* priority */4, + /* schedule */FULL, + /* autostart */FALSE, + /* resource_int_p */NULL, + /* resource mask */0, + /* activation lim. */1, + /* App owner */APPLICATION_ID_MainApplication, + /* Accessing apps */1 + ), +}; + +// ################################## HOOKS ################################# +GEN_HOOKS( + NULL, + NULL, + NULL, + ErrorHook, + NULL, + NULL +); + +// ################################## ISRS ################################## + +GEN_ISR_MAP = { + 0 +}; + +// ############################ SCHEDULE TABLES ############################# + + diff --git a/boards/hcs12_elmicro_card12/examples/blinker/config/Os_Cfg.h b/boards/hcs12_elmicro_card12/examples/blinker/config/Os_Cfg.h new file mode 100644 index 00000000..391d07b5 --- /dev/null +++ b/boards/hcs12_elmicro_card12/examples/blinker/config/Os_Cfg.h @@ -0,0 +1,116 @@ +/* +* Configuration of module: Os (Os_Cfg.h) +* +* Created by: +* Copyright: +* +* Configured for (MCU): HCS12 +* +* Module vendor: ArcCore +* Generator version: 2.0.34 +* +* Generated by Arctic Studio (http://arccore.com) +* on Fri Jun 17 15:35:49 CEST 2011 +*/ + + +#if !(((OS_SW_MAJOR_VERSION == 2) && (OS_SW_MINOR_VERSION == 0)) ) +#error Os: Configuration file expected BSW module version to be 2.0.* +#endif + + + +#ifndef OS_CFG_H_ +#define OS_CFG_H_ + +// Application Id's +#define APPLICATION_ID_MainApplication 0 + +// Alarm Id's +#define ALARM_ID_ComAlarm 0 +#define ALARM_ID_MainAlarm 1 + +// Counter Id's +#define COUNTER_ID_MainCounter 0 + +// System counter +#define OSMAXALLOWEDVALUE UINT_MAX// NOT CONFIGURABLE IN TOOLS +#define OSTICKSPERBASE 1 // NOT CONFIGURABLE IN TOOLS +#define OSMINCYCLE 1 // NOT CONFIGURABLE IN TOOLS +#define OSTICKDURATION 1000000UL // Time between ticks in nano seconds + +// Counter macros +#define OSMAXALLOWEDVALUE_MainCounter OSMAXALLOWEDVALUE +#define OSTICKSPERBASE_MainCounter 1 // NOT CONFIGURABLE IN TOOLS +#define OSMINCYCLE_MainCounter 1 +#define OS_TICKS2SEC_MainCounter(_ticks) ( (OSTICKDURATION * _ticks)/1000000000UL ) +#define OS_TICKS2MS_MainCounter(_ticks) ( (OSTICKDURATION * _ticks)/1000000UL ) +#define OS_TICKS2US_MainCounter(_ticks) ( (OSTICKDURATION * _ticks)/1000UL ) +#define OS_TICKS2NS_MainCounter(_ticks) (OSTICKDURATION * _ticks) + + + +// Event masks +#define EVENT_MASK_FreqReciveEvent 1 + +// Isr Id's + +// Resource Id's + +// Linked resource id's + +// Resource masks + +// Task Id's +#define TASK_ID_OsIdle 0 + +#define TASK_ID_BlinkerTask 1 +#define TASK_ID_ComReceiveTask 2 +#define TASK_ID_ComTask 3 + +// Task entry points +void OsIdle( void ); +void BlinkerTask( void ); +void ComReceiveTask( void ); +void ComTask( void ); + +// Schedule table id's + +// Stack size +#define OS_INTERRUPT_STACK_SIZE 512 +#define OS_OSIDLE_STACK_SIZE 512 + +#define OS_ALARM_CNT 2 +#define OS_TASK_CNT 4 +#define OS_SCHTBL_CNT 0 +#define OS_COUNTER_CNT 1 +#define OS_EVENTS_CNT 1 +//#define OS_ISRS_CNT 0 +#define OS_RESOURCE_CNT 0 +#define OS_LINKED_RESOURCE_CNT 0 +#define OS_APPLICATION_CNT 1 +#define OS_SERVICE_CNT 0 /* ARCTICSTUDIO_GENERATOR_TODO */ +#define CFG_OS_DEBUG STD_OFF + +#define OS_SC1 STD_ON /* NOT CONFIGURABLE IN TOOLS */ +#define OS_USE_APPLICATIONS STD_ON +#define OS_USE_MEMORY_PROT STD_OFF /* NOT CONFIGURABLE IN TOOLS */ +#define OS_USE_TASK_TIMING_PROT STD_OFF /* NOT CONFIGURABLE IN TOOLS */ +#define OS_USE_ISR_TIMING_PROT STD_OFF /* NOT CONFIGURABLE IN TOOLS */ +//#define OS_SC3 STD_ON /* NOT CONFIGURABLE IN TOOLS */ +#define OS_STACK_MONITORING STD_ON +#define OS_STATUS_EXTENDED STD_ON +#define OS_USE_GET_SERVICE_ID STD_ON +#define OS_USE_PARAMETER_ACCESS STD_ON +#define OS_RES_SCHEDULER STD_ON /* NOT CONFIGURABLE IN TOOLS */ + +#define OS_ISR_CNT 0 +#define OS_ISR2_CNT 0 +#define OS_ISR1_CNT 0 + +#define OS_ISR_MAX_CNT 10 + +#define OS_NUM_CORES 1 + + +#endif /*OS_CFG_H_*/ diff --git a/boards/hcs12_elmicro_card12/examples/blinker/config/PduR_Cfg.h b/boards/hcs12_elmicro_card12/examples/blinker/config/PduR_Cfg.h new file mode 100644 index 00000000..89543cae --- /dev/null +++ b/boards/hcs12_elmicro_card12/examples/blinker/config/PduR_Cfg.h @@ -0,0 +1,132 @@ +/* +* Configuration of module: PduR (PduR_Cfg.h) +* +* Created by: +* Copyright: +* +* Configured for (MCU): HCS12 +* +* Module vendor: ArcCore +* Generator version: 3.0.8 +* +* Generated by Arctic Studio (http://arccore.com) +* on Fri Jun 17 15:35:49 CEST 2011 +*/ + + +#if !(((PDUR_SW_MAJOR_VERSION == 2) && (PDUR_SW_MINOR_VERSION == 0)) ) +#error PduR: Configuration file expected BSW module version to be 2.0.* +#endif + + + +#ifndef PDUR_CFG_H_ +#define PDUR_CFG_H_ + +// Module support +#define PDUR_CANIF_SUPPORT STD_ON +#define PDUR_CANTP_SUPPORT STD_OFF +#define PDUR_FRIF_SUPPORT STD_OFF /* Not supported */ +#define PDUR_FRTP_SUPPORT STD_OFF /* Not supported */ +#define PDUR_LINIF_SUPPORT STD_OFF +#define PDUR_LINTP_SUPPORT STD_OFF /* Not supported */ +#define PDUR_COM_SUPPORT STD_ON +#define PDUR_DCM_SUPPORT STD_OFF +#define PDUR_IPDUM_SUPPORT STD_OFF /* Not supported */ +#define PDUR_SOAD_SUPPORT STD_OFF + +#define PDUR_DEV_ERROR_DETECT STD_OFF +#define PDUR_VERSION_INFO_API STD_OFF + + +// Zero cost operation mode +#define PDUR_ZERO_COST_OPERATION STD_ON +#define PDUR_SINGLE_IF CAN_IF +#define PDUR_SINGLE_TP CAN_TP + + +// Gateway operation +#define PDUR_GATEWAY_OPERATION STD_ON +#define PDUR_MEMORY_SIZE 10 /* Not used */ +#define PDUR_SB_TX_BUFFER_SUPPORT STD_ON +#define PDUR_FIFO_TX_BUFFER_SUPPORT STD_OFF + +/** + * The maximum numbers of Tx buffers. + */ +#define PDUR_MAX_TX_BUFFER_NUMBER 10 /* Not used */ + + +// Multicast +#define PDUR_MULTICAST_TOIF_SUPPORT STD_ON +#define PDUR_MULTICAST_FROMIF_SUPPORT STD_ON +#define PDUR_MULTICAST_TOTP_SUPPORT STD_ON +#define PDUR_MULTICAST_FROMTP_SUPPORT STD_ON + +// Minimum routing +/* Minimum routing not supported. +#define PDUR_MINIMUM_ROUTING_UP_MODULE COM +#define PDUR_MINIMUM_ROUTING_LO_MODULE CAN_IF +#define PDUR_MINIMUM_ROUTING_UP_RXPDUID ((PduIdType)100) +#define PDUR_MINIMUM_ROUTING_LO_RXPDUID ((PduIdType)255) +#define PDUR_MINIMUM_ROUTING_UP_TXPDUID ((PduIdType)255) +#define PDUR_MINIMUM_ROUTING_LO_TXPDUID ((PduIdType)255) +*/ + +// Zero cost operation support active. +#if PDUR_CANIF_SUPPORT == STD_ON +#define PduR_CanIfRxIndication Com_RxIndication +#define PduR_CanIfTxConfirmation Com_TxConfirmation +#else +#define PduR_CanIfRxIndication(... ) +#define PduR_CanIfTxConfirmation(...) +#endif + +#if PDUR_CANTP_SUPPORT == STD_ON +#define PduR_CanTpProvideRxBuffer Dcm_ProvideRxBuffer +#define PduR_CanTpRxIndication Dcm_RxIndication +#define PduR_CanTpProvideTxBuffer Dcm_ProvideTxBuffer +#define PduR_CanTpTxConfirmation Dcm_TxConfirmation +#else +#define PduR_CanTpProvideRxBuffer(...) +#define PduR_CanTpRxIndication(...) +#define PduR_CanTpProvideTxBuffer(...) +#define PduR_CanTpTxConfirmation(...) +#endif + +#if PDUR_LINIF_SUPPORT == STD_ON +#define PduR_LinIfRxIndication Com_RxIndication +#define PduR_LinIfTxConfirmation Com_TxConfirmation +#define PduR_LinIfTriggerTransmit Com_TriggerTransmit +#else +#define PduR_LinIfRxIndication(...) +#define PduR_LinIfTxConfirmation(...) +#define PduR_LinIfTriggerTransmit(...) +#endif + +#if PDUR_SOAD_SUPPORT == STD_ON +#define PduR_SoAdTpProvideRxBuffer Dcm_ProvideRxBuffer +#define PduR_SoAdTpRxIndication Dcm_RxIndication +#define PduR_SoAdTpProvideTxBuffer Dcm_ProvideTxBuffer +#define PduR_SoAdTpTxConfirmation Dcm_TxConfirmation +#else +#define PduR_SoAdProvideRxBuffer(...) +#define PduR_SoAdRxIndication(...) +#define PduR_SoAdProvideTxBuffer(...) +#define PduR_SoAdTxConfirmation(...) +#endif + +#if PDUR_COM_SUPPORT == STD_ON +#define PduR_ComTransmit CanIf_Transmit +#else +#define PduR_ComTransmit(... ) (E_OK) +#endif + +#if PDUR_DCM_SUPPORT == STD_ON +#define PduR_DcmTransmit CanTp_Transmit +#else +#define PduR_DcmTransmit(... ) (E_OK) +#endif + + +#endif diff --git a/boards/hcs12_elmicro_card12/examples/blinker/config/PduR_PbCfg.c b/boards/hcs12_elmicro_card12/examples/blinker/config/PduR_PbCfg.c new file mode 100644 index 00000000..baedb414 --- /dev/null +++ b/boards/hcs12_elmicro_card12/examples/blinker/config/PduR_PbCfg.c @@ -0,0 +1,25 @@ +/* +* Configuration of module: PduR (PduR_PbCfg.c) +* +* Created by: +* Copyright: +* +* Configured for (MCU): HCS12 +* +* Module vendor: ArcCore +* Generator version: 3.0.8 +* +* Generated by Arctic Studio (http://arccore.com) +* on Fri Jun 17 15:35:49 CEST 2011 +*/ + + +#include "PduR.h" + +PduR_PBConfigType PduR_Config = { + .PduRConfigurationId = 0, + .RoutingPaths = NULL, + .TpBuffers = NULL, + .TpRouteBuffers = NULL, + .NRoutingPaths = 0 +}; \ No newline at end of file diff --git a/boards/hcs12_elmicro_card12/examples/blinker/config/PduR_PbCfg.h b/boards/hcs12_elmicro_card12/examples/blinker/config/PduR_PbCfg.h new file mode 100644 index 00000000..f27d59d1 --- /dev/null +++ b/boards/hcs12_elmicro_card12/examples/blinker/config/PduR_PbCfg.h @@ -0,0 +1,41 @@ +/* +* Configuration of module: PduR (PduR_PbCfg.h) +* +* Created by: +* Copyright: +* +* Configured for (MCU): HCS12 +* +* Module vendor: ArcCore +* Generator version: 3.0.8 +* +* Generated by Arctic Studio (http://arccore.com) +* on Fri Jun 17 15:35:49 CEST 2011 +*/ + + +#if !(((PDUR_SW_MAJOR_VERSION == 2) && (PDUR_SW_MINOR_VERSION == 0)) ) +#error PduR: Configuration file expected BSW module version to be 2.0.* +#endif + + +#if defined(USE_DCM) +#include "Dcm.h" +#endif +#if defined(USE_COM) +#include "Com.h" +#endif +#if defined(USE_CANIF) +#include "CanIf.h" +#endif +#if defined(USE_CANTP) +#include "CanTp.h" +#endif + +extern PduR_PBConfigType PduR_Config; + +// PduR Polite Defines. +#define PDUR_PDU_ID_FreqReq COM_PDU_ID_FreqReq +#define PDUR_REVERSE_PDU_ID_FreqReq CANIF_PDU_ID_FreqReq +#define PDUR_PDU_ID_FreqInd CANIF_PDU_ID_FreqInd +#define PDUR_REVERSE_PDU_ID_FreqInd COM_PDU_ID_FreqInd diff --git a/boards/hcs12_elmicro_card12/examples/blinker/config/Port_Cfg.c b/boards/hcs12_elmicro_card12/examples/blinker/config/Port_Cfg.c new file mode 100644 index 00000000..ad6ee5f8 --- /dev/null +++ b/boards/hcs12_elmicro_card12/examples/blinker/config/Port_Cfg.c @@ -0,0 +1,110 @@ +/* +* Configuration of module: Port (Port_Cfg.c) +* +* Created by: +* Copyright: +* +* Configured for (MCU): HCS12 +* +* Module vendor: ArcCore +* Generator version: 2.0.2 +* +* Generated by Arctic Studio (http://arccore.com) +* on Fri Jun 17 15:35:49 CEST 2011 +*/ + + + + +#include "Port.h" + +#define PORT_UNDEFINED 0x00 + +const Port_ConfigType PortConfigData = +{ + .corePullUpRegister = 0x90, + .coreReducedDriveRegister = 0x00, + .modeRoutingRegister = 0x00, + + #if ( PORTA_CONFIGURABLE == STD_ON ) + .portADirection = PORT_UNDEFINED, + .portAOutValue = PORT_UNDEFINED, + .portAMask = PORT_UNDEFINED, + #endif + + #if ( PORTB_CONFIGURABLE == STD_ON ) + .portBDirection = PORT_UNDEFINED, + .portBOutValue = PORT_UNDEFINED, + .portBMask = PORT_UNDEFINED, + #endif + + #if ( PORTE_CONFIGURABLE == STD_ON ) + .portEDirection = PORT_UNDEFINED, + .portEOutValue = PORT_UNDEFINED, + .portEMask = PORT_UNDEFINED, + #endif + + #if ( PORTK_CONFIGURABLE == STD_ON ) + .portKDirection = PORT_UNDEFINED, + .portKOutValue = PORT_UNDEFINED, + .portKMask = PORT_UNDEFINED, + #endif + + #if ( PORTH_CONFIGURABLE == STD_ON ) + .portHDirection = 0x80, + .portHOutValue = 0x0, + .portHMask = 0x0, + .portHPullEnableRegister = 0x0, + .portHPullPolarityRegsiter = 0x0, + .portHReducedDriveRegister = 0x0, + #endif + + #if ( PORTJ_CONFIGURABLE == STD_ON ) + .portJDirection = PORT_UNDEFINED, + .portJOutValue = PORT_UNDEFINED, + .portJMask = PORT_UNDEFINED, + .portJPullEnableRegister = PORT_UNDEFINED, + .portJPullPolarityRegsiter PORT_UNDEFINED, + .portJReducedDriveRegister = PORT_UNDEFINED, + #endif + + #if ( PORTM_CONFIGURABLE == STD_ON ) + .portMDirection = PORT_UNDEFINED, + .portMOutValue = PORT_UNDEFINED, + .portMMask = PORT_UNDEFINED, + .portMPullEnableRegister = PORT_UNDEFINED, + .portMPullPolarityRegsiter = PORT_UNDEFINED, + .portMWiredModeRegsiter = PORT_UNDEFINED, + .portMReducedDriveRegister = PORT_UNDEFINED, + #endif + + #if ( PORTP_CONFIGURABLE == STD_ON ) + .portPDirection = PORT_UNDEFINED, + .portPOutValue = PORT_UNDEFINED, + .portPMask = PORT_UNDEFINED, + .portPPullEnableRegister = PORT_UNDEFINED, + .portPPullPolarityRegsiter = PORT_UNDEFINED, + .portPReducedDriveRegister = PORT_UNDEFINED, + #endif + + #if ( PORTS_CONFIGURABLE == STD_ON ) + .portSDirection = PORT_UNDEFINED, + .portSOutValue = PORT_UNDEFINED, + .portSMask = PORT_UNDEFINED, + .portSPullEnableRegister = PORT_UNDEFINED, + .portSPullPolarityRegsiter = PORT_UNDEFINED, + .portSWiredModeRegsiter = PORT_UNDEFINED, + .portSReducedDriveRegister = PORT_UNDEFINED, + #endif + + #if ( PORTT_CONFIGURABLE == STD_ON ) + .portTDirection = PORT_UNDEFINED, + .portTOutValue = PORT_UNDEFINED, + .portTMask = PORT_UNDEFINED, + .portTPullEnableRegister = PORT_UNDEFINED, + .portTPullPolarityRegsiter = PORT_UNDEFINED, + .portTReducedDriveRegister = PORT_UNDEFINED, + #endif +}; + + diff --git a/boards/hcs12_elmicro_card12/examples/blinker/config/Port_Cfg.h b/boards/hcs12_elmicro_card12/examples/blinker/config/Port_Cfg.h new file mode 100644 index 00000000..dcb49b3a --- /dev/null +++ b/boards/hcs12_elmicro_card12/examples/blinker/config/Port_Cfg.h @@ -0,0 +1,253 @@ +/* +* Configuration of module: Port (Port_Cfg.h) +* +* Created by: +* Copyright: +* +* Configured for (MCU): HCS12 +* +* Module vendor: ArcCore +* Generator version: 2.0.2 +* +* Generated by Arctic Studio (http://arccore.com) +* on Fri Jun 17 15:35:49 CEST 2011 +*/ + + +#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" + + +/** Build version info API */ +#define PORT_VERSION_INFO_API STD_OFF +/** Enable Development Error Trace */ +#define PORT_DEV_ERROR_DETECT STD_OFF +/** Build change pin direction API */ +#define PORT_SET_PIN_DIRECTION_API STD_OFF +/** Allow Pin mode changes during runtime (not avail on this CPU) */ +#define PORT_SET_PIN_MODE_API STD_OFF + +/** Parameter to enable/disable configuration on a port */ +#define PORTA_CONFIGURABLE STD_OFF +#define PORTB_CONFIGURABLE STD_OFF +#define PORTE_CONFIGURABLE STD_OFF +#define PORTK_CONFIGURABLE STD_OFF +#define PORTH_CONFIGURABLE STD_ON +#define PORTJ_CONFIGURABLE STD_OFF +#define PORTM_CONFIGURABLE STD_OFF +#define PORTP_CONFIGURABLE STD_OFF +#define PORTS_CONFIGURABLE STD_OFF +#define PORTT_CONFIGURABLE STD_OFF + +#define PORT_A_BASE 0x0100 +#define PORT_B_BASE 0x0200 +#define PORT_E_BASE 0x0300 +#define PORT_K_BASE 0x0400 +#define PORT_H_BASE 0x0500 +#define PORT_J_BASE 0x0600 +#define PORT_M_BASE 0x0700 +#define PORT_P_BASE 0x0800 +#define PORT_S_BASE 0x0900 +#define PORT_T_BASE 0x0A00 +#define PORT_BITMASK 0x00FF +#define PORT_BASEMASK 0xFF00; + +/** HW specific symbolic names of pins */ +/** @req PORT013 */ +typedef enum +{ + PORT_PA0 = PORT_A_BASE, + PORT_PA1, + PORT_PA2, + PORT_PA3, + PORT_PA4, + PORT_PA5, + PORT_PA6, + PORT_PA7, + PORT_PB0 = PORT_B_BASE, + PORT_PB1, + PORT_PB2, + PORT_PB3, + PORT_PB4, + PORT_PB5, + PORT_PB6, + PORT_PB7, + PORT_PE0 = PORT_E_BASE, + PORT_PE1, + PORT_PE2, + PORT_PE3, + PORT_PE4, + PORT_PE5, + PORT_PE6, + PORT_PE7, + PORT_PH0 = PORT_H_BASE, + PORT_PH1, + PORT_PH2, + PORT_PH3, + PORT_PH4, + PORT_PH5, + PORT_PH6, + PORT_PH7, + PORT_PJ0 = PORT_J_BASE, + PORT_PJ1, + PORT_PJ2, + PORT_PJ3, + PORT_PJ4, + PORT_PJ5, + PORT_PJ6, + PORT_PJ7, + PORT_PK0 = PORT_K_BASE, + PORT_PK1, + PORT_PK2, + PORT_PK3, + PORT_PK4, + PORT_PK5, + PORT_PK6, + PORT_PK7, + PORT_PM0 = PORT_M_BASE, + PORT_PM1, + PORT_PM2, + PORT_PM3, + PORT_PM4, + PORT_PM5, + PORT_PM6, + PORT_PM7, + PORT_PP0 = PORT_P_BASE, + PORT_PP1, + PORT_PP2, + PORT_PP3, + PORT_PP4, + PORT_PP5, + PORT_PP6, + PORT_PP7, + PORT_PS0 = PORT_S_BASE, + PORT_PS1, + PORT_PS2, + PORT_PS3, + PORT_PS4, + PORT_PS5, + PORT_PS6, + PORT_PS7, + PORT_PT0 = PORT_T_BASE, + PORT_PT1, + PORT_PT2, + PORT_PT3, + PORT_PT4, + PORT_PT5, + PORT_PT6, + PORT_PT7, +} Port_PinType; + +/** Top level configuration container */ +/** @req PORT073 */ +typedef struct +{ + const uint8_t corePullUpRegister; // PUCR + const uint8_t coreReducedDriveRegister; // RDRIV + const uint8_t modeRoutingRegister; // MODRR + + /** + * Every port has: + * a direction (input or output) + * a default out value + * a mask that is 0 if the direction is allowed to change during runtime + * + * Some ports have: + * a reduced drive conf (power saving) + * a pull enable conf (enable pull-up/pull-down + * a pull direction conf (pull-up or pull-down) + * a wired mode (enable open drain outputs) + */ +#if ( PORTA_CONFIGURABLE == STD_ON ) + const uint8_t portADirection; + const uint8_t portAOutValue; + const uint8_t portAMask; +#endif + +#if ( PORTB_CONFIGURABLE == STD_ON ) + const uint8_t portBDirection; + const uint8_t portBOutValue; + const uint8_t portBMask; +#endif + +#if ( PORTE_CONFIGURABLE == STD_ON ) + const uint8_t portEDirection; + const uint8_t portEOutValue; + const uint8_t portEMask; +#endif + +#if ( PORTK_CONFIGURABLE == STD_ON ) + const uint8_t portKDirection; + const uint8_t portKOutValue; + const uint8_t portKMask; +#endif + +#if ( PORTH_CONFIGURABLE == STD_ON ) + const uint8_t portHDirection; + const uint8_t portHOutValue; + const uint8_t portHMask; + const uint8_t portHPullEnableRegister; + const uint8_t portHPullPolarityRegsiter; + const uint8_t portHReducedDriveRegister; +#endif + +#if ( PORTJ_CONFIGURABLE == STD_ON ) + const uint8_t portJDirection; + const uint8_t portJOutValue; + const uint8_t portJMask; + const uint8_t portJPullEnableRegister; + const uint8_t portJPullPolarityRegsiter; + const uint8_t portJReducedDriveRegister; +#endif + +#if ( PORTM_CONFIGURABLE == STD_ON ) + const uint8_t portMDirection; + const uint8_t portMOutValue; + const uint8_t portMMask; + const uint8_t portMPullEnableRegister; + const uint8_t portMPullPolarityRegsiter; + const uint8_t portMWiredModeRegsiter; + const uint8_t portMReducedDriveRegister; +#endif + +#if ( PORTP_CONFIGURABLE == STD_ON ) + const uint8_t portPDirection; + const uint8_t portPOutValue; + const uint8_t portPMask; + const uint8_t portPPullEnableRegister; + const uint8_t portPPullPolarityRegsiter; + const uint8_t portPReducedDriveRegister; +#endif + +#if ( PORTS_CONFIGURABLE == STD_ON ) + const uint8_t portSDirection; + const uint8_t portSOutValue; + const uint8_t portSMask; + const uint8_t portSPullEnableRegister; + const uint8_t portSPullPolarityRegsiter; + const uint8_t portSWiredModeRegsiter; + const uint8_t portSReducedDriveRegister; +#endif + +#if ( PORTT_CONFIGURABLE == STD_ON ) + const uint8_t portTDirection; + const uint8_t portTOutValue; + const uint8_t portTMask; + const uint8_t portTPullEnableRegister; + const uint8_t portTPullPolarityRegsiter; + const uint8_t portTReducedDriveRegister; +#endif +} Port_ConfigType; + +/** Instance of the top level configuration container */ +extern const Port_ConfigType PortConfigData; + +#define PORT_PIN_NAME_PH7 PORT_PH7 +#endif /*PORT_CFG_H_*/ diff --git a/boards/hcs12_elmicro_card12/examples/blinker/example_info.txt b/boards/hcs12_elmicro_card12/examples/blinker/example_info.txt new file mode 100644 index 00000000..22c6207c --- /dev/null +++ b/boards/hcs12_elmicro_card12/examples/blinker/example_info.txt @@ -0,0 +1,6 @@ +A simple application that flashes the LED on the board. Default +frequency is 1 Hz. The frequency can be changed by sending a +new period in a CAN message. The first 32 bit in a message with +CAN Id 100 is treated as the new period (in system ticks). A CAN +message with CAN Id 102 is transmitted every 100 ms to indicate +the current period. \ No newline at end of file diff --git a/boards/hcs12_elmicro_card12/examples/blinker/makefile b/boards/hcs12_elmicro_card12/examples/blinker/makefile new file mode 100644 index 00000000..ec637949 --- /dev/null +++ b/boards/hcs12_elmicro_card12/examples/blinker/makefile @@ -0,0 +1,17 @@ + + +EXAMPLENAME=blinker +ROOTDIR?=../../../.. +include $(ROOTDIR)/examples/build_example.mk + +ifneq (${MAKELEVEL},0) + +# object files +obj-y += Tasks.o + +endif + + + + +