@web-font-path: "roboto-debian.css";
Loading...
Searching...
No Matches
flash.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef _HARDWARE_FLASH_H
8#define _HARDWARE_FLASH_H
9
10#include "pico.h"
11
37// PICO_CONFIG: PARAM_ASSERTIONS_ENABLED_FLASH, Enable/disable assertions in the flash module, type=bool, default=0, group=hardware_flash
38#ifndef PARAM_ASSERTIONS_ENABLED_FLASH
39#define PARAM_ASSERTIONS_ENABLED_FLASH 0
40#endif
41
42#define FLASH_PAGE_SIZE (1u << 8)
43#define FLASH_SECTOR_SIZE (1u << 12)
44#define FLASH_BLOCK_SIZE (1u << 16)
45
46#define FLASH_UNIQUE_ID_SIZE_BYTES 8
47
48// PICO_CONFIG: PICO_FLASH_SIZE_BYTES, size of primary flash in bytes, type=int, group=hardware_flash
49
50#ifdef __cplusplus
51extern "C" {
52#endif
53
60void flash_range_erase(uint32_t flash_offs, size_t count);
61
70void flash_range_program(uint32_t flash_offs, const uint8_t *data, size_t count);
71
82void flash_get_unique_id(uint8_t *id_out);
83
107void flash_do_cmd(const uint8_t *txbuf, uint8_t *rxbuf, size_t count);
108
109
110#ifdef __cplusplus
111}
112#endif
113
114#endif
void flash_range_program(uint32_t flash_offs, const uint8_t *data, size_t count)
Program flash.
Definition flash.c:86
void flash_range_erase(uint32_t flash_offs, size_t count)
Erase areas of flash.
Definition flash.c:63
void flash_get_unique_id(uint8_t *id_out)
Get flash unique 64 bit identifier.
Definition flash.c:164
void flash_do_cmd(const uint8_t *txbuf, uint8_t *rxbuf, size_t count)
Execute bidirectional flash command.
Definition flash.c:124