diff options
author | makefu <github@syntax-fehler.de> | 2011-08-24 01:59:20 +0200 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2011-08-24 01:59:20 +0200 |
commit | 8951433431572bb3e3e2c7b77d97f49df7ce6170 (patch) | |
tree | 7938b56cee8d403b806044ed8fc92a56d388dc74 /oncology/dpfhack_display/include | |
parent | 1288c00ac6048b180e959b56d1834f927417c552 (diff) | |
parent | f5d75883e517965fa025e7b88e790a13a3e9dc9b (diff) |
Merge branch 'master' of github.com:krebscode/painload
Diffstat (limited to 'oncology/dpfhack_display/include')
-rw-r--r-- | oncology/dpfhack_display/include/flash.h | 19 | ||||
-rw-r--r-- | oncology/dpfhack_display/include/usbuser.h | 27 |
2 files changed, 46 insertions, 0 deletions
diff --git a/oncology/dpfhack_display/include/flash.h b/oncology/dpfhack_display/include/flash.h new file mode 100644 index 00000000..f753bd59 --- /dev/null +++ b/oncology/dpfhack_display/include/flash.h @@ -0,0 +1,19 @@ +// SPI STM flash commands: +// stolen from BFloader + +#define SPM_RDID 0x9f // Read ID +#define SPM_WREN 0x06 // Write enable +#define SPM_WRDI 0x04 // Write disable +#define SPM_RDSR 0x05 // Read status register +#define SPM_WRSR 0x01 // Write status register +#define SPM_READ 0x03 // Read data bytes +#define SPM_PP 0x02 // Page program +#define SPM_DP 0xb9 // Deep power down +#define SPM_RES 0xab // Release from deep power down + // and read signature +#define SPM_FLASH_SE 0xd8 // Sector erase +#define SPM_FLASH_BE 0xc7 // Bulk erase +#define SPM_FLASH_FAST_READ 0x0B // Read data bytes fast + +#define SPM_SR_SRWD 0x80 // SR write protection (HW) + diff --git a/oncology/dpfhack_display/include/usbuser.h b/oncology/dpfhack_display/include/usbuser.h new file mode 100644 index 00000000..618fb601 --- /dev/null +++ b/oncology/dpfhack_display/include/usbuser.h @@ -0,0 +1,27 @@ +/* USB user commands + * + * Only temporary. Should move to dpflib or into a dclib configuration. + * + */ + +#define PROTOCOL_VERSION 1 + +/** Our vendor specific USB commands to do stuff on the DPF */ + +#define USBCMD_GETPROPERTY 0x00 ///< Get property +#define USBCMD_SETPROPERTY 0x01 ///< Set property +#define USBCMD_MEMREAD 0x04 ///< Memory read +#define USBCMD_APPLOAD 0x05 ///< Load and run applet +// #define USBCMD_CLRFB 0x10 ///< Clear screen with RGB565 color +#define USBCMD_WRITEFB 0x11 ///< Write full screen. DEPRECATED. +#define USBCMD_BLIT 0x12 ///< Blit to screen +#define USBCMD_FLASHLOCK 0x20 ///< Lock USB for flash access +#define USBCMD_PROBE 0xff ///< Get version code (probe) + +/* Some special return codes */ +#define USB_IN_SEQUENCE 0x7f ///< We're inside a command sequence + +// Property handling: + +#define PROPERTY_BRIGHTNESS 0x01 +#define PROPERTY_ORIENTATION 0x10 |