libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
memctl.c
Go to the documentation of this file.
1/**
2 * @brief <b>PAC55xxxx Memory Controller Driver</b>
3 * @author @htmlonly &copy; @endhtmlonly 2020 Kevin Stefanik <kevin@allocor.tech>
4 * @date April 1, 2020
5 *
6 * This library supports the Memory Controller in the PAC55xx SoC from Qorvo.
7 *
8 * LGPL License Terms @ref lgpl_license
9 */
10/*
11 * This file is part of the libopencm3 project.
12 *
13 * This library is free software: you can redistribute it and/or modify
14 * it under the terms of the GNU Lesser General Public License as published by
15 * the Free Software Foundation, either version 3 of the License, or
16 * (at your option) any later version.
17 *
18 * This library is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License for more details.
22 *
23 * You should have received a copy of the GNU Lesser General Public License
24 * along with this library. If not, see <http://www.gnu.org/licenses/>.
25 */
27
28void memctl_flash_set_wstate(uint32_t wstate) {
30}
31void memctl_flash_set_mclkdiv(uint32_t div) {
32 MEMCTL_MEMCTLR = (MEMCTL_MEMCTLR & ~MEMCTL_MEMCTLR_MCLKDIV(16)) | MEMCTL_MEMCTLR_MCLKDIV(div);
33}
35 MEMCTL_MEMCTLR = (MEMCTL_MEMCTLR & ~MEMCTL_MEMCTLR_WRITEWORDCNT(MEMCTL_MEMCTLR_WRITEWORDCNT_MASK));
36}
39}
41 MEMCTL_MEMCTLR &= ~MEMCTL_MEMCTLR_STBY;
42}
44 MEMCTL_MEMCTLR &= ~MEMCTL_MEMCTLR_CACHEDIS;
45}
48}
50 MEMCTL_MEMCTLR &= ~MEMCTL_MEMCTLR_MCLKSEL;
51}
54}
56 MEMCTL_MEMCTLR &= ~MEMCTL_MEMCTLR_ECCDIS;
57}
60}
63}
65 MEMCTL_MEMCTLR &= ~MEMCTL_MEMCTLR_SEIE;
66}
69}
71 MEMCTL_MEMCTLR &= ~MEMCTL_MEMCTLR_DEIE;
72}
75}
77 MEMCTL_MEMCTLR &= ~MEMCTL_MEMCTLR_INVADDRIE;
78}
#define MEMCTL_MEMCTLR_MCLKSEL
Definition: memctl.h:57
#define MEMCTL_MEMCTLR_WSTATE_MASK
Definition: memctl.h:42
#define MEMCTL_MEMCTLR
Memory Controller Configuration Register.
Definition: memctl.h:41
#define MEMCTL_MEMCTLR_CACHEDIS
Definition: memctl.h:56
#define MEMCTL_MEMCTLR_ECCDIS
Definition: memctl.h:55
#define MEMCTL_MEMCTLR_DEIE
Definition: memctl.h:52
#define MEMCTL_MEMCTLR_WSTATE(ws)
Definition: memctl.h:43
#define MEMCTL_MEMCTLR_MCLKDIV(div)
Definition: memctl.h:47
#define MEMCTL_MEMCTLR_SEIE
Definition: memctl.h:51
#define MEMCTL_MEMCTLR_WRITEWORDCNT_MASK
Definition: memctl.h:48
#define MEMCTL_MEMCTLR_INVADDRIE
Definition: memctl.h:53
#define MEMCTL_MEMCTLR_STBY
Definition: memctl.h:54
void memctl_sram_ecc_disable(void)
Disable SRAM ECC.
Definition: memctl.c:58
void memctl_flash_select_mclk(void)
Select MCLK as input to Flash Memory Controller.
Definition: memctl.c:52
void memctl_flash_reset_write_buffer(void)
Set WRITEWORDCOUNT to 0 to reset the Flash write data buffer.
Definition: memctl.c:34
void memctl_flash_standby_mode_disable(void)
Disable Flash Standby Mode.
Definition: memctl.c:40
void memctl_invaddr_interrupt_disable(void)
Disable Invalid Memory Access Interrupt.
Definition: memctl.c:76
void memctl_flash_select_roscclk(void)
Select ROSCCLK as input to Flash Memory Controller.
Definition: memctl.c:49
void memctl_flash_cache_enable(void)
Enable Flash cache.
Definition: memctl.c:43
void memctl_sram_ecc_dual_bit_interrupt_enable(void)
Enable SRAM ECC Dual Bit Detection Interrupt.
Definition: memctl.c:67
void memctl_sram_ecc_dual_bit_interrupt_disable(void)
Disable SRAM ECC Dual Bit Detection Interrupt.
Definition: memctl.c:70
void memctl_flash_standby_mode_enable(void)
Enable Flash Standby Mode.
Definition: memctl.c:37
void memctl_sram_ecc_single_bit_interrupt_disable(void)
Disable SRAM ECC Single Bit Detection Interrupt.
Definition: memctl.c:64
void memctl_sram_ecc_enable(void)
Enable SRAM ECC.
Definition: memctl.c:55
void memctl_invaddr_interrupt_enable(void)
Enable Invalid Memory Access Interrupt.
Definition: memctl.c:73
void memctl_flash_set_wstate(uint32_t wstate)
PAC55xxxx Memory Controller Driver
Definition: memctl.c:28
void memctl_flash_set_mclkdiv(uint32_t div)
Set the MCLK divisor.
Definition: memctl.c:31
void memctl_sram_ecc_single_bit_interrupt_enable(void)
Enable SRAM ECC Single Bit Detection Interrupt.
Definition: memctl.c:61
void memctl_flash_cache_disable(void)
Disable Flash cache.
Definition: memctl.c:46