zephyrproject-rtos / gsoc-2022-arduino-core

Arduino Core Zephyr Module (GSoC 2022 Project)
Apache License 2.0
44 stars 11 forks source link

GPIO enhancements needed #12

Closed DhruvaG2000 closed 2 years ago

DhruvaG2000 commented 2 years ago
adirsingh96 commented 2 years ago

Hey, I have gone through the1st point , I have a noob question to ask, do we have to define enum for different pinmodes as mentioned here or do we have to append the pinMode function with the option to set the pinmode as GPIO_PULL_UP, GPIO_PULL_DOWN,GPIO_OPEN_DRAIN as done here

DhruvaG2000 commented 2 years ago

do we have to define enum for different pinmodes as mentioned here

No, You are not atall supposed to modify any code in ArduinoCore-API.

What is required is that you implement each of

INPUT_PULLUP     = 0x2,
  INPUT_PULLDOWN   = 0x3,
  OUTPUT_OPENDRAIN = 0x4,

using an underlying zephyr code as documented here: GPIO input/output configuration flags

DhruvaG2000 commented 2 years ago

Thanks @szczys for solving this in PR https://github.com/zephyrproject-rtos/gsoc-2022-arduino-core/pull/19