osc.h 785 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. ** Made by fabien le mentec <texane@gmail.com>
  3. **
  4. ** Started on Sat Oct 3 07:04:58 2009 texane
  5. ** Last update Mon Oct 12 07:18:01 2009 texane
  6. */
  7. #ifndef OSC_H_INCLUDED
  8. # define OSC_H_INCLUDED
  9. #define OSC_FREQ 8000000
  10. enum osc_pmode
  11. {
  12. /* sleep mode: both cpu and peripherals not clocked */
  13. OSC_PMODE_SLEEP = 0,
  14. /* run mode: both cpu and peripherals clocked */
  15. OSC_PMODE_PRI_RUN,
  16. OSC_PMODE_SEC_RUN,
  17. OSC_PMODE_RC_RUN,
  18. #define OSC_PMODE_RUN OSC_PMODE_PRI_RUN
  19. /* idle mode: cpu not clocked, peripherals clocked */
  20. OSC_PMODE_PRI_IDLE,
  21. OSC_PMODE_SEC_IDLE,
  22. OSC_PMODE_RC_IDLE,
  23. #define OSC_PMODE_IDLE OSC_PMODE_PRI_IDLE
  24. OSC_PMODE_MAX
  25. };
  26. void osc_setup(void);
  27. void osc_set_power(enum osc_pmode);
  28. #endif /* ! OSC_H_INCLUDED */