Analog Devices / ADMX2001
Committer:
nsheth
Date:
Wed Oct 27 07:36:03 2021 +0000
Revision:
8:ca65a811c522
Convert platform drivers away from library

Who changed what in which revision?

UserRevisionLine numberNew contents of line
nsheth 8:ca65a811c522 1 /***************************************************************************//**
nsheth 8:ca65a811c522 2 * @file platform_drivers.h
nsheth 8:ca65a811c522 3 * @brief Header file of Generic Platform Drivers.
nsheth 8:ca65a811c522 4 * @author DBogdan (dragos.bogdan@analog.com)
nsheth 8:ca65a811c522 5 ********************************************************************************
nsheth 8:ca65a811c522 6 * Copyright 2017, 2019(c) Analog Devices, Inc.
nsheth 8:ca65a811c522 7 *
nsheth 8:ca65a811c522 8 * All rights reserved.
nsheth 8:ca65a811c522 9 *
nsheth 8:ca65a811c522 10 * Redistribution and use in source and binary forms, with or without
nsheth 8:ca65a811c522 11 * modification, are permitted provided that the following conditions are met:
nsheth 8:ca65a811c522 12 * - Redistributions of source code must retain the above copyright
nsheth 8:ca65a811c522 13 * notice, this list of conditions and the following disclaimer.
nsheth 8:ca65a811c522 14 * - Redistributions in binary form must reproduce the above copyright
nsheth 8:ca65a811c522 15 * notice, this list of conditions and the following disclaimer in
nsheth 8:ca65a811c522 16 * the documentation and/or other materials provided with the
nsheth 8:ca65a811c522 17 * distribution.
nsheth 8:ca65a811c522 18 * - Neither the name of Analog Devices, Inc. nor the names of its
nsheth 8:ca65a811c522 19 * contributors may be used to endorse or promote products derived
nsheth 8:ca65a811c522 20 * from this software without specific prior written permission.
nsheth 8:ca65a811c522 21 * - The use of this software may or may not infringe the patent rights
nsheth 8:ca65a811c522 22 * of one or more patent holders. This license does not release you
nsheth 8:ca65a811c522 23 * from the requirement that you obtain separate licenses from these
nsheth 8:ca65a811c522 24 * patent holders to use this software.
nsheth 8:ca65a811c522 25 * - Use of the software either in source or binary form, must be run
nsheth 8:ca65a811c522 26 * on or directly connected to an Analog Devices Inc. component.
nsheth 8:ca65a811c522 27 *
nsheth 8:ca65a811c522 28 * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
nsheth 8:ca65a811c522 29 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
nsheth 8:ca65a811c522 30 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
nsheth 8:ca65a811c522 31 * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
nsheth 8:ca65a811c522 32 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
nsheth 8:ca65a811c522 33 * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
nsheth 8:ca65a811c522 34 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
nsheth 8:ca65a811c522 35 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
nsheth 8:ca65a811c522 36 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
nsheth 8:ca65a811c522 37 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
nsheth 8:ca65a811c522 38 *******************************************************************************/
nsheth 8:ca65a811c522 39
nsheth 8:ca65a811c522 40 #ifndef PLATFORM_DRIVERS_H_
nsheth 8:ca65a811c522 41 #define PLATFORM_DRIVERS_H_
nsheth 8:ca65a811c522 42
nsheth 8:ca65a811c522 43
nsheth 8:ca65a811c522 44 // Platform drivers needs to be C-compatible to work with other drivers
nsheth 8:ca65a811c522 45 #ifdef __cplusplus
nsheth 8:ca65a811c522 46 extern "C"
nsheth 8:ca65a811c522 47 {
nsheth 8:ca65a811c522 48 #endif // _cplusplus
nsheth 8:ca65a811c522 49
nsheth 8:ca65a811c522 50
nsheth 8:ca65a811c522 51 /******************************************************************************/
nsheth 8:ca65a811c522 52 /********************** Macros and Constants Definitions **********************/
nsheth 8:ca65a811c522 53 /******************************************************************************/
nsheth 8:ca65a811c522 54
nsheth 8:ca65a811c522 55 // spi_init(), i2c_init(), i2c_write() and i2c_read() function are already defined
nsheth 8:ca65a811c522 56 // in mbed-os libraries. To avoid this naming conflict, the functions are wrapped
nsheth 8:ca65a811c522 57 // with suffix _noos using macros.
nsheth 8:ca65a811c522 58
nsheth 8:ca65a811c522 59 #define spi_init(desc, init_param) spi_init_noos(desc, init_param)
nsheth 8:ca65a811c522 60
nsheth 8:ca65a811c522 61 #define i2c_init(desc, init_param) i2c_init_noos(desc, init_param)
nsheth 8:ca65a811c522 62 #define i2c_write(desc, data, bytes_number, stop_bits) i2c_write_noos(desc, data, bytes_number, stop_bits)
nsheth 8:ca65a811c522 63 #define i2c_read(desc, data, bytes_number, stop_bits) i2c_read_noos(desc, data, bytes_number, stop_bits)
nsheth 8:ca65a811c522 64
nsheth 8:ca65a811c522 65 /******************************************************************************/
nsheth 8:ca65a811c522 66 /***************************** Include Files **********************************/
nsheth 8:ca65a811c522 67 /******************************************************************************/
nsheth 8:ca65a811c522 68
nsheth 8:ca65a811c522 69 #include "delay.h"
nsheth 8:ca65a811c522 70 #include "error.h"
nsheth 8:ca65a811c522 71 #include "gpio.h"
nsheth 8:ca65a811c522 72 #include "i2c.h"
nsheth 8:ca65a811c522 73 #include "spi.h"
nsheth 8:ca65a811c522 74
nsheth 8:ca65a811c522 75
nsheth 8:ca65a811c522 76 #ifdef __cplusplus // Closing extern c
nsheth 8:ca65a811c522 77 }
nsheth 8:ca65a811c522 78 #endif // _cplusplus
nsheth 8:ca65a811c522 79
nsheth 8:ca65a811c522 80 #endif // PLATFORM_DRIVERS_H_