px-fwlib 0.10.0
Cross-platform embedded library and documentation for 8/16/32-bit microcontrollers generated with Doxygen 1.9.2
px_log_fs_glue.h
1#ifndef __PX_LOG_FS_GLUE_H__
2#define __PX_LOG_FS_GLUE_H__
3/* =============================================================================
4 ____ ___ ____ ___ _ _ ___ __ __ ___ __ __ TM
5 | _ \ |_ _| / ___| / _ \ | \ | | / _ \ | \/ | |_ _| \ \/ /
6 | |_) | | | | | | | | | | \| | | | | | | |\/| | | | \ /
7 | __/ | | | |___ | |_| | | |\ | | |_| | | | | | | | / \
8 |_| |___| \____| \___/ |_| \_| \___/ |_| |_| |___| /_/\_\
9
10 Copyright (c) 2019 Pieter Conradie <https://piconomix.com>
11
12 License: MIT
13 https://github.com/piconomix/px-fwlib/blob/master/LICENSE.md
14
15 Title: px_log_fs_glue.h : Physical device glue layer for Log FS
16 Author(s): Pieter Conradie
17 Creation Date: 2019-01-11
18
19============================================================================= */
20
21/**
22 * @addtogroup PX_LOG_FS
23 *
24 * @{
25 */
26
27/* _____STANDARD INCLUDES____________________________________________________ */
28
29/* _____PROJECT INCLUDES_____________________________________________________ */
30#include "px_defs.h"
31
32#ifdef __cplusplus
33extern "C" {
34#endif
35/* _____DEFINITIONS__________________________________________________________ */
36
37/* _____TYPE DEFINITIONS_____________________________________________________ */
38
39/* _____GLOBAL VARIABLES_____________________________________________________ */
40
41/* _____GLOBAL FUNCTION DECLARATIONS_________________________________________ */
42/**
43 * Read data from Serial Flash.
44 *
45 * This glue function reads data from Serial Flash and stores it in the
46 * specified buffer.
47 *
48 * @param buffer Buffer to store read data
49 * @param page PX_LOG_FS_CFG_PAGE_START to PX_LOG_FS_CFG_PAGE_END
50 * @param start_byte_in_page 0 to PX_LOG_FS_CFG_PAGE_SIZE - 1
51 * @param nr_of_bytes 1 to PX_LOG_FS_CFG_PAGE_SIZE
52 *
53 */
54void px_log_fs_glue_rd(void * buffer,
55 uint16_t page,
56 uint16_t start_byte_in_page,
57 uint16_t nr_of_bytes);
58
59/**
60 * Writes data to Serial Flash.
61 *
62 * This glue function write data from Serial Flash and stores it in the
63 * specified buffer.
64 *
65 * @param buffer Buffer to store read data
66 * @param page PX_LOG_FS_CFG_PAGE_START to PX_LOG_FS_CFG_PAGE_END
67 * @param start_byte_in_page 0 to PX_LOG_FS_CFG_PAGE_SIZE - 1
68 * @param nr_of_bytes 1 to PX_LOG_FS_CFG_PAGE_SIZE
69 *
70 */
71void px_log_fs_glue_wr(const void * buffer,
72 uint16_t page,
73 uint16_t start_byte_in_page,
74 uint16_t nr_of_bytes);
75
76/**
77 * Erases data in Serial Flash.
78 *
79 * This glue function erases a block of pages in Serial Flash.
80 *
81 * @param page PX_LOG_FS_CFG_PAGE_START to PX_LOG_FS_CFG_PAGE_END
82 *
83 */
84void px_log_fs_glue_erase_block(uint16_t page);
85
86/* _____MACROS_______________________________________________________________ */
87
88#ifdef __cplusplus
89}
90#endif
91
92/// @}
93#endif
void px_log_fs_glue_wr(const void *buffer, uint16_t page, uint16_t start_byte_in_page, uint16_t nr_of_bytes)
Writes data to Serial Flash.
void px_log_fs_glue_rd(void *buffer, uint16_t page, uint16_t start_byte_in_page, uint16_t nr_of_bytes)
Read data from Serial Flash.
void px_log_fs_glue_erase_block(uint16_t page)
Erases data in Serial Flash.