Skip to content

Mongoose os app to test MCP2515 CAN library ported from Arduino.

License

Notifications You must be signed in to change notification settings

Podnet/mcp2515-mgos-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MCP2515 testing Mongoose OS app

Mongoose os app to test mcp2515 CAN library ported from Arduino.

  • Create MCP object
struct MCP_CAN *mc; 
  • Send message to CAN controller
void can_send(void *arg)
  • Recieve messages from other CAN controller
void can_recieve(void *arg)
  • Mongoose OS app intialization function
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;
  }
}

Releases

No releases published

Packages