/* * Copyright (c) 2017-2020 Arm Limited. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * \file device_definition.c * \brief This file defines exports the structures based on the peripheral * definitions from device_cfg.h. * This file is meant to be used as a helper for baremetal * applications and/or as an example of how to configure the generic * driver structures. */ #include "device_cfg.h" #include "device_definition.h" #include "platform_description.h" /* ======= Peripheral configuration structure definitions ======= */ /* CMSDK GPIO driver structures */ #ifdef GPIO0_CMSDK_S static const struct gpio_cmsdk_dev_cfg_t GPIO0_CMSDK_DEV_CFG_S = { .base = MUSCA_S1_GPIO_S_BASE}; struct gpio_cmsdk_dev_t GPIO0_CMSDK_DEV_S = {&(GPIO0_CMSDK_DEV_CFG_S)}; #endif /* CMSDK Timers driver structures */ #ifdef CMSDK_TIMER0_S static const struct timer_cmsdk_dev_cfg_t CMSDK_TIMER0_DEV_CFG_S = { .base = TMR01_BASE}; static struct timer_cmsdk_dev_data_t CMSDK_TIMER0_DEV_DATA_S = { .is_initialized = 0}; struct timer_cmsdk_dev_t CMSDK_TIMER0_DEV_S = {&(CMSDK_TIMER0_DEV_CFG_S), &(CMSDK_TIMER0_DEV_DATA_S)}; #endif #ifdef CMSDK_TIMER1_S static const struct timer_cmsdk_dev_cfg_t CMSDK_TIMER1_DEV_CFG_S = { .base = TMR}; static struct timer_cmsdk_dev_data_t CMSDK_TIMER1_DEV_DATA_S = { .is_initialized = 0}; struct timer_cmsdk_dev_t CMSDK_TIMER1_DEV_S = {&(CMSDK_TIMER1_DEV_CFG_S), &(CMSDK_TIMER1_DEV_DATA_S)}; #endif #ifdef CMSDK_TIMER2_NS static const struct timer_cmsdk_dev_cfg_t CMSDK_TIMER2_DEV_CFG_NS = { .base = TMR23_BASE+NS_OFFSET }; static struct timer_cmsdk_dev_data_t CMSDK_TIMER2_DEV_DATA_NS = { .is_initialized = 0 }; struct timer_cmsdk_dev_t CMSDK_TIMER2_DEV_NS = { &(CMSDK_TIMER2_DEV_CFG_NS), &(CMSDK_TIMER2_DEV_DATA_NS) }; #endif