2014-08-29 07:52:33 -07:00
|
|
|
/**
|
|
|
|
* @file io_pins.h
|
|
|
|
*
|
|
|
|
* @date Jan 24, 2013
|
2015-01-12 15:04:10 -08:00
|
|
|
* @author Andrey Belomutskiy, (c) 2012-2015
|
2014-08-29 07:52:33 -07:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef STATUS_LEDS_H_
|
|
|
|
#define STATUS_LEDS_H_
|
|
|
|
|
2014-10-07 05:02:58 -07:00
|
|
|
#include "rusefi_enums.h"
|
2014-08-29 07:52:33 -07:00
|
|
|
|
|
|
|
#define GPIO_NULL NULL
|
|
|
|
|
2014-11-22 14:03:07 -08:00
|
|
|
#define NAMED_PIN_COUNT 24
|
|
|
|
|
2015-01-13 08:05:47 -08:00
|
|
|
typedef enum {
|
|
|
|
INJECTOR_1,
|
|
|
|
INJECTOR_2,
|
|
|
|
INJECTOR_3,
|
|
|
|
INJECTOR_4,
|
|
|
|
INJECTOR_5,
|
|
|
|
INJECTOR_6,
|
|
|
|
INJECTOR_7,
|
|
|
|
INJECTOR_8,
|
|
|
|
INJECTOR_9_,
|
|
|
|
INJECTOR_10,
|
|
|
|
INJECTOR_11,
|
|
|
|
INJECTOR_12,
|
|
|
|
|
|
|
|
INJECTOR_NONE,
|
|
|
|
} injector_channel_e;
|
|
|
|
|
2014-08-29 07:52:33 -07:00
|
|
|
/**
|
|
|
|
* Logical pins. See brain_pin_e for physical pins.
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
SPARKOUT_1_OUTPUT,
|
|
|
|
SPARKOUT_2_OUTPUT,
|
|
|
|
SPARKOUT_3_OUTPUT,
|
|
|
|
SPARKOUT_4_OUTPUT,
|
|
|
|
SPARKOUT_5_OUTPUT,
|
|
|
|
SPARKOUT_6_OUTPUT,
|
|
|
|
SPARKOUT_7_OUTPUT,
|
|
|
|
SPARKOUT_8_OUTPUT,
|
|
|
|
SPARKOUT_9_OUTPUT,
|
|
|
|
SPARKOUT_10_OUTPUT,
|
|
|
|
SPARKOUT_11_OUTPUT,
|
|
|
|
SPARKOUT_12_OUTPUT,
|
|
|
|
|
|
|
|
INJECTOR_1_OUTPUT,
|
|
|
|
INJECTOR_2_OUTPUT,
|
|
|
|
INJECTOR_3_OUTPUT,
|
|
|
|
INJECTOR_4_OUTPUT,
|
|
|
|
INJECTOR_5_OUTPUT,
|
|
|
|
INJECTOR_6_OUTPUT,
|
|
|
|
INJECTOR_7_OUTPUT,
|
|
|
|
INJECTOR_8_OUTPUT,
|
|
|
|
INJECTOR_9_OUTPUT,
|
|
|
|
INJECTOR_10_OUTPUT,
|
|
|
|
INJECTOR_11_OUTPUT,
|
|
|
|
INJECTOR_12_OUTPUT,
|
|
|
|
|
2014-11-22 14:03:07 -08:00
|
|
|
IO_INVALID,
|
|
|
|
|
2014-08-29 07:52:33 -07:00
|
|
|
/**
|
|
|
|
* these seven segment display pins are related to unused external tachometer code
|
|
|
|
* I still have the hardware so maybe one day I will fix it, but for now it's just dead code
|
|
|
|
* See https://www.youtube.com/watch?v=YYiHoN6MBqE
|
|
|
|
* todo: this should be re-implemented in a smarter way with some sort of multiplexing anyway
|
|
|
|
*/
|
|
|
|
/* digit 1 */
|
2015-01-11 21:03:57 -08:00
|
|
|
// LED_HUGE_0, // B2
|
|
|
|
// LED_HUGE_1,
|
|
|
|
// LED_HUGE_2,
|
|
|
|
// LED_HUGE_3,
|
|
|
|
// LED_HUGE_4,
|
|
|
|
// LED_HUGE_5,
|
|
|
|
// LED_HUGE_6,
|
|
|
|
// /* digit 2 */
|
|
|
|
// LED_HUGE_7,
|
|
|
|
// LED_HUGE_8,
|
|
|
|
// LED_HUGE_9, // E15
|
|
|
|
// LED_HUGE_10,
|
|
|
|
// LED_HUGE_11,
|
|
|
|
// LED_HUGE_12,
|
|
|
|
// LED_HUGE_13,
|
|
|
|
// /* digit 3 */
|
|
|
|
// LED_HUGE_14,
|
|
|
|
// LED_HUGE_15,
|
|
|
|
// LED_HUGE_16,
|
|
|
|
// LED_HUGE_17,
|
|
|
|
// LED_HUGE_18,
|
|
|
|
// LED_HUGE_19,
|
|
|
|
// LED_HUGE_20,
|
2014-08-29 07:52:33 -07:00
|
|
|
|
|
|
|
|
|
|
|
} io_pin_e;
|
|
|
|
|
|
|
|
#define IO_PIN_COUNT 100
|
|
|
|
|
2014-10-25 05:03:11 -07:00
|
|
|
void initPrimaryPins(void);
|
|
|
|
void initOutputPins(void);
|
|
|
|
|
2014-08-29 07:52:33 -07:00
|
|
|
#ifdef __cplusplus
|
2015-01-07 15:04:40 -08:00
|
|
|
extern "C" {
|
2014-08-29 07:52:33 -07:00
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
2014-09-25 22:02:43 -07:00
|
|
|
io_pin_e getPinByName(const char *name);
|
2014-08-29 07:52:33 -07:00
|
|
|
|
2014-12-23 22:03:26 -08:00
|
|
|
#if EFI_GPIO
|
2015-01-07 15:04:40 -08:00
|
|
|
void turnAllPinsOff(void);
|
2014-12-23 22:03:26 -08:00
|
|
|
#else
|
2015-01-07 15:04:40 -08:00
|
|
|
#define turnAllPinsOff() {}
|
2014-12-23 22:03:26 -08:00
|
|
|
#endif
|
2014-08-29 07:52:33 -07:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
|
|
|
#endif /* STATUS_LEDS_H_ */
|