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.
 
 
 

122 lines
2.0 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. int cc_init( int pinRST, int pinDC, int pinDD );
  8. void cc_delay( unsigned char d );
  9. uint8_t cc_error();
  10. ////////////////////////////
  11. // High-Level interaction
  12. ////////////////////////////
  13. void cc_setActive( uint8_t on );
  14. /**
  15. * Enter debug mode
  16. */
  17. uint8_t cc_enter();
  18. /**
  19. * Exit from debug mode
  20. */
  21. uint8_t cc_exit();
  22. /**
  23. * Execute a CPU instructuion
  24. */
  25. uint8_t cc_exec( uint8_t oc0 );
  26. uint8_t cc_execi( uint8_t oc0, unsigned short c0 );
  27. uint8_t cc_exec2( uint8_t oc0, uint8_t oc1 );
  28. uint8_t cc_exec3( uint8_t oc0, uint8_t oc1, uint8_t oc2 );
  29. /**
  30. * Return chip ID
  31. */
  32. unsigned short cc_getChipID();
  33. /**
  34. * Return PC
  35. */
  36. unsigned short cc_getPC();
  37. /**
  38. * Return debug status
  39. */
  40. uint8_t cc_getStatus();
  41. /**
  42. * resume program exec
  43. */
  44. uint8_t cc_resume();
  45. /**
  46. * halt program exec
  47. */
  48. uint8_t cc_halt();
  49. /**
  50. * Step a single instruction
  51. */
  52. uint8_t cc_step();
  53. /**
  54. * Get debug configuration
  55. */
  56. uint8_t cc_getConfig();
  57. /**
  58. * Set debug configuration
  59. */
  60. uint8_t cc_setConfig( uint8_t config );
  61. /**
  62. * Massive erasure on the chip
  63. */
  64. uint8_t cc_chipErase();
  65. ////////////////////////////
  66. // Low-level interaction
  67. ////////////////////////////
  68. /**
  69. * Write to the debugger
  70. */
  71. uint8_t cc_write( uint8_t data );
  72. /**
  73. * Wait until we are ready to read & Switch to read mode
  74. */
  75. uint8_t cc_switchRead( uint8_t maxWaitCycles );
  76. /**
  77. * Switch to write mode
  78. */
  79. uint8_t cc_switchWrite();
  80. /**
  81. * Read from the debugger
  82. */
  83. uint8_t cc_read();
  84. /**
  85. * Update the debug instruction table
  86. */
  87. uint8_t cc_updateInstructionTable( uint8_t newTable[16] );
  88. /**
  89. * Get the instruction table version
  90. */
  91. uint8_t cc_getInstructionTableVersion();
  92. #endif