i2c_opencores.[ch], spi_io.[ch]: Improve const correctness.

This commit is contained in:
Ari Sundholm 2020-11-05 18:43:52 +02:00
parent cd77713255
commit 556140dd62
4 changed files with 4 additions and 4 deletions

View File

@ -17,7 +17,7 @@ int I2C_start(alt_u32 base, alt_u32 add, alt_u32 read);
alt_u32 I2C_read(alt_u32 base,alt_u32 last); alt_u32 I2C_read(alt_u32 base,alt_u32 last);
alt_u32 I2C_write(alt_u32 base,alt_u8 data, alt_u32 last); alt_u32 I2C_write(alt_u32 base,alt_u8 data, alt_u32 last);
void SPI_read(alt_u32 base, alt_u8 *rdata, int len); void SPI_read(alt_u32 base, alt_u8 *rdata, int len);
void SPI_write(alt_u32 base, alt_u8 *wdata, int len); void SPI_write(alt_u32 base, const alt_u8 *wdata, int len);
#define I2C_OK (0) #define I2C_OK (0)
#define I2C_ACK (0) #define I2C_ACK (0)
#define I2C_NOACK (1) #define I2C_NOACK (1)

View File

@ -197,7 +197,7 @@ void SPI_read(alt_u32 base, alt_u8 *rdata, int len)
} }
} }
void SPI_write(alt_u32 base, alt_u8 *wdata, int len) void SPI_write(alt_u32 base, const alt_u8 *wdata, int len)
{ {
int i; int i;

View File

@ -15,7 +15,7 @@ void SPI_Init (void) {
I2C_init(SD_SPI_BASE,ALT_CPU_FREQ,400000); I2C_init(SD_SPI_BASE,ALT_CPU_FREQ,400000);
} }
void SPI_W(BYTE *wd, int len) { void SPI_W(const BYTE *wd, int len) {
SPI_write(SD_SPI_BASE, wd, len); SPI_write(SD_SPI_BASE, wd, len);
} }

View File

@ -33,7 +33,7 @@ void SPI_R (BYTE *rd, int len);
\param *wd Pointer to array which holds the bytes. \param *wd Pointer to array which holds the bytes.
\param len Length of the array. \param len Length of the array.
*/ */
void SPI_W (BYTE *wd, int len); void SPI_W (const BYTE *wd, int len);
/** /**
\brief Read a single byte. \brief Read a single byte.