Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/podnet/mcp2515-mgos-test
Mongoose os app to test MCP2515 CAN library ported from Arduino.
https://github.com/podnet/mcp2515-mgos-test
can esp32 esp8266 mcp2515 mongoose-os mongoose-os-app
Last synced: 29 days ago
JSON representation
Mongoose os app to test MCP2515 CAN library ported from Arduino.
- Host: GitHub
- URL: https://github.com/podnet/mcp2515-mgos-test
- Owner: Podnet
- License: other
- Created: 2020-05-24T07:17:17.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-08-02T10:56:14.000Z (over 4 years ago)
- Last Synced: 2024-11-16T01:42:07.875Z (3 months ago)
- Topics: can, esp32, esp8266, mcp2515, mongoose-os, mongoose-os-app
- Language: C++
- Homepage:
- Size: 135 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MCP2515 testing Mongoose OS app
Mongoose os app to test mcp2515 CAN library ported from Arduino.- Create MCP object
``` C
struct MCP_CAN *mc;
```
- Send message to CAN controller
```C
void can_send(void *arg)
```
- Recieve messages from other CAN controller
```C
void can_recieve(void *arg)
```
- Mongoose OS app intialization function
``` C
enum mgos_app_init_result mgos_app_init(void)
{
LOG(LL_INFO, ("TCU: Adding CAN interface."));
mc = mgos_mcp2515_create(10); // cs pin as input
while (CAN_OK != mgos_mcp2515_begin(mc, CAN_500KBPS))
{
LOG(LL_INFO, ("TCU: CAN init failed"));
}LOG(LL_INFO, ("TCU: CAN init ok!"));
return MGOS_APP_INIT_SUCCESS;
}
}
```