资源简介
grbl1.1f在stm32f103c8t6上的移植,参考了github上grbl0.9的移植,但将通讯方式改为usb虚拟串口,同时调整了端口设置。之前在csdn上传的版本有许多bug,已删除,此代码修复了很多问题。

代码片段和文件信息
/*
coolant_control.c - coolant control methods
Part of Grbl
Copyright (c) 2012-2016 Sungeun K. Jeon for Gnea Research LLC
Grbl 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.
Grbl 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 Grbl. If not see .
*/
#include “grbl.h“
void coolant_init()
{
HW_GPIO_Init_Out(COOLANT_FLOOD_GPIOCOOLANT_FLOOD_GPIO_PIN);
#ifdef ENABLE_M7
HW_GPIO_Init_Out(COOLANT_MIST_GPIOCOOLANT_MIST_GPIO_PIN);
#endif
coolant_stop();
}
// Returns current coolant output state. Overrides may alter it from programmed state.
uint8_t coolant_get_state()
{
uint8_t cl_state = COOLANT_STATE_DISABLE;
#ifdef INVERT_COOLANT_FLOOD_PIN
if(0==HW_GPIO_ReadODR(COOLANT_FLOOD_GPIOCOOLANT_FLOOD_GPIO_PIN))
#else
if(HW_GPIO_ReadODR(COOLANT_FLOOD_GPIOCOOLANT_FLOOD_GPIO_PIN))
#endif
cl_state |= COOLANT_STATE_FLOOD;
#ifdef ENABLE_M7
#ifdef INVERT_COOLANT_MIST_PIN
if(0==HW_GPIO_ReadODR(COOLANT_MIST_GPIOCOOLANT_MIST_GPIO_PIN))
#else
if(HW_GPIO_ReadODR(COOLANT_MIST_GPIOCOOLANT_MIST_GPIO_PIN))
#endif
cl_state |= COOLANT_STATE_MIST;
#endif
return(cl_state);
}
// Directly called by coolant_init() coolant_set_state() and mc_reset() which can be at
// an interrupt-level. No report flag set but only called by routines that don‘t need it.
void coolant_stop()
{
#ifdef INVERT_COOLANT_FLOOD_PIN
HW_GPIO_Write(COOLANT_FLOOD_GPIOCOOLANT_FLOOD_GPIO_PIN1);
#else
HW_GPIO_Write(COOLANT_FLOOD_GPIOCOOLANT_FLOOD_GPIO_PIN0);
#endif
#ifdef ENABLE_M7
#ifdef INVERT_COOLANT_MIST_PIN
HW_GPIO_Write(COOLANT_MIST_GPIOCOOLANT_MIST_GPIO_PIN1);
#else
HW_GPIO_Write(COOLANT_MIST_GPIOCOOLANT_MIST_GPIO_PIN0);
#endif
#endif
}
// Main program only. Immediately sets flood coolant running state and also mist coolant
// if enabled. Also sets a flag to report an update to a coolant state.
// Called by coolant toggle override parking restore parking retract sleep mode g-code
// parser program end and g-code parser coolant_sync().
void coolant_set_state(uint8_t mode)
{
if(sys.abort) return; // Block during abort.
if(mode == COOLANT_DISABLE) coolant_stop();
else
{
if(mode & COOLANT_FLOOD_ENABLE)
{
#ifdef INVERT_COOLANT_FLOOD_PIN
HW_GPIO_Write(COOLANT_FLOOD_GPIOCOOLANT_FLOOD_GPIO_PIN0);
#else
HW_GPIO_Write(COOLANT_FLOOD_GPIOCOOLANT_FLOOD_
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 103132 2017-09-08 21:05 GRBL1.1f.20170801-STM32-0909\Debug\Exe\GRBL1.1f.20170801-STM32.hex
文件 45697 2017-09-03 14:03 GRBL1.1f.20170801-STM32-0909\GRBL\config.h
文件 3752 2017-08-14 20:03 GRBL1.1f.20170801-STM32-0909\GRBL\coolant_control.c
文件 1469 2017-08-01 09:27 GRBL1.1f.20170801-STM32-0909\GRBL\coolant_control.h
文件 8421 2017-08-15 20:19 GRBL1.1f.20170801-STM32-0909\GRBL\cpu_map.h
文件 25723 2017-09-08 21:05 GRBL1.1f.20170801-STM32-0909\GRBL\defaults.h
文件 2361 2017-08-15 19:59 GRBL1.1f.20170801-STM32-0909\GRBL\eeprom.c
文件 1059 2017-08-01 09:27 GRBL1.1f.20170801-STM32-0909\GRBL\eeprom.h
文件 63915 2017-08-13 22:39 GRBL1.1f.20170801-STM32-0909\GRBL\gcode.c
文件 10429 2017-08-01 09:27 GRBL1.1f.20170801-STM32-0909\GRBL\gcode.h
文件 3502 2017-08-20 11:05 GRBL1.1f.20170801-STM32-0909\GRBL\grbl.h
文件 1775 2017-08-01 09:27 GRBL1.1f.20170801-STM32-0909\GRBL\jog.c
文件 1022 2017-08-01 09:27 GRBL1.1f.20170801-STM32-0909\GRBL\jog.h
文件 16464 2017-08-20 10:54 GRBL1.1f.20170801-STM32-0909\GRBL\limits.c
文件 1238 2017-08-01 09:27 GRBL1.1f.20170801-STM32-0909\GRBL\limits.h
文件 5113 2017-08-26 13:42 GRBL1.1f.20170801-STM32-0909\GRBL\main.c
文件 19122 2017-08-13 16:44 GRBL1.1f.20170801-STM32-0909\GRBL\motion_control.c
文件 2674 2017-08-01 09:27 GRBL1.1f.20170801-STM32-0909\GRBL\motion_control.h
文件 5581 2017-08-20 10:02 GRBL1.1f.20170801-STM32-0909\GRBL\nuts_bolts.c
文件 3076 2017-08-01 09:27 GRBL1.1f.20170801-STM32-0909\GRBL\nuts_bolts.h
文件 27094 2017-08-01 09:27 GRBL1.1f.20170801-STM32-0909\GRBL\planner.c
文件 6893 2017-08-01 09:27 GRBL1.1f.20170801-STM32-0909\GRBL\planner.h
文件 5202 2017-08-12 19:43 GRBL1.1f.20170801-STM32-0909\GRBL\print.c
文件 1670 2017-08-01 09:27 GRBL1.1f.20170801-STM32-0909\GRBL\print.h
文件 2419 2017-08-12 20:01 GRBL1.1f.20170801-STM32-0909\GRBL\probe.c
文件 1610 2017-08-01 09:27 GRBL1.1f.20170801-STM32-0909\GRBL\probe.h
文件 42139 2017-08-26 18:39 GRBL1.1f.20170801-STM32-0909\GRBL\protocol.c
文件 1882 2017-08-01 09:27 GRBL1.1f.20170801-STM32-0909\GRBL\protocol.h
文件 27629 2017-08-26 13:42 GRBL1.1f.20170801-STM32-0909\GRBL\report.c
文件 4476 2017-08-01 09:27 GRBL1.1f.20170801-STM32-0909\GRBL\report.h
............此处省略106个文件信息
- 上一篇:RXChart 实现一条平滑曲线
- 下一篇:DBSCAN挖掘船舶航迹图谱
相关资源
- stm32做的红外遥控解码程序
- 《emwin实战指南(基于STM32-ISO开发板)
- Beginning STM32: Developing with FreeRTOS libo
- stm32f103c8t6_sch.Lib
- ALIENTEK战舰STM32F1 V3开发板原理图.rar
- STM32F103RC+ADC+DMA多通道采样LCD显示
- I2C读写AT24C02 基于STM32F103 cube116540
- 基于stm32f103ve的程序——跑马灯实验
- 基于STM32RCT6的步进电机驱动程序
- stm32f407上的两个can发送和接收例程
- STM32 led 时钟
- STM32 2.4G通信例程
- 直流无刷电机方波驱动 stm32 例程代码
- STM32中文资料
- STM32蓝牙和串口程序
- STM32f103超声波模块例程
- stm32f103c8t6 4 oled.rar
- stm32f030 IAP Demo(原创)
- STM32基于rt_thread操作系统的SDHC卡文件
- NRF24L01实现51与STM32双向通讯
- STM32F103 串口程序(完整版)
- stm32 ds18b20 温度传感器 测试通过
- stm32官方例程
- STM32F103定时器中断程序
- [免费]基于stm32f103ze 的OLED驱动代码
- STM32F103RBT6驱动UC1698控制芯片的160160黑
- STM32F103 DS18B20 V3.5.0固件库驱动程序工
- STM32定时器使用入门。看了这个程序会
- SIM908 SDIO FSMC STM32 FIFO
- STM32F103 CC2500完整驱动(模拟SPI)
评论
共有 条评论