Skip to content

Commit

Permalink
use new SPIManager class
Browse files Browse the repository at this point in the history
  • Loading branch information
Dragon-Knight committed Oct 30, 2024
1 parent 00f9259 commit 9e43e81
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 589 deletions.
7 changes: 4 additions & 3 deletions include/CAN_SPI.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#pragma once
#include <inttypes.h>
#include <EasyPinD.h>
#include <MCP2515_HAL.h>
#include <SPIManager.h>
#include <drivers/SPI_MCP2515.h>

extern SPI_HandleTypeDef hspi1;

Expand Down Expand Up @@ -164,8 +165,8 @@ class SteeringAngleSensor


SPIManager<2> manager(SPI_Config, SPI_Write, SPI_Read, SPI_WriteRead);
MCP2515Class obj1(SPI_CS_CAN1, CAN1_RX_INT, SPI_BAUDRATEPRESCALER_8);
MCP2515Class obj2(SPI_CS_CAN2, CAN2_RX_INT, SPI_BAUDRATEPRESCALER_8);
SPI_MCP2515 obj1(SPI_CS_CAN1, CAN1_RX_INT, SPI_BAUDRATEPRESCALER_8);
SPI_MCP2515 obj2(SPI_CS_CAN2, CAN2_RX_INT, SPI_BAUDRATEPRESCALER_8);
EasyPinD pin_rs_1(CAN1_RS.Port, {CAN1_RS.Pin, GPIO_MODE_OUTPUT_OD, GPIO_NOPULL, GPIO_SPEED_FREQ_HIGH}, GPIO_PIN_SET);
EasyPinD pin_sens_1(CAN1_SENS_PWR.Port, {CAN1_SENS_PWR.Pin, GPIO_MODE_OUTPUT_PP, GPIO_NOPULL, GPIO_SPEED_FREQ_HIGH}, GPIO_PIN_RESET);
EasyPinD pin_rs_2(CAN2_RS.Port, {CAN2_RS.Pin, GPIO_MODE_OUTPUT_OD, GPIO_NOPULL, GPIO_SPEED_FREQ_HIGH}, GPIO_PIN_SET);
Expand Down
2 changes: 2 additions & 0 deletions include/SPI.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#pragma once
#include <inttypes.h>
#include <SPIManager.h>
#include <drivers/SPI_ZD25Q80B.h>
#include <drivers/SPI_CAT25080.h>
#include "SPIFast.h"

extern SPI_HandleTypeDef hspi2;
Expand Down
Loading

0 comments on commit 9e43e81

Please sign in to comment.