4D systems Picaso uLCD 32PTU touch display library

Committer:
CaptainR
Date:
Mon Sep 26 10:51:02 2016 +0000
Revision:
20:88e137b9ea46
Child:
21:ea68a8a3cea4
started on file system

Who changed what in which revision?

UserRevisionLine numberNew contents of line
CaptainR 20:88e137b9ea46 1 //
CaptainR 20:88e137b9ea46 2 // Picaso_4DGL-32PTU is a class to drive 4D Systems TFT touch screens with PICASO processor
CaptainR 20:88e137b9ea46 3 // Tested with NUCLEO L152RE development board
CaptainR 20:88e137b9ea46 4 // Copyright (C) <2016> Rihards Balass <rihards.balass@gmail.com>
CaptainR 20:88e137b9ea46 5 //
CaptainR 20:88e137b9ea46 6 // Picaso_4DGL-32PTU is free software: you can redistribute it and/or modify
CaptainR 20:88e137b9ea46 7 // it under the terms of the GNU General Public License as published by
CaptainR 20:88e137b9ea46 8 // the Free Software Foundation, either version 3 of the License, or
CaptainR 20:88e137b9ea46 9 // (at your option) any later version.
CaptainR 20:88e137b9ea46 10 //
CaptainR 20:88e137b9ea46 11 // Picaso_4DGL-32PTU is distributed in the hope that it will be useful,
CaptainR 20:88e137b9ea46 12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
CaptainR 20:88e137b9ea46 13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
CaptainR 20:88e137b9ea46 14 // GNU General Public License for more details.
CaptainR 20:88e137b9ea46 15 //
CaptainR 20:88e137b9ea46 16 // You can see GNU General Public License at <http://www.gnu.org/licenses/>.
CaptainR 20:88e137b9ea46 17 //
CaptainR 20:88e137b9ea46 18
CaptainR 20:88e137b9ea46 19 #include "mbed.h"
CaptainR 20:88e137b9ea46 20 #include "Picaso_4DGL-32PTU.h"
CaptainR 20:88e137b9ea46 21
CaptainR 20:88e137b9ea46 22 //**************************************************************************
CaptainR 20:88e137b9ea46 23 // Starts up the FAT16 disk file services and allocates a small 32 byte control block
CaptainR 20:88e137b9ea46 24 // for subsequent use. When you open a file using the “File Open” command
CaptainR 20:88e137b9ea46 25 // further 512 + 44 = 556 bytes are attached to the FAT16 file control block.
CaptainR 20:88e137b9ea46 26 // When you close a file using the “File Close” command, the 556 byte allocation
CaptainR 20:88e137b9ea46 27 // is released leaving the 32 byte file control block.
CaptainR 20:88e137b9ea46 28 // The File Mount command must be called before any other FAT16 file related
CaptainR 20:88e137b9ea46 29 // functions can be used. The control block and all FAT16 file resources are
CaptainR 20:88e137b9ea46 30 // completely released with the “File Unmount” command.
CaptainR 20:88e137b9ea46 31 //**************************************************************************
CaptainR 20:88e137b9ea46 32 bool PICASO_4DGL :: file_Mount() {
CaptainR 20:88e137b9ea46 33
CaptainR 20:88e137b9ea46 34 char command[2] = "";
CaptainR 20:88e137b9ea46 35
CaptainR 20:88e137b9ea46 36 command[0] = (FILE_MOUNT >> (8*1)) & 0xff;
CaptainR 20:88e137b9ea46 37 command[1] = (FILE_MOUNT >> (8*0)) & 0xff;
CaptainR 20:88e137b9ea46 38
CaptainR 20:88e137b9ea46 39 writeCOMMAND(command, 2);
CaptainR 20:88e137b9ea46 40 bool success = fileMountResponse();
CaptainR 20:88e137b9ea46 41 #ifdef DEBUGMODE
CaptainR 20:88e137b9ea46 42 pc.printf("\n\r DEBUG: FAT16 Mount: %s\n\r", success ? "true" : "false");
CaptainR 20:88e137b9ea46 43 #endif
CaptainR 20:88e137b9ea46 44 return success;
CaptainR 20:88e137b9ea46 45 }