luat_netdrv_ch390h.h 686 B

1234567891011121314151617181920212223242526272829303132333435
  1. #ifndef LUAT_NETDRV_CH390H_H
  2. #define LUAT_NETDRV_CH390H_H 1
  3. #include "luat_netdrv.h"
  4. #include "lwip/netif.h"
  5. #include "lwip/pbuf.h"
  6. #include "luat_ulwip.h"
  7. #define CH390H_MAX_TX_NUM (128)
  8. typedef struct luat_ch390h_cstring
  9. {
  10. uint16_t len;
  11. uint8_t buff[4];
  12. }luat_ch390h_cstring_t;
  13. typedef struct ch390h
  14. {
  15. uint8_t spiid;
  16. uint8_t cspin;
  17. uint8_t intpin;
  18. uint8_t adapter_id;
  19. uint8_t status;
  20. uint8_t init_done;
  21. uint8_t init_step;
  22. luat_netdrv_t* netdrv;
  23. uint8_t rxbuff[1600];
  24. uint8_t txbuff[1600];
  25. luat_ch390h_cstring_t* txqueue[CH390H_MAX_TX_NUM];
  26. }ch390h_t;
  27. luat_netdrv_t* luat_netdrv_ch390h_setup(luat_netdrv_conf_t *conf);
  28. #endif