10#ifndef M5_UNIT_RF433_RMT_ITEM_TYPES_HPP
11#define M5_UNIT_RF433_RMT_ITEM_TYPES_HPP
13#include <M5UnitComponent.hpp>
14#if defined(ESP_PLATFORM)
15#include <soc/soc_caps.h>
23constexpr m5::unit::gpio::m5_rmt_item_t rmt_item_one{{800, 1, 200, 0}};
24constexpr m5::unit::gpio::m5_rmt_item_t rmt_item_zero{{200, 1, 800, 0}};
25constexpr m5::unit::gpio::m5_rmt_item_t rmt_sof_0{{4868, 1, 2469, 0}};
26constexpr m5::unit::gpio::m5_rmt_item_t rmt_sof_1{{1647, 1, 315, 0}};
27constexpr m5::unit::gpio::m5_rmt_item_t rmt_preamble{{500, 1, 500, 0}};
45#if defined(M5_UNIT_UNIFIED_USING_RMT_V2)
47#elif defined(SOC_RMT_SUPPORT_RX_PINGPONG) && SOC_RMT_SUPPORT_RX_PINGPONG
49#elif defined(SOC_RMT_RX_CANDIDATES_PER_GROUP)
51constexpr uint8_t
RmtRxMemBlocks = (SOC_RMT_RX_CANDIDATES_PER_GROUP < 6) ? SOC_RMT_RX_CANDIDATES_PER_GROUP : 6;
69#if defined(M5_UNIT_UNIFIED_USING_RMT_V2)
71#elif defined(SOC_RMT_MEM_WORDS_PER_CHANNEL)
95#if defined(M5_UNIT_UNIFIED_USING_RMT_V2)
97#elif defined(SOC_RMT_SUPPORT_RX_PINGPONG) && SOC_RMT_SUPPORT_RX_PINGPONG
102 static_cast<uint8_t
>((
RmtRxMaxItems - 1 ) / 8 - ProtocolOverhead);
113 return (1 + (
ProtocolOverhead + payload_size) * 8) *
sizeof(m5::unit::gpio::m5_rmt_item_t) +
124item_container_type encodeManchester(
const uint8_t* data,
const uint32_t len,
const bool MSB =
true);
135uint16_t decodeManchester(uint8_t* buf,
const uint16_t buf_size,
const m5::unit::gpio::m5_rmt_item_t* data,
136 const uint32_t num,
const bool MSB =
true);
Top level namespace of M5Stack.
uint8_t communication_identifier_t
Communication identifier (0-255)
Definition rmt_item_types.hpp:32
constexpr uint8_t MaxPayloadSize
Theoretical maximum payload size in bytes for the current platform.
Definition rmt_item_types.hpp:94
constexpr uint32_t calculateRingBufferSize(const uint32_t payload_size)
Calculate the minimum ring buffer size required to receive the given payload size.
Definition rmt_item_types.hpp:110
std::vector< uint8_t > container_type
Container.
Definition rmt_item_types.hpp:30
constexpr uint8_t RmtRxMemBlocks
RMT memory blocks used by the RX channel per platform.
Definition rmt_item_types.hpp:53
constexpr uint16_t RmtRxMaxItems
Maximum RMT items receivable in a single frame per platform.
Definition rmt_item_types.hpp:75
constexpr uint8_t ProtocolOverhead
Protocol overhead in bytes: CRC8(1) + ID(1) + Count(1) + Length(1) = 4.
Definition rmt_item_types.hpp:35
std::vector< gpio::m5_rmt_item_t > item_container_type
Item container.
Definition rmt_item_types.hpp:31