1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16#include "timed_ctrl.h"
17
18#ifndef __INLINE_TIMED_CTRL__
19#include "timed_ctrl_private.h"
20#endif
21
22#include "assert_support.h"
23
24void timed_ctrl_snd_commnd(
25 const timed_ctrl_ID_t ID,
26 hrt_data mask,
27 hrt_data condition,
28 hrt_data counter,
29 hrt_address addr,
30 hrt_data value)
31{
32 OP___assert(ID == TIMED_CTRL0_ID);
33 OP___assert(TIMED_CTRL_BASE[ID] != (hrt_address)-1);
34
35 timed_ctrl_reg_store(ID, _HRT_TIMED_CONTROLLER_CMD_REG_IDX, mask);
36 timed_ctrl_reg_store(ID, _HRT_TIMED_CONTROLLER_CMD_REG_IDX, condition);
37 timed_ctrl_reg_store(ID, _HRT_TIMED_CONTROLLER_CMD_REG_IDX, counter);
38 timed_ctrl_reg_store(ID, _HRT_TIMED_CONTROLLER_CMD_REG_IDX, (hrt_data)addr);
39 timed_ctrl_reg_store(ID, _HRT_TIMED_CONTROLLER_CMD_REG_IDX, value);
40}
41
42
43
44
45void timed_ctrl_snd_sp_commnd(
46 const timed_ctrl_ID_t ID,
47 hrt_data mask,
48 hrt_data condition,
49 hrt_data counter,
50 const sp_ID_t SP_ID,
51 hrt_address offset,
52 hrt_data value)
53{
54 OP___assert(SP_ID < N_SP_ID);
55 OP___assert(SP_DMEM_BASE[SP_ID] != (hrt_address)-1);
56
57 timed_ctrl_snd_commnd(ID, mask, condition, counter,
58 SP_DMEM_BASE[SP_ID] + offset, value);
59}
60
61void timed_ctrl_snd_gpio_commnd(
62 const timed_ctrl_ID_t ID,
63 hrt_data mask,
64 hrt_data condition,
65 hrt_data counter,
66 const gpio_ID_t GPIO_ID,
67 hrt_address offset,
68 hrt_data value)
69{
70 OP___assert(GPIO_ID < N_GPIO_ID);
71 OP___assert(GPIO_BASE[GPIO_ID] != (hrt_address)-1);
72
73 timed_ctrl_snd_commnd(ID, mask, condition, counter,
74 GPIO_BASE[GPIO_ID] + offset, value);
75}
76