Files
KaOs d270131062 RevE-light development version
WARNING: The files in this commit are our current development version. The hardware and software is not functional yet - so do not use it. We will not answer any support inquiry regarding this version at the moment.
2017-11-23 14:40:40 +00:00

31 lines
740 B
C

/*
* Map.h
*
* Created on: 07.12.2014
* Author: sk
*/
#ifndef MAP_H_
#define MAP_H_
#include <stdint.h>
#include <stdbool.h>
#include <avr/pgmspace.h>
#define MAP_TEXT_BUF_SIZE 32
#define MAP_MAX_TEXT_SIZE (MAP_TEXT_BUF_SIZE - 1)
typedef uint8_t MapIdType;
typedef const char* MapTextPtrType;
const typedef struct {
MapIdType Id;
const char Text[MAP_TEXT_BUF_SIZE];
} MapEntryType;
bool MapIdToText(const MapEntryType* MapPtr, uint8_t MapSize, MapIdType Id, char* Text, uint16_t MaxBufferSize);
bool MapTextToId(const MapEntryType* MapPtr, uint8_t MapSize, MapTextPtrType Text, MapIdType* IdPtr);
void MapToString(const MapEntryType* MapPtr, uint8_t MapSize, char* String, uint16_t MaxBufferSize);
#endif /* MAP_H_ */