ESOS32
ESOSOn32-bitProcessors
esos_hwxxx_i2c.h
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 #ifndef _ESOS_HWXXX_I2C_H
29 #define _ESOS_HWXXX_I2C_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_i2c.h"
49 #include "esos_hwxxx.h"
50 
51 /* D E F I N I T I O N S ****************************************************/
52 
53 /* E X T E R N S ************************************************************/
54 extern struct stTask __stChildTaskI2C, __stGrandChildTaskI2C;
55 extern uint8_t __esos_i2c_dataBytes[2]; // used to store arguments
56 
57 /* M A C R O S **************************************************************/
58 #define CLEAR_REGISTER_BITS(reg,mask) reg &= (~(mask))
59 #define SET_REGISTER_BITS(reg,mask) reg |= (mask)
60 #define MAKE_I2C_WR_ADDR(bits) bits &= 0xFFE
61 #define MAKE_I2C_RD_ADDR(bits) bits &= 0x001
62 
63 /* P U B L I C P R O T O T Y P E S *****************************************/
64 
65 //I2C Operations
66 void __esos_i2c_hw_config(uint32_t u32_i2cbps);
67 
68 //I2C Transactions
69 ESOS_CHILD_TASK( __esos_i2c_hw_writeN, uint8_t u8_addr, uint8_t* pu8_d, uint_t u8_cnt);
70 ESOS_CHILD_TASK( __esos_i2c_hw_readN, uint8_t u8_addr, uint8_t* pu8_d, uint8_t u8_cnt);
71 ESOS_CHILD_TASK( __esos_i2c_hw_writeNReadM, uint8_t u8_addr, uint8_t* pu8_wd, uint8_t u8_wcnt, uint8_t* pu8_rd, uint8_t u8_rcnt);
72 
73 
75 #endif // end ESOS_HWXXX_I2C_H
esos_hwxxx.h
This is the master include file template for the target hardware (hwxxxx)
__esos_i2c_hw_config
void __esos_i2c_hw_config(uint32_t u32_i2cbps)
Definition: esos_hwxxx_i2c.c:74
esos.h
ESOS_CHILD_TASK
#define ESOS_CHILD_TASK(taskname,...)
Definition: esos_task.h:246
stTask
Definition: esos_task.h:54
esos_i2c.h