Forked repo of Platform Drivers- Analog Devices
spi.cpp@20:26b1a4570f4b, 2021-11-22 (annotated)
- Committer:
- Janani Sunil
- Date:
- Mon Nov 22 22:26:51 2021 +0530
- Revision:
- 20:26b1a4570f4b
- Parent:
- 17:af1f2416dd26
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 |
---|---|---|---|
mahphalke |
17:af1f2416dd26 | 1 | /***************************************************************************//** |
mahphalke |
17:af1f2416dd26 | 2 | * @file spi.cpp |
mahphalke |
17:af1f2416dd26 | 3 | * @brief Implementation of SPI Mbed platform driver interfaces |
mahphalke |
17:af1f2416dd26 | 4 | ******************************************************************************** |
mahphalke |
17:af1f2416dd26 | 5 | * Copyright (c) 2019-2021 Analog Devices, Inc. |
mahphalke |
17:af1f2416dd26 | 6 | * All rights reserved. |
mahphalke |
17:af1f2416dd26 | 7 | * |
mahphalke |
17:af1f2416dd26 | 8 | * This software is proprietary to Analog Devices, Inc. and its licensors. |
mahphalke |
17:af1f2416dd26 | 9 | * By using this software you agree to the terms of the associated |
mahphalke |
17:af1f2416dd26 | 10 | * Analog Devices Software License Agreement. |
mahphalke |
17:af1f2416dd26 | 11 | *******************************************************************************/ |
mahphalke |
17:af1f2416dd26 | 12 | |
mahphalke |
17:af1f2416dd26 | 13 | /******************************************************************************/ |
mahphalke |
17:af1f2416dd26 | 14 | /***************************** Include Files **********************************/ |
mahphalke |
17:af1f2416dd26 | 15 | /******************************************************************************/ |
mahphalke |
17:af1f2416dd26 | 16 | |
mahphalke |
17:af1f2416dd26 | 17 | #include <stdio.h> |
mahphalke |
17:af1f2416dd26 | 18 | #include <mbed.h> |
mahphalke |
17:af1f2416dd26 | 19 | |
mahphalke |
17:af1f2416dd26 | 20 | // Platform drivers needs to be C-compatible to work with other drivers |
mahphalke |
17:af1f2416dd26 | 21 | #ifdef __cplusplus |
mahphalke |
17:af1f2416dd26 | 22 | extern "C" |
mahphalke |
17:af1f2416dd26 | 23 | { |
mahphalke |
17:af1f2416dd26 | 24 | #endif // _cplusplus |
mahphalke |
17:af1f2416dd26 | 25 | |
mahphalke |
17:af1f2416dd26 | 26 | #include "error.h" |
mahphalke |
17:af1f2416dd26 | 27 | #include "spi.h" |
mahphalke |
17:af1f2416dd26 | 28 | #include "gpio.h" |
mahphalke |
17:af1f2416dd26 | 29 | #include "spi_extra.h" |
mahphalke |
17:af1f2416dd26 | 30 | |
mahphalke |
17:af1f2416dd26 | 31 | /******************************************************************************/ |
mahphalke |
17:af1f2416dd26 | 32 | /********************** Macros and Constants Definitions **********************/ |
mahphalke |
17:af1f2416dd26 | 33 | /******************************************************************************/ |
mahphalke |
17:af1f2416dd26 | 34 | |
mahphalke |
17:af1f2416dd26 | 35 | #define SPI_8_BIT_FRAME 8 // SPI 8-bit frame size |
mahphalke |
17:af1f2416dd26 | 36 | |
mahphalke |
17:af1f2416dd26 | 37 | /******************************************************************************/ |
mahphalke |
17:af1f2416dd26 | 38 | /********************** Variables and User defined data types *****************/ |
mahphalke |
17:af1f2416dd26 | 39 | /******************************************************************************/ |
mahphalke |
17:af1f2416dd26 | 40 | |
mahphalke |
17:af1f2416dd26 | 41 | /******************************************************************************/ |
mahphalke |
17:af1f2416dd26 | 42 | /************************ Functions Declarations ******************************/ |
mahphalke |
17:af1f2416dd26 | 43 | /******************************************************************************/ |
mahphalke |
17:af1f2416dd26 | 44 | |
mahphalke |
17:af1f2416dd26 | 45 | /******************************************************************************/ |
mahphalke |
17:af1f2416dd26 | 46 | /************************ Functions Definitions *******************************/ |
mahphalke |
17:af1f2416dd26 | 47 | /******************************************************************************/ |
mahphalke |
17:af1f2416dd26 | 48 | |
mahphalke |
17:af1f2416dd26 | 49 | /** |
mahphalke |
17:af1f2416dd26 | 50 | * @brief Initialize the SPI communication peripheral. |
mahphalke |
17:af1f2416dd26 | 51 | * @param desc - The SPI descriptor. |
mahphalke |
17:af1f2416dd26 | 52 | * @param init_param - The structure that contains the SPI parameters. |
mahphalke |
17:af1f2416dd26 | 53 | * @return SUCCESS in case of success, FAILURE otherwise. |
mahphalke |
17:af1f2416dd26 | 54 | */ |
mahphalke |
17:af1f2416dd26 | 55 | int32_t spi_init_noos(struct spi_desc **desc, |
mahphalke |
17:af1f2416dd26 | 56 | const struct spi_init_param *param) |
mahphalke |
17:af1f2416dd26 | 57 | { |
mahphalke |
17:af1f2416dd26 | 58 | mbed::SPI *spi; // Pointer to new spi instance |
mahphalke |
17:af1f2416dd26 | 59 | DigitalOut *csb; // pointer to new CSB gpio instance |
mahphalke |
17:af1f2416dd26 | 60 | mbed_spi_desc *mbed_desc; // Pointer to mbed spi descriptor |
mahphalke |
17:af1f2416dd26 | 61 | use_gpio_ssel_t use_gpio_ssel; // For CSB hardware (implicit) control |
mahphalke |
17:af1f2416dd26 | 62 | spi_desc *new_desc; |
mahphalke |
17:af1f2416dd26 | 63 | |
mahphalke |
17:af1f2416dd26 | 64 | if ((desc) && (param) && (param->extra)) { |
mahphalke |
17:af1f2416dd26 | 65 | // Create the spi description object for the device |
mahphalke |
17:af1f2416dd26 | 66 | new_desc = (spi_desc *)malloc(sizeof(spi_desc)); |
mahphalke |
17:af1f2416dd26 | 67 | if (!new_desc) { |
mahphalke |
17:af1f2416dd26 | 68 | goto err_new_desc; |
mahphalke |
17:af1f2416dd26 | 69 | } |
mahphalke |
17:af1f2416dd26 | 70 | |
mahphalke |
17:af1f2416dd26 | 71 | new_desc->chip_select = param->chip_select; |
mahphalke |
17:af1f2416dd26 | 72 | new_desc->mode = param->mode; |
mahphalke |
17:af1f2416dd26 | 73 | new_desc->max_speed_hz = param->max_speed_hz; |
mahphalke |
17:af1f2416dd26 | 74 | |
mahphalke |
17:af1f2416dd26 | 75 | // Create the SPI extra descriptor object to store new SPI instances |
mahphalke |
17:af1f2416dd26 | 76 | mbed_desc = (mbed_spi_desc *)malloc(sizeof(mbed_spi_desc)); |
mahphalke |
17:af1f2416dd26 | 77 | if (!mbed_desc) { |
mahphalke |
17:af1f2416dd26 | 78 | goto err_mbed_desc; |
mahphalke |
17:af1f2416dd26 | 79 | } |
mahphalke |
17:af1f2416dd26 | 80 | |
mahphalke |
17:af1f2416dd26 | 81 | // Configure and instantiate SPI protocol |
mahphalke |
17:af1f2416dd26 | 82 | if (((mbed_spi_init_param *)param->extra)->use_sw_csb) { |
mahphalke |
17:af1f2416dd26 | 83 | /* CSB pin toggled explicitly (s/w controlled) during SPI transaction */ |
mahphalke |
17:af1f2416dd26 | 84 | spi = new SPI( |
mahphalke |
17:af1f2416dd26 | 85 | (PinName)(((mbed_spi_init_param *)param->extra)->spi_mosi_pin), |
mahphalke |
17:af1f2416dd26 | 86 | (PinName)(((mbed_spi_init_param *)param->extra)->spi_miso_pin), |
mahphalke |
17:af1f2416dd26 | 87 | (PinName)(((mbed_spi_init_param *)param->extra)->spi_clk_pin)); |
mahphalke |
17:af1f2416dd26 | 88 | |
mahphalke |
17:af1f2416dd26 | 89 | if (spi) { |
mahphalke |
17:af1f2416dd26 | 90 | /* Configure and instantiate chip select pin */ |
mahphalke |
17:af1f2416dd26 | 91 | csb = new DigitalOut((PinName)(new_desc->chip_select)); |
mahphalke |
17:af1f2416dd26 | 92 | if (csb) { |
mahphalke |
17:af1f2416dd26 | 93 | mbed_desc->use_sw_csb = true; |
mahphalke |
17:af1f2416dd26 | 94 | mbed_desc->csb_gpio = (DigitalOut *)csb; |
mahphalke |
17:af1f2416dd26 | 95 | csb->write(GPIO_HIGH); |
mahphalke |
17:af1f2416dd26 | 96 | } else { |
mahphalke |
17:af1f2416dd26 | 97 | goto err_csb; |
mahphalke |
17:af1f2416dd26 | 98 | } |
mahphalke |
17:af1f2416dd26 | 99 | } |
mahphalke |
17:af1f2416dd26 | 100 | } else { |
mahphalke |
17:af1f2416dd26 | 101 | /* CSB pin toggled implicitly (through HAL layer) during SPI transaction */ |
mahphalke |
17:af1f2416dd26 | 102 | spi = new SPI( |
mahphalke |
17:af1f2416dd26 | 103 | (PinName)(((mbed_spi_init_param *)param->extra)->spi_mosi_pin), |
mahphalke |
17:af1f2416dd26 | 104 | (PinName)(((mbed_spi_init_param *)param->extra)->spi_miso_pin), |
mahphalke |
17:af1f2416dd26 | 105 | (PinName)(((mbed_spi_init_param *)param->extra)->spi_clk_pin), |
mahphalke |
17:af1f2416dd26 | 106 | (PinName)(param->chip_select), |
mahphalke |
17:af1f2416dd26 | 107 | use_gpio_ssel); |
mahphalke |
17:af1f2416dd26 | 108 | |
mahphalke |
17:af1f2416dd26 | 109 | mbed_desc->use_sw_csb = false; |
mahphalke |
17:af1f2416dd26 | 110 | mbed_desc->csb_gpio = NULL; |
mahphalke |
17:af1f2416dd26 | 111 | } |
mahphalke |
17:af1f2416dd26 | 112 | |
mahphalke |
17:af1f2416dd26 | 113 | if (!spi) { |
mahphalke |
17:af1f2416dd26 | 114 | goto err_spi; |
mahphalke |
17:af1f2416dd26 | 115 | } |
mahphalke |
17:af1f2416dd26 | 116 | |
mahphalke |
17:af1f2416dd26 | 117 | mbed_desc->spi_port = (SPI *)spi; |
mahphalke |
17:af1f2416dd26 | 118 | |
mahphalke |
17:af1f2416dd26 | 119 | new_desc->extra = (mbed_spi_desc *)mbed_desc; |
mahphalke |
17:af1f2416dd26 | 120 | *desc = new_desc; |
mahphalke |
17:af1f2416dd26 | 121 | |
mahphalke |
17:af1f2416dd26 | 122 | /** |
mahphalke |
17:af1f2416dd26 | 123 | NOTE: Actual frequency of SPI clk will be somewhat device |
mahphalke |
17:af1f2416dd26 | 124 | dependent, relating to clock-settings, prescalars etc. If absolute |
mahphalke |
17:af1f2416dd26 | 125 | SPI frequency is required, consult your device documentation. |
mahphalke |
17:af1f2416dd26 | 126 | **/ |
mahphalke |
17:af1f2416dd26 | 127 | spi->frequency(param->max_speed_hz); |
mahphalke |
17:af1f2416dd26 | 128 | spi->format(SPI_8_BIT_FRAME, param->mode); // data write/read format |
mahphalke |
17:af1f2416dd26 | 129 | spi->set_default_write_value(0x00); // code to write when reading back |
mahphalke |
17:af1f2416dd26 | 130 | |
mahphalke |
17:af1f2416dd26 | 131 | return SUCCESS; |
mahphalke |
17:af1f2416dd26 | 132 | } |
mahphalke |
17:af1f2416dd26 | 133 | |
mahphalke |
17:af1f2416dd26 | 134 | err_spi: |
mahphalke |
17:af1f2416dd26 | 135 | if (((mbed_spi_init_param *)param->extra)->use_sw_csb) { |
mahphalke |
17:af1f2416dd26 | 136 | free(csb); |
mahphalke |
17:af1f2416dd26 | 137 | } |
mahphalke |
17:af1f2416dd26 | 138 | err_csb: |
mahphalke |
17:af1f2416dd26 | 139 | free(spi); |
mahphalke |
17:af1f2416dd26 | 140 | free(mbed_desc); |
mahphalke |
17:af1f2416dd26 | 141 | err_mbed_desc: |
mahphalke |
17:af1f2416dd26 | 142 | free(new_desc); |
mahphalke |
17:af1f2416dd26 | 143 | err_new_desc: |
mahphalke |
17:af1f2416dd26 | 144 | // Nothing to free |
mahphalke |
17:af1f2416dd26 | 145 | |
mahphalke |
17:af1f2416dd26 | 146 | return FAILURE; |
mahphalke |
17:af1f2416dd26 | 147 | } |
mahphalke |
17:af1f2416dd26 | 148 | |
mahphalke |
17:af1f2416dd26 | 149 | |
mahphalke |
17:af1f2416dd26 | 150 | /** |
mahphalke |
17:af1f2416dd26 | 151 | * @brief Free the resources allocated by spi_init(). |
mahphalke |
17:af1f2416dd26 | 152 | * @param desc - The SPI descriptor. |
mahphalke |
17:af1f2416dd26 | 153 | * @return SUCCESS in case of success, FAILURE otherwise. |
mahphalke |
17:af1f2416dd26 | 154 | */ |
mahphalke |
17:af1f2416dd26 | 155 | int32_t spi_remove(struct spi_desc *desc) |
mahphalke |
17:af1f2416dd26 | 156 | { |
mahphalke |
17:af1f2416dd26 | 157 | if (desc) { |
mahphalke |
17:af1f2416dd26 | 158 | if (((mbed_spi_desc *)desc->extra)->use_sw_csb) { |
mahphalke |
17:af1f2416dd26 | 159 | // Free the CSB gpio object |
mahphalke |
17:af1f2416dd26 | 160 | if((DigitalOut *)(((mbed_spi_desc *)(desc->extra))->csb_gpio)) { |
mahphalke |
17:af1f2416dd26 | 161 | delete((DigitalOut *)(((mbed_spi_desc *)(desc->extra))->csb_gpio)); |
mahphalke |
17:af1f2416dd26 | 162 | } |
mahphalke |
17:af1f2416dd26 | 163 | } |
mahphalke |
17:af1f2416dd26 | 164 | |
mahphalke |
17:af1f2416dd26 | 165 | // Free the SPI port object |
mahphalke |
17:af1f2416dd26 | 166 | if ((SPI *)(((mbed_spi_desc *)(desc->extra))->spi_port)) { |
mahphalke |
17:af1f2416dd26 | 167 | delete((SPI *)(((mbed_spi_desc *)(desc->extra))->spi_port)); |
mahphalke |
17:af1f2416dd26 | 168 | } |
mahphalke |
17:af1f2416dd26 | 169 | |
mahphalke |
17:af1f2416dd26 | 170 | // Free the SPI extra descriptor object |
mahphalke |
17:af1f2416dd26 | 171 | if ((mbed_spi_desc *)(desc->extra)) { |
mahphalke |
17:af1f2416dd26 | 172 | free((mbed_spi_desc *)(desc->extra)); |
mahphalke |
17:af1f2416dd26 | 173 | } |
mahphalke |
17:af1f2416dd26 | 174 | |
mahphalke |
17:af1f2416dd26 | 175 | // Free the SPI descriptor object |
mahphalke |
17:af1f2416dd26 | 176 | free(desc); |
mahphalke |
17:af1f2416dd26 | 177 | |
mahphalke |
17:af1f2416dd26 | 178 | return SUCCESS; |
mahphalke |
17:af1f2416dd26 | 179 | } |
mahphalke |
17:af1f2416dd26 | 180 | |
mahphalke |
17:af1f2416dd26 | 181 | return FAILURE; |
mahphalke |
17:af1f2416dd26 | 182 | } |
mahphalke |
17:af1f2416dd26 | 183 | |
mahphalke |
17:af1f2416dd26 | 184 | |
mahphalke |
17:af1f2416dd26 | 185 | /** |
mahphalke |
17:af1f2416dd26 | 186 | * @brief Write and read data to/from SPI. |
mahphalke |
17:af1f2416dd26 | 187 | * @param desc - The SPI descriptor. |
mahphalke |
17:af1f2416dd26 | 188 | * @param data - The buffer with the transmitted/received data. |
mahphalke |
17:af1f2416dd26 | 189 | * @param bytes_number - Number of bytes to write/read. |
mahphalke |
17:af1f2416dd26 | 190 | * @return SUCCESS in case of success, FAILURE otherwise. |
mahphalke |
17:af1f2416dd26 | 191 | */ |
mahphalke |
17:af1f2416dd26 | 192 | int32_t spi_write_and_read(struct spi_desc *desc, |
mahphalke |
17:af1f2416dd26 | 193 | uint8_t *data, |
mahphalke |
17:af1f2416dd26 | 194 | uint16_t bytes_number) |
mahphalke |
17:af1f2416dd26 | 195 | { |
mahphalke |
17:af1f2416dd26 | 196 | mbed::SPI *spi; // pointer to new spi instance |
mahphalke |
17:af1f2416dd26 | 197 | mbed::DigitalOut *csb; // pointer to new CSB instance |
mahphalke |
17:af1f2416dd26 | 198 | |
mahphalke |
17:af1f2416dd26 | 199 | if (desc) { |
mahphalke |
17:af1f2416dd26 | 200 | spi = (SPI *)(((mbed_spi_desc *)(desc->extra))->spi_port); |
mahphalke |
17:af1f2416dd26 | 201 | |
mahphalke |
17:af1f2416dd26 | 202 | if (((mbed_spi_desc *)desc->extra)->use_sw_csb) { |
mahphalke |
17:af1f2416dd26 | 203 | csb = (DigitalOut *)(((mbed_spi_desc *)(desc->extra))->csb_gpio); |
mahphalke |
17:af1f2416dd26 | 204 | csb->write(GPIO_LOW); |
mahphalke |
17:af1f2416dd26 | 205 | } |
mahphalke |
17:af1f2416dd26 | 206 | |
mahphalke |
17:af1f2416dd26 | 207 | /* Perform synchronous SPI write and read */ |
mahphalke |
17:af1f2416dd26 | 208 | spi->write((const char *)data, bytes_number, (char *)data, bytes_number); |
mahphalke |
17:af1f2416dd26 | 209 | |
mahphalke |
17:af1f2416dd26 | 210 | if (((mbed_spi_desc *)desc->extra)->use_sw_csb) { |
mahphalke |
17:af1f2416dd26 | 211 | csb->write(GPIO_HIGH); |
mahphalke |
17:af1f2416dd26 | 212 | } |
mahphalke |
17:af1f2416dd26 | 213 | |
mahphalke |
17:af1f2416dd26 | 214 | return SUCCESS; |
mahphalke |
17:af1f2416dd26 | 215 | } |
mahphalke |
17:af1f2416dd26 | 216 | |
mahphalke |
17:af1f2416dd26 | 217 | return FAILURE; |
mahphalke |
17:af1f2416dd26 | 218 | } |
mahphalke |
17:af1f2416dd26 | 219 | |
Janani Sunil | 20:26b1a4570f4b | 220 | |
Janani Sunil | 20:26b1a4570f4b | 221 | /** |
Janani Sunil | 20:26b1a4570f4b | 222 | * @brief Transfer (write/read) the number of SPI messages |
Janani Sunil | 20:26b1a4570f4b | 223 | * @param desc - The SPI descriptor |
Janani Sunil | 20:26b1a4570f4b | 224 | * @param msgs - Pointer to SPI messages |
Janani Sunil | 20:26b1a4570f4b | 225 | * @param num_of_msgs - Number of SPI messages |
Janani Sunil | 20:26b1a4570f4b | 226 | * @return SUCCESS in case of success, FAILURE otherwise. |
Janani Sunil | 20:26b1a4570f4b | 227 | * @note Use of this function requires CSB pin to be software controlled |
Janani Sunil | 20:26b1a4570f4b | 228 | */ |
Janani Sunil | 20:26b1a4570f4b | 229 | int32_t spi_transfer(struct spi_desc *desc, struct spi_msg *msgs, |
Janani Sunil | 20:26b1a4570f4b | 230 | uint32_t num_of_msgs) |
Janani Sunil | 20:26b1a4570f4b | 231 | { |
Janani Sunil | 20:26b1a4570f4b | 232 | mbed::SPI *spi; // pointer to new spi instance |
Janani Sunil | 20:26b1a4570f4b | 233 | mbed::DigitalOut *csb; // pointer to new CSB instance |
Janani Sunil | 20:26b1a4570f4b | 234 | uint8_t msg_cnt; // SPI message counter |
Janani Sunil | 20:26b1a4570f4b | 235 | |
Janani Sunil | 20:26b1a4570f4b | 236 | if (desc) { |
Janani Sunil | 20:26b1a4570f4b | 237 | if (!((mbed_spi_desc *)desc->extra)->use_sw_csb) |
Janani Sunil | 20:26b1a4570f4b | 238 | return FAILURE; |
Janani Sunil | 20:26b1a4570f4b | 239 | |
Janani Sunil | 20:26b1a4570f4b | 240 | spi = (SPI *)(((mbed_spi_desc *)(desc->extra))->spi_port); |
Janani Sunil | 20:26b1a4570f4b | 241 | csb = (DigitalOut *)(((mbed_spi_desc *)(desc->extra))->csb_gpio); |
Janani Sunil | 20:26b1a4570f4b | 242 | |
Janani Sunil | 20:26b1a4570f4b | 243 | if (!spi || !csb) |
Janani Sunil | 20:26b1a4570f4b | 244 | return FAILURE; |
Janani Sunil | 20:26b1a4570f4b | 245 | |
Janani Sunil | 20:26b1a4570f4b | 246 | for (msg_cnt = 0; msg_cnt < num_of_msgs; msg_cnt++) { |
Janani Sunil | 20:26b1a4570f4b | 247 | csb->write(GPIO_LOW); |
Janani Sunil | 20:26b1a4570f4b | 248 | |
Janani Sunil | 20:26b1a4570f4b | 249 | /* Perform synchronous SPI write and read */ |
Janani Sunil | 20:26b1a4570f4b | 250 | if (!msgs[msg_cnt].tx_buff) { |
Janani Sunil | 20:26b1a4570f4b | 251 | spi->write(NULL, 0, |
Janani Sunil | 20:26b1a4570f4b | 252 | (char *)msgs[msg_cnt].rx_buff, msgs[msg_cnt].bytes_number); |
Janani Sunil | 20:26b1a4570f4b | 253 | } else { |
Janani Sunil | 20:26b1a4570f4b | 254 | spi->write((const char *)msgs[msg_cnt].tx_buff, msgs[msg_cnt].bytes_number, |
Janani Sunil | 20:26b1a4570f4b | 255 | (char *)msgs[msg_cnt].rx_buff, msgs[msg_cnt].bytes_number); |
Janani Sunil | 20:26b1a4570f4b | 256 | } |
Janani Sunil | 20:26b1a4570f4b | 257 | |
Janani Sunil | 20:26b1a4570f4b | 258 | if (msgs[msg_cnt].cs_change) { |
Janani Sunil | 20:26b1a4570f4b | 259 | csb->write(GPIO_HIGH); |
Janani Sunil | 20:26b1a4570f4b | 260 | } |
Janani Sunil | 20:26b1a4570f4b | 261 | } |
Janani Sunil | 20:26b1a4570f4b | 262 | |
Janani Sunil | 20:26b1a4570f4b | 263 | csb->write(GPIO_HIGH); |
Janani Sunil | 20:26b1a4570f4b | 264 | return SUCCESS; |
Janani Sunil | 20:26b1a4570f4b | 265 | } |
Janani Sunil | 20:26b1a4570f4b | 266 | |
Janani Sunil | 20:26b1a4570f4b | 267 | return FAILURE; |
Janani Sunil | 20:26b1a4570f4b | 268 | } |
Janani Sunil | 20:26b1a4570f4b | 269 | |
mahphalke |
17:af1f2416dd26 | 270 | #ifdef __cplusplus // Closing extern c |
mahphalke |
17:af1f2416dd26 | 271 | } |
mahphalke |
17:af1f2416dd26 | 272 | #endif // _cplusplus |