Still use SWI2C on RAMBo10a boards

The wiring for the PAT9125 on RAMBo10a boards is not directly connected
to the SCL pin and requires the sw mode.

Detect this requirement by checking the definition for the SWI2C_SCL pin
in the board definition.

Remove SWI2C_SCL/SDA from the other boards to use the HW mode.
This commit is contained in:
Yuri D'Elia 2020-09-27 14:29:07 +02:00
parent e37cdab38f
commit 6d476d7144
4 changed files with 7 additions and 10 deletions

View File

@ -31,8 +31,11 @@
//PAT9125 configuration
//#define PAT9125_SWSPI // software SPI mode (incomplete)
//#define PAT9125_SWI2C // software I2C mode
#ifdef SWI2C_SCL
#define PAT9125_SWI2C // software I2C mode
#else
#define PAT9125_I2C // hardware I2C mode
#endif
#define PAT9125_I2C_ADDR 0x75 //ID=LO
//#define PAT9125_I2C_ADDR 0x79 //ID=HI

View File

@ -18,12 +18,6 @@
#define W25X20CL // external 256kB flash
#define BOOTAPP // bootloader support
#define SWI2C_SDA 20 //SDA on P3
#define SWI2C_SCL 21 //SCL on P3
#define X_TMC2130_CS 41
#define X_TMC2130_DIAG 64 // !!! changed from 40 (EINY03)
#define X_STEP_PIN 37

View File

@ -11,9 +11,6 @@
#define PINDA_THERMISTOR
#define SWI2C_SDA 20 //SDA on P3
#define SWI2C_SCL 21 //SCL on P3
#ifdef MICROMETER_LOGGING
#define D_DATACLOCK 24 //Y_MAX (green)
#define D_DATA 30 //X_MAX (blue)

View File

@ -7,6 +7,7 @@
#include "pins.h"
#include "io_atmega2560.h"
#ifdef SWI2C_SCL
#define SWI2C_RMSK 0x01 //read mask (bit0 = 1)
#define SWI2C_WMSK 0x00 //write mask (bit0 = 0)
@ -187,3 +188,5 @@ uint8_t swi2c_writeByte_A16(uint8_t dev_addr, unsigned short addr, uint8_t* pbyt
}
#endif //SWI2C_A16
#endif //SWI2C_SCL