feat: initial

This commit is contained in:
2025-08-11 10:19:36 +03:00
parent 3370f57c08
commit 9f03e866c1
4 changed files with 55 additions and 3 deletions

View File

@@ -1,3 +1 @@
# zh_avr_common
AVR system definitions.
# AVR system definitions

19
include/avr_bit_defs.h Normal file
View File

@@ -0,0 +1,19 @@
#pragma once
#ifdef __cplusplus
extern "C"
{
#endif
#define AVR_BIT7 0x80
#define AVR_BIT6 0x40
#define AVR_BIT5 0x20
#define AVR_BIT4 0x10
#define AVR_BIT3 0x08
#define AVR_BIT2 0x04
#define AVR_BIT1 0x02
#define AVR_BIT0 0x01
#ifdef __cplusplus
}
#endif

34
include/avr_err.h Normal file
View File

@@ -0,0 +1,34 @@
#pragma once
#ifdef __cplusplus
extern "C"
{
#endif
#define ZH_ERROR_CHECK(cond, err, ...) \
if (!(cond)) \
{ \
return err; \
}
typedef enum
{
AVR_FAIL = -1,
AVR_OK,
AVR_ERR_NO_MEM,
AVR_ERR_INVALID_ARG,
AVR_ERR_INVALID_STATE,
AVR_ERR_INVALID_SIZE,
AVR_ERR_NOT_FOUND,
AVR_ERR_NOT_SUPPORTED,
AVR_ERR_TIMEOUT,
AVR_ERR_INVALID_RESPONSE,
AVR_ERR_INVALID_CRC,
AVR_ERR_INVALID_VERSION,
AVR_ERR_NOT_FINISHED,
AVR_ERR_NOT_ALLOWED
} avr_err_t;
#ifdef __cplusplus
}
#endif

1
version.txt Normal file
View File

@@ -0,0 +1 @@
1.0.0