Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
RF24
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
RF24
Commits
dcdc35d7
Commit
dcdc35d7
authored
Dec 18, 2014
by
mz-fuzzy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding SPI enum to RPi python wrapper
parent
91c6d214
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
RPi/pyRF24/pyRF24.cpp
RPi/pyRF24/pyRF24.cpp
+8
-0
examples_RPi/pingpair_dyn.py
examples_RPi/pingpair_dyn.py
+2
-2
No files found.
RPi/pyRF24/pyRF24.cpp
View file @
dcdc35d7
...
...
@@ -180,6 +180,14 @@ BOOST_PYTHON_MODULE(RF24){
.
value
(
"BCM2835_SPI_CLOCK_DIVIDER_1"
,
BCM2835_SPI_CLOCK_DIVIDER_1
)
.
export_values
();
bp
::
enum_
<
bcm2835SPIChipSelect
>
(
"bcm2835SPIChipSelect"
)
.
value
(
"BCM2835_SPI_CS0"
,
BCM2835_SPI_CS0
)
.
value
(
"BCM2835_SPI_CS1"
,
BCM2835_SPI_CS1
)
.
value
(
"BCM2835_SPI_CS2"
,
BCM2835_SPI_CS2
)
.
value
(
"BCM2835_SPI_CS_NONE"
,
BCM2835_SPI_CS_NONE
)
.
export_values
();
// exposing '#define's for SPI speed as this is needed for RF24 constructor
bp
::
scope
().
attr
(
"BCM2835_SPI_SPEED_64MHZ"
)
=
BCM2835_SPI_SPEED_64MHZ
;
bp
::
scope
().
attr
(
"BCM2835_SPI_SPEED_32MHZ"
)
=
BCM2835_SPI_SPEED_32MHZ
;
...
...
examples_RPi/pingpair_dyn.py
View file @
dcdc35d7
...
...
@@ -13,13 +13,13 @@ from RF24 import *
# CE Pin, CSN Pin, SPI Speed
# Setup for GPIO 22 CE and GPIO 25 CSN with SPI Speed @ 1Mhz
#radio =
radio
(RPI_V2_GPIO_P1_22, RPI_V2_GPIO_P1_18, BCM2835_SPI_SPEED_1MHZ)
#radio =
RF24
(RPI_V2_GPIO_P1_22, RPI_V2_GPIO_P1_18, BCM2835_SPI_SPEED_1MHZ)
# Setup for GPIO 22 CE and CE0 CSN with SPI Speed @ 4Mhz
#radio = RF24(RPI_V2_GPIO_P1_15, BCM2835_SPI_CS0, BCM2835_SPI_SPEED_4MHZ)
# Setup for GPIO 22 CE and CE1 CSN with SPI Speed @ 8Mhz
#radio = RF24(RPI_V2_GPIO_P1_15, BCM2835_SPI_CS
0
, BCM2835_SPI_SPEED_8MHZ)
#radio = RF24(RPI_V2_GPIO_P1_15, BCM2835_SPI_CS
1
, BCM2835_SPI_SPEED_8MHZ)
# Setup for GPIO 22 CE and CE0 CSN for RPi B+ with SPI Speed @ 8Mhz
radio
=
RF24
(
RPI_BPLUS_GPIO_J8_22
,
RPI_BPLUS_GPIO_J8_24
,
BCM2835_SPI_SPEED_8MHZ
)
...
...
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