[11U68]fix P0_11 to use GPIO

Fork of mbed-src by mbed official

Revision:
563:536c9fb088a0
Parent:
549:99e4f6522a2d
Child:
564:24a7119bd73a
--- a/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/spi_api.c	Tue Jun 09 15:30:08 2015 +0100
+++ b/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/spi_api.c	Wed Jun 10 10:00:08 2015 +0100
@@ -399,7 +399,7 @@
     }
 }
 
-void spi_buffer_set(spi_t *obj, void *tx, uint32_t tx_length, void *rx, uint32_t rx_length, uint8_t bit_width)
+void spi_buffer_set(spi_t *obj, const void *tx, uint32_t tx_length, void *rx, uint32_t rx_length, uint8_t bit_width)
 {
     uint32_t i;
     uint16_t *tx_ptr = (uint16_t *) tx;
@@ -407,7 +407,7 @@
     tx_length *= (bit_width >> 3);
     rx_length *= (bit_width >> 3);
 
-    obj->tx_buff.buffer = tx;
+    obj->tx_buff.buffer = (void *)tx;
     obj->rx_buff.buffer = rx;
     obj->tx_buff.length = tx_length;
     obj->rx_buff.length = rx_length;
@@ -761,7 +761,7 @@
 *   * tx_length: how many bytes will get sent.
 *   * rx_length: how many bytes will get received. If > tx_length, TX will get padded with n lower bits of SPI_FILL_WORD.
 ******************************************/
-static void spi_activate_dma(spi_t *obj, void* rxdata, void* txdata, int tx_length, int rx_length)
+static void spi_activate_dma(spi_t *obj, void* rxdata, const void* txdata, int tx_length, int rx_length)
 {
     /* DMA descriptors */
     DMA_CfgDescr_TypeDef rxDescrCfg;
@@ -822,7 +822,7 @@
                             true,
                             false,
                             (obj->spi.bits <= 8 ? (void *)&(obj->spi.spi->TXDATA) : (void *)&(obj->spi.spi->TXDOUBLE)), //When frame size > 9, point to TXDOUBLE
-                            (txdata == 0 ? &fill_word : txdata), // When there is nothing to transmit, point to static fill word
+                            (txdata == 0 ? &fill_word : (void *)txdata), // When there is nothing to transmit, point to static fill word
                             (obj->spi.bits <= 8 ? tx_length - 1 : (tx_length / 2) - 1)); // When using TXDOUBLE, recalculate transfer length
     } else {
         /* Frame size == 9 */
@@ -860,7 +860,7 @@
                             true,
                             false,
                             (void *)&(obj->spi.spi->TXDATAX), //When frame size > 9, point to TXDOUBLE
-                            (txdata == 0 ? &fill_word : txdata), // When there is nothing to transmit, point to static fill word
+                            (txdata == 0 ? &fill_word : (void *)txdata), // When there is nothing to transmit, point to static fill word
                             (tx_length / 2) - 1); // When using TXDOUBLE, recalculate transfer length
     }
 }
@@ -882,7 +882,7 @@
 *                 If the previous transfer has kept the channel, that channel will continue to get used.
 *
 ********************************************************************/
-void spi_master_transfer_dma(spi_t *obj, void *txdata, void *rxdata, int tx_length, int rx_length, void* cb, DMAUsage hint)
+void spi_master_transfer_dma(spi_t *obj, const void *txdata, void *rxdata, int tx_length, int rx_length, void* cb, DMAUsage hint)
 {
     /* Init DMA here to include it in the power figure */
     dma_init();
@@ -930,7 +930,7 @@
  * @param[in] handler   SPI interrupt handler
  * @param[in] hint      A suggestion for how to use DMA with this transfer
  */
-void spi_master_transfer(spi_t *obj, void *tx, size_t tx_length, void *rx, size_t rx_length, uint8_t bit_width, uint32_t handler, uint32_t event, DMAUsage hint)
+void spi_master_transfer(spi_t *obj, const void *tx, size_t tx_length, void *rx, size_t rx_length, uint8_t bit_width, uint32_t handler, uint32_t event, DMAUsage hint)
 {
     if( spi_active(obj) ) return;