Skip to content

Commit

Permalink
update fw
Browse files Browse the repository at this point in the history
  • Loading branch information
NouranAbdelaziz committed May 12, 2024
1 parent 2f0ee76 commit fbadd0a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
16 changes: 6 additions & 10 deletions fw/EF_GPIO8.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,7 @@ void EF_GPIO8_setPinDirection(uint32_t gpio_base, int pin, int dir){
gpio->DIR = directions;
}

void EF_GPIO8_setIM(uint32_t gpio_base, int data){

EF_GPIO8_TYPE* gpio = (EF_GPIO8_TYPE*)gpio_base;
gpio->im = data;
}


// Interrupts bits in RIS, MIS, IM, and ICR
// bit 0: TX FIFO is Empty
Expand All @@ -74,31 +70,31 @@ void EF_GPIO8_setIM(uint32_t gpio_base, int data){
int EF_GPIO8_getRIS(uint32_t gpio_base){

EF_GPIO8_TYPE* gpio = (EF_GPIO8_TYPE*)gpio_base;
return (gpio->ris);
return (gpio->RIS);
}

int EF_GPIO8_getMIS(uint32_t gpio_base){

EF_GPIO8_TYPE* gpio = (EF_GPIO8_TYPE*)gpio_base;
return (gpio->mis);
return (gpio->MIS);
}

void EF_GPIO8_setIM(uint32_t gpio_base, int mask){

EF_GPIO8_TYPE* gpio = (EF_GPIO8_TYPE*)gpio_base;
gpio->im |= mask;
gpio->IM |= mask;
}

int EF_GPIO8_getIM(uint32_t gpio_base){

EF_GPIO8_TYPE* gpio = (EF_GPIO8_TYPE*)gpio_base;
return (gpio->im);
return (gpio->IM);
}

void EF_GPIO8_setICR(uint32_t gpio_base, int mask){

EF_GPIO8_TYPE* gpio = (EF_GPIO8_TYPE*)gpio_base;
(gpio->icr) |= mask;
(gpio->IC) |= mask;
}

#endif // GPIO_H
14 changes: 7 additions & 7 deletions fw/EF_GPIO8_regs.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
Copyright 2023 Efabless Corp.
Copyright 2024 Efabless Corp.
Author: Mohamed Shalan (mshalan@aucegypt.edu)
Author: Mohamed Shalan (mshalan@efabless.com)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -65,11 +65,11 @@ typedef struct _EF_GPIO8_TYPE_ {
__R DATAI;
__W DATAO;
__W DIR;
__R reserved[957];
__RW im;
__R mis;
__R ris;
__W icr;
__R reserved_0[16317];
__RW IM;
__R MIS;
__R RIS;
__W IC;
} EF_GPIO8_TYPE;

#endif
Expand Down

0 comments on commit fbadd0a

Please sign in to comment.