nRF Connect SDK API
3.4.99
Toggle main menu visibility
Loading...
Searching...
No Matches
hrt.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2024 Nordic Semiconductor ASA
3
*
4
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5
*/
6
7
#ifndef _HRT_H__
8
#define _HRT_H__
9
10
#include <stdint.h>
11
#include <stdbool.h>
12
#include <
drivers/mspi/hpf_mspi.h
>
13
#include <zephyr/drivers/mspi.h>
14
15
#define VPRCSR_NORDIC_OUT_HIGH 1
16
#define VPRCSR_NORDIC_OUT_LOW 0
17
18
#define VPRCSR_NORDIC_DIR_OUTPUT 1
19
#define VPRCSR_NORDIC_DIR_INPUT 0
20
#define VPRCSR_NORDIC_PIN_USED 1
21
22
#define BITS_IN_WORD 32
23
#define BITS_IN_BYTE 8
24
25
typedef
enum
{
26
HRT_FE_COMMAND
,
27
HRT_FE_ADDRESS
,
28
HRT_FE_DUMMY_CYCLES
,
29
HRT_FE_DATA
,
30
HRT_FE_MAX
31
}
hrt_frame_element_t
;
32
33
typedef
enum
{
34
HRT_FUN_OUT_BYTE
,
35
HRT_FUN_OUT_WORD
,
36
}
hrt_fun_out_t
;
37
39
typedef
struct
{
40
uint8_t
command
;
41
uint8_t
address
;
42
uint8_t
dummy_cycles
;
43
uint8_t
data
;
44
}
hrt_xfer_bus_widths_t
;
45
46
typedef
struct
{
48
volatile
uint8_t *
data
;
49
53
uint32_t
word_count
;
54
67
uint8_t
last_word_clocks
;
68
72
uint8_t
penultimate_word_clocks
;
73
77
uint32_t
last_word
;
78
80
hrt_fun_out_t
fun_out
;
81
}
hrt_xfer_data_t
;
82
84
typedef
struct
{
85
87
hrt_xfer_data_t
xfer_data
[
HRT_FE_MAX
];
88
92
hrt_xfer_bus_widths_t
bus_widths
;
93
96
uint16_t
counter_value
;
97
99
uint8_t
ce_vio
;
100
102
bool
ce_hold
;
103
105
enum
mspi_ce_polarity
ce_polarity
;
106
108
uint16_t
used_pins_mask
;
109
111
enum
mspi_cpp_mode
cpp_mode
;
112
113
}
hrt_xfer_t
;
114
121
void
hrt_write
(
volatile
hrt_xfer_t
*hrt_xfer_params);
122
129
void
hrt_read
(
volatile
hrt_xfer_t
*hrt_xfer_params);
130
131
#endif
/* _HRT_H__ */
hpf_mspi.h
hrt_write
void hrt_write(volatile hrt_xfer_t *hrt_xfer_params)
Write.
hrt_frame_element_t
hrt_frame_element_t
Definition
hrt.h:25
HRT_FE_ADDRESS
@ HRT_FE_ADDRESS
Definition
hrt.h:27
HRT_FE_DUMMY_CYCLES
@ HRT_FE_DUMMY_CYCLES
Definition
hrt.h:28
HRT_FE_MAX
@ HRT_FE_MAX
Definition
hrt.h:30
HRT_FE_COMMAND
@ HRT_FE_COMMAND
Definition
hrt.h:26
HRT_FE_DATA
@ HRT_FE_DATA
Definition
hrt.h:29
hrt_read
void hrt_read(volatile hrt_xfer_t *hrt_xfer_params)
Read.
hrt_fun_out_t
hrt_fun_out_t
Definition
hrt.h:33
HRT_FUN_OUT_BYTE
@ HRT_FUN_OUT_BYTE
Definition
hrt.h:34
HRT_FUN_OUT_WORD
@ HRT_FUN_OUT_WORD
Definition
hrt.h:35
hrt_xfer_bus_widths_t::address
uint8_t address
Definition
hrt.h:41
hrt_xfer_bus_widths_t::command
uint8_t command
Definition
hrt.h:40
hrt_xfer_bus_widths_t::data
uint8_t data
Definition
hrt.h:43
hrt_xfer_bus_widths_t::dummy_cycles
uint8_t dummy_cycles
Definition
hrt.h:42
hrt_xfer_bus_widths_t
Structure for holding bus width of different xfer parts.
Definition
hrt.h:39
hrt_xfer_data_t::data
volatile uint8_t * data
Buffer for RX/TX data.
Definition
hrt.h:48
hrt_xfer_data_t::last_word_clocks
uint8_t last_word_clocks
Amount of clock pulses for last word. Due to hardware limitation, in case when last word clock pulse ...
Definition
hrt.h:67
hrt_xfer_data_t::word_count
uint32_t word_count
Data length in 4 byte words, calculated as CEIL(buffer_length_bits/32).
Definition
hrt.h:53
hrt_xfer_data_t::fun_out
hrt_fun_out_t fun_out
Function for writing to buffered out register.
Definition
hrt.h:80
hrt_xfer_data_t::last_word
uint32_t last_word
Value of last word. For more info see last_word_clocks.
Definition
hrt.h:77
hrt_xfer_data_t::penultimate_word_clocks
uint8_t penultimate_word_clocks
Amount of clock pulses for penultimate word. For more info see last_word_clocks.
Definition
hrt.h:72
hrt_xfer_data_t
Definition
hrt.h:46
hrt_xfer_t::ce_polarity
enum mspi_ce_polarity ce_polarity
Chip enable pin polarity in enabled state.
Definition
hrt.h:105
hrt_xfer_t::ce_hold
bool ce_hold
If true chip enable pin will be left active after transfer.
Definition
hrt.h:102
hrt_xfer_t::ce_vio
uint8_t ce_vio
Index of CE VIO pin.
Definition
hrt.h:99
hrt_xfer_t::bus_widths
hrt_xfer_bus_widths_t bus_widths
Bus widths for different transfer parts (command, address, dummy_cycles, and data).
Definition
hrt.h:92
hrt_xfer_t::counter_value
uint16_t counter_value
Timer value, used for setting clock frequency.
Definition
hrt.h:96
hrt_xfer_t::xfer_data
hrt_xfer_data_t xfer_data[HRT_FE_MAX]
Data for all transfer parts.
Definition
hrt.h:87
hrt_xfer_t::used_pins_mask
uint16_t used_pins_mask
Used pins mask for csr dir register.
Definition
hrt.h:108
hrt_xfer_t::cpp_mode
enum mspi_cpp_mode cpp_mode
Due to hardware issues hrt module needs to know about selected spi mode.
Definition
hrt.h:111
hrt_xfer_t
Hrt transfer parameters.
Definition
hrt.h:84
applications
hpf
mspi
src
hrt
hrt.h
Generated on
for nRF Connect SDK API by
1.17.0