Updates along with SDK1.3.0 release (#181)
Bug fixes and new examples Co-authored-by: Paulo Marques <pm@quant-insight.com> Co-authored-by: martin <admin@crossleys.biz> Co-authored-by: matiasilva <matias.silva@raspberrypi.com> Co-authored-by: Uri Shaked <uri@urishaked.com> Co-authored-by: Diego Solano <diegosolano@gmail.com> Co-authored-by: Andrew Scheller <andrew.scheller@raspberrypi.com> Co-authored-by: Adrian Hesketh <a-h@users.noreply.github.com> Co-authored-by: Emircan Gündoğdu <58917386+emircangun@users.noreply.github.com> Co-authored-by: Josef Wegner <80200012+josefwegner@users.noreply.github.com> Co-authored-by: pmarques-dev <72901351+pmarques-dev@users.noreply.github.com> Co-authored-by: Paulo Marques <pm@quant-insight.com> Co-authored-by: mjcross <mjcross@users.noreply.github.com> Co-authored-by: martin <admin@crossleys.biz>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
if (NOT PICO_NO_HARDWARE)
|
||||
add_subdirectory(spi_flash)
|
||||
add_subdirectory(mpu9250_spi)
|
||||
add_subdirectory(bme280_spi)
|
||||
add_subdirectory(mpu9250_spi)
|
||||
add_subdirectory(spi_dma)
|
||||
add_subdirectory(spi_flash)
|
||||
endif ()
|
||||
|
||||
@@ -2,7 +2,7 @@ add_executable(bme280_spi
|
||||
bme280_spi.c
|
||||
)
|
||||
|
||||
# Pull in our (to be renamed) simple get you started dependencies
|
||||
# pull in common dependencies and additional spi hardware support
|
||||
target_link_libraries(bme280_spi pico_stdlib hardware_spi)
|
||||
|
||||
# create map/bin/hex file etc.
|
||||
|
||||
@@ -42,9 +42,7 @@ bme280_spi.c:: The example code.
|
||||
|===
|
||||
| *Item* | *Quantity* | Details
|
||||
| Breadboard | 1 | generic part
|
||||
| Raspberry Pi Pico | 1 | http://raspberrypi.org/
|
||||
| Raspberry Pi Pico | 1 | https://www.raspberrypi.com/products/raspberry-pi-pico/
|
||||
| BME280 board| 1 | generic part
|
||||
| M/M Jumper wires | 6 | generic part
|
||||
|===
|
||||
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
/* Example code to talk to a bme280 humidity/temperature/pressure sensor.
|
||||
|
||||
NOTE: Ensure the device is capable of being driven at 3.3v NOT 5v. The Pico
|
||||
GPIO (and therefor SPI) cannot be used at 5v.
|
||||
GPIO (and therefore SPI) cannot be used at 5v.
|
||||
|
||||
You will need to use a level shifter on the SPI lines if you want to run the
|
||||
board at 5v.
|
||||
@@ -52,7 +52,7 @@ int16_t dig_H2, dig_H4, dig_H5;
|
||||
/* The following compensation functions are required to convert from the raw ADC
|
||||
data from the chip to something usable. Each chip has a different set of
|
||||
compensation parameters stored on the chip at point of manufacture, which are
|
||||
read from the chip at startup and used inthese routines.
|
||||
read from the chip at startup and used in these routines.
|
||||
*/
|
||||
int32_t compensate_temp(int32_t adc_T) {
|
||||
int32_t var1, var2, T;
|
||||
|
||||
@@ -2,7 +2,7 @@ add_executable(mpu9250_spi
|
||||
mpu9250_spi.c
|
||||
)
|
||||
|
||||
# Pull in our (to be renamed) simple get you started dependencies
|
||||
# pull in common dependencies and additional spi hardware support
|
||||
target_link_libraries(mpu9250_spi pico_stdlib hardware_spi)
|
||||
|
||||
# create map/bin/hex file etc.
|
||||
|
||||
@@ -44,9 +44,7 @@ mpu9250_spi.c:: The example code.
|
||||
|===
|
||||
| *Item* | *Quantity* | Details
|
||||
| Breadboard | 1 | generic part
|
||||
| Raspberry Pi Pico | 1 | http://raspberrypi.org/
|
||||
| Raspberry Pi Pico | 1 | https://www.raspberrypi.com/products/raspberry-pi-pico/
|
||||
| MPU9250 board| 1 | generic part
|
||||
| M/M Jumper wires | 6 | generic part
|
||||
|===
|
||||
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ int main() {
|
||||
printf("Configure TX DMA\n");
|
||||
dma_channel_config c = dma_channel_get_default_config(dma_tx);
|
||||
channel_config_set_transfer_data_size(&c, DMA_SIZE_8);
|
||||
channel_config_set_dreq(&c, spi_get_index(spi_default) ? DREQ_SPI1_TX : DREQ_SPI0_TX);
|
||||
channel_config_set_dreq(&c, spi_get_dreq(spi_default, true));
|
||||
dma_channel_configure(dma_tx, &c,
|
||||
&spi_get_hw(spi_default)->dr, // write address
|
||||
txbuf, // read address
|
||||
@@ -70,7 +70,7 @@ int main() {
|
||||
// address to increment (so data is written throughout the buffer)
|
||||
c = dma_channel_get_default_config(dma_rx);
|
||||
channel_config_set_transfer_data_size(&c, DMA_SIZE_8);
|
||||
channel_config_set_dreq(&c, spi_get_index(spi_default) ? DREQ_SPI1_RX : DREQ_SPI0_RX);
|
||||
channel_config_set_dreq(&c, spi_get_dreq(spi_default, false));
|
||||
channel_config_set_read_increment(&c, false);
|
||||
channel_config_set_write_increment(&c, true);
|
||||
dma_channel_configure(dma_rx, &c,
|
||||
|
||||
@@ -2,7 +2,7 @@ add_executable(spi_flash
|
||||
spi_flash.c
|
||||
)
|
||||
|
||||
# Pull in basic dependencies
|
||||
# pull in common dependencies and additional spi hardware support
|
||||
target_link_libraries(spi_flash pico_stdlib hardware_spi)
|
||||
|
||||
# create map/bin/hex file etc.
|
||||
|
||||
Reference in New Issue
Block a user