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.
 
 
 
 
 
 

82 lines
2.7 KiB

  1. /***************************************************************************
  2. * Copyright (C) 2011 by Mathias Kuester *
  3. * Mathias Kuester <kesmtp@freenet.de> *
  4. * *
  5. * This program is free software; you can redistribute it and/or modify *
  6. * it under the terms of the GNU General Public License as published by *
  7. * the Free Software Foundation; either version 2 of the License, or *
  8. * (at your option) any later version. *
  9. * *
  10. * This program is distributed in the hope that it will be useful, *
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of *
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
  13. * GNU General Public License for more details. *
  14. * *
  15. * You should have received a copy of the GNU General Public License *
  16. * along with this program; if not, write to the *
  17. * Free Software Foundation, Inc., *
  18. * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
  19. ***************************************************************************/
  20. #ifndef _STLINK_LAYOUT_H_
  21. #define _STLINK_LAYOUT_H_
  22. /** */
  23. struct stlink_interface_s;
  24. struct stlink_interface_param_s;
  25. /** */
  26. extern struct stlink_layout_api_s stlink_layout_api;
  27. /** */
  28. struct stlink_layout_api_s {
  29. /** */
  30. int (*open) (struct stlink_interface_param_s *param, void **fd);
  31. /** */
  32. int (*close) (void *fd);
  33. /** */
  34. int (*reset) (void *fd);
  35. /** */
  36. int (*run) (void *fd);
  37. /** */
  38. int (*halt) (void *fd);
  39. /** */
  40. int (*step) (void *fd);
  41. /** */
  42. int (*read_regs) (void *fd);
  43. /** */
  44. int (*read_reg) (void *fd, int num, uint32_t *val);
  45. /** */
  46. int (*write_reg) (void *fd, int num, uint32_t val);
  47. /** */
  48. int (*read_mem32) (void *handle, uint32_t addr, uint16_t len,
  49. uint32_t *buffer);
  50. /** */
  51. int (*write_mem32) (void *handle, uint32_t addr, uint16_t len,
  52. uint32_t *buffer);
  53. /** */
  54. int (*idcode) (void *fd, uint32_t *idcode);
  55. /** */
  56. enum target_state (*state) (void *fd);
  57. };
  58. /** */
  59. struct stlink_layout {
  60. /** */
  61. char *name;
  62. /** */
  63. int type;
  64. /** */
  65. int (*open) (struct stlink_interface_s *stlink_if);
  66. /** */
  67. int (*close) (struct stlink_interface_s *stlink_if);
  68. /** */
  69. struct stlink_layout_api_s *api;
  70. };
  71. /** */
  72. const struct stlink_layout *stlink_layout_get_list(void);
  73. /** */
  74. int stlink_layout_init(struct stlink_interface_s *stlink_if);
  75. #endif