What is resource_map.h

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
WiWi_4702256
Level 5
Level 5
5 sign-ins Welcome! 5 solutions authored

resourcemap.gif

I've seen it a couple times now in examples for interface to I2C and I cant seem to find it anywhere in documentation on how its generated or why you use it but it seems to work well for pointing out the pins being used in the example. Furthermore if I open device configurator, these pins are not configured. For example, this example uses P6.0 and P6.1 for SCL and SDA respectively as seen in the gifs...

Pins.gifHighlighted.gifSlaves.gif

If this a C++, or Python, or linux trick. I've been programming in TI environment for 10 years and C for 35+ years and I've not seen this... I feel a little ridiculous asking but I need to know because it works...

Thanks,

William

0 Likes
1 Solution

Hi WiWi_4702256​,

resource_map.h is a file in the Code Example (CE) to ensure that the right pins are selected for all target BSPs. It is not a generated file.

Furthermore if I open device configurator, these pins are not configured

Yes, these pins are not configured using the Device Configurator. The CE uses Hardware Abstraction Layer (HAL). Most HAL drivers do not require you to enable the pins/resources in Device Configurator and the init API takes care of that. You can refer to this thread to know about some of the features of HAL - Issues starting with ModusToolbox IDE on Mac

HAL Documentation link - Hardware Abstraction Layer (HAL)

In this case, the cyhal_i2c_init configures these pins and you need not explicitly enable/configure them.

Thanks and Regards,

Rakshith M B

Edit: Added expansion of CE

Thanks and Regards,
Rakshith M B

View solution in original post

5 Replies
WiWi_4702256
Level 5
Level 5
5 sign-ins Welcome! 5 solutions authored

This is what I get when I do a search on Cypress Community...

search.gif

0 Likes

Hi WiWi_4702256​,

resource_map.h is a file in the Code Example (CE) to ensure that the right pins are selected for all target BSPs. It is not a generated file.

Furthermore if I open device configurator, these pins are not configured

Yes, these pins are not configured using the Device Configurator. The CE uses Hardware Abstraction Layer (HAL). Most HAL drivers do not require you to enable the pins/resources in Device Configurator and the init API takes care of that. You can refer to this thread to know about some of the features of HAL - Issues starting with ModusToolbox IDE on Mac

HAL Documentation link - Hardware Abstraction Layer (HAL)

In this case, the cyhal_i2c_init configures these pins and you need not explicitly enable/configure them.

Thanks and Regards,

Rakshith M B

Edit: Added expansion of CE

Thanks and Regards,
Rakshith M B

Thanks Rakshith! Could you tell me what you mean by CE and if there is something I can read other than what you already recommended regarding "CE" please let me know.

Best Regards,

William

0 Likes

Hi William,

I am sorry. I missed adding the expansion of CE when I first used it in my response. CE stands for Code Example in my response.

To make it easier for others who might be referring to this thread, I will add this to my previous response as well.

Thanks a lot for pointing this out!

Best Regards,

Rakshith M B

Thanks and Regards,
Rakshith M B

LOL LOL LOL but of course! I work at NASA so we live acronyms... Have a great day!