29 Gpio::A0,
Gpio::B0,
Gpio::C0,
Gpio::D0,
Gpio::E0,
Gpio::F0,
Gpio::Invalid,
Gpio::G0,
Gpio::Invalid,
Gpio::Invalid,
Gpio::H0,
Gpio::I0,
Gpio::J0,
Gpio::Invalid,
Gpio::Invalid,
Gpio::K0
40 return (brainPin -
Gpio::A0) % PORT_SIZE;
79#if defined(GPIOJ_BASE)
83#if defined(GPIOK_BASE)
120#if defined(GPIOJ_BASE)
124#if defined(GPIOK_BASE)
134 return portIndex * PORT_SIZE +
pin;
155 return EFI_ERROR_CODE;
161 return EFI_ERROR_CODE;
170 if (strEqual(str,
"none"))
173 if (str[0] !=
'p' && str[0] !=
'P') {
177 if (port >=
'a' && port <=
'z') {
178 port = 10 + (port -
'a');
179 }
else if (port >=
'A' && port <=
'Z') {
180 port = 10 + (port -
'A');
181 }
else if (port >=
'0' && port <=
'9') {
183 port = 0 + (port -
'0');
190 const char *pinStr = str + 2;
191 int pin = atoi(pinStr);
192 return basePin +
pin;
196 return BRAIN_PIN_ONCHIP_PINS;
ioportid_t * getGpioPorts()
static brain_pin_e portMap[16]
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)
void firmwareError(ObdCode code, const char *fmt,...)
uint32_t ioportmask_t
Digital I/O port sized unsigned type.
GPIO_TypeDef * ioportid_t
Port Identifier.
this file is about general input/output utility methods, not much EFI-specifics
@ CUSTOM_ERR_UNKNOWN_PORT
bool brain_pin_is_onchip(brain_pin_e brainPin)
bool isBrainPinValid(brain_pin_e brainPin)
static BigBufferHandle buffer