M5Unit-RF433 0.0.1 git rev:a9e15af
Loading...
Searching...
No Matches
rmt_item_types.hpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2025 M5Stack Technology CO LTD
3 *
4 * SPDX-License-Identifier: MIT
5 */
10#ifndef M5_UNIT_RF433_RNT_ITEM_TYPES_HPP
11#define M5_UNIT_RF433_RNT_ITEM_TYPES_HPP
12
13#include <M5UnitComponent.hpp>
14
15namespace m5 {
16namespace unit {
17namespace rf433 {
18
20constexpr m5::unit::gpio::m5_rmt_item_t rmt_item_one{{800, 1, 200, 0}}; // 1
21constexpr m5::unit::gpio::m5_rmt_item_t rmt_item_zero{{200, 1, 800, 0}}; // 0
22constexpr m5::unit::gpio::m5_rmt_item_t rmt_sof_0{{4868, 1, 2469, 0}}; // Frame start 0
23constexpr m5::unit::gpio::m5_rmt_item_t rmt_sof_1{{1647, 1, 315, 0}}; // Frame start 1
24constexpr m5::unit::gpio::m5_rmt_item_t rmt_preamble{{500, 1, 500, 0}}; // preamble
26
27using container_type = std::vector<uint8_t>;
28using item_container_type = std::vector<gpio::m5_rmt_item_t>;
30
33using Protocol = uint8_t;
37
45item_container_type encodeManchester(const uint8_t* data, const uint32_t len, const bool MSB = true);
46
56uint16_t decodeManchester(uint8_t* buf, const uint16_t buf_size, const m5::unit::gpio::m5_rmt_item_t* data,
57 const uint32_t num, const bool MSB = true);
58
59} // namespace rf433
60} // namespace unit
61} // namespace m5
62#endif
Top level namespace of M5stack.
Unit-related namespace.
constexpr Protocol ProtocolIncludeSendCount
Include send count.
Definition rmt_item_types.hpp:34
constexpr Protocol ProtocolIncludeIdentifier
Include identifier.
Definition rmt_item_types.hpp:35
std::vector< uint8_t > container_type
Container.
Definition rmt_item_types.hpp:27
uint32_t communication_identifier_t
Communication identifier.
Definition rmt_item_types.hpp:29
uint8_t Protocol
Protocol type.
Definition rmt_item_types.hpp:33
std::vector< gpio::m5_rmt_item_t > item_container_type
Item container.
Definition rmt_item_types.hpp:28