跳转到主要内容

ButtonController

platform/driver/button/ButtonController.hpp

Interface for sampling external key events.

Public Functions

virtual voidinit() =0
Initializes button controller.
virtual voidreset()
Resets button controller.
virtual boolsample(uint8_t & key) =0
Sample external key events.
virtual ~ButtonController()
Finalizes an instance of the ButtonController class.

Public Functions Documentation

init

virtual void init()=0

Initializes button controller.

reset

virtual void reset()

Resets button controller.

Does nothing in the default implementation.

sample

virtual bool sample(uint8_t &key)

Sample external key events.

Parameters:
keyOutput parameter that will be set to the key value if a keypress was detected.
Returns:

True if a keypress was detected and the "key" parameter is set to a value.

~ButtonController

Finalizes an instance of the ButtonController class.