1 /* 2 * Copyright (c) 2024 Nordic Semiconductor ASA 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 */ 6 7 /** 8 * @file hal_reg.h 9 * 10 * @brief Header containing register read/write specific declarations for the 11 * HAL Layer of the Wi-Fi driver. 12 */ 13 14 #ifndef __HAL_REG_H__ 15 #define __HAL_REG_H__ 16 17 #include "hal_structs_common.h" 18 19 /** 20 * @brief Read from an RPU register. 21 * 22 * @param hal_ctx Pointer to HAL context. 23 * @param val Pointer to the host memory where the value read from the RPU register 24 * is to be copied. 25 * @param rpu_reg_addr Absolute value of RPU register address from which the 26 * value is to be read. 27 * 28 * This function reads a 4 byte value from a RPU register and copies it 29 * to the host memory pointed to by the val parameter. 30 * 31 * @return Status 32 * - Pass: NRF_WIFI_STATUS_SUCCESS 33 * - Error: NRF_WIFI_STATUS_FAIL 34 */ 35 enum nrf_wifi_status hal_rpu_reg_read(struct nrf_wifi_hal_dev_ctx *hal_ctx, 36 unsigned int *val, 37 unsigned int rpu_reg_addr); 38 39 /** 40 * @brief Wnrite to an RPU register. 41 * 42 * @param hal_ctx Pointer to HAL context. 43 * @param rpu_reg_addr Absolute value of RPU register address to which the 44 * value is to be written. 45 * @param val The value which is to be written to the RPU register. 46 * 47 * This function writes a 4 byte value to a RPU register. 48 * 49 * @return Status 50 * - Pass: NRF_WIFI_STATUS_SUCCESS 51 * - Error: NRF_WIFI_STATUS_FAIL 52 */ 53 enum nrf_wifi_status hal_rpu_reg_write(struct nrf_wifi_hal_dev_ctx *hal_ctx, 54 unsigned int rpu_reg_addr, 55 unsigned int val); 56 #endif /* __HAL_REG_H__ */ 57