Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/thirdpin/libopencm3_cpp_extensions.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Pushkarev <v.pushkarev@thirdpin.io>2019-01-22 12:23:52 +0300
committerVictor Pushkarev <v.pushkarev@thirdpin.io>2019-01-22 12:23:52 +0300
commitdf1e91875a99028849193a826d3fb69fa0e667a7 (patch)
tree79e8619f5db8150fea6ab9fdaf7539be60cda97b
parente41ac8b05ba6b8e293827e4d9593fe58fbd6edb4 (diff)
IMPR: [flash_otp] Add func get_pointer()
-rw-r--r--cm3cpp_flash_otp.hpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/cm3cpp_flash_otp.hpp b/cm3cpp_flash_otp.hpp
index 1c392e6..dac397f 100644
--- a/cm3cpp_flash_otp.hpp
+++ b/cm3cpp_flash_otp.hpp
@@ -101,6 +101,12 @@ public:
return *(uint8_t*)address;
}
+ static const uint8_t* const get_pointer(OtpBlock block, OtpByte byte)
+ {
+ uint32_t address = _OTP_START_ADDR + ((uint32_t)block * _OTP_BYTES_IN_BLOCK) + (uint32_t)byte;
+ return (uint8_t*)address;
+ }
+
static bool get_flag(Flag flag)
{
uint32_t status = FLASH_SR | (uint32_t)flag;