26 return (brainPin -
Gpio::A0) % PORT_SIZE;
65#if defined(GPIOJ_BASE)
69#if defined(GPIOK_BASE)
106#if defined(GPIOJ_BASE)
110#if defined(GPIOK_BASE)
120 return portIndex * PORT_SIZE +
pin;
141 return EFI_ERROR_CODE;
147 return EFI_ERROR_CODE;
156 if (strEqual(str,
"none"))
159 if (str[0] !=
'p' && str[0] !=
'P') {
164 if (port >=
'a' && port <=
'z') {
165 basePin = (
Gpio::A0 + PORT_SIZE * (port -
'a'));
166 }
else if (port >=
'A' && port <=
'Z') {
167 basePin = (
Gpio::A0 + PORT_SIZE * (port -
'A'));
171 const char *pinStr = str + 2;
172 int pin = atoi(pinStr);
173 return basePin +
pin;
177 return BRAIN_PIN_ONCHIP_PINS;
void firmwareError(ObdCode code, const char *fmt,...)
uint32_t ioportmask_t
Digital I/O port sized unsigned type.
GPIO_TypeDef * ioportid_t
Port Identifier.
ioportid_t * getGpioPorts()
int getBrainPinIndex(brain_pin_e brainPin)
static ioportid_t ports[]
ioportid_t getHwPort(const char *msg, brain_pin_e brainPin)
brain_pin_e parseBrainPin(const char *str)
unsigned int getBrainPinOnchipNum(void)
static int getPortIndex(ioportid_t port)
int getPortPinIndex(ioportid_t port, ioportmask_t pin)
void debugBrainPin(char *buffer, size_t, brain_pin_e)
ioportmask_t getHwPin(const char *msg, brain_pin_e brainPin)
const char * portname(ioportid_t GPIOx)
ioportid_t getBrainPinPort(brain_pin_e brainPin)
@ CUSTOM_ERR_UNKNOWN_PORT
bool brain_pin_is_onchip(brain_pin_e brainPin)
bool isBrainPinValid(brain_pin_e brainPin)
static BigBufferHandle buffer