RTEMS 6.1-rc6
Loading...
Searching...
No Matches
fsl_lpspi_freertos.h
1/*
2 * Copyright (c) 2015, Freescale Semiconductor, Inc.
3 * Copyright 2016-2022 NXP
4 * All rights reserved.
5 *
6 * SPDX-License-Identifier: BSD-3-Clause
7 */
8#ifndef __FSL_LPSPI_FREERTOS_H__
9#define __FSL_LPSPI_FREERTOS_H__
10
11#include "FreeRTOS.h"
12#include "portable.h"
13#include "semphr.h"
14
15#include "fsl_lpspi.h"
16
22/**********************************************************************************************************************
23 * Definitions
24 *********************************************************************************************************************/
25
29#define FSL_LPSPI_FREERTOS_DRIVER_VERSION (MAKE_VERSION(2, 3, 1))
36typedef struct _lpspi_rtos_handle
37{
38 LPSPI_Type *base;
39 lpspi_master_handle_t drv_handle;
40 status_t async_status;
41 SemaphoreHandle_t mutex;
42 SemaphoreHandle_t event;
43} lpspi_rtos_handle_t;
46/**********************************************************************************************************************
47 * API
48 *********************************************************************************************************************/
49
50#if defined(__cplusplus)
51extern "C" {
52#endif
53
70status_t LPSPI_RTOS_Init(lpspi_rtos_handle_t *handle,
71 LPSPI_Type *base,
72 const lpspi_master_config_t *masterConfig,
73 uint32_t srcClock_Hz);
74
82status_t LPSPI_RTOS_Deinit(lpspi_rtos_handle_t *handle);
83
93status_t LPSPI_RTOS_Transfer(lpspi_rtos_handle_t *handle, lpspi_transfer_t *transfer);
94
99#if defined(__cplusplus)
100}
101#endif
102
107#endif /* __FSL_LPSPI_FREERTOS_H__ */
int32_t status_t
Type used for all status and error return values.
Definition: fsl_common.h:225
status_t LPSPI_RTOS_Init(lpspi_rtos_handle_t *handle, LPSPI_Type *base, const lpspi_master_config_t *masterConfig, uint32_t srcClock_Hz)
Initializes LPSPI.
status_t LPSPI_RTOS_Transfer(lpspi_rtos_handle_t *handle, lpspi_transfer_t *transfer)
Performs SPI transfer.
status_t LPSPI_RTOS_Deinit(lpspi_rtos_handle_t *handle)
Deinitializes the LPSPI.
Definition: MIMXRT1052.h:30457
LPSPI master configuration structure.
Definition: fsl_lpspi.h:262
LPSPI master transfer handle structure used for transactional API.
Definition: fsl_lpspi.h:356
LPSPI master/slave transfer structure.
Definition: fsl_lpspi.h:344
Definition: mutex.h:4