RTEMS 6.1-rc2
Loading...
Searching...
No Matches
fsl_lpi2c_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_LPI2C_FREERTOS_H__
9#define __FSL_LPI2C_FREERTOS_H__
10
11#include "FreeRTOS.h"
12#include "portable.h"
13#include "semphr.h"
14
15#include "fsl_lpi2c.h"
16
22/*******************************************************************************
23 * Definitions
24 ******************************************************************************/
25
29#define FSL_LPI2C_FREERTOS_DRIVER_VERSION (MAKE_VERSION(2, 3, 2))
36typedef struct _lpi2c_rtos_handle
37{
38 LPI2C_Type *base;
39 lpi2c_master_handle_t drv_handle;
40 status_t async_status;
41 SemaphoreHandle_t mutex;
42 SemaphoreHandle_t semaphore;
43} lpi2c_rtos_handle_t;
46/*******************************************************************************
47 * API
48 ******************************************************************************/
49
50#if defined(__cplusplus)
51extern "C" {
52#endif
53
70status_t LPI2C_RTOS_Init(lpi2c_rtos_handle_t *handle,
71 LPI2C_Type *base,
72 const lpi2c_master_config_t *masterConfig,
73 uint32_t srcClock_Hz);
74
82status_t LPI2C_RTOS_Deinit(lpi2c_rtos_handle_t *handle);
83
93status_t LPI2C_RTOS_Transfer(lpi2c_rtos_handle_t *handle, lpi2c_master_transfer_t *transfer);
94
99#if defined(__cplusplus)
100}
101#endif
102
107#endif /* __FSL_LPI2C_FREERTOS_H__ */
int32_t status_t
Type used for all status and error return values.
Definition: fsl_common.h:225
status_t LPI2C_RTOS_Init(lpi2c_rtos_handle_t *handle, LPI2C_Type *base, const lpi2c_master_config_t *masterConfig, uint32_t srcClock_Hz)
Initializes LPI2C.
status_t LPI2C_RTOS_Transfer(lpi2c_rtos_handle_t *handle, lpi2c_master_transfer_t *transfer)
Performs I2C transfer.
status_t LPI2C_RTOS_Deinit(lpi2c_rtos_handle_t *handle)
Deinitializes the LPI2C.
Definition: MIMXRT1052.h:29282
Structure with settings to initialize the LPI2C master module.
Definition: fsl_lpi2c.h:150
Driver handle for master non-blocking APIs.
Definition: fsl_lpi2c.h:249
Non-blocking transfer descriptor structure.
Definition: fsl_lpi2c.h:233
Definition: mutex.h:4