Implemented LED logic
This commit is contained in:
parent
fb4aa2f964
commit
b0446e4b01
@ -48,11 +48,12 @@ Your configuration file will need to define the following pin manipulation funct
|
||||
|
||||
Note that all pin manipulation functions are required even if one of the interfaces (JTAG or SWD) is not enabled.
|
||||
|
||||
Additionally configuration file must contain basic initialization functions:
|
||||
Additionally configuration file must provide basic initialization and control functions:
|
||||
|
||||
* DAP_CONFIG_SETUP()
|
||||
* DAP_CONFIG_DISCONNECT()
|
||||
* DAP_CONFIG_CONNECT_SWD()
|
||||
* DAP_CONFIG_CONNECT_JTAG()
|
||||
* DAP_CONFIG_LED()
|
||||
|
||||
|
||||
|
||||
4
dap.c
4
dap.c
@ -652,9 +652,7 @@ static void dap_led(uint8_t *req, uint8_t *resp)
|
||||
int index = req[0];
|
||||
int state = req[1];
|
||||
|
||||
// TODO: Actually set LED state
|
||||
(void)index;
|
||||
(void)state;
|
||||
DAP_CONFIG_LED(index, state);
|
||||
|
||||
resp[0] = DAP_OK;
|
||||
}
|
||||
|
||||
1
dap.h
1
dap.h
@ -30,7 +30,6 @@
|
||||
#define _DAP_H_
|
||||
|
||||
/*- Includes ----------------------------------------------------------------*/
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
/*- Prototypes --------------------------------------------------------------*/
|
||||
|
||||
@ -41,6 +41,8 @@ HAL_GPIO_PIN(TDO, A, 9)
|
||||
HAL_GPIO_PIN(nTRST, B, 23)
|
||||
HAL_GPIO_PIN(nRESET, A, 2)
|
||||
|
||||
HAL_GPIO_PIN(LED, B, 30)
|
||||
|
||||
#define DAP_CONFIG_ENABLE_SWD
|
||||
//#define DAP_CONFIG_ENABLE_JTAG
|
||||
|
||||
@ -171,6 +173,9 @@ static inline void DAP_CONFIG_SETUP(void)
|
||||
HAL_GPIO_nRESET_in();
|
||||
|
||||
HAL_GPIO_SWDIO_TMS_pullup();
|
||||
|
||||
HAL_GPIO_LED_out();
|
||||
HAL_GPIO_LED_set();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -222,5 +227,12 @@ static inline void DAP_CONFIG_CONNECT_JTAG(void)
|
||||
HAL_GPIO_nTRST_set();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
static inline void DAP_CONFIG_LED(int index, int state)
|
||||
{
|
||||
if (0 == index)
|
||||
HAL_GPIO_LED_write(!state);
|
||||
}
|
||||
|
||||
#endif // _DAP_CONFIG_H_
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user