-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,12 +64,40 @@ | |
/*==================[inclusions]=============================================*/ | ||
|
||
/*==================[macros]=================================================*/ | ||
#define lpc4337 1 | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
jcecconi
Author
Contributor
|
||
#define mk60fx512vlq15 2 | ||
|
||
/*==================[typedef]================================================*/ | ||
|
||
/*==================[external data declaration]==============================*/ | ||
|
||
/*==================[external functions declaration]=========================*/ | ||
#if (CPU == mk60fx512vlq15) | ||
/* Reset_Handler is defined in startup_MK60F15.S_CPP */ | ||
void Reset_Handler( void ); | ||
|
||
extern uint32_t __StackTop; | ||
#elif (CPU == lpc4337) | ||
/** \brief Reset ISR | ||
** | ||
** ResetISR is defined in cr_startup_lpc43xx.c | ||
** | ||
** \remark the definition is in | ||
** externals/drivers/cortexM4/lpc43xx/src/cr_startup_lpc43xx.c | ||
**/ | ||
extern void ResetISR(void); | ||
|
||
/** \brief Stack Top address | ||
** | ||
** External declaration for the pointer to the stack top from the Linker Script | ||
** | ||
** \remark only a declaration is needed, there is no definition, the address | ||
** is set in the linker script: | ||
** externals/base/cortexM4/lpc43xx/linker/ciaa_lpc4337.ld. | ||
**/ | ||
extern void _vStackTop(void); | ||
#else | ||
#endif | ||
|
||
/** @} doxygen end group definition */ | ||
/** @} doxygen end group definition */ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,4 +46,5 @@ SRC_FILES += $(wildcard $($(PROJECT_NAME)_SRC_PATH)$(DS)*.c) | |
# configuration for Drivers | ||
OIL_FILES += $(PROJECT_PATH)$(DS)etc$(DS)$(PROJECT_NAME).oil | ||
# Modules needed for this example | ||
MODS ?= modules$(DS)hisio | ||
MODS += modules$(DS)hisio | ||
MODS += externals$(DS)drivers | ||
This comment has been minimized.
Sorry, something went wrong.
mcerdeiro
Contributor
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,6 +64,14 @@ | |
#include "IODriver.h" /* <= IO Driver header files */ | ||
#include "ciaaPOSIX_stdint.h" /* <= DataTypes */ | ||
|
||
#ifndef CPU | ||
#error CPU shall be defined | ||
#endif | ||
#if (lpc4337 == CPU) | ||
#include "chip.h" | ||
This comment has been minimized.
Sorry, something went wrong.
mcerdeiro
Contributor
|
||
#elif (mk60fx512vlq15 == CPU) | ||
#else | ||
#endif | ||
/*==================[macros and definitions]=================================*/ | ||
|
||
/*==================[internal data declaration]==============================*/ | ||
|
@@ -93,7 +101,7 @@ int main(void) | |
|
||
/* Initialize the Dio Driver. The name MyDioConfig is the | ||
* one given in the DIL Configuration File */ | ||
Dio_InitSync(&MyDioConfig); | ||
Dio_InitSync(0); | ||
|
||
/* to perform a while 1 is NEVER recomended, but in this case to perform a | ||
* really simple example we used anyway. :( */ | ||
|
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
/* Copyright 2015, Mariano Cerdeiro | ||
* Copyright 2016, Juan Cecconi | ||
* All rights reserved. | ||
* | ||
* This file is part of CIAA Firmware. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions are met: | ||
* | ||
* 1. Redistributions of source code must retain the above copyright notice, | ||
* this list of conditions and the following disclaimer. | ||
* | ||
* 2. Redistributions in binary form must reproduce the above copyright notice, | ||
* this list of conditions and the following disclaimer in the documentation | ||
* and/or other materials provided with the distribution. | ||
* | ||
* 3. Neither the name of the copyright holder nor the names of its | ||
* contributors may be used to endorse or promote products derived from this | ||
* software without specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE | ||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
* POSSIBILITY OF SUCH DAMAGE. | ||
* | ||
*/ | ||
|
||
/** \brief IO DIO Driver Arch source file | ||
** | ||
** This file contains is the Dio driver Arch | ||
** | ||
**/ | ||
|
||
/** \addtogroup CIAA_Firmware CIAA Firmware | ||
** @{ */ | ||
/** \addtogroup HISIO HisIO Module | ||
** @{ */ | ||
|
||
/* | ||
* Initials Name | ||
* --------------------------- | ||
* MaCe Mariano Cerdeiro | ||
* JuCe Juan Cecconi | ||
*/ | ||
|
||
/* | ||
* modification history (new versions first) | ||
* ----------------------------------------------------------- | ||
* 20160111 v0.0.1 JuCe initial version | ||
*/ | ||
|
||
/*==================[inclusions]=============================================*/ | ||
#include "IODriver_Base.h" | ||
This comment has been minimized.
Sorry, something went wrong. |
||
/*==================[macros and definitions]=================================*/ | ||
|
||
/*==================[internal data declaration]==============================*/ | ||
|
||
/*==================[internal functions declaration]=========================*/ | ||
|
||
/*==================[internal data definition]===============================*/ | ||
|
||
/*==================[external data definition]===============================*/ | ||
|
||
/*==================[internal functions definition]==========================*/ | ||
|
||
/*==================[external functions definition]==========================*/ | ||
extern IO_ErrorType Dio_InitSync_Arch(void * address) | ||
{ | ||
uint16_t i; | ||
|
||
for(i=0 ; i < DIO_PINS_COUNT ; i++) | ||
{ | ||
if(Dio_Config.Pins[i].Flags & DIO_CONFIG_PIN_DIRECTION_INPUT) | ||
{ | ||
Chip_SCU_PinMux(Dio_Config.Pins[i].Port, Dio_Config.Pins[i].Pin, SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS, FUNC0); | ||
//Chip_GPIO_SetDir( LPC_GPIO_PORT, gpioPort, ( 1 << gpioPin ), INPUT ); | ||
} | ||
else if(Dio_Config.Pins[i].Flags & DIO_CONFIG_PIN_DIRECTION_OUTPUT_INIT_LOW) | ||
{ | ||
Chip_SCU_PinMux(Dio_Config.Pins[i].Port, Dio_Config.Pins[i].Pin, SCU_MODE_INACT | SCU_MODE_ZIF_DIS, FUNC0); | ||
//Chip_GPIO_SetDir( LPC_GPIO_PORT, gpioPort, ( 1 << gpioPin ), OUTPUT ); | ||
//Chip_GPIO_ClearValue(LPC_GPIO_PORT, gpioPort, ( 1 << gpioPin )); | ||
} | ||
|
||
} | ||
return IO_E_OK; | ||
} | ||
|
||
extern IO_ValueType Dio_GetSync_Arch(IO_ChannelType channel) | ||
{ | ||
return IO_HIGH; | ||
} | ||
|
||
extern void Dio_SetSync_Arch(IO_ChannelType channel, IO_ValueType value) | ||
{ | ||
|
||
} | ||
|
||
extern IO_ValueType Dio_GetPortSync_Arch(IO_ChannelType channel) | ||
{ | ||
return 0xFF; | ||
} | ||
|
||
extern void Dio_SetPortSync_Arch(IO_ChannelType channel, IO_ValueType value) | ||
{ | ||
|
||
} | ||
|
||
extern void Dio_SetPortMaskedSync_Arch(IO_ChannelType channel, IO_ValueType value, IO_ValueType mask) | ||
{ | ||
|
||
} | ||
|
||
/** @} doxygen end group definition */ | ||
/** @} doxygen end group definition */ | ||
/*==================[end of file]============================================*/ | ||
|
esto supongo queda claro que no me gusta no? :)