-
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sys/io_ports: add new sys component to handle I/O ports
For now, this just powers down the ports when the hub is shut down. Issue: https://github.com/pybricks/pybricks-micropython/issues/36
- Loading branch information
Showing
9 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// SPDX-License-Identifier: MIT | ||
// Copyright (c) 2021 The Pybricks Authors | ||
|
||
// Manages I/O ports | ||
|
||
#include <pbsys/status.h> | ||
|
||
// TODO need to make this more generic - for now assuming LPF2 everywhere | ||
#include "../../drv/ioport/ioport_lpf2.h" | ||
|
||
void pbsys_io_ports_poll(void) { | ||
if (pbsys_status_test(PBIO_PYBRICKS_STATUS_SHUTDOWN)) { | ||
pbdrv_ioport_lpf2_shutdown(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// SPDX-License-Identifier: MIT | ||
// Copyright (c) 2021 The Pybricks Authors | ||
|
||
#ifndef _PBSYS_SYS_IO_PORTS_H_ | ||
#define _PBSYS_SYS_IO_PORTS_H_ | ||
|
||
void pbsys_io_ports_poll(void); | ||
|
||
#endif // _PBSYS_SYS_IO_PORTS_H_ |