Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
micropython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
micropython
Commits
908e4cf5
Commit
908e4cf5
authored
Jan 02, 2022
by
iabdalkader
Committed by
Damien George
Jan 06, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rp2: Add support for DHT11 and DHT22 sensors.
parent
01d9b7ad
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
0 deletions
+7
-0
drivers/dht/dht.py
drivers/dht/dht.py
+2
-0
ports/rp2/CMakeLists.txt
ports/rp2/CMakeLists.txt
+1
-0
ports/rp2/boards/manifest.py
ports/rp2/boards/manifest.py
+1
-0
ports/rp2/modrp2.c
ports/rp2/modrp2.c
+3
-0
No files found.
drivers/dht/dht.py
View file @
908e4cf5
...
...
@@ -7,6 +7,8 @@ if sys.platform.startswith("esp"):
from
esp
import
dht_readinto
elif
sys
.
platform
==
"mimxrt"
:
from
mimxrt
import
dht_readinto
elif
sys
.
platform
==
"rp2"
:
from
rp2
import
dht_readinto
else
:
from
pyb
import
dht_readinto
...
...
ports/rp2/CMakeLists.txt
View file @
908e4cf5
...
...
@@ -79,6 +79,7 @@ set(MICROPY_SOURCE_LIB
set
(
MICROPY_SOURCE_DRIVERS
${
MICROPY_DIR
}
/drivers/bus/softspi.c
${
MICROPY_DIR
}
/drivers/dht/dht.c
)
set
(
MICROPY_SOURCE_PORT
...
...
ports/rp2/boards/manifest.py
View file @
908e4cf5
freeze
(
"$(PORT_DIR)/modules"
)
freeze
(
"$(MPY_DIR)/drivers/onewire"
)
freeze
(
"$(MPY_DIR)/drivers/dht"
,
"dht.py"
)
include
(
"$(MPY_DIR)/extmod/uasyncio/manifest.py"
)
include
(
"$(MPY_DIR)/drivers/neopixel/manifest.py"
)
ports/rp2/modrp2.c
View file @
908e4cf5
...
...
@@ -25,6 +25,7 @@
*/
#include "py/runtime.h"
#include "drivers/dht/dht.h"
#include "modrp2.h"
STATIC
const
mp_rom_map_elem_t
rp2_module_globals_table
[]
=
{
...
...
@@ -32,6 +33,8 @@ STATIC const mp_rom_map_elem_t rp2_module_globals_table[] = {
{
MP_ROM_QSTR
(
MP_QSTR_Flash
),
MP_ROM_PTR
(
&
rp2_flash_type
)
},
{
MP_ROM_QSTR
(
MP_QSTR_PIO
),
MP_ROM_PTR
(
&
rp2_pio_type
)
},
{
MP_ROM_QSTR
(
MP_QSTR_StateMachine
),
MP_ROM_PTR
(
&
rp2_state_machine_type
)
},
{
MP_ROM_QSTR
(
MP_QSTR_dht_readinto
),
MP_ROM_PTR
(
&
dht_readinto_obj
)
},
};
STATIC
MP_DEFINE_CONST_DICT
(
rp2_module_globals
,
rp2_module_globals_table
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment