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.
Dependencies: mbed-dev-f303 FastPWM3
Diff: DRV8323/DRV.cpp
- Revision:
- 52:8e74c22ed89f
- Parent:
- 45:26801179208e
--- a/DRV8323/DRV.cpp Wed Jul 17 03:40:12 2019 +0000
+++ b/DRV8323/DRV.cpp Sun Jul 21 21:42:49 2019 +0000
@@ -73,7 +73,11 @@
uint16_t val2 = read_FSR2();
wait_us(10);
- if(val1 & (1<<10)){printf("\n\rFAULT\n\r");}
+ if(val1 & (1<<10))
+ {
+ printf("\n\rFAULT\n\r");
+ fault = 1;
+ }
if(val1 & (1<<9)){printf("VDS_OCP\n\r");}
if(val1 & (1<<8)){printf("GDF\n\r");}
@@ -104,6 +108,7 @@
uint16_t val = (read_register(DCR)) & (~(0x1<<2));
write_register(DCR, val);
}
+
void DRV832x::disable_gd(void)
{
@@ -115,4 +120,9 @@
{
uint16_t val = 0x1<<4 + 0x1<<3 + 0x1<<2;
write_register(CSACR, val);
- }
\ No newline at end of file
+ }
+
+int DRV832x::get_fault(void)
+{
+ return fault;
+}