ADC debugged and functional now

Added Version interface

Added DisplayDevice to create an independent bridge between display app and specific display driver

git-svn-id: https://svn.vbchaos.nl/svn/hsb/trunk@228 05563f52-14a8-4384-a975-3d1654cca0fa
This commit is contained in:
mmi
2017-10-04 09:06:16 +00:00
parent 802e9c64ca
commit c613e64e8a
24 changed files with 1147 additions and 231 deletions

View File

@@ -34,26 +34,40 @@
#include <stdbool.h>
#include "FreeRTOS.h"
#include "semphr.h"
#include "task.h"
#include "stm32f10x.h"
#include "DisplayDevice.h"
// -----------------------------------------------------------------------------
// Constant and macro definitions
// -----------------------------------------------------------------------------
#define DISPLAY_MAX_ROWS (6)
#define DISPLAY_MAX_COLUMNS (25)
// -----------------------------------------------------------------------------
// Type definitions.
// -----------------------------------------------------------------------------
struct DisplayCharacter
{
char character;
bool isUpdated;
};
struct Display
{
void* displayDriver; // USE WITH CAUTION - VOID POINTER
struct DisplayDevice* displayDevice;
TaskHandle_t taskHandle;
int TaskPriority;
uint16_t stackSize;
bool runTask;
SemaphoreHandle_t displayShadowAccessSemaphore;
struct DisplayCharacter displayShadow[DISPLAY_MAX_ROWS][DISPLAY_MAX_COLUMNS];
int maxCharactersPerTransmit;
};
// -----------------------------------------------------------------------------
@@ -65,11 +79,14 @@ struct Display
* Constructor for a display application
*
* @param self The display object to initialize
* @param displayDriver The specific display driver that the
* @param displayDevice The specific display device that the
* application will use
* This is a constant and will not be matter
* to changes after initialisation. Only
* via destruct and a new construct
* @param TaskPriority Priority for the display Task
* 0 is highest (most important)
* @param stackSize Number of words (not bytes) for the
* display task
* @param maxNumberOfCharacters Max number of characters to send within
* one transfer action
*
* @return ErrorStatus SUCCESS if initialisation was OK
* ERROR otherwise
@@ -77,7 +94,7 @@ struct Display
* @todo
* -----------------------------------------------------------------------------
*/
extern ErrorStatus Display_construct(struct Display* self, void* displayDriver);
extern ErrorStatus Display_construct(struct Display* self, struct DisplayDevice* displayDevice, int TaskPriority, uint16_t stackSize, int maxCharactersPerTransmit);
/** ----------------------------------------------------------------------------
@@ -109,6 +126,54 @@ extern void Display_destruct(struct Display* self);
extern ErrorStatus Display_clearScreen(struct Display* self);
/** ----------------------------------------------------------------------------
* Display_setState
* Sets the display state
*
* @param self The display information to use
* @param state The state to set
*
* @return ErrorStatus SUCCESS if clearing display was OK
* ERROR otherwise
*
* @todo
* -----------------------------------------------------------------------------
*/
extern ErrorStatus Display_setState(struct Display* self, DisplayDevice_functionalState state);
/** ----------------------------------------------------------------------------
* Display_setBrightness
* Sets the display brightness
*
* @param self The display information to use
* @param brightness The brightness to set
*
* @return ErrorStatus SUCCESS if clearing display was OK
* ERROR otherwise
*
* @todo
* -----------------------------------------------------------------------------
*/
extern ErrorStatus Display_setBrightness(struct Display* self, size_t brightness);
/** ----------------------------------------------------------------------------
* Display_setContrast
* Sets the display contrast
*
* @param self The display information to use
* @param state The contrast to set
*
* @return ErrorStatus SUCCESS if clearing display was OK
* ERROR otherwise
*
* @todo
* -----------------------------------------------------------------------------
*/
extern ErrorStatus Display_setContrast(struct Display* self, size_t contrast);
/** ----------------------------------------------------------------------------
* Display_write
* Description of function
@@ -130,6 +195,6 @@ extern ErrorStatus Display_clearScreen(struct Display* self);
* @todo
* -----------------------------------------------------------------------------
*/
extern ErrorStatus Display_write(struct Display* self, const char* buffer, unsigned int length, unsigned int row, unsigned int column);
extern ErrorStatus Display_write(struct Display* self, const char* buffer, unsigned int length, size_t row, size_t column);
#endif /* DISPLAY_H_ */