Skip to content
Prev Previous commit
Next Next commit
opta_analog: add LDAC handling
  • Loading branch information
maidnl committed Jun 11, 2024
commit 8d2d033c7d2c9c561d1df12f7ed42ef78104e82d
3 changes: 3 additions & 0 deletions variants/OPTA_ANALOG/pins_arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ extern "C" unsigned int PINCOUNT_fn();
#define SPI_CK (33u)
#define SPI_CS_1 (34u)
#define SPI_CS_2 (35u)
/* +++++++++++++++++++++++++++++++++ SPI +++++++++++++++++++++++++++++++++++ */
#define LDAC1 (36u)
#define LDAC2 (37u)

/* ************************** UART CORE DEFINES **************************** */
#define SERIAL_HOWMANY 1
Expand Down
8 changes: 8 additions & 0 deletions variants/OPTA_ANALOG/variant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ extern "C" const PinMuxCfg_t g_pin_cfg[] = {
{BSP_IO_PORT_01_PIN_02, P102}, /* (33) SPI_CK */
{BSP_IO_PORT_01_PIN_03, P103}, /* (34) SPI_CS_1 */
{BSP_IO_PORT_01_PIN_04, P104}, /* (35) SPI_CS_2 */
/* +++++++++++++++++++++++++++++++++ SPI ++++++++++++++++++++++++++++++++ */
{BSP_IO_PORT_01_PIN_12, P112}, /* (36) LDAC1 */
{BSP_IO_PORT_03_PIN_03, P303}, /* (37) LDAC2 */

};

extern "C" const size_t g_pin_cfg_size = sizeof(g_pin_cfg);
Expand Down Expand Up @@ -105,6 +109,10 @@ void initVariant() {
digitalWrite(DIO_RTD_SWITCH_1,LOW);
digitalWrite(DIO_RTD_SWITCH_2,LOW);

pinMode(LDAC1,OUTPUT);
pinMode(LDAC2,OUTPUT);
digitalWrite(LDAC1,HIGH);
digitalWrite(LDAC2,HIGH);



Expand Down