Nordic Semiconductor nRF5 AirFuel SDK  version 2.2.0
test_mux_common.h
Go to the documentation of this file.
1 /* Copyright (c) Nordic Semiconductor. All Rights Reserved.
2  *
3  * The information contained herein is property of Nordic Semiconductor ASA.
4  * Terms and conditions of usage are described in detail in NORDIC
5  * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
6  *
7  * Licensees are granted free, non-transferable use of the information. NO
8  * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
9  * the file.
10  *
11  */
12 
20 #ifndef __TEST_MUX_COMMON_H__
21 #define __TEST_MUX_COMMON_H__
22 
23 #include <stdint.h>
24 
25 
26 /******************************************************************************
27  * Definitions
28  ******************************************************************************/
29 
35 #define TMUX_SET(hal_fun, arg) do \
36 { \
37  if(set_mux_select == TMUX_SELECT_NO_OVERRIDE) \
38  { \
39  return hal_fun(arg); \
40  } \
41  else \
42  { \
43  ASSERT(set_mux_select == TMUX_SELECT_OVERRIDE) \
44  return NRF_SUCCESS; \
45  } \
46 } while(0)
47 
56 #define TMUX_GET(hal_fun, arg, override_val) do \
57 { \
58  if(get_mux_select == TMUX_SELECT_NO_OVERRIDE) \
59  { \
60  return hal_fun(arg); \
61  } \
62  else \
63  { \
64  ASSERT(get_mux_select == TMUX_SELECT_OVERRIDE) \
65  *arg = override_val; \
66  return NRF_SUCCESS; \
67  } \
68 } while(0)
69 
70 /******************************************************************************
71  * Types
72  ******************************************************************************/
73 
78  typedef enum
79  {
80  TMUX_SELECT_NO_OVERRIDE = 0,
81  TMUX_SELECT_OVERRIDE,
82  } tmux_select_t;
83 
84 /******************************************************************************
85  * Profile API
86  ******************************************************************************/
87 
92 uint32_t tmux_init(void);
93 
94 /******************************************************************************
95  * Test API
96  ******************************************************************************/
97 
104 void tmux_get_select(tmux_select_t select);
105 
112 void tmux_set_select(tmux_select_t select);
113 
114 #endif /* __TMUX_H__ */
115 
tmux_select_t
Enumerator used for configuring test multiplexer.
void tmux_get_select(tmux_select_t select)
Select source for all **tmux**get() functions.
Definition: pru_test_mux.c:135
void tmux_set_select(tmux_select_t select)
Select whether override values shall be used when writing to **hal**set() functions.
Definition: pru_test_mux.c:140
uint32_t tmux_init(void)
Initialize the PTU's test multiplexer.
Definition: pru_test_mux.c:53