Shift avclan_bit_t to avclan.h

This commit is contained in:
Allen Hill
2026-07-06 13:55:13 -07:00
parent a0c6601cda
commit 1c0124edcc
6 changed files with 62 additions and 79 deletions
+34 -36
View File
@@ -3,54 +3,52 @@
#pragma once
#ifdef __cplusplus
#include <cstdint>
#define AVCLAN_ENUM_CLASS enum class
#else
#include <stdint.h>
#define AVCLAN_ENUM_CLASS enum
#endif
#include <stdint.h>
#ifdef __cplusplus
#define AVCLAN_ENUM_CLASS class
namespace avclan::detail {
struct Error {
#else
#define AVCLAN_ENUM_CLASS
#endif
// Error enums are ordered such that a lower numeric value corresponds to
// more progress/success before an error occured, with 0 being no errors
AVCLAN_ENUM_CLASS Read : uint8_t {
BAD_DATA_PARITY = 0x01,
BAD_LENGTH_RANGE,
BAD_LENGTH_PARITY,
BAD_PERIPHERAL_PARITY,
BAD_CONTROLLER_PARITY,
BAD_CONTROL_PARITY,
BAD_PARITY, // non-specific bad parity
STARTBIT_TOO_SHORT,
STARTBIT_TOO_LONG,
BAD_STARTBIT,
}
// #ifndef __cplusplus
// Read
// #endif
;
enum AVCLAN_ENUM_CLASS Read : uint8_t {
BAD_DATA_PARITY = 0x01,
BAD_LENGTH_RANGE,
BAD_LENGTH_PARITY,
BAD_PERIPHERAL_PARITY,
BAD_CONTROLLER_PARITY,
BAD_CONTROL_PARITY,
BAD_PARITY, // non-specific bad parity
STARTBIT_TOO_SHORT,
STARTBIT_TOO_LONG,
BAD_STARTBIT,
};
AVCLAN_ENUM_CLASS Send : uint8_t {
NAK_DATA = 0x01,
NAK_MESSAGE_LENGTH,
NAK_CONTROL,
NAK_ADDRESS,
NAK, // non-specific NAK
BUSY,
MUTED,
}
// #ifndef __cplusplus
// Send
// #endif
;
enum AVCLAN_ENUM_CLASS Send : uint8_t {
NAK_DATA = 0x01,
NAK_MESSAGE_LENGTH,
NAK_CONTROL,
NAK_ADDRESS,
NAK, // non-specific NAK
BUSY,
MUTED,
};
#ifdef __cplusplus
};
#endif
enum AVCLAN_ENUM_CLASS Bit : uint8_t {
bit_zero = 0x00,
bit_one = 0x01,
bit_start = 0x10
};
#ifdef __cplusplus
} // namespace avclan::detail
#endif