Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: MAX8614X.cpp
- Revision:
- 1:7ae9b934ee55
- Parent:
- 0:77ee0ceb503a
- Child:
- 2:11e0b5b86e1e
diff -r 77ee0ceb503a -r 7ae9b934ee55 MAX8614X.cpp
--- a/MAX8614X.cpp Fri Aug 10 04:54:06 2018 +0000
+++ b/MAX8614X.cpp Sat Aug 11 00:37:58 2018 +0000
@@ -40,7 +40,7 @@
#define ARRAY_SIZE(array) (sizeof(array)/sizeof(array[0]))
MAX8614X::MAX8614X(SPI &spiBus, DigitalOut &cs, PinName pin)
-:m_spiBus(spiBus), m_cs(cs)
+:m_ir(pin), m_spiBus(spiBus), m_cs(cs)
{
m_cs = 1;
}
@@ -51,7 +51,6 @@
m_spiBus.write(reg);
m_spiBus.write(0x80);
-
int i = 0;
for(; i < len; i++) { /*TODO: make len unsigned*/
data[i] = m_spiBus.write(0x00);
@@ -90,6 +89,22 @@
return ret;
}
+void MAX8614X::irq_handler(void)
+{
+ int ret;
+ int_status_t status;
+
+ ret = readRegister(MAX8614X_INT_STATUS1_REG, status.val, 2);
+ if (ret < 0) {
+ printf("readRegister failed. ret: %d", ret);
+ }
+ printf("Status reg: %X %X \n\r", status.val[0], status.val[1]);
+
+ if (status.sha_done) {
+ printf("sha interrupt\n\r");
+ }
+}
+
MAX8614X::~MAX8614X(void)
{
//empty block