mbed library sources
Dependents: frdm_kl05z_gpio_test
Fork of mbed-src by
targets/hal/TARGET_STM/TARGET_DISCO_F100RB/spi_api.c@323:9e901b0a5aa1, 2014-09-13 (annotated)
- Committer:
- shaoziyang
- Date:
- Sat Sep 13 14:25:46 2014 +0000
- Revision:
- 323:9e901b0a5aa1
- Parent:
- 227:7bd0639b8911
test with CLOCK_SETUP = 0
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 126:549ba18ddd81 | 1 | /* mbed Microcontroller Library |
mbed_official | 126:549ba18ddd81 | 2 | ******************************************************************************* |
mbed_official | 126:549ba18ddd81 | 3 | * Copyright (c) 2014, STMicroelectronics |
mbed_official | 126:549ba18ddd81 | 4 | * All rights reserved. |
mbed_official | 126:549ba18ddd81 | 5 | * |
mbed_official | 126:549ba18ddd81 | 6 | * Redistribution and use in source and binary forms, with or without |
mbed_official | 126:549ba18ddd81 | 7 | * modification, are permitted provided that the following conditions are met: |
mbed_official | 126:549ba18ddd81 | 8 | * |
mbed_official | 126:549ba18ddd81 | 9 | * 1. Redistributions of source code must retain the above copyright notice, |
mbed_official | 126:549ba18ddd81 | 10 | * this list of conditions and the following disclaimer. |
mbed_official | 126:549ba18ddd81 | 11 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
mbed_official | 126:549ba18ddd81 | 12 | * this list of conditions and the following disclaimer in the documentation |
mbed_official | 126:549ba18ddd81 | 13 | * and/or other materials provided with the distribution. |
mbed_official | 126:549ba18ddd81 | 14 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
mbed_official | 126:549ba18ddd81 | 15 | * may be used to endorse or promote products derived from this software |
mbed_official | 126:549ba18ddd81 | 16 | * without specific prior written permission. |
mbed_official | 126:549ba18ddd81 | 17 | * |
mbed_official | 126:549ba18ddd81 | 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
mbed_official | 126:549ba18ddd81 | 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
mbed_official | 126:549ba18ddd81 | 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
mbed_official | 126:549ba18ddd81 | 21 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
mbed_official | 126:549ba18ddd81 | 22 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
mbed_official | 126:549ba18ddd81 | 23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
mbed_official | 126:549ba18ddd81 | 24 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
mbed_official | 126:549ba18ddd81 | 25 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
mbed_official | 126:549ba18ddd81 | 26 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
mbed_official | 126:549ba18ddd81 | 27 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
mbed_official | 126:549ba18ddd81 | 28 | ******************************************************************************* |
mbed_official | 126:549ba18ddd81 | 29 | */ |
mbed_official | 227:7bd0639b8911 | 30 | #include "mbed_assert.h" |
mbed_official | 126:549ba18ddd81 | 31 | #include "spi_api.h" |
mbed_official | 126:549ba18ddd81 | 32 | |
mbed_official | 126:549ba18ddd81 | 33 | #if DEVICE_SPI |
mbed_official | 126:549ba18ddd81 | 34 | |
mbed_official | 126:549ba18ddd81 | 35 | #include <math.h> |
mbed_official | 126:549ba18ddd81 | 36 | #include "cmsis.h" |
mbed_official | 126:549ba18ddd81 | 37 | #include "pinmap.h" |
mbed_official | 126:549ba18ddd81 | 38 | |
mbed_official | 126:549ba18ddd81 | 39 | static const PinMap PinMap_SPI_MOSI[] = { |
mbed_official | 126:549ba18ddd81 | 40 | {PA_7, SPI_1, STM_PIN_DATA(GPIO_Mode_AF_PP, 0)}, |
mbed_official | 126:549ba18ddd81 | 41 | {PB_5, SPI_1, STM_PIN_DATA(GPIO_Mode_AF_PP, 1)}, // Remap |
mbed_official | 126:549ba18ddd81 | 42 | {NC, NC, 0} |
mbed_official | 126:549ba18ddd81 | 43 | }; |
mbed_official | 126:549ba18ddd81 | 44 | |
mbed_official | 126:549ba18ddd81 | 45 | static const PinMap PinMap_SPI_MISO[] = { |
mbed_official | 126:549ba18ddd81 | 46 | {PA_6, SPI_1, STM_PIN_DATA(GPIO_Mode_AF_PP, 0)}, |
mbed_official | 126:549ba18ddd81 | 47 | {PB_4, SPI_1, STM_PIN_DATA(GPIO_Mode_AF_PP, 1)}, // Remap |
mbed_official | 126:549ba18ddd81 | 48 | {NC, NC, 0} |
mbed_official | 126:549ba18ddd81 | 49 | }; |
mbed_official | 126:549ba18ddd81 | 50 | |
mbed_official | 126:549ba18ddd81 | 51 | static const PinMap PinMap_SPI_SCLK[] = { |
mbed_official | 126:549ba18ddd81 | 52 | {PA_5, SPI_1, STM_PIN_DATA(GPIO_Mode_AF_PP, 0)}, |
mbed_official | 126:549ba18ddd81 | 53 | {PB_3, SPI_1, STM_PIN_DATA(GPIO_Mode_AF_PP, 1)}, // Remap |
mbed_official | 126:549ba18ddd81 | 54 | {NC, NC, 0} |
mbed_official | 126:549ba18ddd81 | 55 | }; |
mbed_official | 126:549ba18ddd81 | 56 | |
mbed_official | 126:549ba18ddd81 | 57 | // Only used in Slave mode |
mbed_official | 126:549ba18ddd81 | 58 | static const PinMap PinMap_SPI_SSEL[] = { |
mbed_official | 126:549ba18ddd81 | 59 | {PB_6, SPI_1, STM_PIN_DATA(GPIO_Mode_IN_FLOATING, 0)}, // Generic IO, not real H/W NSS pin |
mbed_official | 126:549ba18ddd81 | 60 | {NC, NC, 0} |
mbed_official | 126:549ba18ddd81 | 61 | }; |
mbed_official | 126:549ba18ddd81 | 62 | |
mbed_official | 126:549ba18ddd81 | 63 | static void init_spi(spi_t *obj) { |
mbed_official | 126:549ba18ddd81 | 64 | SPI_TypeDef *spi = (SPI_TypeDef *)(obj->spi); |
mbed_official | 126:549ba18ddd81 | 65 | SPI_InitTypeDef SPI_InitStructure; |
mbed_official | 126:549ba18ddd81 | 66 | |
mbed_official | 126:549ba18ddd81 | 67 | SPI_Cmd(spi, DISABLE); |
mbed_official | 126:549ba18ddd81 | 68 | |
mbed_official | 126:549ba18ddd81 | 69 | SPI_InitStructure.SPI_Mode = obj->mode; |
mbed_official | 227:7bd0639b8911 | 70 | SPI_InitStructure.SPI_NSS = obj->nss; |
mbed_official | 227:7bd0639b8911 | 71 | SPI_InitStructure.SPI_Direction = SPI_Direction_2Lines_FullDuplex; |
mbed_official | 126:549ba18ddd81 | 72 | SPI_InitStructure.SPI_DataSize = obj->bits; |
mbed_official | 126:549ba18ddd81 | 73 | SPI_InitStructure.SPI_CPOL = obj->cpol; |
mbed_official | 227:7bd0639b8911 | 74 | SPI_InitStructure.SPI_CPHA = obj->cpha; |
mbed_official | 126:549ba18ddd81 | 75 | SPI_InitStructure.SPI_BaudRatePrescaler = obj->br_presc; |
mbed_official | 126:549ba18ddd81 | 76 | SPI_InitStructure.SPI_FirstBit = SPI_FirstBit_MSB; |
mbed_official | 126:549ba18ddd81 | 77 | SPI_InitStructure.SPI_CRCPolynomial = 7; |
mbed_official | 126:549ba18ddd81 | 78 | SPI_Init(spi, &SPI_InitStructure); |
mbed_official | 126:549ba18ddd81 | 79 | |
mbed_official | 126:549ba18ddd81 | 80 | SPI_Cmd(spi, ENABLE); |
mbed_official | 126:549ba18ddd81 | 81 | } |
mbed_official | 126:549ba18ddd81 | 82 | |
mbed_official | 126:549ba18ddd81 | 83 | void spi_init(spi_t *obj, PinName mosi, PinName miso, PinName sclk, PinName ssel) { |
mbed_official | 126:549ba18ddd81 | 84 | // Determine the SPI to use |
mbed_official | 126:549ba18ddd81 | 85 | SPIName spi_mosi = (SPIName)pinmap_peripheral(mosi, PinMap_SPI_MOSI); |
mbed_official | 126:549ba18ddd81 | 86 | SPIName spi_miso = (SPIName)pinmap_peripheral(miso, PinMap_SPI_MISO); |
mbed_official | 126:549ba18ddd81 | 87 | SPIName spi_sclk = (SPIName)pinmap_peripheral(sclk, PinMap_SPI_SCLK); |
mbed_official | 126:549ba18ddd81 | 88 | SPIName spi_ssel = (SPIName)pinmap_peripheral(ssel, PinMap_SPI_SSEL); |
mbed_official | 126:549ba18ddd81 | 89 | |
mbed_official | 126:549ba18ddd81 | 90 | SPIName spi_data = (SPIName)pinmap_merge(spi_mosi, spi_miso); |
mbed_official | 126:549ba18ddd81 | 91 | SPIName spi_cntl = (SPIName)pinmap_merge(spi_sclk, spi_ssel); |
mbed_official | 126:549ba18ddd81 | 92 | |
mbed_official | 126:549ba18ddd81 | 93 | obj->spi = (SPIName)pinmap_merge(spi_data, spi_cntl); |
mbed_official | 227:7bd0639b8911 | 94 | MBED_ASSERT(obj->spi != (SPIName)NC); |
mbed_official | 126:549ba18ddd81 | 95 | |
mbed_official | 126:549ba18ddd81 | 96 | // Enable SPI clock |
mbed_official | 126:549ba18ddd81 | 97 | if (obj->spi == SPI_1) { |
mbed_official | 227:7bd0639b8911 | 98 | RCC_APB2PeriphClockCmd(RCC_APB2Periph_SPI1, ENABLE); |
mbed_official | 126:549ba18ddd81 | 99 | } |
mbed_official | 126:549ba18ddd81 | 100 | |
mbed_official | 126:549ba18ddd81 | 101 | // Configure the SPI pins |
mbed_official | 126:549ba18ddd81 | 102 | pinmap_pinout(mosi, PinMap_SPI_MOSI); |
mbed_official | 126:549ba18ddd81 | 103 | pinmap_pinout(miso, PinMap_SPI_MISO); |
mbed_official | 126:549ba18ddd81 | 104 | pinmap_pinout(sclk, PinMap_SPI_SCLK); |
mbed_official | 126:549ba18ddd81 | 105 | |
mbed_official | 126:549ba18ddd81 | 106 | // Save new values |
mbed_official | 126:549ba18ddd81 | 107 | obj->bits = SPI_DataSize_8b; |
mbed_official | 126:549ba18ddd81 | 108 | obj->cpol = SPI_CPOL_Low; |
mbed_official | 126:549ba18ddd81 | 109 | obj->cpha = SPI_CPHA_1Edge; |
mbed_official | 126:549ba18ddd81 | 110 | obj->br_presc = SPI_BaudRatePrescaler_256; // 1MHz |
mbed_official | 126:549ba18ddd81 | 111 | |
mbed_official | 126:549ba18ddd81 | 112 | if (ssel == NC) { // Master |
mbed_official | 126:549ba18ddd81 | 113 | obj->mode = SPI_Mode_Master; |
mbed_official | 126:549ba18ddd81 | 114 | obj->nss = SPI_NSS_Soft; |
mbed_official | 126:549ba18ddd81 | 115 | } |
mbed_official | 126:549ba18ddd81 | 116 | else { // Slave |
mbed_official | 126:549ba18ddd81 | 117 | pinmap_pinout(ssel, PinMap_SPI_SSEL); |
mbed_official | 126:549ba18ddd81 | 118 | obj->mode = SPI_Mode_Slave; |
mbed_official | 126:549ba18ddd81 | 119 | obj->nss = SPI_NSS_Soft; |
mbed_official | 126:549ba18ddd81 | 120 | } |
mbed_official | 126:549ba18ddd81 | 121 | |
mbed_official | 126:549ba18ddd81 | 122 | init_spi(obj); |
mbed_official | 126:549ba18ddd81 | 123 | } |
mbed_official | 126:549ba18ddd81 | 124 | |
mbed_official | 126:549ba18ddd81 | 125 | void spi_free(spi_t *obj) { |
mbed_official | 126:549ba18ddd81 | 126 | SPI_TypeDef *spi = (SPI_TypeDef *)(obj->spi); |
mbed_official | 126:549ba18ddd81 | 127 | SPI_I2S_DeInit(spi); |
mbed_official | 126:549ba18ddd81 | 128 | } |
mbed_official | 126:549ba18ddd81 | 129 | |
mbed_official | 227:7bd0639b8911 | 130 | void spi_format(spi_t *obj, int bits, int mode, int slave) { |
mbed_official | 126:549ba18ddd81 | 131 | // Save new values |
mbed_official | 126:549ba18ddd81 | 132 | if (bits == 8) { |
mbed_official | 126:549ba18ddd81 | 133 | obj->bits = SPI_DataSize_8b; |
mbed_official | 126:549ba18ddd81 | 134 | } |
mbed_official | 126:549ba18ddd81 | 135 | else { |
mbed_official | 126:549ba18ddd81 | 136 | obj->bits = SPI_DataSize_16b; |
mbed_official | 126:549ba18ddd81 | 137 | } |
mbed_official | 126:549ba18ddd81 | 138 | |
mbed_official | 126:549ba18ddd81 | 139 | switch (mode) { |
mbed_official | 126:549ba18ddd81 | 140 | case 0: |
mbed_official | 126:549ba18ddd81 | 141 | obj->cpol = SPI_CPOL_Low; |
mbed_official | 126:549ba18ddd81 | 142 | obj->cpha = SPI_CPHA_1Edge; |
mbed_official | 126:549ba18ddd81 | 143 | break; |
mbed_official | 126:549ba18ddd81 | 144 | case 1: |
mbed_official | 126:549ba18ddd81 | 145 | obj->cpol = SPI_CPOL_Low; |
mbed_official | 126:549ba18ddd81 | 146 | obj->cpha = SPI_CPHA_2Edge; |
mbed_official | 126:549ba18ddd81 | 147 | break; |
mbed_official | 126:549ba18ddd81 | 148 | case 2: |
mbed_official | 126:549ba18ddd81 | 149 | obj->cpol = SPI_CPOL_High; |
mbed_official | 227:7bd0639b8911 | 150 | obj->cpha = SPI_CPHA_1Edge; |
mbed_official | 126:549ba18ddd81 | 151 | break; |
mbed_official | 126:549ba18ddd81 | 152 | default: |
mbed_official | 126:549ba18ddd81 | 153 | obj->cpol = SPI_CPOL_High; |
mbed_official | 227:7bd0639b8911 | 154 | obj->cpha = SPI_CPHA_2Edge; |
mbed_official | 126:549ba18ddd81 | 155 | break; |
mbed_official | 126:549ba18ddd81 | 156 | } |
mbed_official | 126:549ba18ddd81 | 157 | |
mbed_official | 126:549ba18ddd81 | 158 | if (slave == 0) { |
mbed_official | 126:549ba18ddd81 | 159 | obj->mode = SPI_Mode_Master; |
mbed_official | 126:549ba18ddd81 | 160 | obj->nss = SPI_NSS_Soft; |
mbed_official | 126:549ba18ddd81 | 161 | } |
mbed_official | 126:549ba18ddd81 | 162 | else { |
mbed_official | 126:549ba18ddd81 | 163 | obj->mode = SPI_Mode_Slave; |
mbed_official | 227:7bd0639b8911 | 164 | obj->nss = SPI_NSS_Hard; |
mbed_official | 126:549ba18ddd81 | 165 | } |
mbed_official | 126:549ba18ddd81 | 166 | |
mbed_official | 126:549ba18ddd81 | 167 | init_spi(obj); |
mbed_official | 126:549ba18ddd81 | 168 | } |
mbed_official | 126:549ba18ddd81 | 169 | |
mbed_official | 126:549ba18ddd81 | 170 | void spi_frequency(spi_t *obj, int hz) { |
mbed_official | 126:549ba18ddd81 | 171 | // Choose the baud rate divisor (between 2 and 256) |
mbed_official | 126:549ba18ddd81 | 172 | uint32_t divisor = SystemCoreClock / hz; |
mbed_official | 126:549ba18ddd81 | 173 | |
mbed_official | 126:549ba18ddd81 | 174 | // Find the nearest power-of-2 |
mbed_official | 126:549ba18ddd81 | 175 | divisor = (divisor > 0 ? divisor-1 : 0); |
mbed_official | 126:549ba18ddd81 | 176 | divisor |= divisor >> 1; |
mbed_official | 126:549ba18ddd81 | 177 | divisor |= divisor >> 2; |
mbed_official | 126:549ba18ddd81 | 178 | divisor |= divisor >> 4; |
mbed_official | 126:549ba18ddd81 | 179 | divisor |= divisor >> 8; |
mbed_official | 126:549ba18ddd81 | 180 | divisor |= divisor >> 16; |
mbed_official | 126:549ba18ddd81 | 181 | divisor++; |
mbed_official | 126:549ba18ddd81 | 182 | |
mbed_official | 126:549ba18ddd81 | 183 | uint32_t baud_rate = __builtin_ffs(divisor) - 2; |
mbed_official | 126:549ba18ddd81 | 184 | |
mbed_official | 126:549ba18ddd81 | 185 | // Save new value |
mbed_official | 126:549ba18ddd81 | 186 | obj->br_presc = ((baud_rate > 7) ? (7 << 3) : (baud_rate << 3)); |
mbed_official | 126:549ba18ddd81 | 187 | |
mbed_official | 126:549ba18ddd81 | 188 | init_spi(obj); |
mbed_official | 126:549ba18ddd81 | 189 | } |
mbed_official | 126:549ba18ddd81 | 190 | |
mbed_official | 126:549ba18ddd81 | 191 | static inline int ssp_readable(spi_t *obj) { |
mbed_official | 126:549ba18ddd81 | 192 | int status; |
mbed_official | 126:549ba18ddd81 | 193 | SPI_TypeDef *spi = (SPI_TypeDef *)(obj->spi); |
mbed_official | 126:549ba18ddd81 | 194 | // Check if data is received |
mbed_official | 126:549ba18ddd81 | 195 | status = ((SPI_I2S_GetFlagStatus(spi, SPI_I2S_FLAG_RXNE) != RESET) ? 1 : 0); |
mbed_official | 227:7bd0639b8911 | 196 | return status; |
mbed_official | 126:549ba18ddd81 | 197 | } |
mbed_official | 126:549ba18ddd81 | 198 | |
mbed_official | 126:549ba18ddd81 | 199 | static inline int ssp_writeable(spi_t *obj) { |
mbed_official | 126:549ba18ddd81 | 200 | int status; |
mbed_official | 126:549ba18ddd81 | 201 | SPI_TypeDef *spi = (SPI_TypeDef *)(obj->spi); |
mbed_official | 126:549ba18ddd81 | 202 | // Check if data is transmitted |
mbed_official | 126:549ba18ddd81 | 203 | status = ((SPI_I2S_GetFlagStatus(spi, SPI_I2S_FLAG_TXE) != RESET) ? 1 : 0); |
mbed_official | 126:549ba18ddd81 | 204 | return status; |
mbed_official | 126:549ba18ddd81 | 205 | } |
mbed_official | 126:549ba18ddd81 | 206 | |
mbed_official | 126:549ba18ddd81 | 207 | static inline void ssp_write(spi_t *obj, int value) { |
mbed_official | 227:7bd0639b8911 | 208 | SPI_TypeDef *spi = (SPI_TypeDef *)(obj->spi); |
mbed_official | 126:549ba18ddd81 | 209 | while (!ssp_writeable(obj)); |
mbed_official | 126:549ba18ddd81 | 210 | SPI_I2S_SendData(spi, (uint16_t)value); |
mbed_official | 126:549ba18ddd81 | 211 | } |
mbed_official | 126:549ba18ddd81 | 212 | |
mbed_official | 126:549ba18ddd81 | 213 | static inline int ssp_read(spi_t *obj) { |
mbed_official | 227:7bd0639b8911 | 214 | SPI_TypeDef *spi = (SPI_TypeDef *)(obj->spi); |
mbed_official | 126:549ba18ddd81 | 215 | while (!ssp_readable(obj)); |
mbed_official | 126:549ba18ddd81 | 216 | return (int)SPI_I2S_ReceiveData(spi); |
mbed_official | 126:549ba18ddd81 | 217 | } |
mbed_official | 126:549ba18ddd81 | 218 | |
mbed_official | 126:549ba18ddd81 | 219 | static inline int ssp_busy(spi_t *obj) { |
mbed_official | 126:549ba18ddd81 | 220 | int status; |
mbed_official | 126:549ba18ddd81 | 221 | SPI_TypeDef *spi = (SPI_TypeDef *)(obj->spi); |
mbed_official | 126:549ba18ddd81 | 222 | status = ((SPI_I2S_GetFlagStatus(spi, SPI_I2S_FLAG_BSY) != RESET) ? 1 : 0); |
mbed_official | 126:549ba18ddd81 | 223 | return status; |
mbed_official | 126:549ba18ddd81 | 224 | } |
mbed_official | 126:549ba18ddd81 | 225 | |
mbed_official | 126:549ba18ddd81 | 226 | int spi_master_write(spi_t *obj, int value) { |
mbed_official | 126:549ba18ddd81 | 227 | ssp_write(obj, value); |
mbed_official | 126:549ba18ddd81 | 228 | return ssp_read(obj); |
mbed_official | 126:549ba18ddd81 | 229 | } |
mbed_official | 126:549ba18ddd81 | 230 | |
mbed_official | 126:549ba18ddd81 | 231 | int spi_slave_receive(spi_t *obj) { |
mbed_official | 126:549ba18ddd81 | 232 | return (ssp_readable(obj) && !ssp_busy(obj)) ? (1) : (0); |
mbed_official | 126:549ba18ddd81 | 233 | }; |
mbed_official | 126:549ba18ddd81 | 234 | |
mbed_official | 126:549ba18ddd81 | 235 | int spi_slave_read(spi_t *obj) { |
mbed_official | 126:549ba18ddd81 | 236 | SPI_TypeDef *spi = (SPI_TypeDef *)(obj->spi); |
mbed_official | 126:549ba18ddd81 | 237 | return (int)SPI_I2S_ReceiveData(spi); |
mbed_official | 126:549ba18ddd81 | 238 | } |
mbed_official | 126:549ba18ddd81 | 239 | |
mbed_official | 126:549ba18ddd81 | 240 | void spi_slave_write(spi_t *obj, int value) { |
mbed_official | 227:7bd0639b8911 | 241 | SPI_TypeDef *spi = (SPI_TypeDef *)(obj->spi); |
mbed_official | 227:7bd0639b8911 | 242 | while (!ssp_writeable(obj)); |
mbed_official | 126:549ba18ddd81 | 243 | SPI_I2S_SendData(spi, (uint16_t)value); |
mbed_official | 126:549ba18ddd81 | 244 | } |
mbed_official | 126:549ba18ddd81 | 245 | |
mbed_official | 126:549ba18ddd81 | 246 | int spi_busy(spi_t *obj) { |
mbed_official | 126:549ba18ddd81 | 247 | return ssp_busy(obj); |
mbed_official | 126:549ba18ddd81 | 248 | } |
mbed_official | 126:549ba18ddd81 | 249 | |
mbed_official | 126:549ba18ddd81 | 250 | #endif |