skl-tunnel/radio/include/radio_interrupts.hpp

40 lines
833 B
C++

//
// Created by erki on 15.07.22.
//
#ifndef SKL_TUNNEL_RADIO_INTERRUPTS_HPP
#define SKL_TUNNEL_RADIO_INTERRUPTS_HPP
#include <cstdint>
namespace radio
{
enum class Interrupts : std::uint8_t
{
PLL_LOCK = (1 << 0),
PLL_UNLOCK = (1 << 1),
RX_START = (1 << 2),
TRX_END = (1 << 3),
CCA_ED_DONE = (1 << 4),
AMI = (1 << 5),
TRX_UR = (1 << 6),
BAT_LOW = (1 << 7)
};
inline Interrupts operator|(const Interrupts& lhs, const Interrupts& rhs)
{
using T = std::underlying_type_t<Interrupts>;
return static_cast<Interrupts>(static_cast<T>(lhs) | static_cast<T>(rhs));
}
inline Interrupts operator&(const Interrupts& lhs, const Interrupts& rhs)
{
using T = std::underlying_type_t<Interrupts>;
return static_cast<Interrupts>(static_cast<T>(lhs) & static_cast<T>(rhs));
}
}
#endif //SKL_TUNNEL_RADIO_INTERRUPTS_HPP