Files
tonberry-pico/software/modules/rp2_sd/sd_spi.h
Matthias Blankertz 7f8282315e
All checks were successful
Build RPi Pico firmware image / Build-Firmware (push) Successful in 5m29s
Check code formatting / Check-C-Format (push) Successful in 9s
Check code formatting / Check-Python-Flake8 (push) Successful in 9s
Check code formatting / Check-Bash-Shellcheck (push) Successful in 4s
Run unit tests on host / Run-Unit-Tests (push) Successful in 8s
Restructure sources
The python and C modules that are supposed to be built into the firmware
image (i.e. those that are in manifest.py or in USER_C_MODULES) have
been moved to the software/modules directory.

The software/src directory should now only contain python scripts and
other files that should be installed to the Picos flash filesystem. The
idea is that these should be those scripts that implement the
application behaviour, as these are the ones that a user who does not
want to build the whole firmware themself wants to modify.
2025-04-01 22:05:30 +02:00

28 lines
745 B
C

#pragma once
#include <stdbool.h>
#include <stdint.h>
#define SD_MISO 4
#define SD_SCK 2
#define SD_MOSI 3
#define SD_CS 5
#define SD_PIO pio0
#define SD_INIT_BITRATE 400000
#define SD_BITRATE 15000000
bool sd_cmd(const uint8_t cmd, const uint32_t arg, unsigned resplen, uint8_t resp[static resplen]);
bool sd_cmd_read(uint8_t cmd, uint32_t arg, unsigned datalen, uint8_t data[static datalen]);
bool sd_spi_init(int mosi, int miso, int sck, int ss);
bool sd_spi_deinit(void);
void sd_spi_set_bitrate(const int rate);
void sd_spi_dbg_clk(const int div, const int frac);
bool sd_cmd_read_start(uint8_t cmd, uint32_t arg, unsigned datalen, uint8_t data[static datalen]);
bool sd_cmd_read_complete(void);
bool sd_cmd_read_is_complete(void);