Files

31 lines
746 B
C
Raw Permalink Normal View History

2016-10-07 23:44:50 +02:00
/*
* 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;
2019-11-15 10:21:40 +01:00
typedef const char *MapTextPtrType;
2016-10-07 23:44:50 +02:00
const typedef struct {
2017-11-07 15:53:23 +01:00
MapIdType Id;
const char Text[MAP_TEXT_BUF_SIZE];
2016-10-07 23:44:50 +02:00
} MapEntryType;
2019-11-15 10:21:40 +01:00
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);
2016-10-07 23:44:50 +02:00
#endif /* MAP_H_ */