Skip to content

Commit

Permalink
update external spi port for r53
Browse files Browse the repository at this point in the history
  • Loading branch information
yconst committed Aug 19, 2024
1 parent 556b87b commit 4d8827d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
11 changes: 8 additions & 3 deletions firmware/src/sensor/sensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,19 @@
#include <src/ssp/ssp_func.h>
#include <src/motor/motor.h>

#if defined BOARD_REV_R3
#define ONBOARD_SENSOR_SSP_PORT SSPD
#define ONBOARD_SENSOR_SSP_STRUCT PAC55XX_SSPD
#if defined(BOARD_REV_R53)
#define ONBOARD_SENSOR_SSP_PORT SSPC
#define ONBOARD_SENSOR_SSP_STRUCT PAC55XX_SSPC
#define EXTERNAL_SENSOR_SSP_PORT SSPD_PD4567
#define EXTERNAL_SENSOR_SSP_STRUCT PAC55XX_SSPD
#elif defined BOARD_REV_R5 || defined BOARD_REV_M5
#define ONBOARD_SENSOR_SSP_PORT SSPC
#define ONBOARD_SENSOR_SSP_STRUCT PAC55XX_SSPC
#define EXTERNAL_SENSOR_SSP_PORT SSPD
#define EXTERNAL_SENSOR_SSP_STRUCT PAC55XX_SSPD
#elif defined BOARD_REV_R3
#define ONBOARD_SENSOR_SSP_PORT SSPD
#define ONBOARD_SENSOR_SSP_STRUCT PAC55XX_SSPD
#endif

typedef struct Sensor Sensor;
Expand Down
6 changes: 5 additions & 1 deletion firmware/src/ssp/ssp_func.c
Original file line number Diff line number Diff line change
Expand Up @@ -661,13 +661,17 @@ void ssp_io_config(SSP_TYPE ssp, SSP_MS_TYPE ms_mode)

case SSPD:
// Select ssp D peripheral choose one!
// SSPD_IO_Select_PD4567(ms_mode);
// SSPD_IO_Select_PE4567(ms_mode);
SSPD_IO_Select_PF4567(ms_mode);
// SSPD_IO_Select_PG0123(ms_mode);
// SSPD_IO_Select_PG4567(ms_mode);
break;

case SSPD_PD4567:
SSPD_IO_Select_PD4567(ms_mode);

break;

default:
break;
}
Expand Down
3 changes: 2 additions & 1 deletion firmware/src/ssp/ssp_func.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ typedef enum
SSPA = 0,
SSPB = 1,
SSPC = 2,
SSPD = 3
SSPD = 3,
SSPD_PD4567 = 4
} SSP_TYPE;


Expand Down

0 comments on commit 4d8827d

Please sign in to comment.