summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorJoshua Drake <joshua.ellis.drake@gmail.com>2024-03-11 01:00:18 -0500
committerJoshua Drake <joshua.ellis.drake@gmail.com>2024-03-11 01:00:18 -0500
commitbda5904d876a895f438e200f31f29c2a8765cb82 (patch)
tree017c70075a85f486c6f619212b381f7402b81f34 /main.c
parentfe7e5b97a50fa66aadb11e20b8f5210e1cb6dde6 (diff)
Functional I2C bus. MPLAB autogenerated code is cringe and nonfunctional.
Diffstat (limited to 'main.c')
-rw-r--r--main.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/main.c b/main.c
index 2b6547c..2750ee8 100644
--- a/main.c
+++ b/main.c
@@ -48,6 +48,7 @@
#include "mcc_generated_files/system.h"
#include "SPI.h"
+
/*
Main application
*/
@@ -65,16 +66,23 @@ int main(void)
Message_HWCR(nullarray);
SPI_slaveDeselect();
- _LATB6 = 0;
+ _LATB6 = 1;
_LATB7 = 1;
_LATB8 = 1;
+ //MSSP2_I2C_ReadPointerSet(0b00000011);
+ // MSSP2_I2C_WritePointerSet(0x00);
+ uint8_t *buffer;
+ uint8_t *status;
+
while (1)
{
- SPI_slaveSelect();
- Message_OUT(15, 5, 0);
- SPI_slaveDeselect();
+ //MSSP2_I2C_ReadPointerSet(0b00000011);
+ //MSSP2_I2C_ReadPointerSet(0b00000011);
+ //SPI_slaveSelect();
+ //Message_OUT(15, 5, 0);
+ //SPI_slaveDeselect();
/*
SPI_slaveSelect();
Message_OUT(15, 5, 0);
@@ -87,7 +95,11 @@ int main(void)
SPI_slaveSelect();
Message_OUT(15, 5, 0);
SPI_slaveDeselect();
+ *
+ *
*/
+ //if(MSSP2_I2C_WritePointerGet() > 50) {_LATB7 = 0; _LATB6 = 1;}
+ //else {_LATB6 = 0; _LATB7 = 1;}
}
return 1;