2019-04-12 13:14:25 -07:00
|
|
|
/*
|
|
|
|
* mc33972.h
|
|
|
|
*
|
|
|
|
* Multiple Switch Detection Interface with Suppressed Wake-up
|
|
|
|
*
|
|
|
|
* @date Apr 07, 2019
|
|
|
|
* @author Andrey Gusakov <dron0gus@gmail.com>, (c) 2019
|
|
|
|
*/
|
|
|
|
|
2020-02-10 06:29:11 -08:00
|
|
|
#pragma once
|
2019-04-12 13:14:25 -07:00
|
|
|
|
|
|
|
#include <hal.h>
|
2019-04-13 07:58:52 -07:00
|
|
|
#include "efifeatures.h"
|
|
|
|
|
2019-04-12 13:14:25 -07:00
|
|
|
#define MC33972_INPUTS 22
|
|
|
|
|
|
|
|
/* DOTO: add irq support */
|
|
|
|
#define MC33972_POLL_INTERVAL_MS 100
|
|
|
|
|
|
|
|
struct mc33972_config {
|
2021-02-05 18:37:33 -08:00
|
|
|
#if HAL_USE_SPI
|
2019-04-12 13:14:25 -07:00
|
|
|
SPIDriver *spi_bus;
|
2019-04-20 20:39:06 -07:00
|
|
|
SPIConfig spi_config;
|
2021-02-05 18:37:33 -08:00
|
|
|
#endif
|
2019-04-12 13:14:25 -07:00
|
|
|
};
|
|
|
|
|
2021-01-06 15:29:47 -08:00
|
|
|
int mc33972_add(brain_pin_e base, unsigned int index, const struct mc33972_config *cfg);
|