Sample driver code for i2c , SPI ,PWM and CAN

Is there any repository where I can get sample code for ,IO handling , i2c , spi ,pwm and CAN driver (Imax6,Imax8).