reflow-oven-control-sw/stm-firmware/include/reflow-controller/button.h

41 lines
1.2 KiB
C
Raw Normal View History

/* Reflow Oven Controller
*
* Copyright (C) 2020 Mario Hüttel <mario.huettel@gmx.net>
*
* This file is part of the Reflow Oven Controller Project.
*
* The reflow oven controller is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* The Reflow Oven Control Firmware is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the reflow oven controller project.
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __BUTTON_H__
#define __BUTTON_H__
2020-02-23 21:48:52 +01:00
#define BUTTON_PORT GPIOD
#define BUTTON_RCC_MASK RCC_AHB1ENR_GPIODEN
#define BUTTON_PIN 4
#define BUTTON_SHORT_ON_TIME_MS 50
#define BUTTON_LONG_ON_TIME_MS 800
2020-02-25 21:01:34 +01:00
enum button_state {BUTTON_IDLE = 0, BUTTON_SHORT_RELEASED, BUTTON_LONG_RELEASED, BUTTON_SHORT, BUTTON_LONG};
2020-02-23 21:48:52 +01:00
void button_init();
enum button_state button_read_event();
void button_deinit();
#endif /* __BUTTON_H__ */