|
@@ -1,62 +1,58 @@
|
|
|
-/* This header file is part of the ATMEL AVR-UC3-SoftwareFramework-1.7.0 Release */
|
|
|
|
|
-
|
|
|
|
|
-/*This file is prepared for Doxygen automatic documentation generation.*/
|
|
|
|
|
-/*! \file *********************************************************************
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * \file
|
|
|
*
|
|
*
|
|
|
* \brief FLASHC driver for AVR32 UC3.
|
|
* \brief FLASHC driver for AVR32 UC3.
|
|
|
*
|
|
*
|
|
|
- * AVR32 Flash Controller driver module.
|
|
|
|
|
- *
|
|
|
|
|
- * - Compiler: IAR EWAVR32 and GNU GCC for AVR32
|
|
|
|
|
- * - Supported devices: All AVR32 devices with a FLASHC module can be used.
|
|
|
|
|
- * - AppNote:
|
|
|
|
|
|
|
+ * Copyright (c) 2009-2018 Microchip Technology Inc. and its subsidiaries.
|
|
|
*
|
|
*
|
|
|
- * \author Atmel Corporation: http://www.atmel.com \n
|
|
|
|
|
- * Support and FAQ: http://support.atmel.no/
|
|
|
|
|
- *
|
|
|
|
|
- ******************************************************************************/
|
|
|
|
|
-
|
|
|
|
|
-/* Copyright (c) 2009 Atmel Corporation. All rights reserved.
|
|
|
|
|
|
|
+ * \asf_license_start
|
|
|
*
|
|
*
|
|
|
- * Redistribution and use in source and binary forms, with or without
|
|
|
|
|
- * modification, are permitted provided that the following conditions are met:
|
|
|
|
|
|
|
+ * \page License
|
|
|
*
|
|
*
|
|
|
- * 1. Redistributions of source code must retain the above copyright notice, this
|
|
|
|
|
- * list of conditions and the following disclaimer.
|
|
|
|
|
|
|
+ * Subject to your compliance with these terms, you may use Microchip
|
|
|
|
|
+ * software and any derivatives exclusively with Microchip products.
|
|
|
|
|
+ * It is your responsibility to comply with third party license terms applicable
|
|
|
|
|
+ * to your use of third party software (including open source software) that
|
|
|
|
|
+ * may accompany Microchip software.
|
|
|
*
|
|
*
|
|
|
- * 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.
|
|
|
|
|
|
|
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
|
|
|
|
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
|
|
|
|
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
|
|
|
|
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
|
|
|
|
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
|
|
|
|
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
|
|
|
|
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
|
|
|
|
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
|
|
|
|
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
|
|
|
|
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
|
|
|
|
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
|
|
*
|
|
*
|
|
|
- * 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
|
|
|
|
|
- * AVR 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
|
|
|
*
|
|
*
|
|
|
*/
|
|
*/
|
|
|
|
|
+/*
|
|
|
|
|
+ * Support and FAQ: visit <a href="https://www.microchip.com/support/">Microchip Support</a>
|
|
|
|
|
+ */
|
|
|
|
|
+
|
|
|
|
|
|
|
|
#ifndef _FLASHC_H_
|
|
#ifndef _FLASHC_H_
|
|
|
#define _FLASHC_H_
|
|
#define _FLASHC_H_
|
|
|
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * \defgroup group_avr32_drivers_flashc MEMORY - FLASHC - Flash Controller
|
|
|
|
|
+ *
|
|
|
|
|
+ * FLASHC interfaces a flash block with the 32-bit internal HSB bus.
|
|
|
|
|
+ *
|
|
|
|
|
+ * \{
|
|
|
|
|
+ */
|
|
|
|
|
+
|
|
|
#include <avr32/io.h>
|
|
#include <avr32/io.h>
|
|
|
#include <stddef.h>
|
|
#include <stddef.h>
|
|
|
#include "compiler.h"
|
|
#include "compiler.h"
|
|
|
|
|
|
|
|
//! Number of flash regions defined by the FLASHC.
|
|
//! Number of flash regions defined by the FLASHC.
|
|
|
#define AVR32_FLASHC_REGIONS (AVR32_FLASHC_FLASH_SIZE /\
|
|
#define AVR32_FLASHC_REGIONS (AVR32_FLASHC_FLASH_SIZE /\
|
|
|
- (AVR32_FLASHC_PAGES_PR_REGION * AVR32_FLASHC_PAGE_SIZE))
|
|
|
|
|
|
|
+ (AVR32_FLASHC_PAGES_PR_REGION * AVR32_FLASHC_PAGE_SIZE))
|
|
|
|
|
|
|
|
|
|
|
|
|
/*! \name Flash Properties
|
|
/*! \name Flash Properties
|
|
@@ -120,44 +116,56 @@ extern unsigned int flashc_get_wait_state(void);
|
|
|
*/
|
|
*/
|
|
|
extern void flashc_set_wait_state(unsigned int wait_state);
|
|
extern void flashc_set_wait_state(unsigned int wait_state);
|
|
|
|
|
|
|
|
|
|
+/*! \brief Depending on the CPU frequency, set the wait states of flash read
|
|
|
|
|
+ * accesses.
|
|
|
|
|
+ *
|
|
|
|
|
+ * \param cpu_f_hz The CPU frequency
|
|
|
|
|
+ */
|
|
|
|
|
+extern void flashc_set_bus_freq(unsigned int cpu_f_hz);
|
|
|
|
|
+/*! \brief Alias on the flashc_set_bus_freq() function.
|
|
|
|
|
+ *
|
|
|
|
|
+ * \param cpu_f_hz The CPU frequency
|
|
|
|
|
+ */
|
|
|
|
|
+#define flash_set_bus_freq(cpu_f_hz) flashc_set_bus_freq(cpu_f_hz)
|
|
|
|
|
+
|
|
|
/*! \brief Tells whether the Flash Ready interrupt is enabled.
|
|
/*! \brief Tells whether the Flash Ready interrupt is enabled.
|
|
|
*
|
|
*
|
|
|
* \return Whether the Flash Ready interrupt is enabled.
|
|
* \return Whether the Flash Ready interrupt is enabled.
|
|
|
*/
|
|
*/
|
|
|
-extern Bool flashc_is_ready_int_enabled(void);
|
|
|
|
|
|
|
+extern bool flashc_is_ready_int_enabled(void);
|
|
|
|
|
|
|
|
/*! \brief Enables or disables the Flash Ready interrupt.
|
|
/*! \brief Enables or disables the Flash Ready interrupt.
|
|
|
*
|
|
*
|
|
|
- * \param enable Whether to enable the Flash Ready interrupt: \c TRUE or
|
|
|
|
|
- * \c FALSE.
|
|
|
|
|
|
|
+ * \param enable Whether to enable the Flash Ready interrupt: \c true or
|
|
|
|
|
+ * \c false.
|
|
|
*/
|
|
*/
|
|
|
-extern void flashc_enable_ready_int(Bool enable);
|
|
|
|
|
|
|
+extern void flashc_enable_ready_int(bool enable);
|
|
|
|
|
|
|
|
/*! \brief Tells whether the Lock Error interrupt is enabled.
|
|
/*! \brief Tells whether the Lock Error interrupt is enabled.
|
|
|
*
|
|
*
|
|
|
* \return Whether the Lock Error interrupt is enabled.
|
|
* \return Whether the Lock Error interrupt is enabled.
|
|
|
*/
|
|
*/
|
|
|
-extern Bool flashc_is_lock_error_int_enabled(void);
|
|
|
|
|
|
|
+extern bool flashc_is_lock_error_int_enabled(void);
|
|
|
|
|
|
|
|
/*! \brief Enables or disables the Lock Error interrupt.
|
|
/*! \brief Enables or disables the Lock Error interrupt.
|
|
|
*
|
|
*
|
|
|
- * \param enable Whether to enable the Lock Error interrupt: \c TRUE or
|
|
|
|
|
- * \c FALSE.
|
|
|
|
|
|
|
+ * \param enable Whether to enable the Lock Error interrupt: \c true or
|
|
|
|
|
+ * \c false.
|
|
|
*/
|
|
*/
|
|
|
-extern void flashc_enable_lock_error_int(Bool enable);
|
|
|
|
|
|
|
+extern void flashc_enable_lock_error_int(bool enable);
|
|
|
|
|
|
|
|
/*! \brief Tells whether the Programming Error interrupt is enabled.
|
|
/*! \brief Tells whether the Programming Error interrupt is enabled.
|
|
|
*
|
|
*
|
|
|
* \return Whether the Programming Error interrupt is enabled.
|
|
* \return Whether the Programming Error interrupt is enabled.
|
|
|
*/
|
|
*/
|
|
|
-extern Bool flashc_is_prog_error_int_enabled(void);
|
|
|
|
|
|
|
+extern bool flashc_is_prog_error_int_enabled(void);
|
|
|
|
|
|
|
|
/*! \brief Enables or disables the Programming Error interrupt.
|
|
/*! \brief Enables or disables the Programming Error interrupt.
|
|
|
*
|
|
*
|
|
|
- * \param enable Whether to enable the Programming Error interrupt: \c TRUE or
|
|
|
|
|
- * \c FALSE.
|
|
|
|
|
|
|
+ * \param enable Whether to enable the Programming Error interrupt: \c true or
|
|
|
|
|
+ * \c false.
|
|
|
*/
|
|
*/
|
|
|
-extern void flashc_enable_prog_error_int(Bool enable);
|
|
|
|
|
|
|
+extern void flashc_enable_prog_error_int(bool enable);
|
|
|
|
|
|
|
|
//! @}
|
|
//! @}
|
|
|
|
|
|
|
@@ -170,7 +178,7 @@ extern void flashc_enable_prog_error_int(Bool enable);
|
|
|
*
|
|
*
|
|
|
* \return Whether the FLASHC is ready to run a new command.
|
|
* \return Whether the FLASHC is ready to run a new command.
|
|
|
*/
|
|
*/
|
|
|
-extern Bool flashc_is_ready(void);
|
|
|
|
|
|
|
+extern bool flashc_is_ready(void);
|
|
|
|
|
|
|
|
/*! \brief Waits actively until the FLASHC is ready to run a new command.
|
|
/*! \brief Waits actively until the FLASHC is ready to run a new command.
|
|
|
*
|
|
*
|
|
@@ -190,7 +198,7 @@ extern void (*volatile flashc_wait_until_ready)(void);
|
|
|
* \return Whether a Lock Error has occurred during the last function called
|
|
* \return Whether a Lock Error has occurred during the last function called
|
|
|
* that issued one or more FLASHC commands.
|
|
* that issued one or more FLASHC commands.
|
|
|
*/
|
|
*/
|
|
|
-extern Bool flashc_is_lock_error(void);
|
|
|
|
|
|
|
+extern bool flashc_is_lock_error(void);
|
|
|
|
|
|
|
|
/*! \brief Tells whether a Programming Error has occurred during the last
|
|
/*! \brief Tells whether a Programming Error has occurred during the last
|
|
|
* function called that issued one or more FLASHC commands.
|
|
* function called that issued one or more FLASHC commands.
|
|
@@ -198,7 +206,7 @@ extern Bool flashc_is_lock_error(void);
|
|
|
* \return Whether a Programming Error has occurred during the last function
|
|
* \return Whether a Programming Error has occurred during the last function
|
|
|
* called that issued one or more FLASHC commands.
|
|
* called that issued one or more FLASHC commands.
|
|
|
*/
|
|
*/
|
|
|
-extern Bool flashc_is_programming_error(void);
|
|
|
|
|
|
|
+extern bool flashc_is_programming_error(void);
|
|
|
|
|
|
|
|
//! @}
|
|
//! @}
|
|
|
|
|
|
|
@@ -283,7 +291,7 @@ extern void flashc_erase_all(void);
|
|
|
*
|
|
*
|
|
|
* \return Whether the Security bit is active.
|
|
* \return Whether the Security bit is active.
|
|
|
*/
|
|
*/
|
|
|
-extern Bool flashc_is_security_bit_active(void);
|
|
|
|
|
|
|
+extern bool flashc_is_security_bit_active(void);
|
|
|
|
|
|
|
|
/*! \brief Activates the Security bit.
|
|
/*! \brief Activates the Security bit.
|
|
|
*
|
|
*
|
|
@@ -318,18 +326,18 @@ extern unsigned int flashc_set_bootloader_protected_size(unsigned int bootprot_s
|
|
|
*
|
|
*
|
|
|
* \return Whether external privileged fetch is locked.
|
|
* \return Whether external privileged fetch is locked.
|
|
|
*/
|
|
*/
|
|
|
-extern Bool flashc_is_external_privileged_fetch_locked(void);
|
|
|
|
|
|
|
+extern bool flashc_is_external_privileged_fetch_locked(void);
|
|
|
|
|
|
|
|
/*! \brief Locks or unlocks external privileged fetch.
|
|
/*! \brief Locks or unlocks external privileged fetch.
|
|
|
*
|
|
*
|
|
|
- * \param lock Whether to lock external privileged fetch: \c TRUE or \c FALSE.
|
|
|
|
|
|
|
+ * \param lock Whether to lock external privileged fetch: \c true or \c false.
|
|
|
*
|
|
*
|
|
|
* \warning A Lock Error is issued if the Security bit is active.
|
|
* \warning A Lock Error is issued if the Security bit is active.
|
|
|
*
|
|
*
|
|
|
* \note The FLASHC error status returned by \ref flashc_is_lock_error and
|
|
* \note The FLASHC error status returned by \ref flashc_is_lock_error and
|
|
|
* \ref flashc_is_programming_error is updated.
|
|
* \ref flashc_is_programming_error is updated.
|
|
|
*/
|
|
*/
|
|
|
-extern void flashc_lock_external_privileged_fetch(Bool lock);
|
|
|
|
|
|
|
+extern void flashc_lock_external_privileged_fetch(bool lock);
|
|
|
|
|
|
|
|
/*! \brief Tells whether the region of a page is locked.
|
|
/*! \brief Tells whether the region of a page is locked.
|
|
|
*
|
|
*
|
|
@@ -340,7 +348,7 @@ extern void flashc_lock_external_privileged_fetch(Bool lock);
|
|
|
*
|
|
*
|
|
|
* \return Whether the region of the specified page is locked.
|
|
* \return Whether the region of the specified page is locked.
|
|
|
*/
|
|
*/
|
|
|
-extern Bool flashc_is_page_region_locked(int page_number);
|
|
|
|
|
|
|
+extern bool flashc_is_page_region_locked(int page_number);
|
|
|
|
|
|
|
|
/*! \brief Tells whether a region is locked.
|
|
/*! \brief Tells whether a region is locked.
|
|
|
*
|
|
*
|
|
@@ -348,7 +356,7 @@ extern Bool flashc_is_page_region_locked(int page_number);
|
|
|
*
|
|
*
|
|
|
* \return Whether the specified region is locked.
|
|
* \return Whether the specified region is locked.
|
|
|
*/
|
|
*/
|
|
|
-extern Bool flashc_is_region_locked(unsigned int region);
|
|
|
|
|
|
|
+extern bool flashc_is_region_locked(unsigned int region);
|
|
|
|
|
|
|
|
/*! \brief Locks or unlocks the region of a page.
|
|
/*! \brief Locks or unlocks the region of a page.
|
|
|
*
|
|
*
|
|
@@ -356,32 +364,32 @@ extern Bool flashc_is_region_locked(unsigned int region);
|
|
|
* \arg \c 0 to <tt>(flashc_get_page_count() - 1)</tt>: a page number within
|
|
* \arg \c 0 to <tt>(flashc_get_page_count() - 1)</tt>: a page number within
|
|
|
* the flash array;
|
|
* the flash array;
|
|
|
* \arg <tt>< 0</tt>: the current page number.
|
|
* \arg <tt>< 0</tt>: the current page number.
|
|
|
- * \param lock Whether to lock the region of the specified page: \c TRUE or
|
|
|
|
|
- * \c FALSE.
|
|
|
|
|
|
|
+ * \param lock Whether to lock the region of the specified page: \c true or
|
|
|
|
|
+ * \c false.
|
|
|
*
|
|
*
|
|
|
* \note The FLASHC error status returned by \ref flashc_is_lock_error and
|
|
* \note The FLASHC error status returned by \ref flashc_is_lock_error and
|
|
|
* \ref flashc_is_programming_error is updated.
|
|
* \ref flashc_is_programming_error is updated.
|
|
|
*/
|
|
*/
|
|
|
-extern void flashc_lock_page_region(int page_number, Bool lock);
|
|
|
|
|
|
|
+extern void flashc_lock_page_region(int page_number, bool lock);
|
|
|
|
|
|
|
|
/*! \brief Locks or unlocks a region.
|
|
/*! \brief Locks or unlocks a region.
|
|
|
*
|
|
*
|
|
|
* \param region The region number: \c 0 to <tt>(AVR32_FLASHC_REGIONS - 1)</tt>.
|
|
* \param region The region number: \c 0 to <tt>(AVR32_FLASHC_REGIONS - 1)</tt>.
|
|
|
- * \param lock Whether to lock the specified region: \c TRUE or \c FALSE.
|
|
|
|
|
|
|
+ * \param lock Whether to lock the specified region: \c true or \c false.
|
|
|
*
|
|
*
|
|
|
* \note The FLASHC error status returned by \ref flashc_is_lock_error and
|
|
* \note The FLASHC error status returned by \ref flashc_is_lock_error and
|
|
|
* \ref flashc_is_programming_error is updated.
|
|
* \ref flashc_is_programming_error is updated.
|
|
|
*/
|
|
*/
|
|
|
-extern void flashc_lock_region(unsigned int region, Bool lock);
|
|
|
|
|
|
|
+extern void flashc_lock_region(unsigned int region, bool lock);
|
|
|
|
|
|
|
|
/*! \brief Locks or unlocks all regions.
|
|
/*! \brief Locks or unlocks all regions.
|
|
|
*
|
|
*
|
|
|
- * \param lock Whether to lock the regions: \c TRUE or \c FALSE.
|
|
|
|
|
|
|
+ * \param lock Whether to lock the regions: \c true or \c false.
|
|
|
*
|
|
*
|
|
|
* \note The FLASHC error status returned by \ref flashc_is_lock_error and
|
|
* \note The FLASHC error status returned by \ref flashc_is_lock_error and
|
|
|
* \ref flashc_is_programming_error is updated.
|
|
* \ref flashc_is_programming_error is updated.
|
|
|
*/
|
|
*/
|
|
|
-extern void flashc_lock_all_regions(Bool lock);
|
|
|
|
|
|
|
+extern void flashc_lock_all_regions(bool lock);
|
|
|
|
|
|
|
|
//! @}
|
|
//! @}
|
|
|
|
|
|
|
@@ -400,7 +408,7 @@ extern void flashc_lock_all_regions(Bool lock);
|
|
|
* is given by \c AVR32_FLASHC_GPF_NUM. The other bits among the 64 are
|
|
* is given by \c AVR32_FLASHC_GPF_NUM. The other bits among the 64 are
|
|
|
* fixed at 1 by hardware.
|
|
* fixed at 1 by hardware.
|
|
|
*/
|
|
*/
|
|
|
-extern Bool flashc_read_gp_fuse_bit(unsigned int gp_fuse_bit);
|
|
|
|
|
|
|
+extern bool flashc_read_gp_fuse_bit(unsigned int gp_fuse_bit);
|
|
|
|
|
|
|
|
/*! \brief Reads a general-purpose fuse bit-field.
|
|
/*! \brief Reads a general-purpose fuse bit-field.
|
|
|
*
|
|
*
|
|
@@ -415,7 +423,7 @@ extern Bool flashc_read_gp_fuse_bit(unsigned int gp_fuse_bit);
|
|
|
* is given by \c AVR32_FLASHC_GPF_NUM. The other bits among the 64 are
|
|
* is given by \c AVR32_FLASHC_GPF_NUM. The other bits among the 64 are
|
|
|
* fixed at 1 by hardware.
|
|
* fixed at 1 by hardware.
|
|
|
*/
|
|
*/
|
|
|
-extern U64 flashc_read_gp_fuse_bitfield(unsigned int pos, unsigned int width);
|
|
|
|
|
|
|
+extern uint64_t flashc_read_gp_fuse_bitfield(unsigned int pos, unsigned int width);
|
|
|
|
|
|
|
|
/*! \brief Reads a general-purpose fuse byte.
|
|
/*! \brief Reads a general-purpose fuse byte.
|
|
|
*
|
|
*
|
|
@@ -427,7 +435,7 @@ extern U64 flashc_read_gp_fuse_bitfield(unsigned int pos, unsigned int width);
|
|
|
* is given by \c AVR32_FLASHC_GPF_NUM. The other bits among the 64 are
|
|
* is given by \c AVR32_FLASHC_GPF_NUM. The other bits among the 64 are
|
|
|
* fixed at 1 by hardware.
|
|
* fixed at 1 by hardware.
|
|
|
*/
|
|
*/
|
|
|
-extern U8 flashc_read_gp_fuse_byte(unsigned int gp_fuse_byte);
|
|
|
|
|
|
|
+extern uint8_t flashc_read_gp_fuse_byte(unsigned int gp_fuse_byte);
|
|
|
|
|
|
|
|
/*! \brief Reads all general-purpose fuses.
|
|
/*! \brief Reads all general-purpose fuses.
|
|
|
*
|
|
*
|
|
@@ -437,14 +445,14 @@ extern U8 flashc_read_gp_fuse_byte(unsigned int gp_fuse_byte);
|
|
|
* is given by \c AVR32_FLASHC_GPF_NUM. The other bits among the 64 are
|
|
* is given by \c AVR32_FLASHC_GPF_NUM. The other bits among the 64 are
|
|
|
* fixed at 1 by hardware.
|
|
* fixed at 1 by hardware.
|
|
|
*/
|
|
*/
|
|
|
-extern U64 flashc_read_all_gp_fuses(void);
|
|
|
|
|
|
|
+extern uint64_t flashc_read_all_gp_fuses(void);
|
|
|
|
|
|
|
|
/*! \brief Erases a general-purpose fuse bit.
|
|
/*! \brief Erases a general-purpose fuse bit.
|
|
|
*
|
|
*
|
|
|
* \param gp_fuse_bit The general-purpose fuse bit: \c 0 to \c 63.
|
|
* \param gp_fuse_bit The general-purpose fuse bit: \c 0 to \c 63.
|
|
|
- * \param check Whether to check erase: \c TRUE or \c FALSE.
|
|
|
|
|
|
|
+ * \param check Whether to check erase: \c true or \c false.
|
|
|
*
|
|
*
|
|
|
- * \return Whether the erase succeeded or always \c TRUE if erase check was not
|
|
|
|
|
|
|
+ * \return Whether the erase succeeded or always \c true if erase check was not
|
|
|
* requested.
|
|
* requested.
|
|
|
*
|
|
*
|
|
|
* \warning A Lock Error is issued if the Security bit is active and the command
|
|
* \warning A Lock Error is issued if the Security bit is active and the command
|
|
@@ -459,7 +467,7 @@ extern U64 flashc_read_all_gp_fuses(void);
|
|
|
* is given by \c AVR32_FLASHC_GPF_NUM. The other bits among the 64 are
|
|
* is given by \c AVR32_FLASHC_GPF_NUM. The other bits among the 64 are
|
|
|
* fixed at 1 by hardware.
|
|
* fixed at 1 by hardware.
|
|
|
*/
|
|
*/
|
|
|
-extern Bool flashc_erase_gp_fuse_bit(unsigned int gp_fuse_bit, Bool check);
|
|
|
|
|
|
|
+extern bool flashc_erase_gp_fuse_bit(unsigned int gp_fuse_bit, bool check);
|
|
|
|
|
|
|
|
/*! \brief Erases a general-purpose fuse bit-field.
|
|
/*! \brief Erases a general-purpose fuse bit-field.
|
|
|
*
|
|
*
|
|
@@ -467,9 +475,9 @@ extern Bool flashc_erase_gp_fuse_bit(unsigned int gp_fuse_bit, Bool check);
|
|
|
* \c 63.
|
|
* \c 63.
|
|
|
* \param width The bit-width of the general-purpose fuse bit-field: \c 0 to
|
|
* \param width The bit-width of the general-purpose fuse bit-field: \c 0 to
|
|
|
* \c 64.
|
|
* \c 64.
|
|
|
- * \param check Whether to check erase: \c TRUE or \c FALSE.
|
|
|
|
|
|
|
+ * \param check Whether to check erase: \c true or \c false.
|
|
|
*
|
|
*
|
|
|
- * \return Whether the erase succeeded or always \c TRUE if erase check was not
|
|
|
|
|
|
|
+ * \return Whether the erase succeeded or always \c true if erase check was not
|
|
|
* requested.
|
|
* requested.
|
|
|
*
|
|
*
|
|
|
* \warning A Lock Error is issued if the Security bit is active and the command
|
|
* \warning A Lock Error is issued if the Security bit is active and the command
|
|
@@ -484,14 +492,14 @@ extern Bool flashc_erase_gp_fuse_bit(unsigned int gp_fuse_bit, Bool check);
|
|
|
* is given by \c AVR32_FLASHC_GPF_NUM. The other bits among the 64 are
|
|
* is given by \c AVR32_FLASHC_GPF_NUM. The other bits among the 64 are
|
|
|
* fixed at 1 by hardware.
|
|
* fixed at 1 by hardware.
|
|
|
*/
|
|
*/
|
|
|
-extern Bool flashc_erase_gp_fuse_bitfield(unsigned int pos, unsigned int width, Bool check);
|
|
|
|
|
|
|
+extern bool flashc_erase_gp_fuse_bitfield(unsigned int pos, unsigned int width, bool check);
|
|
|
|
|
|
|
|
/*! \brief Erases a general-purpose fuse byte.
|
|
/*! \brief Erases a general-purpose fuse byte.
|
|
|
*
|
|
*
|
|
|
* \param gp_fuse_byte The general-purpose fuse byte: \c 0 to \c 7.
|
|
* \param gp_fuse_byte The general-purpose fuse byte: \c 0 to \c 7.
|
|
|
- * \param check Whether to check erase: \c TRUE or \c FALSE.
|
|
|
|
|
|
|
+ * \param check Whether to check erase: \c true or \c false.
|
|
|
*
|
|
*
|
|
|
- * \return Whether the erase succeeded or always \c TRUE if erase check was not
|
|
|
|
|
|
|
+ * \return Whether the erase succeeded or always \c true if erase check was not
|
|
|
* requested.
|
|
* requested.
|
|
|
*
|
|
*
|
|
|
* \warning A Lock Error is issued if the Security bit is active.
|
|
* \warning A Lock Error is issued if the Security bit is active.
|
|
@@ -505,13 +513,13 @@ extern Bool flashc_erase_gp_fuse_bitfield(unsigned int pos, unsigned int width,
|
|
|
* is given by \c AVR32_FLASHC_GPF_NUM. The other bits among the 64 are
|
|
* is given by \c AVR32_FLASHC_GPF_NUM. The other bits among the 64 are
|
|
|
* fixed at 1 by hardware.
|
|
* fixed at 1 by hardware.
|
|
|
*/
|
|
*/
|
|
|
-extern Bool flashc_erase_gp_fuse_byte(unsigned int gp_fuse_byte, Bool check);
|
|
|
|
|
|
|
+extern bool flashc_erase_gp_fuse_byte(unsigned int gp_fuse_byte, bool check);
|
|
|
|
|
|
|
|
/*! \brief Erases all general-purpose fuses.
|
|
/*! \brief Erases all general-purpose fuses.
|
|
|
*
|
|
*
|
|
|
- * \param check Whether to check erase: \c TRUE or \c FALSE.
|
|
|
|
|
|
|
+ * \param check Whether to check erase: \c true or \c false.
|
|
|
*
|
|
*
|
|
|
- * \return Whether the erase succeeded or always \c TRUE if erase check was not
|
|
|
|
|
|
|
+ * \return Whether the erase succeeded or always \c true if erase check was not
|
|
|
* requested.
|
|
* requested.
|
|
|
*
|
|
*
|
|
|
* \warning A Lock Error is issued if the Security bit is active.
|
|
* \warning A Lock Error is issued if the Security bit is active.
|
|
@@ -525,7 +533,7 @@ extern Bool flashc_erase_gp_fuse_byte(unsigned int gp_fuse_byte, Bool check);
|
|
|
* is given by \c AVR32_FLASHC_GPF_NUM. The other bits among the 64 are
|
|
* is given by \c AVR32_FLASHC_GPF_NUM. The other bits among the 64 are
|
|
|
* fixed at 1 by hardware.
|
|
* fixed at 1 by hardware.
|
|
|
*/
|
|
*/
|
|
|
-extern Bool flashc_erase_all_gp_fuses(Bool check);
|
|
|
|
|
|
|
+extern bool flashc_erase_all_gp_fuses(bool check);
|
|
|
|
|
|
|
|
/*! \brief Writes a general-purpose fuse bit.
|
|
/*! \brief Writes a general-purpose fuse bit.
|
|
|
*
|
|
*
|
|
@@ -538,13 +546,14 @@ extern Bool flashc_erase_all_gp_fuses(Bool check);
|
|
|
* \note The FLASHC error status returned by \ref flashc_is_lock_error and
|
|
* \note The FLASHC error status returned by \ref flashc_is_lock_error and
|
|
|
* \ref flashc_is_programming_error is updated.
|
|
* \ref flashc_is_programming_error is updated.
|
|
|
*
|
|
*
|
|
|
- * \note A write operation can only clear bits.
|
|
|
|
|
|
|
+ * \note A write operation can only clear bits; in other words, an erase operation
|
|
|
|
|
+ * must first be done if some bits need to be set to 1.
|
|
|
*
|
|
*
|
|
|
* \note The actual number of general-purpose fuse bits implemented by hardware
|
|
* \note The actual number of general-purpose fuse bits implemented by hardware
|
|
|
* is given by \c AVR32_FLASHC_GPF_NUM. The other bits among the 64 are
|
|
* is given by \c AVR32_FLASHC_GPF_NUM. The other bits among the 64 are
|
|
|
* fixed at 1 by hardware.
|
|
* fixed at 1 by hardware.
|
|
|
*/
|
|
*/
|
|
|
-extern void flashc_write_gp_fuse_bit(unsigned int gp_fuse_bit, Bool value);
|
|
|
|
|
|
|
+extern void flashc_write_gp_fuse_bit(unsigned int gp_fuse_bit, bool value);
|
|
|
|
|
|
|
|
/*! \brief Writes a general-purpose fuse bit-field.
|
|
/*! \brief Writes a general-purpose fuse bit-field.
|
|
|
*
|
|
*
|
|
@@ -560,13 +569,14 @@ extern void flashc_write_gp_fuse_bit(unsigned int gp_fuse_bit, Bool value);
|
|
|
* \note The FLASHC error status returned by \ref flashc_is_lock_error and
|
|
* \note The FLASHC error status returned by \ref flashc_is_lock_error and
|
|
|
* \ref flashc_is_programming_error is updated.
|
|
* \ref flashc_is_programming_error is updated.
|
|
|
*
|
|
*
|
|
|
- * \note A write operation can only clear bits.
|
|
|
|
|
|
|
+ * \note A write operation can only clear bits; in other words, an erase operation
|
|
|
|
|
+ * must first be done if some bits need to be set to 1.
|
|
|
*
|
|
*
|
|
|
* \note The actual number of general-purpose fuse bits implemented by hardware
|
|
* \note The actual number of general-purpose fuse bits implemented by hardware
|
|
|
* is given by \c AVR32_FLASHC_GPF_NUM. The other bits among the 64 are
|
|
* is given by \c AVR32_FLASHC_GPF_NUM. The other bits among the 64 are
|
|
|
* fixed at 1 by hardware.
|
|
* fixed at 1 by hardware.
|
|
|
*/
|
|
*/
|
|
|
-extern void flashc_write_gp_fuse_bitfield(unsigned int pos, unsigned int width, U64 value);
|
|
|
|
|
|
|
+extern void flashc_write_gp_fuse_bitfield(unsigned int pos, unsigned int width, uint64_t value);
|
|
|
|
|
|
|
|
/*! \brief Writes a general-purpose fuse byte.
|
|
/*! \brief Writes a general-purpose fuse byte.
|
|
|
*
|
|
*
|
|
@@ -578,13 +588,14 @@ extern void flashc_write_gp_fuse_bitfield(unsigned int pos, unsigned int width,
|
|
|
* \note The FLASHC error status returned by \ref flashc_is_lock_error and
|
|
* \note The FLASHC error status returned by \ref flashc_is_lock_error and
|
|
|
* \ref flashc_is_programming_error is updated.
|
|
* \ref flashc_is_programming_error is updated.
|
|
|
*
|
|
*
|
|
|
- * \note A write operation can only clear bits.
|
|
|
|
|
|
|
+ * \note A write operation can only clear bits; in other words, an erase operation
|
|
|
|
|
+ * must first be done if some bits need to be set to 1.
|
|
|
*
|
|
*
|
|
|
* \note The actual number of general-purpose fuse bits implemented by hardware
|
|
* \note The actual number of general-purpose fuse bits implemented by hardware
|
|
|
* is given by \c AVR32_FLASHC_GPF_NUM. The other bits among the 64 are
|
|
* is given by \c AVR32_FLASHC_GPF_NUM. The other bits among the 64 are
|
|
|
* fixed at 1 by hardware.
|
|
* fixed at 1 by hardware.
|
|
|
*/
|
|
*/
|
|
|
-extern void flashc_write_gp_fuse_byte(unsigned int gp_fuse_byte, U8 value);
|
|
|
|
|
|
|
+extern void flashc_write_gp_fuse_byte(unsigned int gp_fuse_byte, uint8_t value);
|
|
|
|
|
|
|
|
/*! \brief Writes all general-purpose fuses.
|
|
/*! \brief Writes all general-purpose fuses.
|
|
|
*
|
|
*
|
|
@@ -595,13 +606,14 @@ extern void flashc_write_gp_fuse_byte(unsigned int gp_fuse_byte, U8 value);
|
|
|
* \note The FLASHC error status returned by \ref flashc_is_lock_error and
|
|
* \note The FLASHC error status returned by \ref flashc_is_lock_error and
|
|
|
* \ref flashc_is_programming_error is updated.
|
|
* \ref flashc_is_programming_error is updated.
|
|
|
*
|
|
*
|
|
|
- * \note A write operation can only clear bits.
|
|
|
|
|
|
|
+ * \note A write operation can only clear bits; in other words, an erase operation
|
|
|
|
|
+ * must first be done if some bits need to be set to 1.
|
|
|
*
|
|
*
|
|
|
* \note The actual number of general-purpose fuse bits implemented by hardware
|
|
* \note The actual number of general-purpose fuse bits implemented by hardware
|
|
|
* is given by \c AVR32_FLASHC_GPF_NUM. The other bits among the 64 are
|
|
* is given by \c AVR32_FLASHC_GPF_NUM. The other bits among the 64 are
|
|
|
* fixed at 1 by hardware.
|
|
* fixed at 1 by hardware.
|
|
|
*/
|
|
*/
|
|
|
-extern void flashc_write_all_gp_fuses(U64 value);
|
|
|
|
|
|
|
+extern void flashc_write_all_gp_fuses(uint64_t value);
|
|
|
|
|
|
|
|
/*! \brief Sets a general-purpose fuse bit with the appropriate erase and write
|
|
/*! \brief Sets a general-purpose fuse bit with the appropriate erase and write
|
|
|
* operations.
|
|
* operations.
|
|
@@ -619,7 +631,7 @@ extern void flashc_write_all_gp_fuses(U64 value);
|
|
|
* is given by \c AVR32_FLASHC_GPF_NUM. The other bits among the 64 are
|
|
* is given by \c AVR32_FLASHC_GPF_NUM. The other bits among the 64 are
|
|
|
* fixed at 1 by hardware.
|
|
* fixed at 1 by hardware.
|
|
|
*/
|
|
*/
|
|
|
-extern void flashc_set_gp_fuse_bit(unsigned int gp_fuse_bit, Bool value);
|
|
|
|
|
|
|
+extern void flashc_set_gp_fuse_bit(unsigned int gp_fuse_bit, bool value);
|
|
|
|
|
|
|
|
/*! \brief Sets a general-purpose fuse bit-field with the appropriate erase and
|
|
/*! \brief Sets a general-purpose fuse bit-field with the appropriate erase and
|
|
|
* write operations.
|
|
* write operations.
|
|
@@ -640,7 +652,7 @@ extern void flashc_set_gp_fuse_bit(unsigned int gp_fuse_bit, Bool value);
|
|
|
* is given by \c AVR32_FLASHC_GPF_NUM. The other bits among the 64 are
|
|
* is given by \c AVR32_FLASHC_GPF_NUM. The other bits among the 64 are
|
|
|
* fixed at 1 by hardware.
|
|
* fixed at 1 by hardware.
|
|
|
*/
|
|
*/
|
|
|
-extern void flashc_set_gp_fuse_bitfield(unsigned int pos, unsigned int width, U64 value);
|
|
|
|
|
|
|
+extern void flashc_set_gp_fuse_bitfield(unsigned int pos, unsigned int width, uint64_t value);
|
|
|
|
|
|
|
|
/*! \brief Sets a general-purpose fuse byte with the appropriate erase and write
|
|
/*! \brief Sets a general-purpose fuse byte with the appropriate erase and write
|
|
|
* operations.
|
|
* operations.
|
|
@@ -657,7 +669,7 @@ extern void flashc_set_gp_fuse_bitfield(unsigned int pos, unsigned int width, U6
|
|
|
* is given by \c AVR32_FLASHC_GPF_NUM. The other bits among the 64 are
|
|
* is given by \c AVR32_FLASHC_GPF_NUM. The other bits among the 64 are
|
|
|
* fixed at 1 by hardware.
|
|
* fixed at 1 by hardware.
|
|
|
*/
|
|
*/
|
|
|
-extern void flashc_set_gp_fuse_byte(unsigned int gp_fuse_byte, U8 value);
|
|
|
|
|
|
|
+extern void flashc_set_gp_fuse_byte(unsigned int gp_fuse_byte, uint8_t value);
|
|
|
|
|
|
|
|
/*! \brief Sets all general-purpose fuses with the appropriate erase and write
|
|
/*! \brief Sets all general-purpose fuses with the appropriate erase and write
|
|
|
* operations.
|
|
* operations.
|
|
@@ -673,7 +685,7 @@ extern void flashc_set_gp_fuse_byte(unsigned int gp_fuse_byte, U8 value);
|
|
|
* is given by \c AVR32_FLASHC_GPF_NUM. The other bits among the 64 are
|
|
* is given by \c AVR32_FLASHC_GPF_NUM. The other bits among the 64 are
|
|
|
* fixed at 1 by hardware.
|
|
* fixed at 1 by hardware.
|
|
|
*/
|
|
*/
|
|
|
-extern void flashc_set_all_gp_fuses(U64 value);
|
|
|
|
|
|
|
+extern void flashc_set_all_gp_fuses(uint64_t value);
|
|
|
|
|
|
|
|
//! @}
|
|
//! @}
|
|
|
|
|
|
|
@@ -700,7 +712,7 @@ extern void flashc_clear_page_buffer(void);
|
|
|
* \return Whether the page to which the last Quick Page Read or Quick Page Read
|
|
* \return Whether the page to which the last Quick Page Read or Quick Page Read
|
|
|
* User Page command was applied was erased.
|
|
* User Page command was applied was erased.
|
|
|
*/
|
|
*/
|
|
|
-extern Bool flashc_is_page_erased(void);
|
|
|
|
|
|
|
+extern bool flashc_is_page_erased(void);
|
|
|
|
|
|
|
|
/*! \brief Applies the Quick Page Read command to a page.
|
|
/*! \brief Applies the Quick Page Read command to a page.
|
|
|
*
|
|
*
|
|
@@ -714,7 +726,7 @@ extern Bool flashc_is_page_erased(void);
|
|
|
* \note The FLASHC error status returned by \ref flashc_is_lock_error and
|
|
* \note The FLASHC error status returned by \ref flashc_is_lock_error and
|
|
|
* \ref flashc_is_programming_error is updated.
|
|
* \ref flashc_is_programming_error is updated.
|
|
|
*/
|
|
*/
|
|
|
-extern Bool flashc_quick_page_read(int page_number);
|
|
|
|
|
|
|
+extern bool flashc_quick_page_read(int page_number);
|
|
|
|
|
|
|
|
/*! \brief Erases a page.
|
|
/*! \brief Erases a page.
|
|
|
*
|
|
*
|
|
@@ -722,9 +734,9 @@ extern Bool flashc_quick_page_read(int page_number);
|
|
|
* \arg \c 0 to <tt>(flashc_get_page_count() - 1)</tt>: a page number within
|
|
* \arg \c 0 to <tt>(flashc_get_page_count() - 1)</tt>: a page number within
|
|
|
* the flash array;
|
|
* the flash array;
|
|
|
* \arg <tt>< 0</tt>: the current page number.
|
|
* \arg <tt>< 0</tt>: the current page number.
|
|
|
- * \param check Whether to check erase: \c TRUE or \c FALSE.
|
|
|
|
|
|
|
+ * \param check Whether to check erase: \c true or \c false.
|
|
|
*
|
|
*
|
|
|
- * \return Whether the erase succeeded or always \c TRUE if erase check was not
|
|
|
|
|
|
|
+ * \return Whether the erase succeeded or always \c true if erase check was not
|
|
|
* requested.
|
|
* requested.
|
|
|
*
|
|
*
|
|
|
* \warning A Lock Error is issued if the command is applied to a page belonging
|
|
* \warning A Lock Error is issued if the command is applied to a page belonging
|
|
@@ -735,13 +747,13 @@ extern Bool flashc_quick_page_read(int page_number);
|
|
|
*
|
|
*
|
|
|
* \note An erase operation can only set bits.
|
|
* \note An erase operation can only set bits.
|
|
|
*/
|
|
*/
|
|
|
-extern Bool flashc_erase_page(int page_number, Bool check);
|
|
|
|
|
|
|
+extern bool flashc_erase_page(int page_number, bool check);
|
|
|
|
|
|
|
|
/*! \brief Erases all pages within the flash array.
|
|
/*! \brief Erases all pages within the flash array.
|
|
|
*
|
|
*
|
|
|
- * \param check Whether to check erase: \c TRUE or \c FALSE.
|
|
|
|
|
|
|
+ * \param check Whether to check erase: \c true or \c false.
|
|
|
*
|
|
*
|
|
|
- * \return Whether the erase succeeded or always \c TRUE if erase check was not
|
|
|
|
|
|
|
+ * \return Whether the erase succeeded or always \c true if erase check was not
|
|
|
* requested.
|
|
* requested.
|
|
|
*
|
|
*
|
|
|
* \warning A Lock Error is issued if at least one region is locked or the
|
|
* \warning A Lock Error is issued if at least one region is locked or the
|
|
@@ -752,7 +764,7 @@ extern Bool flashc_erase_page(int page_number, Bool check);
|
|
|
*
|
|
*
|
|
|
* \note An erase operation can only set bits.
|
|
* \note An erase operation can only set bits.
|
|
|
*/
|
|
*/
|
|
|
-extern Bool flashc_erase_all_pages(Bool check);
|
|
|
|
|
|
|
+extern bool flashc_erase_all_pages(bool check);
|
|
|
|
|
|
|
|
/*! \brief Writes a page from the page buffer.
|
|
/*! \brief Writes a page from the page buffer.
|
|
|
*
|
|
*
|
|
@@ -769,7 +781,8 @@ extern Bool flashc_erase_all_pages(Bool check);
|
|
|
* \note The FLASHC error status returned by \ref flashc_is_lock_error and
|
|
* \note The FLASHC error status returned by \ref flashc_is_lock_error and
|
|
|
* \ref flashc_is_programming_error is updated.
|
|
* \ref flashc_is_programming_error is updated.
|
|
|
*
|
|
*
|
|
|
- * \note A write operation can only clear bits.
|
|
|
|
|
|
|
+ * \note A write operation can only clear bits; in other words, an erase operation
|
|
|
|
|
+ * must first be done if some bits need to be set to 1.
|
|
|
*/
|
|
*/
|
|
|
extern void flashc_write_page(int page_number);
|
|
extern void flashc_write_page(int page_number);
|
|
|
|
|
|
|
@@ -780,13 +793,13 @@ extern void flashc_write_page(int page_number);
|
|
|
* \note The FLASHC error status returned by \ref flashc_is_lock_error and
|
|
* \note The FLASHC error status returned by \ref flashc_is_lock_error and
|
|
|
* \ref flashc_is_programming_error is updated.
|
|
* \ref flashc_is_programming_error is updated.
|
|
|
*/
|
|
*/
|
|
|
-extern Bool flashc_quick_user_page_read(void);
|
|
|
|
|
|
|
+extern bool flashc_quick_user_page_read(void);
|
|
|
|
|
|
|
|
/*! \brief Erases the User page.
|
|
/*! \brief Erases the User page.
|
|
|
*
|
|
*
|
|
|
- * \param check Whether to check erase: \c TRUE or \c FALSE.
|
|
|
|
|
|
|
+ * \param check Whether to check erase: \c true or \c false.
|
|
|
*
|
|
*
|
|
|
- * \return Whether the erase succeeded or always \c TRUE if erase check was not
|
|
|
|
|
|
|
+ * \return Whether the erase succeeded or always \c true if erase check was not
|
|
|
* requested.
|
|
* requested.
|
|
|
*
|
|
*
|
|
|
* \note The FLASHC error status returned by \ref flashc_is_lock_error and
|
|
* \note The FLASHC error status returned by \ref flashc_is_lock_error and
|
|
@@ -794,7 +807,7 @@ extern Bool flashc_quick_user_page_read(void);
|
|
|
*
|
|
*
|
|
|
* \note An erase operation can only set bits.
|
|
* \note An erase operation can only set bits.
|
|
|
*/
|
|
*/
|
|
|
-extern Bool flashc_erase_user_page(Bool check);
|
|
|
|
|
|
|
+extern bool flashc_erase_user_page(bool check);
|
|
|
|
|
|
|
|
/*! \brief Writes the User page from the page buffer.
|
|
/*! \brief Writes the User page from the page buffer.
|
|
|
*
|
|
*
|
|
@@ -803,26 +816,25 @@ extern Bool flashc_erase_user_page(Bool check);
|
|
|
* \note The FLASHC error status returned by \ref flashc_is_lock_error and
|
|
* \note The FLASHC error status returned by \ref flashc_is_lock_error and
|
|
|
* \ref flashc_is_programming_error is updated.
|
|
* \ref flashc_is_programming_error is updated.
|
|
|
*
|
|
*
|
|
|
- * \note A write operation can only clear bits.
|
|
|
|
|
|
|
+ * \note A write operation can only clear bits; in other words, an erase operation
|
|
|
|
|
+ * must first be done if some bits need to be set to 1.
|
|
|
*/
|
|
*/
|
|
|
extern void flashc_write_user_page(void);
|
|
extern void flashc_write_user_page(void);
|
|
|
|
|
|
|
|
|
|
+
|
|
|
/*! \brief Copies \a nbytes bytes to the flash destination pointed to by \a dst
|
|
/*! \brief Copies \a nbytes bytes to the flash destination pointed to by \a dst
|
|
|
* from the repeated \a src source byte.
|
|
* from the repeated \a src source byte.
|
|
|
*
|
|
*
|
|
|
- * The destination areas that are not within the flash array or the User page
|
|
|
|
|
- * are ignored.
|
|
|
|
|
- *
|
|
|
|
|
* All pointer and size alignments are supported.
|
|
* All pointer and size alignments are supported.
|
|
|
*
|
|
*
|
|
|
* \param dst Pointer to flash destination.
|
|
* \param dst Pointer to flash destination.
|
|
|
* \param src Source byte.
|
|
* \param src Source byte.
|
|
|
* \param nbytes Number of bytes to set.
|
|
* \param nbytes Number of bytes to set.
|
|
|
- * \param erase Whether to erase before writing: \c TRUE or \c FALSE.
|
|
|
|
|
|
|
+ * \param erase Whether to erase before writing: \c true or \c false.
|
|
|
*
|
|
*
|
|
|
* \return The value of \a dst.
|
|
* \return The value of \a dst.
|
|
|
*
|
|
*
|
|
|
- * \warning This function may be called with \a erase set to \c FALSE only if
|
|
|
|
|
|
|
+ * \warning This function may be called with \a erase set to \c false only if
|
|
|
* the destination consists only of erased words, i.e. this function
|
|
* the destination consists only of erased words, i.e. this function
|
|
|
* can not be used to write only one bit of a previously written word.
|
|
* can not be used to write only one bit of a previously written word.
|
|
|
* E.g., if \c 0x00000001 then \c 0xFFFFFFFE are written to a word, the
|
|
* E.g., if \c 0x00000001 then \c 0xFFFFFFFE are written to a word, the
|
|
@@ -834,24 +846,21 @@ extern void flashc_write_user_page(void);
|
|
|
* \note The FLASHC error status returned by \ref flashc_is_lock_error and
|
|
* \note The FLASHC error status returned by \ref flashc_is_lock_error and
|
|
|
* \ref flashc_is_programming_error is updated.
|
|
* \ref flashc_is_programming_error is updated.
|
|
|
*/
|
|
*/
|
|
|
-extern volatile void *flashc_memset8(volatile void *dst, U8 src, size_t nbytes, Bool erase);
|
|
|
|
|
|
|
+extern volatile void *flashc_memset8(volatile void *dst, uint8_t src, size_t nbytes, bool erase);
|
|
|
|
|
|
|
|
/*! \brief Copies \a nbytes bytes to the flash destination pointed to by \a dst
|
|
/*! \brief Copies \a nbytes bytes to the flash destination pointed to by \a dst
|
|
|
* from the repeated \a src big-endian source half-word.
|
|
* from the repeated \a src big-endian source half-word.
|
|
|
*
|
|
*
|
|
|
- * The destination areas that are not within the flash array or the User page
|
|
|
|
|
- * are ignored.
|
|
|
|
|
- *
|
|
|
|
|
* All pointer and size alignments are supported.
|
|
* All pointer and size alignments are supported.
|
|
|
*
|
|
*
|
|
|
* \param dst Pointer to flash destination.
|
|
* \param dst Pointer to flash destination.
|
|
|
* \param src Source half-word.
|
|
* \param src Source half-word.
|
|
|
* \param nbytes Number of bytes to set.
|
|
* \param nbytes Number of bytes to set.
|
|
|
- * \param erase Whether to erase before writing: \c TRUE or \c FALSE.
|
|
|
|
|
|
|
+ * \param erase Whether to erase before writing: \c true or \c false.
|
|
|
*
|
|
*
|
|
|
* \return The value of \a dst.
|
|
* \return The value of \a dst.
|
|
|
*
|
|
*
|
|
|
- * \warning This function may be called with \a erase set to \c FALSE only if
|
|
|
|
|
|
|
+ * \warning This function may be called with \a erase set to \c false only if
|
|
|
* the destination consists only of erased words, i.e. this function
|
|
* the destination consists only of erased words, i.e. this function
|
|
|
* can not be used to write only one bit of a previously written word.
|
|
* can not be used to write only one bit of a previously written word.
|
|
|
* E.g., if \c 0x00000001 then \c 0xFFFFFFFE are written to a word, the
|
|
* E.g., if \c 0x00000001 then \c 0xFFFFFFFE are written to a word, the
|
|
@@ -863,24 +872,21 @@ extern volatile void *flashc_memset8(volatile void *dst, U8 src, size_t nbytes,
|
|
|
* \note The FLASHC error status returned by \ref flashc_is_lock_error and
|
|
* \note The FLASHC error status returned by \ref flashc_is_lock_error and
|
|
|
* \ref flashc_is_programming_error is updated.
|
|
* \ref flashc_is_programming_error is updated.
|
|
|
*/
|
|
*/
|
|
|
-extern volatile void *flashc_memset16(volatile void *dst, U16 src, size_t nbytes, Bool erase);
|
|
|
|
|
|
|
+extern volatile void *flashc_memset16(volatile void *dst, uint16_t src, size_t nbytes, bool erase);
|
|
|
|
|
|
|
|
/*! \brief Copies \a nbytes bytes to the flash destination pointed to by \a dst
|
|
/*! \brief Copies \a nbytes bytes to the flash destination pointed to by \a dst
|
|
|
* from the repeated \a src big-endian source word.
|
|
* from the repeated \a src big-endian source word.
|
|
|
*
|
|
*
|
|
|
- * The destination areas that are not within the flash array or the User page
|
|
|
|
|
- * are ignored.
|
|
|
|
|
- *
|
|
|
|
|
* All pointer and size alignments are supported.
|
|
* All pointer and size alignments are supported.
|
|
|
*
|
|
*
|
|
|
* \param dst Pointer to flash destination.
|
|
* \param dst Pointer to flash destination.
|
|
|
* \param src Source word.
|
|
* \param src Source word.
|
|
|
* \param nbytes Number of bytes to set.
|
|
* \param nbytes Number of bytes to set.
|
|
|
- * \param erase Whether to erase before writing: \c TRUE or \c FALSE.
|
|
|
|
|
|
|
+ * \param erase Whether to erase before writing: \c true or \c false.
|
|
|
*
|
|
*
|
|
|
* \return The value of \a dst.
|
|
* \return The value of \a dst.
|
|
|
*
|
|
*
|
|
|
- * \warning This function may be called with \a erase set to \c FALSE only if
|
|
|
|
|
|
|
+ * \warning This function may be called with \a erase set to \c false only if
|
|
|
* the destination consists only of erased words, i.e. this function
|
|
* the destination consists only of erased words, i.e. this function
|
|
|
* can not be used to write only one bit of a previously written word.
|
|
* can not be used to write only one bit of a previously written word.
|
|
|
* E.g., if \c 0x00000001 then \c 0xFFFFFFFE are written to a word, the
|
|
* E.g., if \c 0x00000001 then \c 0xFFFFFFFE are written to a word, the
|
|
@@ -892,24 +898,21 @@ extern volatile void *flashc_memset16(volatile void *dst, U16 src, size_t nbytes
|
|
|
* \note The FLASHC error status returned by \ref flashc_is_lock_error and
|
|
* \note The FLASHC error status returned by \ref flashc_is_lock_error and
|
|
|
* \ref flashc_is_programming_error is updated.
|
|
* \ref flashc_is_programming_error is updated.
|
|
|
*/
|
|
*/
|
|
|
-extern volatile void *flashc_memset32(volatile void *dst, U32 src, size_t nbytes, Bool erase);
|
|
|
|
|
|
|
+extern volatile void *flashc_memset32(volatile void *dst, uint32_t src, size_t nbytes, bool erase);
|
|
|
|
|
|
|
|
/*! \brief Copies \a nbytes bytes to the flash destination pointed to by \a dst
|
|
/*! \brief Copies \a nbytes bytes to the flash destination pointed to by \a dst
|
|
|
* from the repeated \a src big-endian source double-word.
|
|
* from the repeated \a src big-endian source double-word.
|
|
|
*
|
|
*
|
|
|
- * The destination areas that are not within the flash array or the User page
|
|
|
|
|
- * are ignored.
|
|
|
|
|
- *
|
|
|
|
|
* All pointer and size alignments are supported.
|
|
* All pointer and size alignments are supported.
|
|
|
*
|
|
*
|
|
|
* \param dst Pointer to flash destination.
|
|
* \param dst Pointer to flash destination.
|
|
|
* \param src Source double-word.
|
|
* \param src Source double-word.
|
|
|
* \param nbytes Number of bytes to set.
|
|
* \param nbytes Number of bytes to set.
|
|
|
- * \param erase Whether to erase before writing: \c TRUE or \c FALSE.
|
|
|
|
|
|
|
+ * \param erase Whether to erase before writing: \c true or \c false.
|
|
|
*
|
|
*
|
|
|
* \return The value of \a dst.
|
|
* \return The value of \a dst.
|
|
|
*
|
|
*
|
|
|
- * \warning This function may be called with \a erase set to \c FALSE only if
|
|
|
|
|
|
|
+ * \warning This function may be called with \a erase set to \c false only if
|
|
|
* the destination consists only of erased words, i.e. this function
|
|
* the destination consists only of erased words, i.e. this function
|
|
|
* can not be used to write only one bit of a previously written word.
|
|
* can not be used to write only one bit of a previously written word.
|
|
|
* E.g., if \c 0x00000001 then \c 0xFFFFFFFE are written to a word, the
|
|
* E.g., if \c 0x00000001 then \c 0xFFFFFFFE are written to a word, the
|
|
@@ -921,25 +924,22 @@ extern volatile void *flashc_memset32(volatile void *dst, U32 src, size_t nbytes
|
|
|
* \note The FLASHC error status returned by \ref flashc_is_lock_error and
|
|
* \note The FLASHC error status returned by \ref flashc_is_lock_error and
|
|
|
* \ref flashc_is_programming_error is updated.
|
|
* \ref flashc_is_programming_error is updated.
|
|
|
*/
|
|
*/
|
|
|
-extern volatile void *flashc_memset64(volatile void *dst, U64 src, size_t nbytes, Bool erase);
|
|
|
|
|
|
|
+extern volatile void *flashc_memset64(volatile void *dst, uint64_t src, size_t nbytes, bool erase);
|
|
|
|
|
|
|
|
/*! \brief Copies \a nbytes bytes to the flash destination pointed to by \a dst
|
|
/*! \brief Copies \a nbytes bytes to the flash destination pointed to by \a dst
|
|
|
* from the repeated \a src big-endian source pattern.
|
|
* from the repeated \a src big-endian source pattern.
|
|
|
*
|
|
*
|
|
|
- * The destination areas that are not within the flash array or the User page
|
|
|
|
|
- * are ignored.
|
|
|
|
|
- *
|
|
|
|
|
* All pointer and size alignments are supported.
|
|
* All pointer and size alignments are supported.
|
|
|
*
|
|
*
|
|
|
* \param dst Pointer to flash destination.
|
|
* \param dst Pointer to flash destination.
|
|
|
* \param src Source double-word.
|
|
* \param src Source double-word.
|
|
|
* \param src_width \a src width in bits: 8, 16, 32 or 64.
|
|
* \param src_width \a src width in bits: 8, 16, 32 or 64.
|
|
|
* \param nbytes Number of bytes to set.
|
|
* \param nbytes Number of bytes to set.
|
|
|
- * \param erase Whether to erase before writing: \c TRUE or \c FALSE.
|
|
|
|
|
|
|
+ * \param erase Whether to erase before writing: \c true or \c false.
|
|
|
*
|
|
*
|
|
|
* \return The value of \a dst.
|
|
* \return The value of \a dst.
|
|
|
*
|
|
*
|
|
|
- * \warning This function may be called with \a erase set to \c FALSE only if
|
|
|
|
|
|
|
+ * \warning This function may be called with \a erase set to \c false only if
|
|
|
* the destination consists only of erased words, i.e. this function
|
|
* the destination consists only of erased words, i.e. this function
|
|
|
* can not be used to write only one bit of a previously written word.
|
|
* can not be used to write only one bit of a previously written word.
|
|
|
* E.g., if \c 0x00000001 then \c 0xFFFFFFFE are written to a word, the
|
|
* E.g., if \c 0x00000001 then \c 0xFFFFFFFE are written to a word, the
|
|
@@ -952,27 +952,27 @@ extern volatile void *flashc_memset64(volatile void *dst, U64 src, size_t nbytes
|
|
|
* \ref flashc_is_programming_error is updated.
|
|
* \ref flashc_is_programming_error is updated.
|
|
|
*/
|
|
*/
|
|
|
#define flashc_memset(dst, src, src_width, nbytes, erase) \
|
|
#define flashc_memset(dst, src, src_width, nbytes, erase) \
|
|
|
- TPASTE2(flashc_memset, src_width)((dst), (src), (nbytes), (erase))
|
|
|
|
|
|
|
+ TPASTE2(flashc_memset, src_width)((dst), (src), (nbytes), (erase))
|
|
|
|
|
|
|
|
/*! \brief Copies \a nbytes bytes to the flash destination pointed to by \a dst
|
|
/*! \brief Copies \a nbytes bytes to the flash destination pointed to by \a dst
|
|
|
* from the source pointed to by \a src.
|
|
* from the source pointed to by \a src.
|
|
|
*
|
|
*
|
|
|
- * The destination areas that are not within the flash array or the User page
|
|
|
|
|
- * are ignored.
|
|
|
|
|
|
|
+ * The destination areas that are not within the flash
|
|
|
|
|
+ * array or the User page are caught by an Assert() operation.
|
|
|
*
|
|
*
|
|
|
* All pointer and size alignments are supported.
|
|
* All pointer and size alignments are supported.
|
|
|
*
|
|
*
|
|
|
* \param dst Pointer to flash destination.
|
|
* \param dst Pointer to flash destination.
|
|
|
* \param src Pointer to source data.
|
|
* \param src Pointer to source data.
|
|
|
* \param nbytes Number of bytes to copy.
|
|
* \param nbytes Number of bytes to copy.
|
|
|
- * \param erase Whether to erase before writing: \c TRUE or \c FALSE.
|
|
|
|
|
|
|
+ * \param erase Whether to erase before writing: \c true or \c false.
|
|
|
*
|
|
*
|
|
|
* \return The value of \a dst.
|
|
* \return The value of \a dst.
|
|
|
*
|
|
*
|
|
|
* \warning If copying takes place between areas that overlap, the behavior is
|
|
* \warning If copying takes place between areas that overlap, the behavior is
|
|
|
* undefined.
|
|
* undefined.
|
|
|
*
|
|
*
|
|
|
- * \warning This function may be called with \a erase set to \c FALSE only if
|
|
|
|
|
|
|
+ * \warning This function may be called with \a erase set to \c false only if
|
|
|
* the destination consists only of erased words, i.e. this function
|
|
* the destination consists only of erased words, i.e. this function
|
|
|
* can not be used to write only one bit of a previously written word.
|
|
* can not be used to write only one bit of a previously written word.
|
|
|
* E.g., if \c 0x00000001 then \c 0xFFFFFFFE are written to a word, the
|
|
* E.g., if \c 0x00000001 then \c 0xFFFFFFFE are written to a word, the
|
|
@@ -984,11 +984,11 @@ extern volatile void *flashc_memset64(volatile void *dst, U64 src, size_t nbytes
|
|
|
* \note The FLASHC error status returned by \ref flashc_is_lock_error and
|
|
* \note The FLASHC error status returned by \ref flashc_is_lock_error and
|
|
|
* \ref flashc_is_programming_error is updated.
|
|
* \ref flashc_is_programming_error is updated.
|
|
|
*/
|
|
*/
|
|
|
-extern volatile void *flashc_memcpy(volatile void *dst, const void *src, size_t nbytes, Bool erase);
|
|
|
|
|
|
|
+extern volatile void *flashc_memcpy(volatile void *dst, const void *src, size_t nbytes, bool erase);
|
|
|
|
|
|
|
|
#if UC3C
|
|
#if UC3C
|
|
|
|
|
|
|
|
-/*! \brief Depednding to the CPU frequency, set the wait states of flash read
|
|
|
|
|
|
|
+/*! \brief Depending to the CPU frequency, set the wait states of flash read
|
|
|
* accesses and enable or disable the High speed read mode.
|
|
* accesses and enable or disable the High speed read mode.
|
|
|
*
|
|
*
|
|
|
* \param cpu_f_hz The CPU frequency
|
|
* \param cpu_f_hz The CPU frequency
|
|
@@ -998,5 +998,8 @@ void flashc_set_flash_waitstate_and_readmode(unsigned long cpu_f_hz);
|
|
|
|
|
|
|
|
//! @}
|
|
//! @}
|
|
|
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * \}
|
|
|
|
|
+ */
|
|
|
|
|
|
|
|
#endif // _FLASHC_H_
|
|
#endif // _FLASHC_H_
|