Pin mappings changes

- moved to a more generic code in pinmap.c
- same thing for specifying initial pin mappings