takashi kadono / Mbed OS Nucleo_446

Dependencies:   ssd1331

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers MBRBlockDevice_stub.cpp Source File

MBRBlockDevice_stub.cpp

00001 /*
00002  * Copyright (c) 2017, Arm Limited and affiliates.
00003  * SPDX-License-Identifier: Apache-2.0
00004  *
00005  * Licensed under the Apache License, Version 2.0 (the "License");
00006  * you may not use this file except in compliance with the License.
00007  * You may obtain a copy of the License at
00008  *
00009  *     http://www.apache.org/licenses/LICENSE-2.0
00010  *
00011  * Unless required by applicable law or agreed to in writing, software
00012  * distributed under the License is distributed on an "AS IS" BASIS,
00013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  * See the License for the specific language governing permissions and
00015  * limitations under the License.
00016  */
00017 
00018 #include "MBRBlockDevice.h"
00019 #include "mbed_critical.h"
00020 #include <algorithm>
00021 
00022 
00023 // On disk structures, all entries are little endian
00024 MBED_PACKED(struct) mbr_entry {
00025     uint8_t status;
00026     uint8_t chs_start[3];
00027     uint8_t type;
00028     uint8_t chs_stop[3];
00029     uint32_t lba_offset;
00030     uint32_t lba_size;
00031 };
00032 
00033 MBED_PACKED(struct) mbr_table {
00034     struct mbr_entry entries[4];
00035     uint8_t signature[2];
00036 };
00037 
00038 // Little-endian conversion, should compile to noop
00039 // if system is little-endian
00040 static inline uint32_t tole32(uint32_t a)
00041 {
00042     return 0;
00043 }
00044 
00045 static inline uint32_t fromle32(uint32_t a)
00046 {
00047     return 0;
00048 }
00049 
00050 static void tochs(uint32_t lba, uint8_t chs[3])
00051 {
00052 }
00053 
00054 
00055 // Partition after address are turned into absolute
00056 // addresses, assumes bd is initialized
00057 static int partition_absolute(
00058         BlockDevice *bd, int part, uint8_t type,
00059         bd_size_t offset, bd_size_t size)
00060 {
00061     return 0;
00062 }
00063 
00064 int MBRBlockDevice::partition(BlockDevice *bd, int part, uint8_t type, bd_addr_t start)
00065 {
00066     return 0;
00067 }
00068 
00069 int MBRBlockDevice::partition(BlockDevice *bd, int part, uint8_t type,
00070         bd_addr_t start, bd_addr_t stop)
00071 {
00072     return 0;
00073 }
00074 
00075 MBRBlockDevice::MBRBlockDevice(BlockDevice *bd, int part)
00076 {
00077 }
00078 
00079 int MBRBlockDevice::init()
00080 {
00081     return 0;
00082 }
00083 
00084 int MBRBlockDevice::deinit()
00085 {
00086     return 0;
00087 }
00088 
00089 int MBRBlockDevice::sync()
00090 {
00091     return 0;
00092 }
00093 
00094 int MBRBlockDevice::read(void *b, bd_addr_t addr, bd_size_t size)
00095 {
00096     return 0;
00097 }
00098 
00099 int MBRBlockDevice::program(const void *b, bd_addr_t addr, bd_size_t size)
00100 {
00101     return 0;
00102 }
00103 
00104 int MBRBlockDevice::erase(bd_addr_t addr, bd_size_t size)
00105 {
00106     return 0;
00107 }
00108 
00109 bd_size_t MBRBlockDevice::get_read_size() const
00110 {
00111     return 0;
00112 }
00113 
00114 bd_size_t MBRBlockDevice::get_program_size() const
00115 {
00116     return 0;
00117 }
00118 
00119 bd_size_t MBRBlockDevice::get_erase_size() const
00120 {
00121     return 0;
00122 }
00123 
00124 bd_size_t MBRBlockDevice::get_erase_size(bd_addr_t addr) const
00125 {
00126     return 0;
00127 }
00128 
00129 int MBRBlockDevice::get_erase_value() const
00130 {
00131     return 0;
00132 }
00133 
00134 bd_size_t MBRBlockDevice::size() const
00135 {
00136     return 0;
00137 }
00138 
00139 bd_size_t MBRBlockDevice::get_partition_start() const
00140 {
00141     return 0;
00142 }
00143 
00144 bd_size_t MBRBlockDevice::get_partition_stop() const
00145 {
00146     return 0;
00147 }
00148 
00149 uint8_t MBRBlockDevice::get_partition_type() const
00150 {
00151     return 0;
00152 }
00153 
00154 int MBRBlockDevice::get_partition_number() const
00155 {
00156     return 0;
00157 }