mbed support for LPC4088 Display Module

Dependencies:   DM_FATFileSystem DM_HttpServer DM_USBHost EthernetInterface USBDevice mbed-rpc mbed-rtos mbed-src

Dependents:   emptyProgram

Fork of DMSupport by Embedded Artists

Committer:
embeddedartists
Date:
Fri Jan 16 11:13:39 2015 +0100
Revision:
22:1a58a518435c
Child:
26:a65fbb4bde5c
- Updated SPIFI code to allow BIOS to id chips not yet supported by DMSupport
- Updated QSPIFileSystem to be chip independant. Erase block info from SPIFI.cpp
- Split BiosDisplayAndTouch into BiosDisplay and BiosTouch
- Added BiosLoader with common functionallity
- Removed BIOS code from DMBoard
- Added first version of a touch listener

Who changed what in which revision?

UserRevisionLine numberNew contents of line
embeddedartists 22:1a58a518435c 1 #ifndef BIOS_H
embeddedartists 22:1a58a518435c 2 #define BIOS_H
embeddedartists 22:1a58a518435c 3
embeddedartists 22:1a58a518435c 4 #include <stdint.h>
embeddedartists 22:1a58a518435c 5 #include <stdbool.h>
embeddedartists 22:1a58a518435c 6
embeddedartists 22:1a58a518435c 7 #define BIOS_MAGIC 0xEA0123EA
embeddedartists 22:1a58a518435c 8 #define BIOS_VER 1
embeddedartists 22:1a58a518435c 9
embeddedartists 22:1a58a518435c 10 typedef enum {
embeddedartists 22:1a58a518435c 11 BiosError_Ok = 0,
embeddedartists 22:1a58a518435c 12 BiosError_ConfigError = 1,
embeddedartists 22:1a58a518435c 13 BiosError_WrongBPP = 2,
embeddedartists 22:1a58a518435c 14 BiosError_InvalidParam = 3,
embeddedartists 22:1a58a518435c 15 BiosError_NoInit = 4,
embeddedartists 22:1a58a518435c 16 BiosError_Calibration = 5,
embeddedartists 22:1a58a518435c 17 BiosError_Timeout = 6,
embeddedartists 22:1a58a518435c 18 BiosError_CommError = 7,
embeddedartists 22:1a58a518435c 19 BiosError_NotSupported = 8,
embeddedartists 22:1a58a518435c 20 } BiosError_t;
embeddedartists 22:1a58a518435c 21
embeddedartists 22:1a58a518435c 22 typedef enum {
embeddedartists 22:1a58a518435c 23 Res_16bit_rgb565 = 1<<0,
embeddedartists 22:1a58a518435c 24 Res_18bit_rgb666 = 1<<1,
embeddedartists 22:1a58a518435c 25 Res_24bit_rgb888 = 1<<2,
embeddedartists 22:1a58a518435c 26 } Resolution_t;
embeddedartists 22:1a58a518435c 27
embeddedartists 22:1a58a518435c 28 typedef struct {
embeddedartists 22:1a58a518435c 29 uint16_t x;
embeddedartists 22:1a58a518435c 30 uint16_t y;
embeddedartists 22:1a58a518435c 31 uint16_t z;
embeddedartists 22:1a58a518435c 32 } touch_coordinate_t;
embeddedartists 22:1a58a518435c 33
embeddedartists 22:1a58a518435c 34 typedef void (*delayUsFunc)(int us);
embeddedartists 22:1a58a518435c 35 typedef uint32_t (*readTimeMsFunc)(void);
embeddedartists 22:1a58a518435c 36
embeddedartists 22:1a58a518435c 37 typedef BiosError_t (*initParamFunc)(void* data, uint32_t SystemCoreClock, uint32_t PeripheralClock, delayUsFunc delay, readTimeMsFunc readMs);
embeddedartists 22:1a58a518435c 38 typedef BiosError_t (*simpleFunc)(void* data);
embeddedartists 22:1a58a518435c 39
embeddedartists 22:1a58a518435c 40 typedef BiosError_t (*powerUpFunc)(void* data, void* framebuffer, Resolution_t wanted);
embeddedartists 22:1a58a518435c 41 typedef BiosError_t (*backlightFunc)(void* data, int percent);
embeddedartists 22:1a58a518435c 42 typedef BiosError_t (*infoFuncD)(void* data,
embeddedartists 22:1a58a518435c 43 uint16_t* width,
embeddedartists 22:1a58a518435c 44 uint16_t* height,
embeddedartists 22:1a58a518435c 45 uint16_t* bytesPerPixel,
embeddedartists 22:1a58a518435c 46 bool* landscape,
embeddedartists 22:1a58a518435c 47 uint16_t* supportedResolutions,
embeddedartists 22:1a58a518435c 48 Resolution_t* currentResolution);
embeddedartists 22:1a58a518435c 49 typedef BiosError_t (*infoFuncT)(void* data,
embeddedartists 22:1a58a518435c 50 bool* supportsTouch,
embeddedartists 22:1a58a518435c 51 bool* supportsCalibration,
embeddedartists 22:1a58a518435c 52 bool* resistive,
embeddedartists 22:1a58a518435c 53 uint8_t* numPoints);
embeddedartists 22:1a58a518435c 54
embeddedartists 22:1a58a518435c 55 typedef void (*touchIrqFunc)(uint32_t arg, bool enable, bool rising);
embeddedartists 22:1a58a518435c 56 typedef BiosError_t (*touchInitFunc)(void* data, touchIrqFunc irqEnabler, uint32_t enablerArg);
embeddedartists 22:1a58a518435c 57 typedef BiosError_t (*readFunc)(void* data, touch_coordinate_t* coords, int num);
embeddedartists 22:1a58a518435c 58 typedef BiosError_t (*nextFunc)(void* data, uint16_t* x, uint16_t* y, bool* last);
embeddedartists 22:1a58a518435c 59 typedef BiosError_t (*waitCalibFunc)(void* data, bool* morePoints, uint32_t timeoutMs);
embeddedartists 22:1a58a518435c 60 typedef BiosError_t (*spifiFunc)(void* data, uint8_t mfgr, uint8_t devType, uint8_t devID, uint32_t memSize, bool* known, uint32_t* eraseBlockSize);
embeddedartists 22:1a58a518435c 61
embeddedartists 22:1a58a518435c 62 typedef struct {
embeddedartists 22:1a58a518435c 63 initParamFunc initParams;
embeddedartists 22:1a58a518435c 64
embeddedartists 22:1a58a518435c 65 simpleFunc displayInit;
embeddedartists 22:1a58a518435c 66 powerUpFunc displayPowerUp;
embeddedartists 22:1a58a518435c 67 simpleFunc displayPowerDown;
embeddedartists 22:1a58a518435c 68 backlightFunc displayBacklight;
embeddedartists 22:1a58a518435c 69 infoFuncD displayInformation;
embeddedartists 22:1a58a518435c 70
embeddedartists 22:1a58a518435c 71 touchInitFunc touchInit;
embeddedartists 22:1a58a518435c 72 simpleFunc touchPowerUp;
embeddedartists 22:1a58a518435c 73 simpleFunc touchPowerDown;
embeddedartists 22:1a58a518435c 74 readFunc touchRead;
embeddedartists 22:1a58a518435c 75 simpleFunc touchCalibrateStart;
embeddedartists 22:1a58a518435c 76 nextFunc touchGetNextCalibPoint;
embeddedartists 22:1a58a518435c 77 waitCalibFunc touchWaitForCalibratePoint;
embeddedartists 22:1a58a518435c 78 simpleFunc touchIrqHandler;
embeddedartists 22:1a58a518435c 79 infoFuncT touchInformation;
embeddedartists 22:1a58a518435c 80
embeddedartists 22:1a58a518435c 81 spifiFunc spifiIsSupported;
embeddedartists 22:1a58a518435c 82 } bios_header_t;
embeddedartists 22:1a58a518435c 83
embeddedartists 22:1a58a518435c 84 typedef struct {
embeddedartists 22:1a58a518435c 85 uint32_t magic;
embeddedartists 22:1a58a518435c 86 uint32_t size;
embeddedartists 22:1a58a518435c 87 uint32_t crc;
embeddedartists 22:1a58a518435c 88 uint32_t version;
embeddedartists 22:1a58a518435c 89 uint32_t paramSize;
embeddedartists 22:1a58a518435c 90 uint32_t headerSize;
embeddedartists 22:1a58a518435c 91 bios_header_t header;
embeddedartists 22:1a58a518435c 92 } file_header_t;
embeddedartists 22:1a58a518435c 93
embeddedartists 22:1a58a518435c 94 #endif /* BIOS_H */