ChibiOS/os/hal/templates/hal_efl_lld.c

118 lines
3.4 KiB
C

/*
ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
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 hal_efl_lld.c
* @brief PLATFORM Embedded Flash subsystem low level driver source.
*
* @addtogroup HAL_EFL
* @{
*/
#include "hal.h"
#if (HAL_USE_EFL == TRUE) || defined(__DOXYGEN__)
/*===========================================================================*/
/* Driver local definitions. */
/*===========================================================================*/
/*===========================================================================*/
/* Driver exported variables. */
/*===========================================================================*/
/**
* @brief EFL1 driver identifier.
*/
#if (PLATFORM_EFL_USE_EFL1 == TRUE) || defined(__DOXYGEN__)
EFlashDriver EFLD1;
#endif
/*===========================================================================*/
/* Driver local variables and types. */
/*===========================================================================*/
/*===========================================================================*/
/* Driver local functions. */
/*===========================================================================*/
/*===========================================================================*/
/* Driver interrupt handlers. */
/*===========================================================================*/
/*===========================================================================*/
/* Driver exported functions. */
/*===========================================================================*/
/**
* @brief Low level Embedded Flash driver initialization.
*
* @notapi
*/
void efl_lld_init(void) {
#if PLATFORM_EFL_USE_EFL1 == TRUE
/* Driver initialization.*/
eflObjectInit(&EFLD1);
#endif
}
/**
* @brief Configures and activates the Embedded Flash peripheral.
*
* @param[in] eflp pointer to a @p EFlashDriver structure
*
* @notapi
*/
void efl_lld_start(EFlashDriver *eflp) {
if (eflp->state == FLASH_STOP) {
/* Enables the peripheral.*/
#if PLATFORM_EFL_USE_EFL1 == TRUE
if (&EFLD1 == eflp) {
}
#endif
}
/* Configures the peripheral.*/
}
/**
* @brief Deactivates the Embedded Flash peripheral.
*
* @param[in] eflp pointer to a @p EFlashDriver structure
*
* @notapi
*/
void efl_lld_stop(EFlashDriver *eflp) {
if (eflp->state == FLASH_READY) {
/* Resets the peripheral.*/
/* Disables the peripheral.*/
#if PLATFORM_EFL_USE_EFL1 == TRUE
if (&EFLD1 == eflp) {
}
#endif
}
}
#endif /* HAL_USE_EFL == TRUE */
/** @} */