File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5858#define M4 0x40000000
5959#define M8 0x80000000
6060
61- void spi_cs_off (int pin )
61+ void RAMFUNCTION spi_cs_off (int pin )
6262{
6363 GPIO_OUTSET = (1 << pin );
6464 while ((GPIO_OUT & (1 << pin )) == 0 )
6565 ;
6666}
6767
68- void spi_cs_on (int pin )
68+ void RAMFUNCTION spi_cs_on (int pin )
6969{
7070 GPIO_OUTCLR = (1 << pin );
7171 while ((GPIO_OUT & (1 << pin )) != 0 )
7272 ;
7373
7474}
7575
76- uint8_t spi_read (void )
76+ uint8_t RAMFUNCTION spi_read (void )
7777{
7878 volatile uint32_t reg = SPI_EV_RDY ;
7979 while (!reg )
@@ -83,7 +83,7 @@ uint8_t spi_read(void)
8383 return reg ;
8484}
8585
86- void spi_write (const char byte )
86+ void RAMFUNCTION spi_write (const char byte )
8787{
8888 uint32_t reg ;
8989 SPI_EV_RDY = 0 ;
Original file line number Diff line number Diff line change 2828#include "spi_drv.h"
2929#include "spi_drv_stm32.h"
3030
31- void spi_cs_off (int pin )
31+ void RAMFUNCTION spi_cs_off (int pin )
3232{
3333 SPI_PIO_CS_BSRR |= (1 << pin );
3434 while (!(SPI_PIO_CS_ODR & (1 << pin )))
3535 ;
3636}
3737
38- void spi_cs_on (int pin )
38+ void RAMFUNCTION spi_cs_on (int pin )
3939{
4040 SPI_PIO_CS_BSRR |= (1 << (pin + 16 ));
4141 while (SPI_PIO_CS_ODR & (1 << pin ))
@@ -122,7 +122,7 @@ static void spi1_reset(void)
122122 APB2_CLOCK_RST &= ~SPI1_APB2_CLOCK_ER_VAL ;
123123}
124124
125- uint8_t spi_read (void )
125+ uint8_t RAMFUNCTION spi_read (void )
126126{
127127 volatile uint32_t reg ;
128128 do {
@@ -131,7 +131,7 @@ uint8_t spi_read(void)
131131 return (uint8_t )SPI1_DR ;
132132}
133133
134- void spi_write (const char byte )
134+ void RAMFUNCTION spi_write (const char byte )
135135{
136136 int i ;
137137 volatile uint32_t reg ;
@@ -161,7 +161,7 @@ void spi_init(int polarity, int phase)
161161 }
162162}
163163
164- void spi_release (void )
164+ void RAMFUNCTION spi_release (void )
165165{
166166 spi1_reset ();
167167 SPI1_CR2 &= ~SPI_CR2_SSOE ;
Original file line number Diff line number Diff line change 3030#define SPI_DRV_H_INCLUDED
3131
3232#include <stdint.h>
33+ #include "image.h"
3334
3435#if defined(PLATFORM_stm32f4 ) || defined(PLATFORM_stm32f7 ) || defined(PLATFORM_stm32wb )
3536#include "hal/spi/spi_drv_stm32.h"
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ static enum write_mode {
5353 SST_SINGLEBYTE = 0x01
5454} chip_write_mode = WB_WRITEPAGE ;
5555
56- static void write_address (uint32_t address )
56+ static void RAMFUNCTION write_address (uint32_t address )
5757{
5858 spi_write ((address & 0xFF0000 ) >> 16 );
5959 spi_read ();
@@ -63,7 +63,7 @@ static void write_address(uint32_t address)
6363 spi_read ();
6464}
6565
66- static uint8_t read_status (void )
66+ static uint8_t RAMFUNCTION read_status (void )
6767{
6868 uint8_t status ;
6969 spi_cs_on (SPI_CS_FLASH );
@@ -212,7 +212,7 @@ void spi_flash_sector_erase(uint32_t address)
212212 wait_busy ();
213213}
214214
215- int spi_flash_read (uint32_t address , void * data , int len )
215+ int RAMFUNCTION spi_flash_read (uint32_t address , void * data , int len )
216216{
217217 uint8_t * buf = data ;
218218 int i = 0 ;
You can’t perform that action at this time.
0 commit comments