diff options
| author | Sam Anthony <sam@samanthony.xyz> | 2025-10-02 14:45:56 -0400 |
|---|---|---|
| committer | Sam Anthony <sam@samanthony.xyz> | 2025-10-02 14:45:56 -0400 |
| commit | 99be520563834d51eb3ddd32b757a3dcd2486632 (patch) | |
| tree | 7c31bcc262950d431a1676b62624b6ac82f30df3 /fw/spi.c | |
| parent | c91e3d96c90cd1c9b3b6155bc5e37954011cf0af (diff) | |
| download | can-gauge-interface-99be520563834d51eb3ddd32b757a3dcd2486632.zip | |
spi systest
Diffstat (limited to 'fw/spi.c')
| -rw-r--r-- | fw/spi.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -2,7 +2,7 @@ #include <stdint.h> -#include "sys.h" +#include "system.h" #include "types.h" #include "spi.h" @@ -16,8 +16,7 @@ spiInit(void) { TRISBbits.TRISB6 = OUT; // SCK SSPSTAT = 0x00; - SSPCON1 = 0x01; // FOSC/16 => 3MHz SPI clock - SSPCON1bits.SSPEN = 1; // enable + SSPCON1 = 0x22; // FOSC/64 => 750kHz SPI clock junk = SSPBUF; // dummy read to clear BF (void)junk; } |