NEORV32 Software Framework Documentation
The NEORV32 RISC-V Processor
Loading...
Searching...
No Matches
neorv32_xip.h
Go to the documentation of this file.
1// ================================================================================ //
2// The NEORV32 RISC-V Processor - https://github.com/stnolting/neorv32 //
3// Copyright (c) NEORV32 contributors. //
4// Copyright (c) 2020 - 2024 Stephan Nolting. All rights reserved. //
5// Licensed under the BSD-3-Clause license, see LICENSE for details. //
6// SPDX-License-Identifier: BSD-3-Clause //
7// ================================================================================ //
8
18#ifndef neorv32_xip_h
19#define neorv32_xip_h
20
21#include <stdint.h>
22
23
24/**********************************************************************/
29typedef volatile struct __attribute__((packed,aligned(4))) {
30 uint32_t CTRL;
31 const uint32_t reserved;
32 uint32_t DATA_LO;
33 uint32_t DATA_HI;
35
37#define NEORV32_XIP ((neorv32_xip_t*) (NEORV32_XIP_BASE))
38
68/**********************************************************************/
72int neorv32_xip_available(void);
73void neorv32_xip_setup(int prsc, int cdiv, int cpol, int cpha, uint8_t rd_cmd);
74int neorv32_xip_start(int abytes);
77uint32_t neorv32_xip_get_clock_speed(void);
78void neorv32_xip_spi_trans(int nbytes, uint64_t *rtx_data);
82#endif // neorv32_xip_h
int neorv32_xip_start(int abytes)
Definition neorv32_xip.c:86
void neorv32_xip_setup(int prsc, int cdiv, int cpol, int cpha, uint8_t rd_cmd)
Definition neorv32_xip.c:49
void neorv32_xip_highspeed_enable(void)
Definition neorv32_xip.c:116
NEORV32_XIP_CTRL_enum
Definition neorv32_xip.h:40
@ XIP_CTRL_SPI_NBYTES_LSB
Definition neorv32_xip.h:47
@ XIP_CTRL_EN
Definition neorv32_xip.h:41
@ XIP_CTRL_XIP_BUSY
Definition neorv32_xip.h:63
@ XIP_CTRL_RD_CMD_MSB
Definition neorv32_xip.h:53
@ XIP_CTRL_XIP_EN
Definition neorv32_xip.h:49
@ XIP_CTRL_CDIV2
Definition neorv32_xip.h:58
@ XIP_CTRL_XIP_ABYTES_MSB
Definition neorv32_xip.h:51
@ XIP_CTRL_SPI_CSEN
Definition neorv32_xip.h:54
@ XIP_CTRL_SPI_NBYTES_MSB
Definition neorv32_xip.h:48
@ XIP_CTRL_XIP_ABYTES_LSB
Definition neorv32_xip.h:50
@ XIP_CTRL_CDIV3
Definition neorv32_xip.h:59
@ XIP_CTRL_PRSC0
Definition neorv32_xip.h:42
@ XIP_CTRL_CDIV1
Definition neorv32_xip.h:57
@ XIP_CTRL_PHY_BUSY
Definition neorv32_xip.h:62
@ XIP_CTRL_BURST_EN
Definition neorv32_xip.h:61
@ XIP_CTRL_RD_CMD_LSB
Definition neorv32_xip.h:52
@ XIP_CTRL_PRSC2
Definition neorv32_xip.h:44
@ XIP_CTRL_CPOL
Definition neorv32_xip.h:45
@ XIP_CTRL_HIGHSPEED
Definition neorv32_xip.h:55
@ XIP_CTRL_CPHA
Definition neorv32_xip.h:46
@ XIP_CTRL_PRSC1
Definition neorv32_xip.h:43
@ XIP_CTRL_CDIV0
Definition neorv32_xip.h:56
uint32_t neorv32_xip_get_clock_speed(void)
Definition neorv32_xip.c:136
void neorv32_xip_spi_trans(int nbytes, uint64_t *rtx_data)
Definition neorv32_xip.c:167
void neorv32_xip_highspeed_disable(void)
Definition neorv32_xip.c:125
int neorv32_xip_available(void)
Definition neorv32_xip.c:26
Definition neorv32_xip.h:29
uint32_t DATA_HI
Definition neorv32_xip.h:33
uint32_t CTRL
Definition neorv32_xip.h:30
const uint32_t reserved
Definition neorv32_xip.h:31
uint32_t DATA_LO
Definition neorv32_xip.h:32