Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pmc: Add interrupt control and enable registers #380

Merged
merged 1 commit into from
Jul 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/ec/ite/include/ec/pmc.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ struct Pmc {
volatile uint8_t *data_in;
// Control register
volatile uint8_t *control;
// Interrupt control register
volatile uint8_t *interrupt_control;
// Interrupt enable register
volatile uint8_t *interrupt_enable;
};

extern struct Pmc __code PMC_1;
Expand All @@ -36,27 +40,40 @@ void pmc_write(struct Pmc *pmc, uint8_t data);

volatile uint8_t __xdata __at(0x1500) PM1STS;
volatile uint8_t __xdata __at(0x1501) PM1DO;
volatile uint8_t __xdata __at(0x1502) PM1DOSCI;
volatile uint8_t __xdata __at(0x1503) PM1DOSMI;
volatile uint8_t __xdata __at(0x1504) PM1DI;
volatile uint8_t __xdata __at(0x1505) PM1DISCI;
volatile uint8_t __xdata __at(0x1506) PM1CTL;
volatile uint8_t __xdata __at(0x1507) PM1IC;
volatile uint8_t __xdata __at(0x1508) PM1IE;

volatile uint8_t __xdata __at(0x1510) PM2STS;
volatile uint8_t __xdata __at(0x1511) PM2DO;
volatile uint8_t __xdata __at(0x1514) PM2DI;
volatile uint8_t __xdata __at(0x1516) PM2CTL;
volatile uint8_t __xdata __at(0x1517) PM2IC;
volatile uint8_t __xdata __at(0x1518) PM2IE;

volatile uint8_t __xdata __at(0x1520) PM3STS;
volatile uint8_t __xdata __at(0x1521) PM3DO;
volatile uint8_t __xdata __at(0x1522) PM3DI;
volatile uint8_t __xdata __at(0x1523) PM3CTL;
volatile uint8_t __xdata __at(0x1524) PM3IC;
volatile uint8_t __xdata __at(0x1525) PM3IE;

volatile uint8_t __xdata __at(0x1530) PM4STS;
volatile uint8_t __xdata __at(0x1531) PM4DO;
volatile uint8_t __xdata __at(0x1532) PM4DI;
volatile uint8_t __xdata __at(0x1533) PM4CTL;
volatile uint8_t __xdata __at(0x1534) PM4IC;
volatile uint8_t __xdata __at(0x1535) PM4IE;

volatile uint8_t __xdata __at(0x1540) PM5STS;
volatile uint8_t __xdata __at(0x1541) PM5DO;
volatile uint8_t __xdata __at(0x1542) PM5DI;
volatile uint8_t __xdata __at(0x1543) PM5CTL;
volatile uint8_t __xdata __at(0x1544) PM5IC;
volatile uint8_t __xdata __at(0x1545) PM5IE;

#endif // _EC_PMC_H
2 changes: 2 additions & 0 deletions src/ec/ite/pmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
.data_out = &PM ## NUM ## DO, \
.data_in = &PM ## NUM ## DI, \
.control = &PM ## NUM ## CTL, \
.interrupt_control = &PM ## NUM ## IC, \
.interrupt_enable = &PM ## NUM ## IE, \
}
// clang-format on

Expand Down