rusefi-1/firmware/hw_layer/drivers/gpio/mc33810.h

50 lines
865 B
C

/*
* mc33810.h
*
* Automotive Engine Control IC
*
* @date Dec 29, 2018
* @author Andrey Belomutskiy, (c) 2012-2018
*
* @date Jan 03, 2020
* @author Andrey Gusakov <dron0gus@gmail.com>, (c) 2020
*/
#ifndef HW_LAYER_MC33810_H_
#define HW_LAYER_MC33810_H_
#include "efifeatures.h"
#include <hal.h>
#define MC33810_OUTPUTS 8
#define MC33810_DIRECT_OUTPUTS 8
/* DOTO: add irq support */
#define MC33810_POLL_INTERVAL_MS 100
struct mc33810_config {
SPIDriver *spi_bus;
SPIConfig spi_config;
struct {
ioportid_t port;
uint_fast8_t pad;
} direct_io[MC33810_DIRECT_OUTPUTS];
struct {
ioportid_t port;
uint_fast8_t pad;
} en;
};
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
int mc33810_add(unsigned int index, const struct mc33810_config *cfg);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* HW_LAYER_MC33810_H_ */