ESOS32
ESOSOn32-bitProcessors
esos_hwxxx_spi.c
Go to the documentation of this file.
1 /*
2  * "Copyright (c) 2019 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 
36 // Documentation for this file. If the \file tag isn't present,
37 // this file won't be documented.
44 /*** I N C L U D E S *************************************************/
45 #include "esos_hwxxx_spi.h"
46 
47 /*** G L O B A L S *************************************************/
48 
49 /*** T H E C O D E *************************************************/
50 
51 /*********************************************************
52  * Public functions intended to be called by other files *
53  *********************************************************/
54 
55 // Documentation for this file. If the \file tag is not present,
56 // this file will not be documented.
57 // Note: place this comment below the #if NUM_I2C_MODS so Doxygen
58 // will only see it once.
63 /*
64 Transaction: Does hardware configuration to setup the SPI
65 periperal given the SPI transfer bitrate \em u32_spibps.
66 \note The SPI peripheral setup determines whether 8-bit or 16-bit data
67 is written.
68  */
69 extern void __esos_spi_hw_config(uint32_t u32_spibps){
70 
71  // write the required hardware code to setup the SPI peripheral
72 
73 } // end __esos_spi_hw_config()
74 
75 /*
76 Transaction: Writes \em u16_cnt words stored in
77 buffer \em *pu16_out to SPI device, while reading \em u16_cnt words from
78 SPI device placing results into buffer \em *pu16_in
79 \note Assumes that SPI peripheral has been properly configured.
80 \note The SPI peripheral setup determines whether 8-bit or 16-bit data
81 is written.
82 \param pu16_out Pointer to buffer containing data to send. If \em pu16_out is \em NULLPTR this function will send zeroes to the SPI device and only "read"
83 \param pu16_in Pointer to buffer to catch incoming data. If \em pu16_in is \em NULLPTR this function will only "write" the SPI device
84 \param u16_cnt Number of words to send
85  */
86 ESOS_CHILD_TASK( __esos_hw_xferNSPI, uint16_t* pu16_out, uint16_t* pu16_in, uint16_t u16_cnt) {
87 
89 
90  // write the hardware-specific code to implement the
91  // functional requirements given above
92 
93  ESOS_TASK_END();
94 } // end __esos_hw_xferNSPI
95 
esos_hwxxx_spi.h
This file contains templates for routines which define, configure and allow use of the SPI service on...
ESOS_TASK_END
#define ESOS_TASK_END()
Definition: esos_task.h:271
ESOS_CHILD_TASK
#define ESOS_CHILD_TASK(taskname,...)
Definition: esos_task.h:246
ESOS_TASK_BEGIN
#define ESOS_TASK_BEGIN()
Definition: esos_task.h:259