M5UnitUnified 0.1.2 git rev:98f967c
Loading...
Searching...
No Matches
adapter_gpio.hpp File Reference

Adapters to treat M5HAL and GPIO in the same way. More...

#include "identify_functions.hpp"
#include "types.hpp"
#include "adapter_base.hpp"

Go to the source code of this file.

Classes

class  m5::unit::AdapterGPIOBase
 
class  m5::unit::AdapterGPIOBase::GPIOImpl
 

Namespaces

namespace  m5
 Top level namespace of M5stack.
 

Functions

uint8_t m5::unit::gpio::calculate_rmt_clk_div (const uint32_t apb_freq_hz, const uint32_t tick_ns)
 Calculate clk_div from desired tick time (nanoseconds)
 
uint32_t m5::unit::gpio::calculate_rmt_resolution_hz (const uint32_t apb_freq_hz, const uint32_t tick_ns)
 Calculate resolution from desired tick time.
 

Detailed Description

Adapters to treat M5HAL and GPIO in the same way.

Note
Currently handles GPIO directly, but will handle via M5HAL in the future

Function Documentation

◆ calculate_rmt_clk_div()

uint8_t m5::unit::gpio::calculate_rmt_clk_div ( const uint32_t apb_freq_hz,
const uint32_t tick_ns )

Calculate clk_div from desired tick time (nanoseconds)

Parameters
apb_freq_hzCurrent APB clock (Hz)
tick_nsDesired tick time (ns)
Returns
clk_div for RMT v1

◆ calculate_rmt_resolution_hz()

uint32_t m5::unit::gpio::calculate_rmt_resolution_hz ( const uint32_t apb_freq_hz,
const uint32_t tick_ns )

Calculate resolution from desired tick time.

Parameters
apb_freq_hzCurrent APB clock (Hz)
tick_nsDesired tick time (ns)
Returns
resoution for RMT v2