Prusa MINI Firmware overview
solenoid.cpp File Reference
#include "../inc/MarlinConfig.h"
#include "solenoid.h"
#include "../module/motion.h"

Macros

#define HAS_SOLENOID(N)   (HAS_SOLENOID_##N && EXTRUDERS > N)
 

Functions

static void set_solenoid (const uint8_t num, const bool active)
 
void enable_solenoid (const uint8_t num)
 
void disable_solenoid (const uint8_t num)
 
void enable_solenoid_on_active_extruder ()
 
void disable_all_solenoids ()
 

Macro Definition Documentation

◆ HAS_SOLENOID

#define HAS_SOLENOID (   N)    (HAS_SOLENOID_##N && EXTRUDERS > N)

Marlin 3D Printer Firmware Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]

Based on Sprinter and grbl. Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Function Documentation

◆ set_solenoid()

static void set_solenoid ( const uint8_t  num,
const bool  active 
)
static
38  {
39  const uint8_t value = active ? HIGH : LOW;
40  switch (num) {
41  case 0:
42  OUT_WRITE(SOL0_PIN, value);
43  break;
44  #if HAS_SOLENOID(1)
45  case 1:
46  OUT_WRITE(SOL1_PIN, value);
47  break;
48  #endif
49  #if HAS_SOLENOID(2)
50  case 2:
51  OUT_WRITE(SOL2_PIN, value);
52  break;
53  #endif
54  #if HAS_SOLENOID(3)
55  case 3:
56  OUT_WRITE(SOL3_PIN, value);
57  break;
58  #endif
59  #if HAS_SOLENOID(4)
60  case 4:
61  OUT_WRITE(SOL4_PIN, value);
62  break;
63  #endif
64  #if HAS_SOLENOID(5)
65  case 5:
66  OUT_WRITE(SOL5_PIN, value);
67  break;
68  #endif
69  default:
71  break;
72  }
73 }
Here is the caller graph for this function:

◆ enable_solenoid()

void enable_solenoid ( const uint8_t  num)
75 { set_solenoid(num, true); }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ disable_solenoid()

void disable_solenoid ( const uint8_t  num)
76 { set_solenoid(num, false); }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ enable_solenoid_on_active_extruder()

void enable_solenoid_on_active_extruder ( )

Marlin 3D Printer Firmware Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]

Based on Sprinter and grbl. Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ disable_all_solenoids()

void disable_all_solenoids ( )
79  {
81  #if HAS_SOLENOID(1)
83  #endif
84  #if HAS_SOLENOID(2)
86  #endif
87  #if HAS_SOLENOID(3)
89  #endif
90  #if HAS_SOLENOID(4)
92  #endif
93  #if HAS_SOLENOID(5)
95  #endif
96 }
Here is the call graph for this function:
Here is the caller graph for this function:
enable_solenoid
void enable_solenoid(const uint8_t num)
Definition: solenoid.cpp:75
MSG_INVALID_SOLENOID
#define MSG_INVALID_SOLENOID
Definition: language.h:170
OUT_WRITE
#define OUT_WRITE(IO, V)
Definition: fastio.h:108
LOW
#define LOW
Definition: wiring_constants.h:70
SOL1_PIN
#define SOL1_PIN
Definition: pins_LEAPFROG.h:89
SERIAL_ECHO_MSG
#define SERIAL_ECHO_MSG(S)
Definition: serial.h:183
netif::num
u8_t num
Definition: netif.h:309
uint8_t
const uint8_t[]
Definition: 404_html.c:3
HIGH
#define HIGH
Definition: wiring_constants.h:71
SOL2_PIN
#define SOL2_PIN
Definition: pins_LEAPFROG.h:90
set_solenoid
static void set_solenoid(const uint8_t num, const bool active)
Definition: solenoid.cpp:38
active_extruder
constexpr uint8_t active_extruder
Definition: motion.h:107
disable_solenoid
void disable_solenoid(const uint8_t num)
Definition: solenoid.cpp:76