SDHI_driver patch (mbedOS 5.11.5)

Committer:
tvendov
Date:
Fri Mar 29 19:47:34 2019 +0200
Revision:
2:7c75ab32d7c9
Fix: Folder structure changed. All SD Auto tests pass with OK!

Who changed what in which revision?

UserRevisionLine numberNew contents of line
tvendov 2:7c75ab32d7c9 1 /** @file fsfat_test.h
tvendov 2:7c75ab32d7c9 2 *
tvendov 2:7c75ab32d7c9 3 * mbed Microcontroller Library
tvendov 2:7c75ab32d7c9 4 * Copyright (c) 2006-2016 ARM Limited
tvendov 2:7c75ab32d7c9 5 *
tvendov 2:7c75ab32d7c9 6 * Licensed under the Apache License, Version 2.0 (the "License");
tvendov 2:7c75ab32d7c9 7 * you may not use this file except in compliance with the License.
tvendov 2:7c75ab32d7c9 8 * You may obtain a copy of the License at
tvendov 2:7c75ab32d7c9 9 *
tvendov 2:7c75ab32d7c9 10 * http://www.apache.org/licenses/LICENSE-2.0
tvendov 2:7c75ab32d7c9 11 *
tvendov 2:7c75ab32d7c9 12 * Unless required by applicable law or agreed to in writing, software
tvendov 2:7c75ab32d7c9 13 * distributed under the License is distributed on an "AS IS" BASIS,
tvendov 2:7c75ab32d7c9 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
tvendov 2:7c75ab32d7c9 15 * See the License for the specific language governing permissions and
tvendov 2:7c75ab32d7c9 16 * limitations under the License.
tvendov 2:7c75ab32d7c9 17 *
tvendov 2:7c75ab32d7c9 18 * Header file for test support data structures and function API.
tvendov 2:7c75ab32d7c9 19 */
tvendov 2:7c75ab32d7c9 20 #ifndef __FSFAT_TEST_H
tvendov 2:7c75ab32d7c9 21 #define __FSFAT_TEST_H
tvendov 2:7c75ab32d7c9 22
tvendov 2:7c75ab32d7c9 23 #include <stdint.h>
tvendov 2:7c75ab32d7c9 24 #include <stdlib.h>
tvendov 2:7c75ab32d7c9 25 #include <stdbool.h>
tvendov 2:7c75ab32d7c9 26
tvendov 2:7c75ab32d7c9 27 #ifdef __cplusplus
tvendov 2:7c75ab32d7c9 28 extern "C" {
tvendov 2:7c75ab32d7c9 29 #endif
tvendov 2:7c75ab32d7c9 30
tvendov 2:7c75ab32d7c9 31 /* Defines */
tvendov 2:7c75ab32d7c9 32 //#define FSFAT_INIT_1_TABLE_HEAD { "a", ""}
tvendov 2:7c75ab32d7c9 33 #define FSFAT_INIT_1_TABLE_MID_NODE { "/sd/01234567.txt", "abcdefghijklmnopqrstuvwxyz"}
tvendov 2:7c75ab32d7c9 34 //#define FSFAT_INIT_1_TABLE_TAIL { "/sd/fopentst/hello/world/animal/wobbly/dog/foot/backrght.txt", "present"}
tvendov 2:7c75ab32d7c9 35 #define FSFAT_TEST_RW_TABLE_SENTINEL 0xffffffff
tvendov 2:7c75ab32d7c9 36 #define FSFAT_TEST_BYTE_DATA_TABLE_SIZE 256
tvendov 2:7c75ab32d7c9 37 #define FSFAT_UTEST_MSG_BUF_SIZE 256
tvendov 2:7c75ab32d7c9 38 #define FSFAT_UTEST_DEFAULT_TIMEOUT_MS 10000
tvendov 2:7c75ab32d7c9 39 #define FSFAT_MBED_HOSTTEST_TIMEOUT 60
tvendov 2:7c75ab32d7c9 40 #define FSFAT_MAX_FILE_BASENAME 8
tvendov 2:7c75ab32d7c9 41 #define FSFAT_MAX_FILE_EXTNAME 3
tvendov 2:7c75ab32d7c9 42 #define FSFAT_BUF_MAX_LENGTH 64
tvendov 2:7c75ab32d7c9 43 #define FSFAT_FILENAME_MAX_LENGTH 255
tvendov 2:7c75ab32d7c9 44
tvendov 2:7c75ab32d7c9 45
tvendov 2:7c75ab32d7c9 46 /* support macro for make string for utest _MESSAGE macros, which dont support formatted output */
tvendov 2:7c75ab32d7c9 47 #define FSFAT_TEST_UTEST_MESSAGE(_buf, _max_len, _fmt, ...) \
tvendov 2:7c75ab32d7c9 48 do \
tvendov 2:7c75ab32d7c9 49 { \
tvendov 2:7c75ab32d7c9 50 snprintf((_buf), (_max_len), (_fmt), __VA_ARGS__); \
tvendov 2:7c75ab32d7c9 51 }while(0);
tvendov 2:7c75ab32d7c9 52
tvendov 2:7c75ab32d7c9 53
tvendov 2:7c75ab32d7c9 54 /*
tvendov 2:7c75ab32d7c9 55 * Structures
tvendov 2:7c75ab32d7c9 56 */
tvendov 2:7c75ab32d7c9 57
tvendov 2:7c75ab32d7c9 58 /* kv data for test */
tvendov 2:7c75ab32d7c9 59 typedef struct fsfat_kv_data_t {
tvendov 2:7c75ab32d7c9 60 const char *filename;
tvendov 2:7c75ab32d7c9 61 const char *value;
tvendov 2:7c75ab32d7c9 62 } fsfat_kv_data_t;
tvendov 2:7c75ab32d7c9 63
tvendov 2:7c75ab32d7c9 64
tvendov 2:7c75ab32d7c9 65 extern const uint8_t fsfat_test_byte_data_table[FSFAT_TEST_BYTE_DATA_TABLE_SIZE];
tvendov 2:7c75ab32d7c9 66
tvendov 2:7c75ab32d7c9 67 int32_t fsfat_test_create(const char *filename, const char *data, size_t len);
tvendov 2:7c75ab32d7c9 68 int32_t fsfat_test_delete(const char *key_name);
tvendov 2:7c75ab32d7c9 69 int32_t fsfat_test_filename_gen(char *name, const size_t len);
tvendov 2:7c75ab32d7c9 70 #ifdef __cplusplus
tvendov 2:7c75ab32d7c9 71 }
tvendov 2:7c75ab32d7c9 72 #endif
tvendov 2:7c75ab32d7c9 73
tvendov 2:7c75ab32d7c9 74 #endif /* __FSFAT_TEST_H */