You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
269 B
15 lines
269 B
4 months ago
|
#ifndef _DEBOUNCE_H__
|
||
|
#define _DEBOUNCE_H__
|
||
|
#include "stdint.h"
|
||
|
#include "stdbool.h"
|
||
|
typedef struct debouncer
|
||
|
{
|
||
|
uint16_t cnt;
|
||
|
uint16_t out;
|
||
|
} debouncer_s;
|
||
|
|
||
|
|
||
|
bool debounce(debouncer_s *obj, bool in, uint16_t up_time, uint16_t down_time);
|
||
|
|
||
|
#endif //_DEBOUNCE_H__
|