CircleOS  1
cx.c
Go to the documentation of this file.
1 /****************** COPYRIGHT (C) 2007-2013 KEOLABS S.A.S. ********************/
11 /******************************************************************************/
12 
13 /* Includes ------------------------------------------------------------------*/
14 #include "circle.h"
15 
16 /* Private defines -----------------------------------------------------------*/
17 
18 /* Private variables ---------------------------------------------------------*/
19 
20 /* External variables ---------------------------------------------------------*/
21 
22 /* Public functions for CircleOS ---------------------------------------------*/
23 
24 /* Public functions ----------------------------------------------------------*/
25 
26 /*******************************************************************************
27 *
28 * CX_Configure
29 *
30 *******************************************************************************/
46 /******************************************************************************/
47 s32 CX_Configure( tCX_ID what, s32 param1, s32 param2 )
48 {
49 
50  s32 ret = 0;
51 
52 #if CX_AVAIL
53 
54  // ==================================== GPIOs PINS =============================
55  if ( what < CX_USART ) //configured as simple GPIOs
56  {
57  ret = CX_Configure_spe_GPIO( what, param1, param2 );
58  }
59  // ==================================== ADCs PINS =============================
60  else if ( ( what == CX_ADC1 ) || ( what == CX_ADC2 ) )
61  {
62  ret = CX_Configure_spe_ADC( what, param1, param2 );
63  }
64  // ==================================== USART ==================================
65  else if ( what == CX_USART )
66  {
67  ret = CX_Configure_spe_USART( param1, param2 );
68  }
69  // ==================================== SPI ====================================
70  else if ( what == CX_SPI )
71  {
72  ret = CX_Configure_spe_SPI( param1, param2 );
73  }
74  // ==================================== I2C ===================================
75  else
76  {
77  //I2C... to be done...
78  }
79 
80 #endif
81 
82  return ret;
83 }
84 
85 
86 /*******************************************************************************
87 *
88 * CX_Write
89 *
90 *******************************************************************************/
106 /******************************************************************************/
107 s32 CX_Write( tCX_ID what, s32 param1, s32 param2 )
108 {
109  s32 ret = 0;
110 
111 #if !PRIMER1
112 
113  ret = CX_Write_spe( what, param1, param2 );
114 
115 #endif
116 
117  return ret;
118 }
119 
120 /*******************************************************************************
121 *
122 * CX_Read
123 *
124 *******************************************************************************/
138 /******************************************************************************/
139 s32 CX_Read( tCX_ID what, s32 param1, s32 param2 )
140 {
141  s32 ret = 0;
142 
143 #if !PRIMER1
144 
145  ret = CX_Read_spe( what, param1, param2 );
146 
147 #endif
148 
149  return ret;
150 
151 }
152