Switch from GPLv2 to GPLv2+
[fw/altos] / src / lpc / ao_arch_funcs.h
index b963d3ab72a72c0b6c7c824c7cf8231c7e6257b6..5fc0f680fa070923558f847ef477c0b70ee8e0cc 100644 (file)
@@ -3,7 +3,8 @@
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -227,6 +228,28 @@ ao_spi_duplex(const void *out, void *in, uint16_t len, uint8_t spi_index);
 void
 ao_spi_init(void);
 
+static inline void
+ao_spi_send_sync(const void *block, uint16_t len, uint8_t spi_index)
+{
+       ao_spi_send(block, len, spi_index);
+}
+
+static inline void ao_spi_send_byte(uint8_t byte, uint8_t spi_index)
+{
+       struct lpc_ssp  *lpc_ssp;
+       switch (spi_index) {
+       case 0:
+               lpc_ssp = &lpc_ssp0;
+               break;
+       case 1:
+               lpc_ssp = &lpc_ssp1;
+               break;
+       }
+       lpc_ssp->dr = byte;
+       while ((lpc_ssp->sr & (1 << LPC_SSP_SR_RNE)) == 0);
+       (void) lpc_ssp->dr;
+}
+
 #define ao_spi_init_cs(port, mask) do {                                        \
                uint8_t __bit__;                                        \
                for (__bit__ = 0; __bit__ < 32; __bit__++) {            \
@@ -249,10 +272,4 @@ static inline void ao_arch_start_scheduler(void) {
        asm("isb");
 }
 
-void *
-ao_usb_alloc(uint16_t len);
-
-void
-ao_usb_write(void *block, int len);
-
 #endif /* _AO_ARCH_FUNCS_H_ */