pinmap.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /** \addtogroup hal */
  2. /** @{*/
  3. /* mbed Microcontroller Library
  4. * Copyright (c) 2006-2013 ARM Limited
  5. *
  6. * Licensed under the Apache License, Version 2.0 (the "License");
  7. * you may not use this file except in compliance with the License.
  8. * You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. */
  18. #ifndef MBED_PINMAP_H
  19. #define MBED_PINMAP_H
  20. #include "PinNames.h"
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. typedef struct {
  25. PinName pin;
  26. int peripheral;
  27. int function;
  28. } PinMap;
  29. void pin_function(PinName pin, int function);
  30. void pin_mode(PinName pin, PinMode mode);
  31. uint32_t pinmap_peripheral(PinName pin, const PinMap *map);
  32. uint32_t pinmap_function(PinName pin, const PinMap *map);
  33. uint32_t pinmap_merge(uint32_t a, uint32_t b);
  34. void pinmap_pinout(PinName pin, const PinMap *map);
  35. uint32_t pinmap_find_peripheral(PinName pin, const PinMap *map);
  36. uint32_t pinmap_find_function(PinName pin, const PinMap *map);
  37. #ifdef __cplusplus
  38. }
  39. #endif
  40. #endif
  41. /** @}*/