Subdirectory provided by Embedded Artists
Dependencies: DM_FATFileSystem DM_HttpServer DM_USBHost EthernetInterface USBDevice mbed-rpc mbed-rtos mbed-src
Dependents: lpc4088_displaymodule_hello_world_Sept_2018
Fork of DMSupport by
Bios/bios.h@39:e1cb4dd9bfeb, 2015-04-28 (annotated)
- Committer:
- alindvall
- Date:
- Tue Apr 28 11:47:20 2015 +0000
- Revision:
- 39:e1cb4dd9bfeb
- Parent:
- 28:8ae20cb0b943
Added display frame rate setting. Updated used libraries.
Who changed what in which revision?
User | Revision | Line number | New 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 |
alindvall | 39:e1cb4dd9bfeb | 8 | #define BIOS_VER 0x000500 // 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 | |
alindvall | 39:e1cb4dd9bfeb | 29 | typedef enum { |
alindvall | 39:e1cb4dd9bfeb | 30 | FrameRate_Low, |
alindvall | 39:e1cb4dd9bfeb | 31 | FrameRate_Normal, |
alindvall | 39:e1cb4dd9bfeb | 32 | FrameRate_High, |
alindvall | 39:e1cb4dd9bfeb | 33 | } FrameRate_t; |
alindvall | 39:e1cb4dd9bfeb | 34 | |
embeddedartists | 22:1a58a518435c | 35 | typedef struct { |
embeddedartists | 22:1a58a518435c | 36 | uint16_t x; |
embeddedartists | 22:1a58a518435c | 37 | uint16_t y; |
embeddedartists | 22:1a58a518435c | 38 | uint16_t z; |
embeddedartists | 22:1a58a518435c | 39 | } touch_coordinate_t; |
embeddedartists | 22:1a58a518435c | 40 | |
embeddedartists | 28:8ae20cb0b943 | 41 | typedef enum { |
embeddedartists | 28:8ae20cb0b943 | 42 | TOUCH_IRQ_RISING_EDGE, |
embeddedartists | 28:8ae20cb0b943 | 43 | TOUCH_IRQ_FALLING_EDGE, |
embeddedartists | 28:8ae20cb0b943 | 44 | TOUCH_IRQ_HIGH_LEVEL, |
embeddedartists | 28:8ae20cb0b943 | 45 | TOUCH_IRQ_LOW_LEVEL, |
embeddedartists | 28:8ae20cb0b943 | 46 | } touch_irq_trigger_t; |
embeddedartists | 28:8ae20cb0b943 | 47 | |
embeddedartists | 22:1a58a518435c | 48 | typedef void (*delayUsFunc)(int us); |
embeddedartists | 22:1a58a518435c | 49 | typedef uint32_t (*readTimeMsFunc)(void); |
embeddedartists | 22:1a58a518435c | 50 | |
embeddedartists | 22:1a58a518435c | 51 | typedef BiosError_t (*initParamFunc)(void* data, uint32_t SystemCoreClock, uint32_t PeripheralClock, delayUsFunc delay, readTimeMsFunc readMs); |
embeddedartists | 22:1a58a518435c | 52 | typedef BiosError_t (*simpleFunc)(void* data); |
embeddedartists | 28:8ae20cb0b943 | 53 | typedef BiosError_t (*macFunc)(void* data, char* mac); |
embeddedartists | 22:1a58a518435c | 54 | |
alindvall | 39:e1cb4dd9bfeb | 55 | typedef BiosError_t (*powerUpFunc)(void* data, void* framebuffer, Resolution_t res, FrameRate_t rate); |
embeddedartists | 22:1a58a518435c | 56 | typedef BiosError_t (*backlightFunc)(void* data, int percent); |
embeddedartists | 22:1a58a518435c | 57 | typedef BiosError_t (*infoFuncD)(void* data, |
embeddedartists | 22:1a58a518435c | 58 | uint16_t* width, |
embeddedartists | 22:1a58a518435c | 59 | uint16_t* height, |
embeddedartists | 22:1a58a518435c | 60 | uint16_t* bytesPerPixel, |
embeddedartists | 22:1a58a518435c | 61 | bool* landscape, |
embeddedartists | 22:1a58a518435c | 62 | uint16_t* supportedResolutions, |
embeddedartists | 22:1a58a518435c | 63 | Resolution_t* currentResolution); |
embeddedartists | 22:1a58a518435c | 64 | typedef BiosError_t (*infoFuncT)(void* data, |
embeddedartists | 22:1a58a518435c | 65 | bool* supportsTouch, |
embeddedartists | 22:1a58a518435c | 66 | bool* supportsCalibration, |
embeddedartists | 22:1a58a518435c | 67 | uint8_t* numPoints); |
embeddedartists | 22:1a58a518435c | 68 | |
embeddedartists | 28:8ae20cb0b943 | 69 | typedef void (*touchIrqFunc)(uint32_t arg, bool enable, touch_irq_trigger_t trigger); |
embeddedartists | 26:a65fbb4bde5c | 70 | typedef void (*touchNewDataFunc)(uint32_t arg, touch_coordinate_t* coords, int num); |
embeddedartists | 26:a65fbb4bde5c | 71 | typedef BiosError_t (*touchInitFunc)(void* data, |
embeddedartists | 26:a65fbb4bde5c | 72 | touchIrqFunc irqEnabler, uint32_t enablerArg, |
embeddedartists | 26:a65fbb4bde5c | 73 | touchNewDataFunc newData, uint32_t newDataArg); |
embeddedartists | 22:1a58a518435c | 74 | typedef BiosError_t (*readFunc)(void* data, touch_coordinate_t* coords, int num); |
embeddedartists | 22:1a58a518435c | 75 | typedef BiosError_t (*nextFunc)(void* data, uint16_t* x, uint16_t* y, bool* last); |
embeddedartists | 22:1a58a518435c | 76 | typedef BiosError_t (*waitCalibFunc)(void* data, bool* morePoints, uint32_t timeoutMs); |
embeddedartists | 22:1a58a518435c | 77 | 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 | 78 | |
embeddedartists | 22:1a58a518435c | 79 | typedef struct { |
embeddedartists | 22:1a58a518435c | 80 | initParamFunc initParams; |
embeddedartists | 28:8ae20cb0b943 | 81 | simpleFunc i2cIRQHandler; |
embeddedartists | 28:8ae20cb0b943 | 82 | spifiFunc spifiIsSupported; |
embeddedartists | 28:8ae20cb0b943 | 83 | macFunc ethernetMac; |
embeddedartists | 22:1a58a518435c | 84 | |
embeddedartists | 22:1a58a518435c | 85 | simpleFunc displayInit; |
embeddedartists | 22:1a58a518435c | 86 | powerUpFunc displayPowerUp; |
embeddedartists | 22:1a58a518435c | 87 | simpleFunc displayPowerDown; |
embeddedartists | 22:1a58a518435c | 88 | backlightFunc displayBacklight; |
embeddedartists | 22:1a58a518435c | 89 | infoFuncD displayInformation; |
embeddedartists | 22:1a58a518435c | 90 | |
embeddedartists | 22:1a58a518435c | 91 | touchInitFunc touchInit; |
embeddedartists | 22:1a58a518435c | 92 | simpleFunc touchPowerUp; |
embeddedartists | 22:1a58a518435c | 93 | simpleFunc touchPowerDown; |
embeddedartists | 22:1a58a518435c | 94 | readFunc touchRead; |
embeddedartists | 22:1a58a518435c | 95 | simpleFunc touchCalibrateStart; |
embeddedartists | 22:1a58a518435c | 96 | nextFunc touchGetNextCalibPoint; |
embeddedartists | 22:1a58a518435c | 97 | waitCalibFunc touchWaitForCalibratePoint; |
embeddedartists | 22:1a58a518435c | 98 | simpleFunc touchIrqHandler; |
embeddedartists | 22:1a58a518435c | 99 | infoFuncT touchInformation; |
embeddedartists | 26:a65fbb4bde5c | 100 | |
embeddedartists | 22:1a58a518435c | 101 | } bios_header_t; |
embeddedartists | 22:1a58a518435c | 102 | |
embeddedartists | 22:1a58a518435c | 103 | typedef struct { |
embeddedartists | 22:1a58a518435c | 104 | uint32_t magic; |
embeddedartists | 22:1a58a518435c | 105 | uint32_t size; |
embeddedartists | 22:1a58a518435c | 106 | uint32_t crc; |
embeddedartists | 22:1a58a518435c | 107 | uint32_t version; |
embeddedartists | 22:1a58a518435c | 108 | uint32_t paramSize; |
embeddedartists | 22:1a58a518435c | 109 | uint32_t headerSize; |
embeddedartists | 22:1a58a518435c | 110 | bios_header_t header; |
embeddedartists | 22:1a58a518435c | 111 | } file_header_t; |
embeddedartists | 22:1a58a518435c | 112 | |
embeddedartists | 22:1a58a518435c | 113 | #endif /* BIOS_H */ |