CC13xx Driver Library
adi.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Filename: adi.h
3 * Revised: 2015-08-18 14:04:56 +0200 (Tue, 18 Aug 2015)
4 * Revision: 44426
5 *
6 * Description: Defines and prototypes for the ADI master interface.
7 *
8 * Copyright (c) 2015, Texas Instruments Incorporated
9 * All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions are met:
13 *
14 * 1) Redistributions of source code must retain the above copyright notice,
15 * this list of conditions and the following disclaimer.
16 *
17 * 2) Redistributions in binary form must reproduce the above copyright notice,
18 * this list of conditions and the following disclaimer in the documentation
19 * and/or other materials provided with the distribution.
20 *
21 * 3) Neither the name of the ORGANIZATION nor the names of its contributors may
22 * be used to endorse or promote products derived from this software without
23 * specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
29 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 * POSSIBILITY OF SUCH DAMAGE.
36 *
37 ******************************************************************************/
38 
39 //*****************************************************************************
40 //
45 //
46 //*****************************************************************************
47 
48 #ifndef __ADI_H__
49 #define __ADI_H__
50 
51 //*****************************************************************************
52 //
53 // If building with a C++ compiler, make all of the definitions in this header
54 // have a C binding.
55 //
56 //*****************************************************************************
57 #ifdef __cplusplus
58 extern "C"
59 {
60 #endif
61 
62 #include <stdbool.h>
63 #include <stdint.h>
64 #include <inc/hw_types.h>
65 #include <inc/hw_uart.h>
66 #include <inc/hw_memmap.h>
67 #include <inc/hw_ints.h>
68 #include <inc/hw_adi.h>
69 #include <driverlib/debug.h>
70 #include <driverlib/ddi.h>
71 
72 //*****************************************************************************
73 //
74 // Number of registers in the ADI slave
75 //
76 //*****************************************************************************
77 #define ADI_SLAVE_REGS 16
78 
79 //*****************************************************************************
80 //
81 // Defines that can be passed to the ADIConfigSet()
82 //
83 //*****************************************************************************
84 #define ADI_NO_WAIT 0x00000000
85 #define ADI_WAIT_FOR_ACK 0x00000004
86 #define ADI_SPEED_2 0x00000000
87 #define ADI_SPEED_4 0x00000001
88 #define ADI_SPEED_8 0x00000002
89 #define ADI_SPEED_16 0x00000003
90 #define ADI_CONFIG_MASK 0x00000007
91 
92 //*****************************************************************************
93 //
94 // Defines that is used to control the ADI slave and master
95 //
96 //*****************************************************************************
97 #define ADI_PROTECT 0x00000080
98 #define ADI_ACK 0x00000001
99 #define ADI_SYNC 0x00000000
100 
101 //*****************************************************************************
102 //
103 // API Functions and prototypes
104 //
105 //*****************************************************************************
106 
107 #ifdef DRIVERLIB_DEBUG
108 //*****************************************************************************
109 //
119 //
120 //*****************************************************************************
121 static bool
122 ADIBaseValid(uint32_t ui32Base)
123 {
124  return(ui32Base == ADI2_BASE || ui32Base == ADI3_BASE ||
125  ui32Base == AUX_ADI4_BASE);
126 }
127 #endif
128 
129 //*****************************************************************************
130 //
142 //
143 //*****************************************************************************
144 __STATIC_INLINE uint32_t
145 ADIStatusGet(uint32_t ui32Base)
146 {
147  //
148  // Check the arguments.
149  //
150  ASSERT(ADIBaseValid(ui32Base));
151 
152  //
153  // Return the status value for the correct ADI Slave.
154  //
155  return(HWREG(ui32Base + ADI_O_SLAVESTAT));
156 }
157 
158 //*****************************************************************************
159 //
186 //
187 //*****************************************************************************
188 __STATIC_INLINE void
189 ADIConfigSet(uint32_t ui32Base, uint32_t ui32Config, bool bProtect)
190 {
191  //
192  // Check the arguments.
193  //
194  ASSERT(ADIBaseValid(ui32Base));
195  ASSERT(((ui32Config & 0x4) == ADI_NO_WAIT) ||
196  ((ui32Config & 0x4) == ADI_WAIT_FOR_ACK));
197  ASSERT(((ui32Config & 0x3) == ADI_SPEED_2) ||
198  ((ui32Config & 0x3) == ADI_SPEED_4) ||
199  ((ui32Config & 0x3) == ADI_SPEED_8) ||
200  ((ui32Config & 0x3) == ADI_SPEED_16));
201 
202  //
203  // Configure the ADI slave.
204  //
205  if (ui32Base==AUX_ADI4_BASE) {
207  ui32Base + ADI_O_SLAVECONF,
208  (ui32Config & 0x7) | (bProtect ? ADI_PROTECT : 0),
209  4
210  );
211  } else {
212  HWREG(ui32Base + ADI_O_SLAVECONF) = (ui32Config & 0x7) |
213  (bProtect ? ADI_PROTECT : 0);
214  }
215 }
216 
217 //*****************************************************************************
218 //
235 //
236 //*****************************************************************************
237 __STATIC_INLINE void
238 ADISync(uint32_t ui32Base)
239 {
240  //
241  // Check the arguments.
242  //
243  ASSERT(ADIBaseValid(ui32Base));
244 
245  //
246  // Synchronize the ADI slave to guarantee future write operations.
247  //
248  if (ui32Base==AUX_ADI4_BASE) {
249  AuxAdiDdiSafeWrite(ui32Base + ADI_O_SLAVESTAT, ADI_SYNC, 1);
250  } else {
251  HWREGB(ui32Base + ADI_O_SLAVESTAT) = ADI_SYNC;
252  }
253 }
254 
255 //*****************************************************************************
256 //
277 //
278 //*****************************************************************************
279 __STATIC_INLINE void
280 ADIProtect(uint32_t ui32Base)
281 {
282  uint32_t ui32Val;
283 
284  //
285  // Check the arguments.
286  //
287  ASSERT(ADIBaseValid(ui32Base));
288 
289  //
290  // Lock the register interface on the ADI slave.
291  //
292  if (ui32Base==AUX_ADI4_BASE) {
293  ui32Val = AuxAdiDdiSafeRead(ui32Base + ADI_O_SLAVECONF, 4);
294  } else {
295  ui32Val = HWREG(ui32Base + ADI_O_SLAVECONF);
296  }
297  ui32Val |= ADI_PROTECT;
298  if (ui32Base==AUX_ADI4_BASE) {
299  AuxAdiDdiSafeWrite(ui32Base + ADI_O_SLAVECONF, ui32Val, 4);
300  } else {
301  HWREG(ui32Base + ADI_O_SLAVECONF) = ui32Val;
302  }
303 }
304 
305 //*****************************************************************************
306 //
330 //
331 //*****************************************************************************
332 __STATIC_INLINE void
333 ADI8RegWrite(uint32_t ui32Base, uint32_t ui32Reg, uint8_t ui8Val)
334 {
335  //
336  // Check the arguments.
337  //
338  ASSERT(ADIBaseValid(ui32Base));
339  ASSERT(ui32Reg < ADI_SLAVE_REGS);
340 
341  //
342  // Write the value to the register.
343  //
344  if (ui32Base==AUX_ADI4_BASE) {
345  AuxAdiDdiSafeWrite(ui32Base + ui32Reg, ui8Val, 1);
346  } else {
347  HWREGB(ui32Base + ui32Reg) = ui8Val;
348  }
349 }
350 
351 //*****************************************************************************
352 //
379 //
380 //*****************************************************************************
381 __STATIC_INLINE void
382 ADI16RegWrite(uint32_t ui32Base, uint32_t ui32Reg,
383  uint16_t ui16Val)
384 {
385  //
386  // Check the arguments.
387  //
388  ASSERT(ADIBaseValid(ui32Base));
389  ASSERT(ui32Reg < ADI_SLAVE_REGS);
390 
391  //
392  // Write the value to the register.
393  //
394  if (ui32Base==AUX_ADI4_BASE) {
395  AuxAdiDdiSafeWrite(ui32Base + (ui32Reg & 0xFE), ui16Val, 2);
396  } else {
397  HWREGH(ui32Base + (ui32Reg & 0xFE)) = ui16Val;
398  }
399 }
400 
401 //*****************************************************************************
402 //
429 //
430 //*****************************************************************************
431 __STATIC_INLINE void
432 ADI32RegWrite(uint32_t ui32Base, uint32_t ui32Reg, uint32_t ui32Val)
433 {
434  //
435  // Check the arguments.
436  //
437  ASSERT(ADIBaseValid(ui32Base));
438  ASSERT(ui32Reg < ADI_SLAVE_REGS);
439 
440  //
441  // Write the value to the register.
442  //
443  if (ui32Base==AUX_ADI4_BASE) {
444  AuxAdiDdiSafeWrite(ui32Base + (ui32Reg & 0xFC), ui32Val, 4);
445  } else {
446  HWREG(ui32Base + (ui32Reg & 0xFC)) = ui32Val;
447  }
448 }
449 
450 //*****************************************************************************
451 //
469 //
470 //*****************************************************************************
471 __STATIC_INLINE uint32_t
472 ADI8RegRead(uint32_t ui32Base, uint32_t ui32Reg)
473 {
474  //
475  // Check the arguments.
476  //
477  ASSERT(ADIBaseValid(ui32Base));
478  ASSERT(ui32Reg < ADI_SLAVE_REGS);
479 
480  //
481  // Read the register and return the value.
482  //
483  if (ui32Base==AUX_ADI4_BASE) {
484  return AuxAdiDdiSafeRead(ui32Base + ui32Reg, 1);
485  } else {
486  return(HWREGB(ui32Base + ui32Reg));
487  }
488 }
489 
490 //*****************************************************************************
491 //
512 //
513 //*****************************************************************************
514 __STATIC_INLINE uint32_t
515 ADI16RegRead(uint32_t ui32Base, uint32_t ui32Reg)
516 {
517  //
518  // Check the arguments.
519  //
520  ASSERT(ADIBaseValid(ui32Base));
521  ASSERT(ui32Reg < ADI_SLAVE_REGS);
522 
523  //
524  // Read the registers and return the value.
525  //
526  if (ui32Base==AUX_ADI4_BASE) {
527  return AuxAdiDdiSafeRead(ui32Base + (ui32Reg & 0xFE), 2);
528  } else {
529  return(HWREGH(ui32Base + (ui32Reg & 0xFE)));
530  }
531 }
532 
533 //*****************************************************************************
534 //
553 //
554 //*****************************************************************************
555 __STATIC_INLINE uint32_t
556 ADI32RegRead(uint32_t ui32Base, uint32_t ui32Reg)
557 {
558  //
559  // Check the arguments.
560  //
561  ASSERT(ADIBaseValid(ui32Base));
562  ASSERT(ui32Reg < ADI_SLAVE_REGS);
563 
564  //
565  // Read the registers and return the value.
566  //
567  if (ui32Base==AUX_ADI4_BASE) {
568  return AuxAdiDdiSafeRead(ui32Base + (ui32Reg & 0xFC), 4);
569  } else {
570  return(HWREG(ui32Base + (ui32Reg & 0xFC)));
571  }
572 }
573 
574 //*****************************************************************************
575 //
602 //
603 //*****************************************************************************
604 __STATIC_INLINE void
605 ADI8BitsSet(uint32_t ui32Base, uint32_t ui32Reg, uint8_t ui8Val)
606 {
607  uint32_t ui32RegOffset;
608 
609  //
610  // Check the arguments.
611  //
612  ASSERT(ADIBaseValid(ui32Base));
613  ASSERT(ui32Reg < ADI_SLAVE_REGS);
614 
615  //
616  // Get the correct address of the first register used for setting bits
617  // in the ADI slave.
618  //
619  ui32RegOffset = ADI_O_SET;
620 
621  //
622  // Set the selected bits.
623  //
624  if (ui32Base==AUX_ADI4_BASE) {
625  AuxAdiDdiSafeWrite(ui32Base + ui32RegOffset + ui32Reg, ui8Val, 1);
626  } else {
627  HWREGB(ui32Base + ui32RegOffset + ui32Reg) = ui8Val;
628  }
629 }
630 
631 //*****************************************************************************
632 //
659 //
660 //*****************************************************************************
661 __STATIC_INLINE void
662 ADI16BitsSet(uint32_t ui32Base, uint32_t ui32Reg, uint16_t ui16Val)
663 {
664  uint32_t ui32RegOffset;
665 
666  //
667  // Check the arguments.
668  //
669  ASSERT(ADIBaseValid(ui32Base));
670  ASSERT(ui32Reg < ADI_SLAVE_REGS);
671 
672  //
673  // Get the correct address of the first register used for setting bits
674  // in the ADI slave.
675  //
676  ui32RegOffset = ADI_O_SET;
677 
678  //
679  // Set the selected bits.
680  //
681  if (ui32Base==AUX_ADI4_BASE) {
682  AuxAdiDdiSafeWrite(ui32Base + ui32RegOffset + (ui32Reg & 0xFE), ui16Val, 2);
683  } else {
684  HWREGH(ui32Base + ui32RegOffset + (ui32Reg & 0xFE)) = ui16Val;
685  }
686 }
687 
688 //*****************************************************************************
689 //
716 //
717 //*****************************************************************************
718 __STATIC_INLINE void
719 ADI32BitsSet(uint32_t ui32Base, uint32_t ui32Reg, uint32_t ui32Val)
720 {
721  uint32_t ui32RegOffset;
722 
723  //
724  // Check the arguments.
725  //
726  ASSERT(ADIBaseValid(ui32Base));
727  ASSERT(ui32Reg < ADI_SLAVE_REGS);
728 
729  //
730  // Get the correct address of the first register used for setting bits
731  // in the ADI slave.
732  //
733  ui32RegOffset = ADI_O_SET;
734 
735  //
736  // Set the selected bits.
737  //
738  if (ui32Base==AUX_ADI4_BASE) {
739  AuxAdiDdiSafeWrite(ui32Base + ui32RegOffset + (ui32Reg & 0xFC), ui32Val, 4);
740  } else {
741  HWREG(ui32Base + ui32RegOffset + (ui32Reg & 0xFC)) = ui32Val;
742  }
743 }
744 
745 //*****************************************************************************
746 //
773 //
774 //*****************************************************************************
775 __STATIC_INLINE void
776 ADI8BitsClear(uint32_t ui32Base, uint32_t ui32Reg, uint8_t ui8Val)
777 {
778  uint32_t ui32RegOffset;
779 
780  //
781  // Check the arguments.
782  //
783  ASSERT(ADIBaseValid(ui32Base));
784  ASSERT(ui32Reg < ADI_SLAVE_REGS);
785 
786  //
787  // Get the correct address of the first register used for setting bits
788  // in the ADI slave.
789  //
790  ui32RegOffset = ADI_O_CLR;
791 
792  //
793  // Set the selected bits.
794  //
795  if (ui32Base==AUX_ADI4_BASE) {
796  AuxAdiDdiSafeWrite(ui32Base + ui32RegOffset + ui32Reg, ui8Val, 1);
797  } else {
798  HWREGB(ui32Base + ui32RegOffset + ui32Reg) = ui8Val;
799  }
800 }
801 
802 //*****************************************************************************
803 //
830 //
831 //*****************************************************************************
832 __STATIC_INLINE void
833 ADI16BitsClear(uint32_t ui32Base, uint32_t ui32Reg, uint16_t ui16Val)
834 {
835  uint32_t ui32RegOffset;
836 
837  //
838  // Check the arguments.
839  //
840  ASSERT(ADIBaseValid(ui32Base));
841  ASSERT(ui32Reg < ADI_SLAVE_REGS);
842 
843  //
844  // Get the correct address of the first register used for setting bits
845  // in the ADI slave.
846  //
847  ui32RegOffset = ADI_O_CLR;
848 
849  //
850  // Set the selected bits.
851  //
852  if (ui32Base==AUX_ADI4_BASE) {
853  AuxAdiDdiSafeWrite(ui32Base + ui32RegOffset + (ui32Reg & 0xFE), ui16Val, 2);
854  } else {
855  HWREGH(ui32Base + ui32RegOffset + (ui32Reg & 0xFE)) = ui16Val;
856  }
857 }
858 
859 //*****************************************************************************
860 //
887 //
888 //*****************************************************************************
889 __STATIC_INLINE void
890 ADI32BitsClear(uint32_t ui32Base, uint32_t ui32Reg, uint32_t ui32Val)
891 {
892  uint32_t ui32RegOffset;
893 
894  //
895  // Check the arguments.
896  //
897  ASSERT(ADIBaseValid(ui32Base));
898  ASSERT(ui32Reg < ADI_SLAVE_REGS);
899 
900  //
901  // Get the correct address of the first register used for setting bits
902  // in the ADI slave.
903  //
904  ui32RegOffset = ADI_O_CLR;
905 
906  //
907  // Set the selected bits.
908  //
909  if (ui32Base==AUX_ADI4_BASE) {
910  AuxAdiDdiSafeWrite(ui32Base + ui32RegOffset + (ui32Reg & 0xFC), ui32Val, 4);
911  } else {
912  HWREG(ui32Base + ui32RegOffset + (ui32Reg & 0xFC)) = ui32Val;
913  }
914 }
915 
916 //*****************************************************************************
917 //
947 //
948 //*****************************************************************************
949 __STATIC_INLINE void
950 ADI4SetValBit(uint32_t ui32Base, uint32_t ui32Reg, bool bWriteHigh,
951  uint8_t ui8Mask, uint8_t ui8Val)
952 {
953  uint32_t ui32RegOffset;
954 
955  //
956  // Check the arguments.
957  //
958  ASSERT(ADIBaseValid(ui32Base));
959  ASSERT(ui32Reg < ADI_SLAVE_REGS);
960  ASSERT(!(ui8Val & 0xF0));
961  ASSERT(!(ui8Mask & 0xF0));
962 
963  //
964  // Get the correct address of the first register used for setting bits
965  // in the ADI slave.
966  //
967  ui32RegOffset = ADI_O_MASK4B + (ui32Reg << 1) + (bWriteHigh ? 1 : 0);
968 
969  //
970  // Set the selected bits.
971  //
972  if (ui32Base==AUX_ADI4_BASE) {
973  AuxAdiDdiSafeWrite(ui32Base + ui32RegOffset, (ui8Mask << 4) | ui8Val, 1);
974  } else {
975  HWREGB(ui32Base + ui32RegOffset) = (ui8Mask << 4) | ui8Val;
976  }
977 }
978 
979 //*****************************************************************************
980 //
1005 //
1006 //*****************************************************************************
1007 __STATIC_INLINE void
1008 ADI8SetValBit(uint32_t ui32Base, uint32_t ui32Reg, uint16_t ui16Mask,
1009  uint16_t ui16Val)
1010 {
1011  uint32_t ui32RegOffset;
1012 
1013  //
1014  // Check the arguments.
1015  //
1016  ASSERT(ADIBaseValid(ui32Base));
1017  ASSERT(ui32Reg < ADI_SLAVE_REGS);
1018  ASSERT(!(ui16Val & 0xFF00));
1019  ASSERT(!(ui16Mask & 0xFF00));
1020 
1021  //
1022  // Get the correct address of the first register used for setting bits
1023  // in the ADI slave.
1024  //
1025  ui32RegOffset = ADI_O_MASK8B + (ui32Reg << 1);
1026 
1027  //
1028  // Set the selected bits.
1029  //
1030  if (ui32Base==AUX_ADI4_BASE) {
1031  AuxAdiDdiSafeWrite(ui32Base + ui32RegOffset, (ui16Mask << 8) | ui16Val, 2);
1032  } else {
1033  HWREGH(ui32Base + ui32RegOffset) = (ui16Mask << 8) | ui16Val;
1034  }
1035 }
1036 
1037 //*****************************************************************************
1038 //
1064 //
1065 //*****************************************************************************
1066 __STATIC_INLINE void
1067 ADI16SetValBit(uint32_t ui32Base, uint32_t ui32Reg, uint32_t ui32Mask,
1068  uint32_t ui32Val)
1069 {
1070  uint32_t ui32RegOffset;
1071 
1072  //
1073  // Check the arguments.
1074  //
1075  ASSERT(ADIBaseValid(ui32Base));
1076  ASSERT(ui32Reg < ADI_SLAVE_REGS);
1077  ASSERT(!(ui32Val & 0xFFFF0000));
1078  ASSERT(!(ui32Mask & 0xFFFF0000));
1079 
1080  //
1081  // Get the correct address of the first register used for setting bits
1082  // in the ADI slave.
1083  //
1084  ui32RegOffset = ADI_O_MASK16B + ((ui32Reg << 1) & 0xFC);
1085 
1086  //
1087  // Set the selected bits.
1088  //
1089  if (ui32Base==AUX_ADI4_BASE) {
1090  AuxAdiDdiSafeWrite(ui32Base + ui32RegOffset, (ui32Mask << 16) | ui32Val, 4);
1091  } else {
1092  HWREG(ui32Base + ui32RegOffset) = (ui32Mask << 16) | ui32Val;
1093  }
1094 }
1095 
1096 //*****************************************************************************
1097 //
1098 // Mark the end of the C bindings section for C++ compilers.
1099 //
1100 //*****************************************************************************
1101 #ifdef __cplusplus
1102 }
1103 #endif
1104 
1105 #endif // __ADI_H__
1106 
1107 //*****************************************************************************
1108 //
1112 //
1113 //*****************************************************************************
static void ADI8BitsClear(uint32_t ui32Base, uint32_t ui32Reg, uint8_t ui8Val)
Clear specific bits in an 8 bit ADI register.
Definition: adi.h:776
static void ADI16SetValBit(uint32_t ui32Base, uint32_t ui32Reg, uint32_t ui32Mask, uint32_t ui32Val)
Set a value on any bits inside an 2 x 8 bit register aligned on a half-word (byte) boundary in the AD...
Definition: adi.h:1067
static uint32_t ADI32RegRead(uint32_t ui32Base, uint32_t ui32Reg)
Read the value in a 32 bit register.
Definition: adi.h:556
static void ADIConfigSet(uint32_t ui32Base, uint32_t ui32Config, bool bProtect)
Configure the ADI Slave.
Definition: adi.h:189
static void ADI16BitsClear(uint32_t ui32Base, uint32_t ui32Reg, uint16_t ui16Val)
Clear specific bits in two 8 bit ADI register.
Definition: adi.h:833
static void ADI16BitsSet(uint32_t ui32Base, uint32_t ui32Reg, uint16_t ui16Val)
Set specific bits in 2 x 8 bit ADI slave registers.
Definition: adi.h:662
#define ADI_SYNC
Definition: adi.h:99
static uint32_t AuxAdiDdiSafeRead(uint32_t nAddr, uint32_t nSize)
Safely read from AUX ADI/DDI interfaces using a semaphore.
Definition: ddi.h:168
static void ADIProtect(uint32_t ui32Base)
Protect an ADI slave configuration by locking the configuration register access.
Definition: adi.h:280
#define ADI_SPEED_2
Definition: adi.h:86
static void ADI8RegWrite(uint32_t ui32Base, uint32_t ui32Reg, uint8_t ui8Val)
Write an 8 bit value to a register in an ADI slave.
Definition: adi.h:333
static uint32_t ADI8RegRead(uint32_t ui32Base, uint32_t ui32Reg)
Read the value of an 8 bit register in the ADI slave.
Definition: adi.h:472
static void ADI4SetValBit(uint32_t ui32Base, uint32_t ui32Reg, bool bWriteHigh, uint8_t ui8Mask, uint8_t ui8Val)
Set a value on any 4 bits inside an 8 bit register in the ADI slave.
Definition: adi.h:950
#define ADI_SPEED_8
Definition: adi.h:88
#define ADI_SPEED_4
Definition: adi.h:87
static uint32_t ADIStatusGet(uint32_t ui32Base)
Get the status of an ADI module.
Definition: adi.h:145
static void ADI16RegWrite(uint32_t ui32Base, uint32_t ui32Reg, uint16_t ui16Val)
Write a 16 bit value to 2 registers in the ADI slave.
Definition: adi.h:382
#define ASSERT(expr)
Definition: debug.h:74
static void ADI8SetValBit(uint32_t ui32Base, uint32_t ui32Reg, uint16_t ui16Mask, uint16_t ui16Val)
Set a value on any bits inside an 8 bit register in the ADI slave.
Definition: adi.h:1008
static void ADISync(uint32_t ui32Base)
Synchronize the ADI slave.
Definition: adi.h:238
#define ADI_SPEED_16
Definition: adi.h:89
#define ADI_NO_WAIT
Definition: adi.h:84
static void ADI32BitsSet(uint32_t ui32Base, uint32_t ui32Reg, uint32_t ui32Val)
Set specific bits in 4 x 8 bit ADI slave registers.
Definition: adi.h:719
static void ADI8BitsSet(uint32_t ui32Base, uint32_t ui32Reg, uint8_t ui8Val)
Set specific bits in a single 8 bit ADI register.
Definition: adi.h:605
#define ADI_PROTECT
Definition: adi.h:97
static uint32_t ADI16RegRead(uint32_t ui32Base, uint32_t ui32Reg)
Read the value in a 16 bit register.
Definition: adi.h:515
#define ADI_WAIT_FOR_ACK
Definition: adi.h:85
#define ADI_SLAVE_REGS
Definition: adi.h:77
static void ADI32BitsClear(uint32_t ui32Base, uint32_t ui32Reg, uint32_t ui32Val)
Clear specific bits in four 8 bit ADI register.
Definition: adi.h:890
static void AuxAdiDdiSafeWrite(uint32_t nAddr, uint32_t nData, uint32_t nSize)
Safely write to AUX ADI/DDI interfaces using a semaphore.
Definition: ddi.h:136
static void ADI32RegWrite(uint32_t ui32Base, uint32_t ui32Reg, uint32_t ui32Val)
Write a 32 bit value to 4 registers in the ADI slave.
Definition: adi.h:432