Update platform drivers

Committer:
EndaKilgarriff
Date:
Mon Jun 15 13:03:55 2020 +0000
Revision:
9:9e247b9c9abf
Parent:
8:70fc373a5f46
- Include the following libraries:; 	- crc; 	- crc8; 	- uart; 	- util; - Add microsecond delay; - Move baud rate definition to mbed_app.json file; - Add bit shift for I2C slave address; - Check error for redefinition; - Make gpio handling more robust;

Who changed what in which revision?

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