ESOS32
ESOSOn32-bitProcessors
esos_stm32l4_spi.h
Go to the documentation of this file.
1 /*
2  * "Copyright (c) 2020 J. W. Bruce ("AUTHOR(S)")"
3  * All rights reserved.
4  * (J. W. Bruce, jwbruce_AT_tntech.edu, Tennessee Tech University)
5  *
6  * Permission to use, copy, modify, and distribute this software and its
7  * documentation for any purpose, without fee, and without written agreement is
8  * hereby granted, provided that the above copyright notice, the following
9  * two paragraphs and the authors appear in all copies of this software.
10  *
11  * IN NO EVENT SHALL THE "AUTHORS" BE LIABLE TO ANY PARTY FOR
12  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
13  * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE "AUTHORS"
14  * HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15  *
16  * THE "AUTHORS" SPECIFICALLY DISCLAIMS ANY WARRANTIES,
17  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
18  * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
19  * ON AN "AS IS" BASIS, AND THE "AUTHORS" HAS NO OBLIGATION TO
20  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS."
21  *
22  * Please maintain this header in its entirety when copying/modifying
23  * these files.
24  *
25  *
26  */
27 
28 #ifndef _ESOS_STM32L4_SPI_H
29 #define _ESOS_STM32L4_SPI_H
30 
31 
37 // Documentation for this file. If the \file tag isn't present,
38 // this file won't be documented.
46 /* I N C L U D E S **********************************************************/
47 #include "esos.h"
48 #include "esos_spi.h"
49 #include "esos_stm32l4.h"
50 #include <libopencm3/stm32/spi.h>
51 
52 /* D E F I N I T I O N S ****************************************************/
53 #define __ESOS_SPI_STM32L4_IS_BUSY() ( SPI_SR(SPI1) & SPI_SR_BSY )
54 #define __ESOS_SPI_STM32L4_IS_OVR() ( SPI_SR(SPI1) & SPI_SR_OVR )
55 #define __ESOS_SPI_STM32L4_IS_TXE() ( SPI_SR(SPI1) & SPI_SR_TXE )
56 #define __ESOS_SPI_STM32L4_IS_RXNE() ( SPI_SR(SPI1) & SPI_SR_RXNE )
57 
58 
59 
60 /* E X T E R N S ************************************************************/
61 
62 
63 /* M A C R O S **************************************************************/
64 
65 /* P U B L I C P R O T O T Y P E S *****************************************/
66 //I2C Operations
67 void __esos_spi_hw_config(uint32_t u32_spibps);
68 
69 //I2C Transactions
70 ESOS_CHILD_TASK( __esos_spi_hw_xferNSPI1, uint16_t* pu16_out, uint16_t* pu16_in, uint16_t u16_cnt);
72 #endif // end ESOS_STM32L4_SPI_H
esos_spi.h
esos_stm32l4.h
This is the master include file for implementing ESOS32 the STMicroelectronics STM32L4xx MCUs.
esos.h
ESOS_CHILD_TASK
#define ESOS_CHILD_TASK(taskname,...)
Definition: esos_task.h:246