Prusa MINI Firmware overview
wiring_analog.c File Reference
#include "wiring_analog.h"

Functions

uint32_t hwio_arduino_analogRead (uint32_t ulPin)
 
void hwio_arduino_analogWrite (uint32_t ulPin, uint32_t ulValue)
 
uint32_t analogRead (uint32_t ulPin)
 
void analogWrite (uint32_t ulPin, uint32_t ulValue)
 

Function Documentation

◆ hwio_arduino_analogRead()

uint32_t hwio_arduino_analogRead ( uint32_t  ulPin)
780  {
781  if (HAL_ADC_Initialized) {
782  switch (ulPin) {
783  case PIN_TEMP_BED:
785  case PIN_TEMP_0:
787  case PIN_TEMP_HEATBREAK:
789  default:
790  hwio_arduino_error(HWIO_ERR_UNDEF_ANA_RD, ulPin); //error: undefined pin analog read
791  }
792  } else
793  hwio_arduino_error(HWIO_ERR_UNINI_ANA_RD, ulPin); //error: uninitialized analog read
794  return 0;
Here is the call graph for this function:
Here is the caller graph for this function:

◆ hwio_arduino_analogWrite()

void hwio_arduino_analogWrite ( uint32_t  ulPin,
uint32_t  ulValue 
)
797  {
798  if (HAL_PWM_Initialized) {
799  switch (ulPin) {
800  case PIN_FAN1:
801  //hwio_fan_set_pwm(_FAN1, ulValue);
803  return;
804  case PIN_FAN:
805  //hwio_fan_set_pwm(_FAN, ulValue);
807  return;
808  case PIN_HEATER_BED:
810  return;
811  case PIN_HEATER_0:
813  return;
814  default:
815  hwio_arduino_error(HWIO_ERR_UNDEF_ANA_WR, ulPin); //error: undefined pin analog write
816  }
817  } else
818  hwio_arduino_error(HWIO_ERR_UNINI_ANA_WR, ulPin); //error: uninitialized analog write
Here is the call graph for this function:
Here is the caller graph for this function:

◆ analogRead()

uint32_t analogRead ( uint32_t  ulPin)
8  {
9  return hwio_arduino_analogRead(ulPin);
10 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ analogWrite()

void analogWrite ( uint32_t  ulPin,
uint32_t  ulValue 
)
12  {
13  hwio_arduino_analogWrite(ulPin, ulValue);
14 }
Here is the call graph for this function:
Here is the caller graph for this function:
PIN_FAN
#define PIN_FAN
Definition: hwio_pindef.h:39
PIN_TEMP_0
#define PIN_TEMP_0
Definition: hwio_pindef.h:16
HAL_PWM_Initialized
int HAL_PWM_Initialized
Definition: main.c:106
HWIO_PWM_HEATER_0
#define HWIO_PWM_HEATER_0
Definition: hwio_a3ides.h:55
hwio_arduino_analogRead
uint32_t hwio_arduino_analogRead(uint32_t ulPin)
Definition: hwio_a3ides_2209_02.c:779
_hwio_pwm_analogWrite_set_val
void _hwio_pwm_analogWrite_set_val(int i_pwm, int val)
Definition: hwio_a3ides_2209_02.c:429
HWIO_ERR_UNDEF_ANA_RD
#define HWIO_ERR_UNDEF_ANA_RD
Definition: hwio_a3ides_2209_02.c:27
PIN_HEATER_0
#define PIN_HEATER_0
Definition: hwio_pindef.h:14
_ADC_TEMP_HEATBREAK
#define _ADC_TEMP_HEATBREAK
Definition: hwio_a3ides.h:36
HWIO_ERR_UNDEF_ANA_WR
#define HWIO_ERR_UNDEF_ANA_WR
Definition: hwio_a3ides_2209_02.c:28
PIN_TEMP_BED
#define PIN_TEMP_BED
Definition: hwio_pindef.h:8
HAL_ADC_Initialized
int HAL_ADC_Initialized
Definition: main.c:105
HWIO_PWM_HEATER_BED
#define HWIO_PWM_HEATER_BED
Definition: hwio_a3ides.h:54
hwio_arduino_error
void hwio_arduino_error(int err, uint32_t pin32)
Definition: hwio_a3ides_2209_02.c:565
hwio_adc_get_val
int hwio_adc_get_val(int i_adc)
Definition: hwio_a3ides_2209_02.c:245
PIN_TEMP_HEATBREAK
#define PIN_TEMP_HEATBREAK
Definition: hwio_pindef.h:10
HWIO_PWM_FAN1
#define HWIO_PWM_FAN1
Definition: hwio_a3ides.h:56
PIN_HEATER_BED
#define PIN_HEATER_BED
Definition: hwio_pindef.h:13
HWIO_PWM_FAN
#define HWIO_PWM_FAN
Definition: hwio_a3ides.h:57
PIN_FAN1
#define PIN_FAN1
Definition: hwio_pindef.h:38
_ADC_TEMP_0
#define _ADC_TEMP_0
Definition: hwio_a3ides.h:37
HWIO_ERR_UNINI_ANA_RD
#define HWIO_ERR_UNINI_ANA_RD
Definition: hwio_a3ides_2209_02.c:23
_ADC_TEMP_BED
#define _ADC_TEMP_BED
Definition: hwio_a3ides.h:34
hwio_arduino_analogWrite
void hwio_arduino_analogWrite(uint32_t ulPin, uint32_t ulValue)
Definition: hwio_a3ides_2209_02.c:796
HWIO_ERR_UNINI_ANA_WR
#define HWIO_ERR_UNINI_ANA_WR
Definition: hwio_a3ides_2209_02.c:24