4D systems Picaso uLCD 32PTU touch display library
Diff: Picaso_4DGL-32PTU_File.cpp
- Revision:
- 20:88e137b9ea46
- Child:
- 21:ea68a8a3cea4
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Picaso_4DGL-32PTU_File.cpp Mon Sep 26 10:51:02 2016 +0000 @@ -0,0 +1,45 @@ +// +// Picaso_4DGL-32PTU is a class to drive 4D Systems TFT touch screens with PICASO processor +// Tested with NUCLEO L152RE development board +// Copyright (C) <2016> Rihards Balass <rihards.balass@gmail.com> +// +// Picaso_4DGL-32PTU is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Picaso_4DGL-32PTU is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You can see GNU General Public License at <http://www.gnu.org/licenses/>. +// + +#include "mbed.h" +#include "Picaso_4DGL-32PTU.h" + +//************************************************************************** +// Starts up the FAT16 disk file services and allocates a small 32 byte control block +// for subsequent use. When you open a file using the “File Open” command +// further 512 + 44 = 556 bytes are attached to the FAT16 file control block. +// When you close a file using the “File Close” command, the 556 byte allocation +// is released leaving the 32 byte file control block. +// The File Mount command must be called before any other FAT16 file related +// functions can be used. The control block and all FAT16 file resources are +// completely released with the “File Unmount” command. +//************************************************************************** +bool PICASO_4DGL :: file_Mount() { + + char command[2] = ""; + + command[0] = (FILE_MOUNT >> (8*1)) & 0xff; + command[1] = (FILE_MOUNT >> (8*0)) & 0xff; + + writeCOMMAND(command, 2); + bool success = fileMountResponse(); +#ifdef DEBUGMODE + pc.printf("\n\r DEBUG: FAT16 Mount: %s\n\r", success ? "true" : "false"); +#endif + return success; +}