summaryrefslogtreecommitdiff
path: root/bsp/drivers
diff options
context:
space:
mode:
authorDrew Barbier <dbarbi1@gmail.com>2018-07-02 15:51:39 -0500
committerDrew Barbier <dbarbi1@gmail.com>2018-07-02 15:51:39 -0500
commit264c905f62394221215cd367b638e90c60d70808 (patch)
tree7243453aa56546e6b523503894779e8a0fdb9bd2 /bsp/drivers
parentff3a78a64798c8cce7f2a10256a26a3e91c0351c (diff)
accessors for other clic registers
Diffstat (limited to 'bsp/drivers')
-rw-r--r--bsp/drivers/clic/clic_driver.c18
-rw-r--r--bsp/drivers/clic/clic_driver.h8
2 files changed, 12 insertions, 14 deletions
diff --git a/bsp/drivers/clic/clic_driver.c b/bsp/drivers/clic/clic_driver.c
index 8acf4d2..a4c4694 100644
--- a/bsp/drivers/clic/clic_driver.c
+++ b/bsp/drivers/clic/clic_driver.c
@@ -67,22 +67,20 @@ void clic_clear_pending(clic_instance_t * this_clic, uint32_t source){
*(volatile uint8_t*)(this_clic->hart_addr+CLIC_INTIP+source) = 0;
}
-//should return max level set. if level set doesn't match requested, check nlbits
-void clic_set_level (clic_instance_t * this_clic, uint32_t source, uint32_t level){
-
+void clic_set_intcfg (clic_instance_t * this_clic, uint32_t source, uint32_t intcfg){
+ *(volatile uint8_t*)(this_clic->hart_addr+CLIC_INTCFG+source) = intcfg;
}
-void clic_get_level (clic_instance_t * this_clic, uint32_t source, uint32_t level){
-
+uint8_t clic_get_intcfg (clic_instance_t * this_clic, uint32_t source){
+ return *(volatile uint8_t*)(this_clic->hart_addr+CLIC_INTCFG+source);
}
-void clic_set_priority (clic_instance_t * this_clic, uint32_t source, uint32_t priority){
-
+void clic_set_cliccfg (clic_instance_t * this_clic, uint32_t cfg){
+ *(volatile uint8_t*)(this_clic->hart_addr+CLIC_CFG) = cfg;
}
-void clic_get_priority (clic_instance_t * this_clic, uint32_t source, uint32_t priority){
-
-
+uint8_t clic_get_cliccfg (clic_instance_t * this_clic){
+ return *(volatile uint8_t*)(this_clic->hart_addr+CLIC_CFG);
}
diff --git a/bsp/drivers/clic/clic_driver.h b/bsp/drivers/clic/clic_driver.h
index 6e8cf0b..1fd9bb6 100644
--- a/bsp/drivers/clic/clic_driver.h
+++ b/bsp/drivers/clic/clic_driver.h
@@ -26,10 +26,10 @@ void clic_enable_interrupt (clic_instance_t * this_clic, uint32_t source);
void clic_disable_interrupt (clic_instance_t * this_clic, uint32_t source);
void clic_set_pending(clic_instance_t * this_clic, uint32_t source);
void clic_clear_pending(clic_instance_t * this_clic, uint32_t source);
-void clic_set_level (clic_instance_t * this_clic, uint32_t source, uint32_t priority);
-void clic_get_level (clic_instance_t * this_clic, uint32_t source, uint32_t priority);
-void clic_set_priority (clic_instance_t * this_clic, uint32_t source, uint32_t priority);
-void clic_get_priority (clic_instance_t * this_clic, uint32_t source, uint32_t priority);
+void clic_set_intcfg (clic_instance_t * this_clic, uint32_t source, uint32_t intcfg);
+uint8_t clic_get_intcfg (clic_instance_t * this_clic, uint32_t source);
+void clic_set_cliccfg (clic_instance_t * this_clic, uint32_t cfg);
+uint8_t clic_get_cliccfg (clic_instance_t * this_clic);
__END_DECLS