Port of flash_cc2531 to FreeBSD. This is likely more just include a wiringPi compatible library for FreeBSD. Any new files are BSD licensed and NOT GPLv3 license.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

134 lines
2.3 KiB

  1. #ifndef CCDEBUGGER_H
  2. #define CCDEBUGGER_H
  3. #define CC_ERROR_NONE 0
  4. #define CC_ERROR_NOT_ACTIVE 1
  5. #define CC_ERROR_NOT_DEBUGGING 2
  6. #define CC_ERROR_NOT_WIRED 3
  7. // defaĆ­ltaj valoroj por pingloj
  8. // por restarigi al pinglo 35, DC al pinglo 36, DD al pinglo 38
  9. #define PIN_RST 24
  10. #define PIN_DC 27
  11. #define PIN_DD 28
  12. // alternativaj valoroj por pingloj
  13. // por restarigi al pinglo 3, DC al pinglo 11, DD al pinglo 13
  14. // Utila por pi 1.
  15. //#define PIN_RST 8
  16. //#define PIN_DC 0
  17. //#define PIN_DD 2
  18. int cc_init( int pinRST, int pinDC, int pinDD );
  19. void cc_delay( unsigned char d );
  20. uint8_t cc_error();
  21. ////////////////////////////
  22. // High-Level interaction
  23. ////////////////////////////
  24. void cc_setActive( uint8_t on );
  25. /**
  26. * Enter debug mode
  27. */
  28. uint8_t cc_enter();
  29. /**
  30. * Exit from debug mode
  31. */
  32. uint8_t cc_exit();
  33. /**
  34. * Execute a CPU instructuion
  35. */
  36. uint8_t cc_exec( uint8_t oc0 );
  37. uint8_t cc_execi( uint8_t oc0, unsigned short c0 );
  38. uint8_t cc_exec2( uint8_t oc0, uint8_t oc1 );
  39. uint8_t cc_exec3( uint8_t oc0, uint8_t oc1, uint8_t oc2 );
  40. /**
  41. * Return chip ID
  42. */
  43. unsigned short cc_getChipID();
  44. /**
  45. * Return PC
  46. */
  47. unsigned short cc_getPC();
  48. /**
  49. * Return debug status
  50. */
  51. uint8_t cc_getStatus();
  52. /**
  53. * resume program exec
  54. */
  55. uint8_t cc_resume();
  56. /**
  57. * halt program exec
  58. */
  59. uint8_t cc_halt();
  60. /**
  61. * Step a single instruction
  62. */
  63. uint8_t cc_step();
  64. /**
  65. * Get debug configuration
  66. */
  67. uint8_t cc_getConfig();
  68. /**
  69. * Set debug configuration
  70. */
  71. uint8_t cc_setConfig( uint8_t config );
  72. /**
  73. * Massive erasure on the chip
  74. */
  75. uint8_t cc_chipErase();
  76. ////////////////////////////
  77. // Low-level interaction
  78. ////////////////////////////
  79. /**
  80. * Write to the debugger
  81. */
  82. uint8_t cc_write( uint8_t data );
  83. /**
  84. * Wait until we are ready to read & Switch to read mode
  85. */
  86. uint8_t cc_switchRead( uint8_t maxWaitCycles );
  87. /**
  88. * Switch to write mode
  89. */
  90. uint8_t cc_switchWrite();
  91. /**
  92. * Read from the debugger
  93. */
  94. uint8_t cc_read();
  95. /**
  96. * Update the debug instruction table
  97. */
  98. uint8_t cc_updateInstructionTable( uint8_t newTable[16] );
  99. /**
  100. * Get the instruction table version
  101. */
  102. uint8_t cc_getInstructionTableVersion();
  103. #endif