Platform drivers for Mbed.

Dependents:   EVAL-CN0535-FMCZ EVAL-CN0535-FMCZ EVAL-AD568x-AD569x EVAL-AD7606 ... more

Committer:
Kjansen
Date:
Mon Nov 29 12:39:54 2021 +0000
Revision:
20:4951ea6abee5
The following changes were made:
1.) Modified udelay() function for generating more accurate smaller usec delays
2.) Implemented the irq_enable and irq_disable functions
3.) Removed the confusion b/w application created peripheral object and interrupt specific object
4.) Created PWM extra init structure and added PWM pin
5.) Added a module for timer and its related header file

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kjansen 20:4951ea6abee5 1 /***************************************************************************//*
Kjansen 20:4951ea6abee5 2 * @file timer_extra.h
Kjansen 20:4951ea6abee5 3 * @brief Header containing extra types for Timer interface
Kjansen 20:4951ea6abee5 4 ******************************************************************************
Kjansen 20:4951ea6abee5 5 * Copyright (c) 2021 Analog Devices, Inc.
Kjansen 20:4951ea6abee5 6 * All rights reserved.
Kjansen 20:4951ea6abee5 7 *
Kjansen 20:4951ea6abee5 8 * This software is proprietary to Analog Devices, Inc. and its licensors.
Kjansen 20:4951ea6abee5 9 * By using this software you agree to the terms of the associated
Kjansen 20:4951ea6abee5 10 * Analog Devices Software License Agreement.
Kjansen 20:4951ea6abee5 11 ******************************************************************************/
Kjansen 20:4951ea6abee5 12
Kjansen 20:4951ea6abee5 13 #ifndef _TIMER_EXTRA_H_
Kjansen 20:4951ea6abee5 14 #define _TIMER_EXTRA_H_
Kjansen 20:4951ea6abee5 15
Kjansen 20:4951ea6abee5 16 // Platform support needs to be C-compatible to work with other drivers
Kjansen 20:4951ea6abee5 17 #ifdef __cplusplus
Kjansen 20:4951ea6abee5 18 extern "C"
Kjansen 20:4951ea6abee5 19 {
Kjansen 20:4951ea6abee5 20 #endif
Kjansen 20:4951ea6abee5 21
Kjansen 20:4951ea6abee5 22 /*****************************************************************************/
Kjansen 20:4951ea6abee5 23 /***************************** Include Files *********************************/
Kjansen 20:4951ea6abee5 24 /*****************************************************************************/
Kjansen 20:4951ea6abee5 25
Kjansen 20:4951ea6abee5 26 #include "stdio.h"
Kjansen 20:4951ea6abee5 27 #include "stdint.h"
Kjansen 20:4951ea6abee5 28
Kjansen 20:4951ea6abee5 29 /*****************************************************************************/
Kjansen 20:4951ea6abee5 30 /********************** Macros and Constants Definition **********************/
Kjansen 20:4951ea6abee5 31 /*****************************************************************************/
Kjansen 20:4951ea6abee5 32
Kjansen 20:4951ea6abee5 33 /******************************************************************************/
Kjansen 20:4951ea6abee5 34 /********************** Variables and User defined data types *****************/
Kjansen 20:4951ea6abee5 35 /******************************************************************************/
Kjansen 20:4951ea6abee5 36
Kjansen 20:4951ea6abee5 37 /**
Kjansen 20:4951ea6abee5 38 * @struct mbed_timer_desc
Kjansen 20:4951ea6abee5 39 * @brief Structure holding the mbed specific Timer parameters
Kjansen 20:4951ea6abee5 40 */
Kjansen 20:4951ea6abee5 41 typedef struct mbed_timer_desc {
Kjansen 20:4951ea6abee5 42 void *timer; // Object to the mbed Timer class
Kjansen 20:4951ea6abee5 43 } mbed_timer_desc;
Kjansen 20:4951ea6abee5 44
Kjansen 20:4951ea6abee5 45 /******************************************************************************/
Kjansen 20:4951ea6abee5 46 /*****************************Function Declarations****************************/
Kjansen 20:4951ea6abee5 47 /******************************************************************************/
Kjansen 20:4951ea6abee5 48
Kjansen 20:4951ea6abee5 49 /* Function to capture the elapsed time in nanoseconds */
Kjansen 20:4951ea6abee5 50 int32_t get_elapsed_time_in_nsec(struct timer_desc *desc,
Kjansen 20:4951ea6abee5 51 uint64_t *elapsed_time);
Kjansen 20:4951ea6abee5 52
Kjansen 20:4951ea6abee5 53 #ifdef __cplusplus // Closing extern c
Kjansen 20:4951ea6abee5 54 }
Kjansen 20:4951ea6abee5 55 #endif
Kjansen 20:4951ea6abee5 56
Kjansen 20:4951ea6abee5 57 #endif /*_TIMER_EXTRA_H_ */