nRF Connect SDK API 3.3.99
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>
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
32
37
39typedef struct {
40 uint8_t command;
41 uint8_t address;
42 uint8_t dummy_cycles;
43 uint8_t data;
45
46typedef struct {
48 volatile uint8_t *data;
49
53 uint32_t word_count;
54
68
73
77 uint32_t last_word;
78
82
84typedef struct {
85
88
93
96 uint16_t counter_value;
97
99 uint8_t ce_vio;
100
103
105 enum mspi_ce_polarity ce_polarity;
106
109
111 enum mspi_cpp_mode cpp_mode;
112
113} hrt_xfer_t;
114
121void hrt_write(volatile hrt_xfer_t *hrt_xfer_params);
122
129void hrt_read(volatile hrt_xfer_t *hrt_xfer_params);
130
131#endif /* _HRT_H__ */
void hrt_write(volatile hrt_xfer_t *hrt_xfer_params)
Write.
hrt_frame_element_t
Definition hrt.h:25
@ HRT_FE_ADDRESS
Definition hrt.h:27
@ HRT_FE_DUMMY_CYCLES
Definition hrt.h:28
@ HRT_FE_MAX
Definition hrt.h:30
@ HRT_FE_COMMAND
Definition hrt.h:26
@ HRT_FE_DATA
Definition hrt.h:29
void hrt_read(volatile hrt_xfer_t *hrt_xfer_params)
Read.
hrt_fun_out_t
Definition hrt.h:33
@ HRT_FUN_OUT_BYTE
Definition hrt.h:34
@ HRT_FUN_OUT_WORD
Definition hrt.h:35
uint8_t address
Definition hrt.h:41
uint8_t command
Definition hrt.h:40
uint8_t data
Definition hrt.h:43
uint8_t dummy_cycles
Definition hrt.h:42
Structure for holding bus width of different xfer parts.
Definition hrt.h:39
volatile uint8_t * data
Buffer for RX/TX data.
Definition hrt.h:48
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
uint32_t word_count
Data length in 4 byte words, calculated as CEIL(buffer_length_bits/32).
Definition hrt.h:53
hrt_fun_out_t fun_out
Function for writing to buffered out register.
Definition hrt.h:80
uint32_t last_word
Value of last word. For more info see last_word_clocks.
Definition hrt.h:77
uint8_t penultimate_word_clocks
Amount of clock pulses for penultimate word. For more info see last_word_clocks.
Definition hrt.h:72
Definition hrt.h:46
enum mspi_ce_polarity ce_polarity
Chip enable pin polarity in enabled state.
Definition hrt.h:105
bool ce_hold
If true chip enable pin will be left active after transfer.
Definition hrt.h:102
uint8_t ce_vio
Index of CE VIO pin.
Definition hrt.h:99
hrt_xfer_bus_widths_t bus_widths
Bus widths for different transfer parts (command, address, dummy_cycles, and data).
Definition hrt.h:92
uint16_t counter_value
Timer value, used for setting clock frequency.
Definition hrt.h:96
uint16_t used_pins_mask
Used pins mask for csr dir register
Definition hrt.h:108
enum mspi_cpp_mode cpp_mode
Due to hardware issues hrt module needs to know about selected spi mode.
Definition hrt.h:111
Hrt transfer parameters.
Definition hrt.h:84