refactoring - reducing GPIO complexity
This commit is contained in:
parent
65aa80c379
commit
e7e7458729
|
@ -260,4 +260,9 @@ void turnAllPinsOff(void) {
|
|||
enginePins.coils[i].setValue(false);
|
||||
}
|
||||
}
|
||||
#else /* EFI_GPIO_HARDWARE */
|
||||
const char *hwPortname(brain_pin_e brainPin) {
|
||||
(void)brainPin;
|
||||
return "N/A";
|
||||
}
|
||||
#endif /* EFI_GPIO_HARDWARE */
|
||||
|
|
|
@ -185,12 +185,19 @@ public:
|
|||
void turnPinHigh(NamedOutputPin *output);
|
||||
void turnPinLow(NamedOutputPin *output);
|
||||
|
||||
#if EFI_PROD_CODE || defined(__DOXYGEN__)
|
||||
#if EFI_GPIO_HARDWARE || defined(__DOXYGEN__)
|
||||
void initOutputPin(const char *msg, OutputPin *outputPin, ioportid_t port, uint32_t pinNumber);
|
||||
void initOutputPinExt(const char *msg, OutputPin *outputPin, ioportid_t port, uint32_t pinNumber, iomode_t mode);
|
||||
|
||||
#endif /* EFI_PROD_CODE */
|
||||
|
||||
void outputPinRegister(const char *msg, OutputPin *output, ioportid_t port, uint32_t pin);
|
||||
void outputPinRegisterExt2(const char *msg, OutputPin *output, brain_pin_e brainPin, pin_output_mode_e *outputMode);
|
||||
|
||||
ioportmask_t getHwPin(brain_pin_e brainPin);
|
||||
ioportid_t getHwPort(brain_pin_e brainPin);
|
||||
const char *portname(ioportid_t GPIOx);
|
||||
|
||||
#endif /* EFI_GPIO_HARDWARE */
|
||||
|
||||
brain_pin_e parseBrainPin(const char *str);
|
||||
const char *hwPortname(brain_pin_e brainPin);
|
||||
|
||||
#endif /* EFIGPIO_H_ */
|
||||
|
|
|
@ -726,10 +726,10 @@ void initTriggerDecoderLogger(Logging *sharedLogger) {
|
|||
}
|
||||
|
||||
void initTriggerDecoder(void) {
|
||||
#if (EFI_PROD_CODE || EFI_SIMULATOR) || defined(__DOXYGEN__)
|
||||
#if EFI_GPIO_HARDWARE || defined(__DOXYGEN__)
|
||||
outputPinRegisterExt2("trg_err", &enginePins.triggerDecoderErrorPin, boardConfiguration->triggerErrorPin,
|
||||
&boardConfiguration->triggerErrorPinMode);
|
||||
#endif
|
||||
#endif /* EFI_GPIO_HARDWARE */
|
||||
}
|
||||
|
||||
#endif /* EFI_SHAFT_POSITION_INPUT */
|
||||
|
|
|
@ -52,4 +52,13 @@
|
|||
// LED_HUGE_19,
|
||||
// LED_HUGE_20,
|
||||
|
||||
#if EFI_GPIO_HARDWARE || defined(__DOXYGEN__)
|
||||
void mySetPadMode(const char *msg, ioportid_t port, ioportmask_t pin, iomode_t mode);
|
||||
void mySetPadMode2(const char *msg, brain_pin_e pin, iomode_t mode);
|
||||
|
||||
iomode_t getInputMode(pin_input_mode_e mode);
|
||||
void efiIcuStart(ICUDriver *icup, const ICUConfig *config);
|
||||
#endif /* EFI_GPIO_HARDWARE */
|
||||
|
||||
|
||||
#endif /* IO_PINS_H_ */
|
||||
|
|
|
@ -17,8 +17,6 @@
|
|||
|
||||
#ifdef __cplusplus
|
||||
#include "efiGpio.h"
|
||||
// does not exactly belong here, but that works better for tests
|
||||
void outputPinRegister(const char *msg, OutputPin *output, ioportid_t port, uint32_t pin);
|
||||
|
||||
class PinRepository {
|
||||
public:
|
||||
|
@ -31,17 +29,8 @@ class PinRepository {
|
|||
#define PORT_SIZE 16
|
||||
|
||||
void initPinRepository(void);
|
||||
brain_pin_e parseBrainPin(const char *str);
|
||||
void mySetPadMode(const char *msg, ioportid_t port, ioportmask_t pin, iomode_t mode);
|
||||
const char *hwPortname(brain_pin_e brainPin);
|
||||
void markUsed(int index, const char *msg);
|
||||
const char * getPinFunction(brain_input_pin_e brainPin);
|
||||
void mySetPadMode2(const char *msg, brain_pin_e pin, iomode_t mode);
|
||||
const char *portname(ioportid_t GPIOx);
|
||||
void unmarkPin(brain_pin_e brainPin);
|
||||
|
||||
iomode_t getInputMode(pin_input_mode_e mode);
|
||||
void efiIcuStart(ICUDriver *icup, const ICUConfig *config);
|
||||
ioportmask_t getHwPin(brain_pin_e brainPin);
|
||||
ioportid_t getHwPort(brain_pin_e brainPin);
|
||||
|
||||
#endif /* PIN_REPOSITORY_H_ */
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
|
||||
#include "global.h"
|
||||
|
||||
#define hwPortname(x) "N/A"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#include "datalogging.h"
|
||||
#include "eficonsole.h"
|
||||
|
|
Loading…
Reference in New Issue