Forked repo of Platform Drivers- Analog Devices
mbed_ain_aout_extra.h@20:26b1a4570f4b, 2021-11-22 (annotated)
- Committer:
- Janani Sunil
- Date:
- Mon Nov 22 22:26:51 2021 +0530
- Revision:
- 20:26b1a4570f4b
- Parent:
- 19:3c61197500c4
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 as it's member for multiplatform project compatibility
5.) Added a module for timer and its related header file
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Kjansen |
19:3c61197500c4 | 1 | /***************************************************************************//* |
Kjansen |
19:3c61197500c4 | 2 | * @file mbed_ain_aout_extra.h |
Kjansen |
19:3c61197500c4 | 3 | * @brief Header containing extra types required for |
Kjansen |
19:3c61197500c4 | 4 | * analog in/output functionality |
Kjansen |
19:3c61197500c4 | 5 | ****************************************************************************** |
Kjansen |
19:3c61197500c4 | 6 | * Copyright (c) 2021 Analog Devices, Inc. |
Kjansen |
19:3c61197500c4 | 7 | * All rights reserved. |
Kjansen |
19:3c61197500c4 | 8 | * |
Kjansen |
19:3c61197500c4 | 9 | * This software is proprietary to Analog Devices, Inc. and its licensors. |
Kjansen |
19:3c61197500c4 | 10 | * By using this software you agree to the terms of the associated |
Kjansen |
19:3c61197500c4 | 11 | * Analog Devices Software License Agreement. |
Kjansen |
19:3c61197500c4 | 12 | ******************************************************************************/ |
Kjansen |
19:3c61197500c4 | 13 | |
Kjansen |
19:3c61197500c4 | 14 | #ifndef MBED_AIN_AOUT_EXTRA_H_ |
Kjansen |
19:3c61197500c4 | 15 | #define MBED_AIN_AOUT_EXTRA_H_ |
Kjansen |
19:3c61197500c4 | 16 | |
Kjansen |
19:3c61197500c4 | 17 | // Platform support needs to be C-compatible to work with other drivers |
Kjansen |
19:3c61197500c4 | 18 | #ifdef __cplusplus |
Kjansen |
19:3c61197500c4 | 19 | extern "C" |
Kjansen |
19:3c61197500c4 | 20 | { |
Kjansen |
19:3c61197500c4 | 21 | #endif |
Kjansen |
19:3c61197500c4 | 22 | |
Kjansen |
19:3c61197500c4 | 23 | /*****************************************************************************/ |
Kjansen |
19:3c61197500c4 | 24 | /***************************** Include Files *********************************/ |
Kjansen |
19:3c61197500c4 | 25 | /*****************************************************************************/ |
Kjansen |
19:3c61197500c4 | 26 | |
Kjansen |
19:3c61197500c4 | 27 | #include "stdio.h" |
Kjansen |
19:3c61197500c4 | 28 | #include "stdint.h" |
Kjansen |
19:3c61197500c4 | 29 | |
Kjansen |
19:3c61197500c4 | 30 | /*****************************************************************************/ |
Kjansen |
19:3c61197500c4 | 31 | /********************** Macros and Constants Definition **********************/ |
Kjansen |
19:3c61197500c4 | 32 | /*****************************************************************************/ |
Kjansen |
19:3c61197500c4 | 33 | |
Kjansen |
19:3c61197500c4 | 34 | /******************************************************************************/ |
Kjansen |
19:3c61197500c4 | 35 | /********************** Variables and User defined data types *****************/ |
Kjansen |
19:3c61197500c4 | 36 | /******************************************************************************/ |
Kjansen |
19:3c61197500c4 | 37 | /** |
Kjansen |
19:3c61197500c4 | 38 | * @struct mbed_analog_in_desc |
Kjansen |
19:3c61197500c4 | 39 | * @brief Analog input pin specific descriptor for the mbed platform. |
Kjansen |
19:3c61197500c4 | 40 | */ |
Kjansen |
19:3c61197500c4 | 41 | struct mbed_analog_in_desc { |
Kjansen |
19:3c61197500c4 | 42 | /* Analog Input instance (mbed::AnalogIn) */ |
Kjansen |
19:3c61197500c4 | 43 | void *analog_in_obj; |
Kjansen |
19:3c61197500c4 | 44 | }; |
Kjansen |
19:3c61197500c4 | 45 | |
Kjansen |
19:3c61197500c4 | 46 | /** |
Kjansen |
19:3c61197500c4 | 47 | * @struct mbed_analog_out_desc |
Kjansen |
19:3c61197500c4 | 48 | * @brief Analog output pin specific descriptor for the mbed platform. |
Kjansen |
19:3c61197500c4 | 49 | */ |
Kjansen |
19:3c61197500c4 | 50 | struct mbed_analog_out_desc { |
Kjansen |
19:3c61197500c4 | 51 | /* Analog Output instance (mbed::AnalogOut) */ |
Kjansen |
19:3c61197500c4 | 52 | void *analog_out_obj; |
Kjansen |
19:3c61197500c4 | 53 | }; |
Kjansen |
19:3c61197500c4 | 54 | |
Kjansen |
19:3c61197500c4 | 55 | /** |
Kjansen |
19:3c61197500c4 | 56 | * @brief mbed specific analog input platform ops structure |
Kjansen |
19:3c61197500c4 | 57 | */ |
Kjansen |
19:3c61197500c4 | 58 | extern const struct ain_platform_ops mbed_ain_ops; |
Kjansen |
19:3c61197500c4 | 59 | |
Kjansen |
19:3c61197500c4 | 60 | /** |
Kjansen |
19:3c61197500c4 | 61 | * @brief mbed specific analog output platform ops structure |
Kjansen |
19:3c61197500c4 | 62 | */ |
Kjansen |
19:3c61197500c4 | 63 | extern const struct aout_platform_ops mbed_out_ops; |
Kjansen |
19:3c61197500c4 | 64 | |
Kjansen |
19:3c61197500c4 | 65 | /******************************************************************************/ |
Kjansen |
19:3c61197500c4 | 66 | /*****************************Function Declarations****************************/ |
Kjansen |
19:3c61197500c4 | 67 | /******************************************************************************/ |
Kjansen |
19:3c61197500c4 | 68 | |
Kjansen |
19:3c61197500c4 | 69 | #ifdef __cplusplus // Closing extern c |
Kjansen |
19:3c61197500c4 | 70 | } |
Kjansen |
19:3c61197500c4 | 71 | #endif |
Kjansen |
19:3c61197500c4 | 72 | |
Kjansen |
19:3c61197500c4 | 73 | #endif /* MBED_AIN_AOUT_EXTRA_H_ */ |
Kjansen |
19:3c61197500c4 | 74 |