git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4862 35acf78f-673a-0410-8e92-d51de3d6d3f4

This commit is contained in:
gdisirio 2012-12-02 08:30:37 +00:00
parent 00141c6cb6
commit 6f70b6257b
5 changed files with 16427 additions and 0 deletions

View File

@ -0,0 +1,65 @@
/*
ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
2011,2012 Giovanni Di Sirio.
This file is part of ChibiOS/RT.
ChibiOS/RT is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
ChibiOS/RT is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @file templates/hal_lld.c
* @brief HAL Driver subsystem low level driver source template.
*
* @addtogroup HAL
* @{
*/
#include "ch.h"
#include "hal.h"
/*===========================================================================*/
/* Driver local definitions. */
/*===========================================================================*/
/*===========================================================================*/
/* Driver exported variables. */
/*===========================================================================*/
/*===========================================================================*/
/* Driver local variables. */
/*===========================================================================*/
/*===========================================================================*/
/* Driver local functions. */
/*===========================================================================*/
/*===========================================================================*/
/* Driver interrupt handlers. */
/*===========================================================================*/
/*===========================================================================*/
/* Driver exported functions. */
/*===========================================================================*/
/**
* @brief Low level HAL driver initialization.
*
* @notapi
*/
void hal_lld_init(void) {
}
/** @} */

View File

@ -0,0 +1,71 @@
/*
ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
2011,2012 Giovanni Di Sirio.
This file is part of ChibiOS/RT.
ChibiOS/RT is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
ChibiOS/RT is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @file templates/hal_lld.h
* @brief HAL subsystem low level driver header template.
*
* @addtogroup HAL
* @{
*/
#ifndef _HAL_LLD_H_
#define _HAL_LLD_H_
/*===========================================================================*/
/* Driver constants. */
/*===========================================================================*/
/**
* @brief Platform name.
*/
#define PLATFORM_NAME ""
/*===========================================================================*/
/* Driver pre-compile time settings. */
/*===========================================================================*/
/*===========================================================================*/
/* Derived constants and error checks. */
/*===========================================================================*/
/*===========================================================================*/
/* Driver data structures and types. */
/*===========================================================================*/
/*===========================================================================*/
/* Driver macros. */
/*===========================================================================*/
/*===========================================================================*/
/* External declarations. */
/*===========================================================================*/
#ifdef __cplusplus
extern "C" {
#endif
void hal_lld_init(void);
#ifdef __cplusplus
}
#endif
#endif /* _HAL_LLD_H_ */
/** @} */

View File

@ -0,0 +1,6 @@
# List of all the STM32F3xx platform files.
PLATFORMSRC = ${CHIBIOS}/os/hal/platforms/SAM4L/hal_lld.c
# Required include directories
PLATFORMINC = ${CHIBIOS}/os/hal/platforms/SAM4L

16184
os/hal/platforms/SAM4L/sam4l.h Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,101 @@
/**
* \file
*
* \brief ASF Patch Header file definitions for SAM4L.
*
* Copyright (c) 2012 Atmel Corporation. All rights reserved.
*
* \asf_license_start
*
* \page License
*
* 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. The name of Atmel may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* 4. This software may only be redistributed and used in connection with an
* Atmel microcontroller product.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL 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.
*
* \asf_license_stop
*
*/
#ifndef SAM4L_PATCH_ASF_H_INCLUDED
#define SAM4L_PATCH_ASF_H_INCLUDED
// These defines are used for sam/drivers/flashcalw implementation.
#define FLASHCALW_FCMD_CMD_HSEN (0x10u << 0)
#define FLASHCALW_FCMD_CMD_HSDIS (0x11u << 0)
// These defines are used to keep compatibility with existing
// sam/drivers/usart implementation from SAM3/4 products with SAM4L product.
#define US_MR_USART_MODE_HW_HANDSHAKING US_MR_USART_MODE_HARDWARE
#define US_MR_USART_MODE_IS07816_T_0 US_MR_USART_MODE_ISO7816_T0
#define US_MR_USART_MODE_IS07816_T_1 US_MR_USART_MODE_ISO7816_T1
#define US_MR_NBSTOP_2_BIT US_MR_NBSTOP_2
#define US_MR_NBSTOP_1_BIT US_MR_NBSTOP_1
#define US_MR_CHRL_8_BIT US_MR_CHRL_8
#define US_MR_PAR_NO US_MR_PAR_NONE
#define US_MR_PAR_MULTIDROP US_MR_PAR_MULTI
#define US_IF US_IFR
#define US_WPSR_WPVS US_WPSR_WPV_1
#if (!defined SCIF_RCOSC_FREQUENCY)
# define SCIF_RCOSC_FREQUENCY 115200
#endif
// These defines for homogeneity with other SAM header files.
#define CHIP_FREQ_FWS_0 (18000000UL) /**< \brief Maximum operating frequency when FWS is 0 */
#define CHIP_FREQ_FWS_1 (36000000UL) /**< \brief Maximum operating frequency when FWS is 1 */
// WARNING NOTE: these are preliminary values.
#define CHIP_FREQ_FLASH_HSEN_FWS_0 (18000000UL) /**< \brief Maximum operating frequency when FWS is 0 and the FLASH HS mode is enabled */
#define CHIP_FREQ_FLASH_HSEN_FWS_1 (36000000UL) /**< \brief Maximum operating frequency when FWS is 1 and the FLASH HS mode is enabled */
// Size of HRAMC1 with 32-bit access
#undef HRAMC1_SIZE
#define HRAMC1_SIZE (0x800UL)
// USBC related offsets
#define USBC_UHINT_P0INT_Pos 8
#define USBC_UHINTE_P0INTE_Pos 8
#define USBC_UPCFG0_PBK_Pos 2
#define USBC_UPCFG0_PBK_Msk (0x1u << USBC_UPCFG0_PBK_Pos)
// These defines are used to keep compatibility with existing
// sam/drivers/tc implementation from SAM3/4 products with SAM4L product.
#define TC_SMMR TC_SMC
#define TC_CMR_LDRA_RISING TC_CMR_LDRA_POS_EDGE_TIOA
#define TC_CMR_LDRB_FALLING TC_CMR_LDRB_NEG_EDGE_TIOA
#define TC_CMR_ETRGEDG_FALLING TC_CMR_ETRGEDG_NEG_EDGE
// These defines are used to keep compatibility with existing
// sam/drivers/spi implementation from SAM3/4 products with SAM4L product.
#define SPI_CSR_BITS_8_BIT SPI_CSR_BITS_8_BPT
#define SPI_WPSR_WPVS_Pos SPI_WPSR_SPIWPVS_Pos
#define SPI_WPSR_WPVS_Msk SPI_WPSR_SPIWPVS_Msk
#define SPI_WPSR_WPVSRC_Pos SPI_WPSR_SPIWPVSRC_Pos
#define SPI_WPSR_WPVSRC_Msk SPI_WPSR_SPIWPVSRC_Msk
#endif // SAM4L_PATCH_ASF_H_INCLUDED