B站:https://space.bilibili.com/309103931
中移4G模块-ML302专栏:https://blog.csdn.net/qq_33259323/category_10453372.html
中移4G模块-ML302文集:https://www.bilibili.com/read/readlist/rl328642
1.中移4G模块-ML302-OpenCpu开发-(固件编译和烧录)
https://blog.csdn.net/qq_33259323/article/details/108586847
https://www.bilibili.com/read/cv7876504
2.中移4G模块-ML302-OpenCpu开发-(MQTT连接阿里云)
https://blog.csdn.net/qq_33259323/article/details/108638945
https://www.bilibili.com/read/cv7876527
2.1中移4G模块-ML302-OpenCpu开发-(MQTT连接阿里云-订阅主题)
https://blog.csdn.net/qq_33259323/article/details/108960540
https://www.bilibili.com/read/cv7879954
2.2中移4G模块-ML302-OpenCpu开发-(MQTT连接阿里云-接收和发送数据)
https://blog.csdn.net/qq_33259323/article/details/108964810
https://www.bilibili.com/read/cv7886836
2.3中移4G模块-ML302-OpenCpu开发-(MQTT连接阿里云-RRPC通讯)
https://blog.csdn.net/qq_33259323/article/details/108965071
https://www.bilibili.com/read/cv7888259
3.中移4G模块-ML302-OpenCpu开发-串口开发
https://blog.csdn.net/qq_33259323/article/details/108974888
https://www.bilibili.com/read/cv7888865
4.中移4G模块-ML302-OpenCpu开发-51单片机串口转I2C
https://blog.csdn.net/qq_33259323/article/details/109020642
https://www.bilibili.com/read/cv7922942
5.中移4G模块-ML302-OpenCpu开发-MCP23017输入/输出
https://blog.csdn.net/qq_33259323/article/details/109109136
https://www.bilibili.com/read/cv7969395
7.中移4G模块-ML302-OpenCpu开发-PCF8591测量电压
https://blog.csdn.net/qq_33259323/article/details/109109266
https://www.bilibili.com/read/cv7969365
8.中移4G模块-ML302-OpenCpu开发-GPIO
https://blog.csdn.net/qq_33259323/article/details/108960947
https://www.bilibili.com/read/cv7877192
9.中移4G模块-ML302-OpenCpu开发-ADC
https://blog.csdn.net/qq_33259323/article/details/109020864
https://www.bilibili.com/read/cv7922958
10.中移4G模块-ML302-OpenCpu开发-CJSON
https://blog.csdn.net/qq_33259323/article/details/109020898
https://www.bilibili.com/read/cv7923020
11.中移4G模块-ML302-OpenCpu开发-HTTP
https://blog.csdn.net/qq_33259323/article/details/109020904
https://www.bilibili.com/read/cv7923054
中移4G模块-ML302-OpenCpu开发-GPIO
ML302模块一共有20路GPIO,但是有些GPIO是和串口I2CSPI共用的,所以实际上没有那么多
GPIO输出
// 测试GPIO 19
int test_gpio = 19;
cm_gpio_cfg_t cfg; //GPIO设置结构体
cfg.id = test_gpio; //ID号
cfg.dir = CM_GPIO_OUT; //方向设置:CM_GPIO_OUT输出,CM_GPIO_IN输入
cfg.irq_enable = 0; //使能
cm_gpio_init(&cfg); //初始化传入设置结构体
cm_gpio_pull_config(test_gpio, CM_GPIO_PULL_UP); //设置上下拉,CM_GPIO_PULL_DOWN ,CM_GPIO_PULL_UP
osDelay(5000); //SDK自带延时函数
cm_gpio_write(test_gpio,CM_GPIO_HIGH); // 写GPIO,让GPIO19高电平
osDelay(5000);
cm_gpio_write(test_gpio,CM_GPIO_LOW); // 写GPIO,让GPIO19低电平
osDelay(5000);
GPIO输入
// 设置GPIO20 读
int read_gpio = 20;
cm_gpio_cfg_t read_cfg;
read_cfg.id = read_gpio;
read_cfg.dir = CM_GPIO_IN;
read_cfg.irq_enable = 0;
cm_gpio_init(&read_cfg);
if(cm_gpio_read(20) == 1){
// 干啥干啥干啥
}