资源简介
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挖掘船舶航迹图谱
相关资源
- 基于STM32F4x9的LCD显示
- VS1053B编解码器的VDR分布式声音采集卡
- stm32的DAC播放音乐文件
- STM32+TMC5160代码电路图.rar
- 基于STM32的深海钻机甲板控制系统
- stm32f103.SchDoc
- STM32F103 USART+DMA
- DMA+stm32 407.zip
- 4_USART串口通信(空闲中断+DMA.zip
- stm32f105-usart-DMA收发demo
- STM32F042F6P6 Uart12DMA;发送中断接收
- 基于STM32的嵌入式双目图像采集系统设
- 基于STM32F103C8单片机的晶联讯电子JL
- 基于STM32的温湿度检测系统实现
- stm32F4+w5300
- 14284969_《STM32单片机应用与全案例实践
-
ST-li
nk-V2的SWD仿真使用方法.docx - 安富莱STM32开发板资料
- STM32F103实现OV7670摄像头显示
- STM32F207学习板例程
- STM32F103VCT6TR - High-density performance lin
- STM32 SRAM启动的 KeiL 配置
- STM32的IAP-Bootloader程序
- STM32例程之Bootloader
- stm32f103 虚拟U盘,调试成功的
- 基于stm32F103vct6的SD卡FATFS文件系统移植
- STM32F030从机中断接收的iic代码,附带
- FreeModbus_Slave+STM32F407+USART2代码亲测可
- STM32+1602液晶proteus仿真.zip
- STM32循迹小车
评论
共有 条评论