Morse Micro IoT SDK  2.9.7
mmhal_flash.h
1/*
2 * Copyright 2021-2023 Morse Micro
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7
16#pragma once
17
18#include <stdbool.h>
19#include <stddef.h>
20#include <stdint.h>
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26
31#define MMHAL_FLASH_ERASE_VALUE 0xFF
32
34struct lfs_config;
35
47{
52
55
61};
62
64#define MMHAL_FLASH_PARTITION_CONFIG_DEFAULT { 0, 0, false }
65
78
88int mmhal_flash_erase(uint32_t block_address);
89
97uint32_t mmhal_flash_getblocksize(uint32_t block_address);
98
107int mmhal_flash_read(uint32_t read_address, uint8_t *buf, size_t size);
108
122int mmhal_flash_write(uint32_t write_address, const uint8_t *data, size_t size);
123
139const struct lfs_config* mmhal_get_littlefs_config(void);
140
141#ifdef __cplusplus
142}
143#endif
144
int mmhal_flash_erase(uint32_t block_address)
Erases a block of Flash pointed to by the block_address.
uint32_t mmhal_flash_getblocksize(uint32_t block_address)
Returns the size of the Flash block at the specified address.
const struct lfs_config * mmhal_get_littlefs_config(void)
Get LittleFS configuration.
int mmhal_flash_write(uint32_t write_address, const uint8_t *data, size_t size)
Write a block of data to the specified Flash address.
const struct mmhal_flash_partition_config * mmhal_get_mmconfig_partition(void)
Get MMCONFIG flash partition configuration.
int mmhal_flash_read(uint32_t read_address, uint8_t *buf, size_t size)
Read a block of data from the specified Flash address into the buffer.
char buf[1408]
Statically allocated buffer for HTTP GET request, just under 1 packet size.
Definition: sslclient.c:177
Flash partition configuration structure.
Definition: mmhal_flash.h:47
uint32_t partition_size
The size of the partition.
Definition: mmhal_flash.h:54
bool not_memory_mapped
If true, then the partition is not memory mapped and cannot be directly accessed at the physical part...
Definition: mmhal_flash.h:60
uint32_t partition_start
The start address of the partition, this may be a physical address or a relative address depending on...
Definition: mmhal_flash.h:51