Loading...
Searching...
No Matches
at24cxxx_defines.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2019 Otto-von-Guericke-Universität Magdeburg
3 *
4 * This file is subject to the terms and conditions of the GNU Lesser
5 * General Public License v2.1. See the file LICENSE in the top level
6 * directory for more details.
7 */
8
24#ifndef AT24CXXX_DEFINES_H
25#define AT24CXXX_DEFINES_H
26
27#include "kernel_defines.h"
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
36#define AT24CXXX_POLL_DELAY_US (1000UL)
40#define AT24CXXX_CLEAR_BYTE (0x00)
51#define AT24CXXX_DEF_DEV_ADDR (0x50)
52
60#define AT24C01A_EEPROM_SIZE (128U)
64#define AT24C01A_PAGE_SIZE (8U)
68#define AT24C01A_PAGE_WRITE_DELAY_US (5000U)
72#define AT24C01A_MAX_POLLS (1 + (AT24C01A_PAGE_WRITE_DELAY_US \
73 / AT24CXXX_POLL_DELAY_US))
83#define AT24C02_EEPROM_SIZE (256U)
87#define AT24C02_PAGE_SIZE (8U)
91#define AT24C02_PAGE_WRITE_DELAY_US (5000U)
95#define AT24C02_MAX_POLLS (1 + (AT24C02_PAGE_WRITE_DELAY_US \
96 / AT24CXXX_POLL_DELAY_US))
106#define AT24C04_EEPROM_SIZE (512U)
110#define AT24C04_PAGE_SIZE (16U)
114#define AT24C04_PAGE_WRITE_DELAY_US (5000U)
118#define AT24C04_MAX_POLLS (1 + (AT24C04_PAGE_WRITE_DELAY_US \
119 / AT24CXXX_POLL_DELAY_US))
129#define AT24C08A_EEPROM_SIZE (1024U)
133#define AT24C08A_PAGE_SIZE (16U)
137#define AT24C08A_PAGE_WRITE_DELAY_US (5000U)
141#define AT24C08A_MAX_POLLS (1 + (AT24C08A_PAGE_WRITE_DELAY_US \
142 / AT24CXXX_POLL_DELAY_US))
152#define AT24C16A_EEPROM_SIZE (2048U)
156#define AT24C16A_PAGE_SIZE (16U)
160#define AT24C16A_PAGE_WRITE_DELAY_US (5000U)
164#define AT24C16A_MAX_POLLS (1 + (AT24C16A_PAGE_WRITE_DELAY_US \
165 / AT24CXXX_POLL_DELAY_US))
175#define AT24C32_EEPROM_SIZE (4096U)
179#define AT24C32_PAGE_SIZE (32U)
183#define AT24C32_PAGE_WRITE_DELAY_US (10000U)
187#define AT24C32_MAX_POLLS (1 + (AT24C32_PAGE_WRITE_DELAY_US \
188 / AT24CXXX_POLL_DELAY_US))
198#define AT24C64_EEPROM_SIZE (8192U)
202#define AT24C64_PAGE_SIZE (32U)
206#define AT24C64_PAGE_WRITE_DELAY_US (10000U)
210#define AT24C64_MAX_POLLS (1 + (AT24C64_PAGE_WRITE_DELAY_US \
211 / AT24CXXX_POLL_DELAY_US))
221#define AT24C128_EEPROM_SIZE (16384U)
225#define AT24C128_PAGE_SIZE (64U)
229#define AT24C128_PAGE_WRITE_DELAY_US (5000U)
233#define AT24C128_MAX_POLLS (1 + (AT24C128_PAGE_WRITE_DELAY_US \
234 / AT24CXXX_POLL_DELAY_US))
244#define AT24C256_EEPROM_SIZE (32768U)
248#define AT24C256_PAGE_SIZE (64U)
252#define AT24C256_PAGE_WRITE_DELAY_US (5000U)
256#define AT24C256_MAX_POLLS (1 + (AT24C256_PAGE_WRITE_DELAY_US \
257 / AT24CXXX_POLL_DELAY_US))
267#define AT24C512_EEPROM_SIZE (65536U)
271#define AT24C512_PAGE_SIZE (128U)
275#define AT24C512_PAGE_WRITE_DELAY_US (5000U)
279#define AT24C512_MAX_POLLS (1 + (AT24C512_PAGE_WRITE_DELAY_US \
280 / AT24CXXX_POLL_DELAY_US))
290#define AT24CS04_EEPROM_SIZE (512U)
294#define AT24CS04_PAGE_SIZE (16U)
298#define AT24CS04_PAGE_WRITE_DELAY_US (5000U)
302#define AT24CS04_MAX_POLLS (1 + (AT24CS04_PAGE_WRITE_DELAY_US \
303 / AT24CXXX_POLL_DELAY_US))
313#define AT24CS08_EEPROM_SIZE (1024U)
317#define AT24CS08_PAGE_SIZE (16U)
321#define AT24CS08_PAGE_WRITE_DELAY_US (5000U)
325#define AT24CS08_MAX_POLLS (1 + (AT24CS08_PAGE_WRITE_DELAY_US \
326 / AT24CXXX_POLL_DELAY_US))
336#define AT24C1024_EEPROM_SIZE (131072U)
340#define AT24C1024_PAGE_SIZE (256U)
344#define AT24C1024_PAGE_WRITE_DELAY_US (5000U)
348#define AT24C1024_MAX_POLLS (1 + (AT24C1024_PAGE_WRITE_DELAY_US \
349 / AT24CXXX_POLL_DELAY_US))
359#define AT24MAC_EEPROM_SIZE (256U)
363#define AT24MAC_PAGE_SIZE (16U)
367#define AT24MAC_PAGE_WRITE_DELAY_US (5000U)
371#define AT24MAC_MAX_POLLS (1 + (AT24MAC_PAGE_WRITE_DELAY_US \
372 / AT24CXXX_POLL_DELAY_US))
382#define M24C01_EEPROM_SIZE (128U)
386#define M24C01_PAGE_SIZE (16U)
390#define M24C01_PAGE_WRITE_DELAY_US (5000U)
394#define M24C01_MAX_POLLS (1 + (M24C01_PAGE_WRITE_DELAY_US \
395 / AT24CXXX_POLL_DELAY_US))
402#if IS_USED(MODULE_AT24C1024)
403#define AT24CXXX_EEPROM_SIZE (AT24C1024_EEPROM_SIZE)
404#define AT24CXXX_PAGE_SIZE (AT24C1024_PAGE_SIZE)
405#define AT24CXXX_MAX_POLLS (AT24C1024_MAX_POLLS)
406#elif IS_USED(MODULE_AT24C512)
407#define AT24CXXX_EEPROM_SIZE (AT24C512_EEPROM_SIZE)
408#define AT24CXXX_PAGE_SIZE (AT24C512_PAGE_SIZE)
409#define AT24CXXX_MAX_POLLS (AT24C512_MAX_POLLS)
410#elif IS_USED(MODULE_AT24C256)
411#define AT24CXXX_EEPROM_SIZE (AT24C256_EEPROM_SIZE)
412#define AT24CXXX_PAGE_SIZE (AT24C256_PAGE_SIZE)
413#define AT24CXXX_MAX_POLLS (AT24C256_MAX_POLLS)
414#elif IS_USED(MODULE_AT24C128)
415#define AT24CXXX_EEPROM_SIZE (AT24C128_EEPROM_SIZE)
416#define AT24CXXX_PAGE_SIZE (AT24C128_PAGE_SIZE)
417#define AT24CXXX_MAX_POLLS (AT24C128_MAX_POLLS)
418#elif IS_USED(MODULE_AT24C64)
419#define AT24CXXX_EEPROM_SIZE (AT24C64_EEPROM_SIZE)
420#define AT24CXXX_PAGE_SIZE (AT24C64_PAGE_SIZE)
421#define AT24CXXX_MAX_POLLS (AT24C64_MAX_POLLS)
422#elif IS_USED(MODULE_AT24C32)
423#define AT24CXXX_EEPROM_SIZE (AT24C32_EEPROM_SIZE)
424#define AT24CXXX_PAGE_SIZE (AT24C32_PAGE_SIZE)
425#define AT24CXXX_MAX_POLLS (AT24C32_MAX_POLLS)
426#elif IS_USED(MODULE_AT24C16A)
427#define AT24CXXX_EEPROM_SIZE (AT24C16A_EEPROM_SIZE)
428#define AT24CXXX_PAGE_SIZE (AT24C16A_PAGE_SIZE)
429#define AT24CXXX_MAX_POLLS (AT24C16A_MAX_POLLS)
430#elif IS_USED(MODULE_AT24C08A)
431#define AT24CXXX_EEPROM_SIZE (AT24C08A_EEPROM_SIZE)
432#define AT24CXXX_PAGE_SIZE (AT24C08A_PAGE_SIZE)
433#define AT24CXXX_MAX_POLLS (AT24C08A_MAX_POLLS)
434#elif IS_USED(MODULE_AT24C04)
435#define AT24CXXX_EEPROM_SIZE (AT24C04_EEPROM_SIZE)
436#define AT24CXXX_PAGE_SIZE (AT24C04_PAGE_SIZE)
437#define AT24CXXX_MAX_POLLS (AT24C04_MAX_POLLS)
438#elif IS_USED(MODULE_AT24C02)
439#define AT24CXXX_EEPROM_SIZE (AT24C02_EEPROM_SIZE)
440#define AT24CXXX_PAGE_SIZE (AT24C02_PAGE_SIZE)
441#define AT24CXXX_MAX_POLLS (AT24C02_MAX_POLLS)
442#elif IS_USED(MODULE_AT24C01A)
443#define AT24CXXX_EEPROM_SIZE (AT24C01A_EEPROM_SIZE)
444#define AT24CXXX_PAGE_SIZE (AT24C01A_PAGE_SIZE)
445#define AT24CXXX_MAX_POLLS (AT24C01A_MAX_POLLS)
446#elif IS_USED(MODULE_AT24CS04)
447#define AT24CXXX_EEPROM_SIZE (AT24CS04_EEPROM_SIZE)
448#define AT24CXXX_PAGE_SIZE (AT24CS04_PAGE_SIZE)
449#define AT24CXXX_MAX_POLLS (AT24CS04_MAX_POLLS)
450#elif IS_USED(MODULE_AT24CS08)
451#define AT24CXXX_EEPROM_SIZE (AT24CS08_EEPROM_SIZE)
452#define AT24CXXX_PAGE_SIZE (AT24CS08_PAGE_SIZE)
453#define AT24CXXX_MAX_POLLS (AT24CS08_MAX_POLLS)
454#elif IS_USED(MODULE_AT24MAC)
455#define AT24CXXX_EEPROM_SIZE (AT24MAC_EEPROM_SIZE)
456#define AT24CXXX_PAGE_SIZE (AT24MAC_PAGE_SIZE)
457#define AT24CXXX_MAX_POLLS (AT24MAC_MAX_POLLS)
458#elif IS_USED(MODULE_M24C01)
459#define AT24CXXX_EEPROM_SIZE (M24C01_EEPROM_SIZE)
460#define AT24CXXX_PAGE_SIZE (M24C01_PAGE_SIZE)
461#define AT24CXXX_MAX_POLLS (M24C01_MAX_POLLS)
462#else /* minimal */
463#define AT24CXXX_EEPROM_SIZE (128U)
464#define AT24CXXX_PAGE_SIZE (4U)
465#define AT24CXXX_MAX_POLLS (6U)
466#endif
469#ifdef __cplusplus
470}
471#endif
472
473#endif /* AT24CXXX_DEFINES_H */
Common macros and compiler attributes/pragmas configuration.