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:
Thu Jan 22 16:04:54 2015 +0100
Revision:
26:a65fbb4bde5c
Parent:
22:1a58a518435c
Child:
28:8ae20cb0b943
- Changed BIOS version info to BOARD_ID.MAJ.MIN.REV
- Added support for interrupt drive I2C for the BIOS

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