4 * This file is part of BeRTOS.
6 * Bertos is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 * As a special exception, you may use this file as part of a free software
21 * library without restriction. Specifically, if other files instantiate
22 * templates or use macros or inline functions from this file, or you compile
23 * this file and link it with other files to produce an executable, this
24 * file does not by itself cause the resulting executable to be covered by
25 * the GNU General Public License. This exception does not however
26 * invalidate any other reasons why the executable file might be covered by
27 * the GNU General Public License.
29 * Copyright 2010 Develer S.r.l. (http://www.develer.com/)
33 * \brief ATSAM3 enhanced embedded flash controller definitions.
43 #define EEFC_FMR_R (*((reg32_t *)0x400E0A00)) ///< Flash Mode Register
44 #define EEFC_FCR_R (*((reg32_t *)0x400E0A04)) ///< Flash Command Register
45 #define EEFC_FSR_R (*((reg32_t *)0x400E0A08)) ///< Flash Status Register
46 #define EEFC_FRR_R (*((reg32_t *)0x400E0A0C)) ///< Flash Result Register
50 * EFC register addresses.
53 #define EEFC_FMR 0x400E0A00 ///< Flash Mode Register
54 #define EEFC_FCR 0x400E0A04 ///< Flash Command Register
55 #define EEFC_FSR 0x400E0A08 ///< Flash Status Register
56 #define EEFC_FRR 0x400E0A0C ///< Flash Result Register
61 * Defines for bit fields in EEFC_FMR register.
64 #define EEFC_FMR_FRDY BV(0) ///< Ready Interrupt Enable
65 #define EEFC_FMR_FWS_S 8
66 #define EEFC_FMR_FWS_M (0xf << EEFC_FMR_FWS_S) ///< Flash Wait State
67 #define EEFC_FMR_FWS(value) (EEFC_FMR_FWS_M & ((value) << EEFC_FMR_FWS_S))
68 #define EEFC_FMR_FAM BV(24) ///< Flash Access Mode
72 * Defines for bit fields in EEFC_FCR register.
75 #define EEFC_FCR_FCMD_M 0xff ///< Flash Command
76 #define EEFC_FCR_FCMD(value) (EEFC_FCR_FCMD_M & (value))
77 #define EEFC_FCR_FARG_S 8
78 #define EEFC_FCR_FARG_M (0xffff << EEFC_FCR_FARG_S) ///< Flash Command Argument
79 #define EEFC_FCR_FARG(value) (EEFC_FCR_FARG_M & ((value) << EEFC_FCR_FARG_S))
80 #define EEFC_FCR_FKEY_S 24
81 #define EEFC_FCR_FKEY_M (0xff << EEFC_FCR_FKEY_S) ///< Flash Writing Protection Key
82 #define EEFC_FCR_FKEY(value) (EEFC_FCR_FKEY_M & ((value) << EEFC_FCR_FKEY_S))
86 * Defines for bit fields in EEFC_FSR register.
89 #define EEFC_FSR_FRDY BV(0) ///< Flash Ready Status
90 #define EEFC_FSR_FCMDE BV(1) ///< Flash Command Error Status
91 #define EEFC_FSR_FLOCKE BV(2) ///< Flash Lock Error Status
94 #endif /* SAM3_FLASH_H */