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 23 17:31:56 2015 +0100
Revision:
28:8ae20cb0b943
Parent:
26:a65fbb4bde5c
Child:
39:e1cb4dd9bfeb
- BIOS API up to 0.2.0
- Moved I2C0 interrupt handling from BiosTouch to BiosLoader
- Added (or prepared for) ethernet MAC address reading from 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 28:8ae20cb0b943 8 #define BIOS_VER 0x000200 // 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 28:8ae20cb0b943 35 typedef enum {
embeddedartists 28:8ae20cb0b943 36 TOUCH_IRQ_RISING_EDGE,
embeddedartists 28:8ae20cb0b943 37 TOUCH_IRQ_FALLING_EDGE,
embeddedartists 28:8ae20cb0b943 38 TOUCH_IRQ_HIGH_LEVEL,
embeddedartists 28:8ae20cb0b943 39 TOUCH_IRQ_LOW_LEVEL,
embeddedartists 28:8ae20cb0b943 40 } touch_irq_trigger_t;
embeddedartists 28:8ae20cb0b943 41
embeddedartists 22:1a58a518435c 42 typedef void (*delayUsFunc)(int us);
embeddedartists 22:1a58a518435c 43 typedef uint32_t (*readTimeMsFunc)(void);
embeddedartists 22:1a58a518435c 44
embeddedartists 22:1a58a518435c 45 typedef BiosError_t (*initParamFunc)(void* data, uint32_t SystemCoreClock, uint32_t PeripheralClock, delayUsFunc delay, readTimeMsFunc readMs);
embeddedartists 22:1a58a518435c 46 typedef BiosError_t (*simpleFunc)(void* data);
embeddedartists 28:8ae20cb0b943 47 typedef BiosError_t (*macFunc)(void* data, char* mac);
embeddedartists 22:1a58a518435c 48
embeddedartists 22:1a58a518435c 49 typedef BiosError_t (*powerUpFunc)(void* data, void* framebuffer, Resolution_t wanted);
embeddedartists 22:1a58a518435c 50 typedef BiosError_t (*backlightFunc)(void* data, int percent);
embeddedartists 22:1a58a518435c 51 typedef BiosError_t (*infoFuncD)(void* data,
embeddedartists 22:1a58a518435c 52 uint16_t* width,
embeddedartists 22:1a58a518435c 53 uint16_t* height,
embeddedartists 22:1a58a518435c 54 uint16_t* bytesPerPixel,
embeddedartists 22:1a58a518435c 55 bool* landscape,
embeddedartists 22:1a58a518435c 56 uint16_t* supportedResolutions,
embeddedartists 22:1a58a518435c 57 Resolution_t* currentResolution);
embeddedartists 22:1a58a518435c 58 typedef BiosError_t (*infoFuncT)(void* data,
embeddedartists 22:1a58a518435c 59 bool* supportsTouch,
embeddedartists 22:1a58a518435c 60 bool* supportsCalibration,
embeddedartists 22:1a58a518435c 61 uint8_t* numPoints);
embeddedartists 22:1a58a518435c 62
embeddedartists 28:8ae20cb0b943 63 typedef void (*touchIrqFunc)(uint32_t arg, bool enable, touch_irq_trigger_t trigger);
embeddedartists 26:a65fbb4bde5c 64 typedef void (*touchNewDataFunc)(uint32_t arg, touch_coordinate_t* coords, int num);
embeddedartists 26:a65fbb4bde5c 65 typedef BiosError_t (*touchInitFunc)(void* data,
embeddedartists 26:a65fbb4bde5c 66 touchIrqFunc irqEnabler, uint32_t enablerArg,
embeddedartists 26:a65fbb4bde5c 67 touchNewDataFunc newData, uint32_t newDataArg);
embeddedartists 22:1a58a518435c 68 typedef BiosError_t (*readFunc)(void* data, touch_coordinate_t* coords, int num);
embeddedartists 22:1a58a518435c 69 typedef BiosError_t (*nextFunc)(void* data, uint16_t* x, uint16_t* y, bool* last);
embeddedartists 22:1a58a518435c 70 typedef BiosError_t (*waitCalibFunc)(void* data, bool* morePoints, uint32_t timeoutMs);
embeddedartists 22:1a58a518435c 71 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 72
embeddedartists 22:1a58a518435c 73 typedef struct {
embeddedartists 22:1a58a518435c 74 initParamFunc initParams;
embeddedartists 28:8ae20cb0b943 75 simpleFunc i2cIRQHandler;
embeddedartists 28:8ae20cb0b943 76 spifiFunc spifiIsSupported;
embeddedartists 28:8ae20cb0b943 77 macFunc ethernetMac;
embeddedartists 22:1a58a518435c 78
embeddedartists 22:1a58a518435c 79 simpleFunc displayInit;
embeddedartists 22:1a58a518435c 80 powerUpFunc displayPowerUp;
embeddedartists 22:1a58a518435c 81 simpleFunc displayPowerDown;
embeddedartists 22:1a58a518435c 82 backlightFunc displayBacklight;
embeddedartists 22:1a58a518435c 83 infoFuncD displayInformation;
embeddedartists 22:1a58a518435c 84
embeddedartists 22:1a58a518435c 85 touchInitFunc touchInit;
embeddedartists 22:1a58a518435c 86 simpleFunc touchPowerUp;
embeddedartists 22:1a58a518435c 87 simpleFunc touchPowerDown;
embeddedartists 22:1a58a518435c 88 readFunc touchRead;
embeddedartists 22:1a58a518435c 89 simpleFunc touchCalibrateStart;
embeddedartists 22:1a58a518435c 90 nextFunc touchGetNextCalibPoint;
embeddedartists 22:1a58a518435c 91 waitCalibFunc touchWaitForCalibratePoint;
embeddedartists 22:1a58a518435c 92 simpleFunc touchIrqHandler;
embeddedartists 22:1a58a518435c 93 infoFuncT touchInformation;
embeddedartists 26:a65fbb4bde5c 94
embeddedartists 22:1a58a518435c 95 } bios_header_t;
embeddedartists 22:1a58a518435c 96
embeddedartists 22:1a58a518435c 97 typedef struct {
embeddedartists 22:1a58a518435c 98 uint32_t magic;
embeddedartists 22:1a58a518435c 99 uint32_t size;
embeddedartists 22:1a58a518435c 100 uint32_t crc;
embeddedartists 22:1a58a518435c 101 uint32_t version;
embeddedartists 22:1a58a518435c 102 uint32_t paramSize;
embeddedartists 22:1a58a518435c 103 uint32_t headerSize;
embeddedartists 22:1a58a518435c 104 bios_header_t header;
embeddedartists 22:1a58a518435c 105 } file_header_t;
embeddedartists 22:1a58a518435c 106
embeddedartists 22:1a58a518435c 107 #endif /* BIOS_H */