port1.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. MSP430 Emulator
  3. Copyright (C) 2020 Rudolf Geosits (rgeosits@live.esu.edu)
  4. "MSP430 Emulator" is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation, either version 3 of the License, or
  7. (at your option) any later version.
  8. "MSP430 Emulator" is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program. If not, see <https://www.gnu.org/licenses/>.
  14. */
  15. #ifndef _PORT_1_
  16. #define _PORT_1_
  17. #include "../cpu/registers.h"
  18. #include "../utilities.h"
  19. struct Port_1 {
  20. // Peripheral register pointers
  21. // Port 1 = r/w = = reset? =
  22. uint8_t *IN; /* r - */
  23. uint8_t *OUT; /* r/w unchanged */
  24. uint8_t *DIR; /* r/w PUC reset */
  25. uint8_t *IFG; /* r/w PUC reset */
  26. uint8_t *IES; /* r/w unchanged */
  27. uint8_t *IE; /* r/w PUC reset */
  28. uint8_t *SEL; /* r/w PUC reset */
  29. uint8_t *SEL2; /* r/w PUC reset */
  30. uint8_t *REN; /* r/w PUC reset */
  31. // Peripherals activation flags (for emulator)
  32. bool DIR_0, OUT_0, IFG_0, IE_0, SEL_0, SEL2_0;
  33. bool DIR_1, OUT_1, IFG_1, IE_1, SEL_1, SEL2_1;
  34. bool DIR_2, OUT_2, IFG_2, IE_2, SEL_2, SEL2_2;
  35. bool DIR_3, OUT_3, IFG_3, IE_3, SEL_3, SEL2_3;
  36. bool DIR_4, OUT_4, IFG_4, IE_4, SEL_4, SEL2_4;
  37. bool DIR_5, OUT_5, IFG_5, IE_5, SEL_5, SEL2_5;
  38. bool DIR_6, OUT_6, IFG_6, IE_6, SEL_6, SEL2_6;
  39. bool DIR_7, OUT_7, IFG_7, IE_7, SEL_7, SEL2_7;
  40. };
  41. void setup_port_1(Emulator *emu);
  42. void handle_port_1(Emulator *emu);
  43. #endif