[Cryptech-Commits] [sw/stm32] 02/07: Function to read data from the main FPGA configuration memory.

git at cryptech.is git at cryptech.is
Mon Sep 13 09:04:46 UTC 2021


This is an automated email from the git hooks/post-receive script.

meisterpaul1 at yandex.ru pushed a commit to branch ice40mkm
in repository sw/stm32.

commit d1624b391113f777f4aa9d70cc26ff6a9fe27ed2
Author: Pavel V. Shatov (Meister) <meisterpaul1 at yandex.ru>
AuthorDate: Mon Sep 13 11:48:47 2021 +0300

    Function to read data from the main FPGA configuration memory.
---
 stm-fpgacfg.c | 5 +++++
 stm-fpgacfg.h | 1 +
 2 files changed, 6 insertions(+)

diff --git a/stm-fpgacfg.c b/stm-fpgacfg.c
index 54342bf..c159f07 100644
--- a/stm-fpgacfg.c
+++ b/stm-fpgacfg.c
@@ -78,6 +78,11 @@ HAL_StatusTypeDef fpgacfg_write_data(uint32_t offset, const uint8_t *buf, const
     return n25q128_write_data(&fpgacfg_ctx, offset, buf, len);
 }
 
+HAL_StatusTypeDef fpgacfg_read_data(uint32_t offset, uint8_t *buf, const uint32_t len)
+{
+    return n25q128_read_data(&fpgacfg_ctx, offset, buf, len);
+}
+
 void fpgacfg_access_control(enum fpgacfg_access_ctrl access)
 {
     if (access == ALLOW_ARM) {
diff --git a/stm-fpgacfg.h b/stm-fpgacfg.h
index 74cc683..a8ec9e8 100644
--- a/stm-fpgacfg.h
+++ b/stm-fpgacfg.h
@@ -88,6 +88,7 @@ enum fpgacfg_reset {
 extern void fpgacfg_init(void);
 extern HAL_StatusTypeDef fpgacfg_check_id(void);
 extern HAL_StatusTypeDef fpgacfg_write_data(uint32_t offset, const uint8_t *buf, const uint32_t len);
+extern HAL_StatusTypeDef fpgacfg_read_data(uint32_t offset, uint8_t *buf, const uint32_t len);
 extern HAL_StatusTypeDef fpgacfg_erase_sector(uint32_t sector_offset);
 extern void fpgacfg_access_control(enum fpgacfg_access_ctrl access);
 /* Reset the FPGA */



More information about the Commits mailing list