|  | @@ -21,3 +21,54 @@
 | 
	
		
			
				|  |  |  enum custom_pin_cfg_t {
 | 
	
		
			
				|  |  |  	PINS_FOR_DEFAULT,
 | 
	
		
			
				|  |  |  	PINS_FOR_U9500,
 | 
	
		
			
				|  |  | +};
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +static enum custom_pin_cfg_t pinsfor;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/* These simply sets bias for pins */
 | 
	
		
			
				|  |  | +#define BIAS(a,b) static unsigned long a[] = { b }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +BIAS(pd, PIN_PULL_DOWN);
 | 
	
		
			
				|  |  | +BIAS(in_nopull, PIN_INPUT_NOPULL);
 | 
	
		
			
				|  |  | +BIAS(in_nopull_slpm_nowkup, PIN_INPUT_NOPULL|PIN_SLPM_WAKEUP_DISABLE);
 | 
	
		
			
				|  |  | +BIAS(in_pu, PIN_INPUT_PULLUP);
 | 
	
		
			
				|  |  | +BIAS(in_pd, PIN_INPUT_PULLDOWN);
 | 
	
		
			
				|  |  | +BIAS(out_hi, PIN_OUTPUT_HIGH);
 | 
	
		
			
				|  |  | +BIAS(out_lo, PIN_OUTPUT_LOW);
 | 
	
		
			
				|  |  | +BIAS(out_lo_slpm_nowkup, PIN_OUTPUT_LOW|PIN_SLPM_WAKEUP_DISABLE);
 | 
	
		
			
				|  |  | +/* These also force them into GPIO mode */
 | 
	
		
			
				|  |  | +BIAS(gpio_in_pu, PIN_INPUT_PULLUP|PIN_GPIOMODE_ENABLED);
 | 
	
		
			
				|  |  | +BIAS(gpio_in_pd, PIN_INPUT_PULLDOWN|PIN_GPIOMODE_ENABLED);
 | 
	
		
			
				|  |  | +BIAS(gpio_in_pu_slpm_gpio_nopull, PIN_INPUT_PULLUP|PIN_GPIOMODE_ENABLED|PIN_SLPM_GPIO|PIN_SLPM_INPUT_NOPULL);
 | 
	
		
			
				|  |  | +BIAS(gpio_in_pd_slpm_gpio_nopull, PIN_INPUT_PULLDOWN|PIN_GPIOMODE_ENABLED|PIN_SLPM_GPIO|PIN_SLPM_INPUT_NOPULL);
 | 
	
		
			
				|  |  | +BIAS(gpio_out_hi, PIN_OUTPUT_HIGH|PIN_GPIOMODE_ENABLED);
 | 
	
		
			
				|  |  | +BIAS(gpio_out_lo, PIN_OUTPUT_LOW|PIN_GPIOMODE_ENABLED);
 | 
	
		
			
				|  |  | +/* Sleep modes */
 | 
	
		
			
				|  |  | +BIAS(slpm_in_nopull_wkup, PIN_SLEEPMODE_ENABLED|
 | 
	
		
			
				|  |  | +	PIN_SLPM_DIR_INPUT|PIN_SLPM_PULL_NONE|PIN_SLPM_WAKEUP_ENABLE);
 | 
	
		
			
				|  |  | +BIAS(slpm_in_wkup_pdis, PIN_SLEEPMODE_ENABLED|
 | 
	
		
			
				|  |  | +	PIN_SLPM_DIR_INPUT|PIN_SLPM_WAKEUP_ENABLE|PIN_SLPM_PDIS_DISABLED);
 | 
	
		
			
				|  |  | +BIAS(slpm_wkup_pdis, PIN_SLEEPMODE_ENABLED|
 | 
	
		
			
				|  |  | +	PIN_SLPM_WAKEUP_ENABLE|PIN_SLPM_PDIS_DISABLED);
 | 
	
		
			
				|  |  | +BIAS(slpm_out_lo_pdis, PIN_SLEEPMODE_ENABLED|
 | 
	
		
			
				|  |  | +	PIN_SLPM_OUTPUT_LOW|PIN_SLPM_WAKEUP_DISABLE|PIN_SLPM_PDIS_DISABLED);
 | 
	
		
			
				|  |  | +BIAS(slpm_out_lo_wkup, PIN_SLEEPMODE_ENABLED|
 | 
	
		
			
				|  |  | +	PIN_SLPM_OUTPUT_LOW|PIN_SLPM_WAKEUP_ENABLE);
 | 
	
		
			
				|  |  | +BIAS(slpm_out_lo_wkup_pdis, PIN_SLEEPMODE_ENABLED|
 | 
	
		
			
				|  |  | +	PIN_SLPM_OUTPUT_LOW|PIN_SLPM_WAKEUP_ENABLE|PIN_SLPM_PDIS_DISABLED);
 | 
	
		
			
				|  |  | +BIAS(slpm_out_hi_wkup_pdis, PIN_SLEEPMODE_ENABLED|PIN_SLPM_OUTPUT_HIGH|
 | 
	
		
			
				|  |  | +	PIN_SLPM_WAKEUP_ENABLE|PIN_SLPM_PDIS_DISABLED);
 | 
	
		
			
				|  |  | +BIAS(slpm_in_nopull_wkup_pdis, PIN_SLEEPMODE_ENABLED|
 | 
	
		
			
				|  |  | +	PIN_SLPM_INPUT_NOPULL|PIN_SLPM_WAKEUP_ENABLE|PIN_SLPM_PDIS_DISABLED);
 | 
	
		
			
				|  |  | +BIAS(slpm_in_pu_wkup_pdis_en, PIN_SLEEPMODE_ENABLED|PIN_SLPM_INPUT_PULLUP|
 | 
	
		
			
				|  |  | +	PIN_SLPM_WAKEUP_ENABLE|PIN_SLPM_PDIS_ENABLED);
 | 
	
		
			
				|  |  | +BIAS(slpm_out_wkup_pdis, PIN_SLEEPMODE_ENABLED|
 | 
	
		
			
				|  |  | +	PIN_SLPM_DIR_OUTPUT|PIN_SLPM_WAKEUP_ENABLE|PIN_SLPM_PDIS_DISABLED);
 | 
	
		
			
				|  |  | +BIAS(out_lo_wkup_pdis, PIN_SLPM_OUTPUT_LOW|
 | 
	
		
			
				|  |  | +	PIN_SLPM_WAKEUP_ENABLE|PIN_SLPM_PDIS_DISABLED);
 | 
	
		
			
				|  |  | +BIAS(in_wkup_pdis_en, PIN_SLPM_DIR_INPUT|PIN_SLPM_WAKEUP_ENABLE|
 | 
	
		
			
				|  |  | +	PIN_SLPM_PDIS_ENABLED);
 | 
	
		
			
				|  |  | +BIAS(in_wkup_pdis, PIN_SLPM_DIR_INPUT|PIN_SLPM_WAKEUP_ENABLE|
 | 
	
		
			
				|  |  | +	PIN_SLPM_PDIS_DISABLED);
 | 
	
		
			
				|  |  | +BIAS(out_wkup_pdis, PIN_SLPM_DIR_OUTPUT|PIN_SLPM_WAKEUP_ENABLE|
 | 
	
		
			
				|  |  | +	PIN_SLPM_PDIS_DISABLED);
 |