Air_58Printer/main/module/include/Sys_Printer.h
2024-08-17 23:09:42 +08:00

89 lines
1.7 KiB
C

#ifndef SYS_PRINTER_H
#define SYS_PRINTER_H
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "esp_system.h"
#include "driver/gpio.h"
#include "esp_system.h"
#include "esp_log.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_freertos_hooks.h"
#include "freertos/semphr.h"
#include "esp_system.h"
#include "driver/gpio.h"
#include "esp_log.h"
#include "freertos/event_groups.h"
#include "driver/gptimer.h"
#include "esp_vfs.h"
#include "driver/spi_master.h"
enum{
UART0 = 0,
UART1,
USB,
CAN,
TCP,
SPIFFS,
};
#define STB_PIN 46
#define LAT_PIN 42
#define VH_PIN 15
//打印头电机控制引脚
#define INA_PIN 16
#define INB_PIN 40
#define INC_PIN 41
#define IND_PIN 45
//头片控制引脚
#define GPIO_MOSI 48
#define GPIO_MISO -1
#define GPIO_SCLK 21
#define GPIO_CS -1
#define HOST_ID -1
#define KEY_FEED_PIN 0
#define KEY_SYS_PIN 9
#define KEY_EVENT BIT7
typedef struct
{
uint8_t type;
char* buffer;
uint16_t size;
uint32_t read,write;
uint32_t max_size;
}Receive_data_t;
typedef struct
{
uint8_t state;
uint8_t pin_num;
gpio_config_t config;
}gpio_state_t;
extern gpio_state_t LED0;
extern gpio_state_t FEED_KEY;
extern gpio_state_t LAT;
extern gpio_state_t STB;
extern EventGroupHandle_t Printer_group;
extern spi_device_handle_t Printer_spi;
extern void BSP_GPIO_Init(void);
extern uint8_t Motor_GO(uint8_t DIR);
extern void Printer_run_init();
extern void Printer_Bsp_Init(void);
extern uint16_t Set_heat_timer_value(uint32_t time);
extern void spi_printer_data_send(spi_device_handle_t handle, uint8_t* pBuffer);
#endif