Download firmware/hal/spi.h from Snapkitty/phaser-ags: direct link, hf CLI and curl.
- Browser
- Download file 3.22 kB
-
https://huggingface.co/Snapkitty/phaser-ags/resolve/main/firmware/hal/spi.h
- Command line
-
hf download hf://Snapkitty/phaser-ags/firmware/hal/spi.h
-
curl -L -o spi.h https://huggingface.co/Snapkitty/phaser-ags/resolve/main/firmware/hal/spi.h
3.22 kB
| /* | |
| * OMAP3530 McSPI (Multi-Channel SPI) driver | |
| * OMAP3530 has 4 McSPI controllers. Used for: | |
| * McSPI1: Flash, sensor | |
| * McSPI2: FPGA configuration (like IMX6 ECSPI for FPGA) | |
| * Modeled on IMX6 Platinum ECSPI1/2 pinmux + setup pattern | |
| */ | |
| /* McSPI register offsets */ | |
| /* Per-channel registers (ch 0-3, stride 0x14) */ | |
| /* MCSPI_MODULCTRL bits */ | |
| /* MCSPI_CHCONF bits */ | |
| /* MCSPI_CHSTAT bits */ | |
| /* MCSPI_CHCTRL bits */ | |
| /* SPI modes (CPOL/CPHA) */ | |
| typedef struct { | |
| hw_reg32_t base; | |
| uint8_t channel; /* 0-3 */ | |
| uint32_t clock_hz; /* Input clock (REF_CLK or L3) */ | |
| uint32_t speed_hz; /* Desired SPI clock */ | |
| uint8_t mode; /* SPI_MODE_x */ | |
| uint8_t bits_per_word; | |
| } spi_dev_t; | |
| int spi_init(spi_dev_t *dev, uint32_t base, uint8_t channel, | |
| uint32_t clock_hz, uint32_t speed_hz, uint8_t mode, uint8_t bpw); | |
| void spi_set_speed(spi_dev_t *dev, uint32_t speed_hz); | |
| int spi_transfer(spi_dev_t *dev, const uint8_t *tx, uint8_t *rx, uint32_t len); | |
| int spi_write_then_read(spi_dev_t *dev, const uint8_t *tx, uint32_t tx_len, | |
| uint8_t *rx, uint32_t rx_len); | |
| uint8_t spi_read_reg8(spi_dev_t *dev, uint8_t reg); | |
| void spi_write_reg8(spi_dev_t *dev, uint8_t reg, uint8_t val); | |