mirror of
https://github.com/RfidResearchGroup/ChameleonMini.git
synced 2026-05-12 11:20:37 -07:00
31 lines
740 B
C
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_ */
|