mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-30 19:52:13 +01:00
[sam] ready for sam3u debug on sam3u-ek
This commit is contained in:
parent
bc253722a6
commit
d287bba7d1
@ -1,5 +1,5 @@
|
|||||||
# Makefile for compiling libboard
|
#VARIANTS = sam3s_ek sam3u_ek arduino_due
|
||||||
BOARD =
|
VARIANTS = sam3u_ek
|
||||||
|
|
||||||
SUBMAKE_OPTIONS=--no-builtin-rules --no-builtin-variables
|
SUBMAKE_OPTIONS=--no-builtin-rules --no-builtin-variables
|
||||||
|
|
||||||
@ -7,7 +7,7 @@ SUBMAKE_OPTIONS=--no-builtin-rules --no-builtin-variables
|
|||||||
# Rules
|
# Rules
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
|
|
||||||
all: sam3s_ek
|
all: $(VARIANTS)
|
||||||
|
|
||||||
.PHONY: sam3s_ek
|
.PHONY: sam3s_ek
|
||||||
sam3s_ek:
|
sam3s_ek:
|
||||||
@ -15,10 +15,30 @@ sam3s_ek:
|
|||||||
@$(MAKE) DEBUG=1 $(SUBMAKE_OPTIONS) -f libarduino_sam3s_ek.mk
|
@$(MAKE) DEBUG=1 $(SUBMAKE_OPTIONS) -f libarduino_sam3s_ek.mk
|
||||||
# @$(MAKE) $(SUBMAKE_OPTIONS) -f libarduino_sam3s_ek.mk
|
# @$(MAKE) $(SUBMAKE_OPTIONS) -f libarduino_sam3s_ek.mk
|
||||||
|
|
||||||
|
.PHONY: sam3u_ek
|
||||||
|
sam3u_ek:
|
||||||
|
@echo --- Making sam3u_ek
|
||||||
|
@$(MAKE) DEBUG=1 $(SUBMAKE_OPTIONS) -f libarduino_sam3u_ek.mk
|
||||||
|
# @$(MAKE) $(SUBMAKE_OPTIONS) -f libarduino_sam3u_ek.mk
|
||||||
|
|
||||||
|
.PHONY: arduino_due
|
||||||
|
arduino_due:
|
||||||
|
@echo --- Making arduino_due
|
||||||
|
@$(MAKE) DEBUG=1 $(SUBMAKE_OPTIONS) -f libarduino_arduino_due.mk
|
||||||
|
# @$(MAKE) $(SUBMAKE_OPTIONS) -f libarduino_arduino_due.mk
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
@echo --- Cleaning sam3s_ek
|
@echo --- Cleaning sam3s_ek
|
||||||
@$(MAKE) DEBUG=1 $(SUBMAKE_OPTIONS) -f libarduino_sam3s_ek.mk $@
|
@$(MAKE) DEBUG=1 $(SUBMAKE_OPTIONS) -f libarduino_sam3s_ek.mk $@
|
||||||
# @$(MAKE) $(SUBMAKE_OPTIONS) -f libarduino_sam3s_ek.mk $@
|
# @$(MAKE) $(SUBMAKE_OPTIONS) -f libarduino_sam3s_ek.mk $@
|
||||||
|
|
||||||
|
@echo --- Cleaning sam3u_ek
|
||||||
|
@$(MAKE) DEBUG=1 $(SUBMAKE_OPTIONS) -f libarduino_sam3u_ek.mk $@
|
||||||
|
# @$(MAKE) $(SUBMAKE_OPTIONS) -f libarduino_sam3u_ek.mk $@
|
||||||
|
|
||||||
|
@echo --- Cleaning arduino_due
|
||||||
|
@$(MAKE) DEBUG=1 $(SUBMAKE_OPTIONS) -f libarduino_arduino_due.mk $@
|
||||||
|
# @$(MAKE) $(SUBMAKE_OPTIONS) -f libarduino_arduino_due.mk $@
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
# Makefile for compiling libArduino
|
# Makefile for compiling libArduino
|
||||||
.SUFFIXES: .o .a .c .s
|
.SUFFIXES: .o .a .c .s
|
||||||
|
|
||||||
CHIP=__SAM3S4C__
|
#CHIP=__SAM3S4C__
|
||||||
VARIANT=sam3s_ek
|
CHIP=__SAM3U4E__
|
||||||
#VARIANT=sam3u_ek
|
#VARIANT=sam3s_ek
|
||||||
|
VARIANT=sam3u_ek
|
||||||
#VARIANT=arduino_due
|
#VARIANT=arduino_due
|
||||||
TOOLCHAIN=gcc
|
TOOLCHAIN=gcc
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ extern "C" {
|
|||||||
#define EFRC_OSC ( 4000000UL) /* Embedded fast RC oscillator freq */
|
#define EFRC_OSC ( 4000000UL) /* Embedded fast RC oscillator freq */
|
||||||
#define UTMIPLL (480000000UL) /* UTMI PLL frequency */
|
#define UTMIPLL (480000000UL) /* UTMI PLL frequency */
|
||||||
#define MAINCK_XTAL_HZ (12000000UL) /* External crystal frequency */
|
#define MAINCK_XTAL_HZ (12000000UL) /* External crystal frequency */
|
||||||
#define MCK_HZ (48000000UL) /* Processor frequency */
|
#define MCK_HZ (96000000UL) /* Processor frequency */
|
||||||
|
|
||||||
/* FIXME: should be generated by sock */
|
/* FIXME: should be generated by sock */
|
||||||
uint32_t SystemCoreClock = EFRC_OSC;
|
uint32_t SystemCoreClock = EFRC_OSC;
|
||||||
@ -134,7 +134,7 @@ extern void SystemCoreClockUpdate( void )
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (PMC->PMC_MCKR & PMC_MCKR_CSS_Msk == PMC_MCKR_CSS_PLLA_CLK) {
|
if ((PMC->PMC_MCKR & PMC_MCKR_CSS_Msk) == PMC_MCKR_CSS_PLLA_CLK) {
|
||||||
SystemCoreClock *= ((((PMC->CKGR_PLLAR) >> CKGR_PLLAR_MULA_Pos) & 0x7FF) + 1);
|
SystemCoreClock *= ((((PMC->CKGR_PLLAR) >> CKGR_PLLAR_MULA_Pos) & 0x7FF) + 1);
|
||||||
SystemCoreClock /= ((((PMC->CKGR_PLLAR) >> CKGR_PLLAR_DIVA_Pos) & 0x0FF));
|
SystemCoreClock /= ((((PMC->CKGR_PLLAR) >> CKGR_PLLAR_DIVA_Pos) & 0x0FF));
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
extern void PMC_EnablePeripheral( uint32_t dwId ) ;
|
extern void PMC_EnablePeripheral( uint32_t dwId ) ;
|
||||||
extern void PMC_DisablePeripheral( uint32_t dwId ) ;
|
extern void PMC_DisablePeripheral( uint32_t dwId ) ;
|
||||||
|
|
||||||
extern uint32_t PMC_IsPeriphEnabled( uint32_t dwId ) ;
|
extern uint32_t PMC_IsPeripheralEnabled( uint32_t dwId ) ;
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
@ -70,6 +70,7 @@ extern void SPI_Write( Spi* spi, uint32_t dwNpcs, uint16_t wData ) ;
|
|||||||
extern uint32_t SPI_GetStatus( Spi* spi ) ;
|
extern uint32_t SPI_GetStatus( Spi* spi ) ;
|
||||||
extern uint32_t SPI_IsFinished( Spi* pSpi ) ;
|
extern uint32_t SPI_IsFinished( Spi* pSpi ) ;
|
||||||
|
|
||||||
|
#if (defined _SAM3S_) || (defined _SAM3S8_) || (defined _SAM3N_)
|
||||||
extern void SPI_PdcEnableTx( Spi* spi ) ;
|
extern void SPI_PdcEnableTx( Spi* spi ) ;
|
||||||
extern void SPI_PdcDisableTx( Spi* spi ) ;
|
extern void SPI_PdcDisableTx( Spi* spi ) ;
|
||||||
extern void SPI_PdcEnableRx( Spi* spi ) ;
|
extern void SPI_PdcEnableRx( Spi* spi ) ;
|
||||||
@ -81,6 +82,7 @@ extern void SPI_PdcSetRx( Spi* spi, void* pvRxBuf, uint32_t dwRxCount, void* pvR
|
|||||||
extern uint32_t SPI_WriteBuffer( Spi* spi, void* pvBuffer, uint32_t dwLength ) ;
|
extern uint32_t SPI_WriteBuffer( Spi* spi, void* pvBuffer, uint32_t dwLength ) ;
|
||||||
|
|
||||||
extern uint32_t SPI_ReadBuffer( Spi* spi, void* pvBuffer, uint32_t dwLength ) ;
|
extern uint32_t SPI_ReadBuffer( Spi* spi, void* pvBuffer, uint32_t dwLength ) ;
|
||||||
|
#endif /* (defined _SAM3S_) || (defined _SAM3S8_) || (defined _SAM3N_) */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
@ -183,6 +183,7 @@ extern uint32_t SPI_IsFinished( Spi* spi )
|
|||||||
return ((spi->SPI_SR & SPI_SR_TXEMPTY) != 0) ;
|
return ((spi->SPI_SR & SPI_SR_TXEMPTY) != 0) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if (defined _SAM3S_) || (defined _SAM3S8_) || (defined _SAM3N_)
|
||||||
/**
|
/**
|
||||||
* \brief Enable Spi PDC transmit
|
* \brief Enable Spi PDC transmit
|
||||||
* \param spi Pointer to an Spi instance.
|
* \param spi Pointer to an Spi instance.
|
||||||
@ -322,4 +323,5 @@ extern uint32_t SPI_ReadBuffer( Spi* spi, void *pvBuffer, uint32_t dwLength )
|
|||||||
return 0 ;
|
return 0 ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* (defined _SAM3S_) || (defined _SAM3S8_) || (defined _SAM3N_) */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user