A board support package for the LPC4088 Display Module.

Dependencies:   DM_HttpServer DM_USBHost

Dependents:   lpc4088_displaymodule_emwin lpc4088_displaymodule_demo_sphere sampleGUI sampleEmptyGUI ... more

Fork of DMSupport by EmbeddedArtists AB

Committer:
embeddedartists
Date:
Mon Nov 04 14:32:50 2019 +0000
Revision:
42:bbfe299d4a0c
Parent:
31:d47cffcb0a3e
More updates related to mbed OS 5

Who changed what in which revision?

UserRevisionLine numberNew contents of line
embeddedartists 22:1a58a518435c 1 /*
embeddedartists 22:1a58a518435c 2 * Copyright 2014 Embedded Artists AB
embeddedartists 22:1a58a518435c 3 *
embeddedartists 22:1a58a518435c 4 * Licensed under the Apache License, Version 2.0 (the "License");
embeddedartists 22:1a58a518435c 5 * you may not use this file except in compliance with the License.
embeddedartists 22:1a58a518435c 6 * You may obtain a copy of the License at
embeddedartists 22:1a58a518435c 7 *
embeddedartists 22:1a58a518435c 8 * http://www.apache.org/licenses/LICENSE-2.0
embeddedartists 22:1a58a518435c 9 *
embeddedartists 22:1a58a518435c 10 * Unless required by applicable law or agreed to in writing, software
embeddedartists 22:1a58a518435c 11 * distributed under the License is distributed on an "AS IS" BASIS,
embeddedartists 22:1a58a518435c 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
embeddedartists 22:1a58a518435c 13 * See the License for the specific language governing permissions and
embeddedartists 22:1a58a518435c 14 * limitations under the License.
embeddedartists 22:1a58a518435c 15 */
embeddedartists 22:1a58a518435c 16
embeddedartists 22:1a58a518435c 17 #ifndef BIOSLOADER_H
embeddedartists 22:1a58a518435c 18 #define BIOSLOADER_H
embeddedartists 22:1a58a518435c 19
embeddedartists 22:1a58a518435c 20 #include "mbed.h"
embeddedartists 22:1a58a518435c 21 #include "DMBoard.h"
embeddedartists 22:1a58a518435c 22 #include "BiosDisplay.h"
embeddedartists 22:1a58a518435c 23 #include "BiosTouch.h"
embeddedartists 22:1a58a518435c 24 #include "bios.h"
embeddedartists 22:1a58a518435c 25
embeddedartists 22:1a58a518435c 26 /**
embeddedartists 22:1a58a518435c 27 * Unpacks and prepares the BIOS code.
embeddedartists 22:1a58a518435c 28 */
embeddedartists 22:1a58a518435c 29 class BiosLoader {
embeddedartists 22:1a58a518435c 30 public:
embeddedartists 22:1a58a518435c 31
embeddedartists 22:1a58a518435c 32 /** Get the only instance of the BiosLoader
embeddedartists 22:1a58a518435c 33 *
embeddedartists 22:1a58a518435c 34 * @returns The BIOS
embeddedartists 22:1a58a518435c 35 */
embeddedartists 22:1a58a518435c 36 static BiosLoader& instance()
embeddedartists 22:1a58a518435c 37 {
embeddedartists 22:1a58a518435c 38 static BiosLoader singleton;
embeddedartists 22:1a58a518435c 39 return singleton;
embeddedartists 22:1a58a518435c 40 }
embeddedartists 22:1a58a518435c 41
embeddedartists 22:1a58a518435c 42
embeddedartists 28:8ae20cb0b943 43 void getMacAddress(char mac[6]);
embeddedartists 22:1a58a518435c 44 bool isKnownSPIFIMemory(uint8_t mfgr, uint8_t devType, uint8_t devID, uint32_t memSize, uint32_t* eraseBlockSize);
embeddedartists 28:8ae20cb0b943 45 void handleI2CInterrupt();
embeddedartists 28:8ae20cb0b943 46
embeddedartists 31:d47cffcb0a3e 47 void getBiosStats(uint8_t& type, uint8_t& major, uint8_t& minor, uint8_t& rev);
embeddedartists 31:d47cffcb0a3e 48
embeddedartists 22:1a58a518435c 49 friend class BiosDisplay;
embeddedartists 22:1a58a518435c 50 friend class BiosTouch;
embeddedartists 22:1a58a518435c 51 friend class DMBoard;
embeddedartists 22:1a58a518435c 52
embeddedartists 22:1a58a518435c 53 private:
embeddedartists 22:1a58a518435c 54
embeddedartists 22:1a58a518435c 55 bool _initialized;
embeddedartists 22:1a58a518435c 56
embeddedartists 22:1a58a518435c 57 bios_header_t _bios;
embeddedartists 22:1a58a518435c 58 void* _biosData;
embeddedartists 22:1a58a518435c 59 uint8_t* _conf;
embeddedartists 22:1a58a518435c 60 uint32_t _confSize;
embeddedartists 31:d47cffcb0a3e 61 uint32_t _stats;
embeddedartists 22:1a58a518435c 62
embeddedartists 22:1a58a518435c 63 explicit BiosLoader();
embeddedartists 22:1a58a518435c 64 // hide copy constructor
embeddedartists 22:1a58a518435c 65 BiosLoader(const BiosLoader&);
embeddedartists 22:1a58a518435c 66 // hide assign operator
embeddedartists 22:1a58a518435c 67 BiosLoader& operator=(const BiosLoader&);
embeddedartists 22:1a58a518435c 68 ~BiosLoader();
embeddedartists 22:1a58a518435c 69
embeddedartists 22:1a58a518435c 70 /** Loads, verifies and prepares the BIOS
embeddedartists 22:1a58a518435c 71 *
embeddedartists 22:1a58a518435c 72 * @returns
embeddedartists 22:1a58a518435c 73 * Ok on success
embeddedartists 22:1a58a518435c 74 * An error code on failure
embeddedartists 22:1a58a518435c 75 */
embeddedartists 22:1a58a518435c 76 DMBoard::BoardError init();
embeddedartists 22:1a58a518435c 77 DMBoard::BoardError readBIOS(uint8_t** data, uint32_t* size);
embeddedartists 22:1a58a518435c 78 DMBoard::BoardError params(bios_header_t** header, void** instanceData);
embeddedartists 22:1a58a518435c 79
embeddedartists 22:1a58a518435c 80 void resetI2C();
embeddedartists 22:1a58a518435c 81 };
embeddedartists 22:1a58a518435c 82
embeddedartists 22:1a58a518435c 83 #endif /* BIOSLOADER_H */