Cosino's peripherals related code