2023-08-24 09:30:29 +00:00
|
|
|
|
|
|
|
#ifndef TREZORHAL_HAPTIC_H
|
|
|
|
#define TREZORHAL_HAPTIC_H
|
|
|
|
|
2024-01-10 13:56:41 +00:00
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
|
2023-08-24 09:30:29 +00:00
|
|
|
typedef enum {
|
|
|
|
HAPTIC_BUTTON_PRESS = 0,
|
|
|
|
HAPTIC_ALERT = 1,
|
|
|
|
HAPTIC_HOLD_TO_CONFIRM = 2,
|
|
|
|
} haptic_effect_t;
|
|
|
|
|
|
|
|
// Initialize haptic driver
|
|
|
|
void haptic_init(void);
|
|
|
|
|
|
|
|
// Calibrate haptic driver
|
|
|
|
void haptic_calibrate(void);
|
|
|
|
|
2024-01-10 13:56:41 +00:00
|
|
|
// Test haptic driver, plays a maximum amplitude for the given duration
|
|
|
|
bool haptic_test(uint16_t duration_ms);
|
|
|
|
|
2023-08-24 09:30:29 +00:00
|
|
|
// Play haptic effect
|
|
|
|
void haptic_play(haptic_effect_t effect);
|
|
|
|
|
|
|
|
#endif
|