Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace libopen's GPIO APIS by Zephyr GPIO APIs #3

Merged
merged 13 commits into from
Jul 7, 2021

Conversation

ikerperezdelpalomar
Copy link
Collaborator

@ikerperezdelpalomar ikerperezdelpalomar commented Apr 12, 2021

This merge request replaces libopens GPIO;s APIs with Zephyr's GPIO API's.
Tested functions:

  • bl_led__get_pin_mask()
  • bl_led__gpio_mode_setup().
  • bl_led_init();
  • bl_led__set();
  • bl_led_status_set.
  • bl_led_setup().
  • bl_led_loop().
  • bl_led_get_port().
  • bl_led_get_gpio().

src/led.c Outdated Show resolved Hide resolved
src/led.c Outdated Show resolved Hide resolved
src/led.c Outdated Show resolved Hide resolved
src/led.c Outdated Show resolved Hide resolved
src/led.c Outdated Show resolved Hide resolved
@ikerperezdelpalomar ikerperezdelpalomar force-pushed the GPIO_APIs branch 2 times, most recently from a9941ce to e7a5d7a Compare April 30, 2021 10:22
@ikerperezdelpalomar
Copy link
Collaborator Author

Zephyr has stopped configuring clock from the code and instead is doing it from device tree. Should I implement this in this pull request or should we work on this separately?

@ikerperezdelpalomar ikerperezdelpalomar force-pushed the GPIO_APIs branch 3 times, most recently from 9244a81 to 01b3ce2 Compare May 25, 2021 11:12
@rdale
Copy link
Collaborator

rdale commented May 25, 2021

Can you please not add 'Signed-off-by:' lines to the commit messages. It doesn't make any sense for the project at this stage.

src/led.c Outdated Show resolved Hide resolved
src/acq/channel.h Outdated Show resolved Hide resolved
src/led.c Outdated Show resolved Hide resolved
@@ -15,6 +15,6 @@ zephyr_include_directories(${CMAKE_SOURCE_DIR}/../..)
project(led_test)

target_sources(app PRIVATE
main.c
bloodlight_based.c
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It isn't clear why you have renamed 'main.c' as 'bloodlight_based.c'. The intended meaning of the name 'bloodlight based' isn't very clear.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I edited the commit description. See: 8afe0b7

#include <drivers/uart.h>

#include "../../src/led.h"
#include "../../src/led.c"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The project should have 'led.c' in the target_sources() in the CMakeLists.txt file and there is not need to include the sources like this. Also 'led.c' will have an include for 'led.h' and you wouldn't need two includes if you to include the 'led.c' source like this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is it that by including led.c in target_sources() I don need to include it in bloodlight_based.c?

CMakeLists.txt Outdated Show resolved Hide resolved
@ikerperezdelpalomar
Copy link
Collaborator Author

Can you please not add 'Signed-off-by:' lines to the commit messages. It doesn't make any sense for the project at this stage.

It is my personal preference to sign all my commits, as it won't hurt in any way the project I will keep doing it.

@ikerperezdelpalomar ikerperezdelpalomar linked an issue Jun 10, 2021 that may be closed by this pull request
4 tasks
@ikerperezdelpalomar ikerperezdelpalomar force-pushed the GPIO_APIs branch 4 times, most recently from 7380329 to 7dcb0de Compare June 10, 2021 11:48
Iker Perez del Palomar Sustatxa added 12 commits July 7, 2021 09:30
Signed-off-by: Iker Perez del Palomar Sustatxa <iker.perez@codethink.co.uk>
Signed-off-by: Iker Perez del Palomar Sustatxa <iker.perez@codethink.co.uk>
Signed-off-by: Iker Perez del Palomar Sustatxa <iker.perez@codethink.co.uk>
Signed-off-by: Iker Perez del Palomar Sustatxa <iker.perez@codethink.co.uk>
Configure inside bl_led__gpio_mode_setup() all pins containing a LED
connected to them on each port.

Signed-off-by: Iker Perez del Palomar Sustatxa <iker.perez@codethink.co.uk>
This ensures that bl_led_get_port() can be used in spi.c

Signed-off-by: Iker Perez del Palomar Sustatxa <iker.perez@codethink.co.uk>
Signed-off-by: Iker Perez del Palomar Sustatxa <iker.perez@codethink.co.uk>
* Include console support
* Bloodlight_based.c: Test leds with led.c APIs.
* Build bloodlight_based.c by default.
* Test bl_led_status_set()

Keep both tests zephyr_based (previous main) and bloodlight_based.c so
the user can select in CMakeFie which test wants to run. zephyr_based to
test leds using zephyrs APIs or bloodlight_based to test them using
bloodlight's APIs.

Signed-off-by: Iker Perez del Palomar Sustatxa <iker.perez@codethink.co.uk>
Signed-off-by: Iker Perez del Palomar Sustatxa <iker.perez@codethink.co.uk>
Signed-off-by: Iker Perez del Palomar Sustatxa <iker.perez@codethink.co.uk>
Signed-off-by: Iker Perez del Palomar Sustatxa <iker.perez@codethink.co.uk>
Signed-off-by: Iker Perez del Palomar Sustatxa <iker.perez@codethink.co.uk>
@ikerperezdelpalomar ikerperezdelpalomar merged commit c8fc807 into main Jul 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Zephyr ztest for LEDs Make LEDs work
3 participants