Keypad Input

Keypad input provides a light and configurable wrapper around lvgl input device driver - specifically designed for use with a keypad, which is typically a matrix of buttons, typically containing buttons such as LEFT, RIGHT, UP, DOWN, ENTER, ESCAPE, etc.

API Reference

Header File

Classes

class KeypadInput : public espp::BaseComponent

Light wrapper around LVGL input device driver, specifically designed for keypads.

Public Functions

inline explicit KeypadInput(const Config &config)

Initialize and register the input drivers associated with the keypad.

Parameters

config – Configuration structure for the KeypadInput.

inline ~KeypadInput()

Unregister the input drivers associated with the Keypad.

inline lv_indev_t *get_input_device()

Get the input device driver associated with the keypad.

Returns

The input device driver associated with the keypad.

inline const std::string &get_name() const

Get the name of the component

Note

This is the tag of the logger

Returns

A const reference to the name of the component

inline void set_log_tag(const std::string_view &tag)

Set the tag for the logger

Parameters

tag – The tag to use for the logger

inline espp::Logger::Verbosity get_log_level() const

Get the log level for the logger

Returns

The verbosity level of the logger

inline void set_log_level(espp::Logger::Verbosity level)

Set the log level for the logger

Parameters

level – The verbosity level to use for the logger

inline void set_log_verbosity(espp::Logger::Verbosity level)

Set the log verbosity for the logger

See also

set_log_level

Note

This is a convenience method that calls set_log_level

Parameters

level – The verbosity level to use for the logger

inline espp::Logger::Verbosity get_log_verbosity() const

Get the log verbosity for the logger

See also

get_log_level

Note

This is a convenience method that calls get_log_level

Returns

The verbosity level of the logger

inline void set_log_rate_limit(std::chrono::duration<float> rate_limit)

Set the rate limit for the logger

Note

Only calls to the logger that have _rate_limit suffix will be rate limited

Parameters

rate_limit – The rate limit to use for the logger

struct Config

Configuration structure, containing the read function for the keypad itself.

Public Members

read_fn read

Input function for the keypad.

Logger::Verbosity log_level = {Logger::Verbosity::WARN}

Log verbosity for the input driver.