This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How do I make device_get_binding("NRF9160_GPS") work, like the Asset Tracker does?

Hi,

I'm trying to get the gps driver to work, but the initialization requires getting a device binding.

The Asset Tracker project does it like this:

device_get_binding(CONFIG_GPS_DEV_NAME);


CONFIG_GPS_DEV_NAME is defined as "NRF9160_GPS".

I have no idea how to set up that device for my own project.
Using the same name just gives me NULL.

I can't find any overlay files in the Asset Tracker project, or any reference to a GPS device in the finished device tree file.

Parents Reply
  • I'm just using the DK for now, do I still have to follow custom board tutorials?

    I have read through that section but still have no idea how the NRF9160_GPS device is made available for the Asset Tracker project to use in code.

    The only instances of NRF9160_GPS and GPS_SIM I can find when grepping the project folder are the few configuration options that I've already ported over from Asset Tracker to my own project.

    For some reason I successfully get the simulator device if I enable the simulator in the configuration and use the name "GPS_SIM".

Children
No Data
Related