In this study, direct numerical simulation of a turbulent flame–wall interaction (FWI) has been done for premixed H
$_2/$air and NH
$_3/$H
$_2/$air flames in a fully developed channel flow at Re
$_\tau$
$\approx$ 300. Both isothermal and adiabatic walls are considered. The results contribute to further clarification of the underlying mechanisms of FWIs. First, the underlying mechanism for the rapid increase of chemical flame thickness near the wall is found to be the zero-flux boundary condition for diffusion. Effects of wall heat loss and wall turbulence are minor. Then, a ridge-based flame surface identification method is proposed to track the flame front, which is found to be more accurate than an isosurface of
$C$ (the progress variable), especially during FWIs. Using this technique, the near-wall flame geometry and orientation are correctly captured. It is found that the flames are laminarised near the wall and almost parallel to the isothermal wall shortly before quenching. Flame–vortex interactions lead to entrained flame pockets for H
$_2$ as a fuel and to a distributed reaction zone for the case of NH
$_3/$H
$_2$. Finally, the turbulent combustion regime is investigated by checking wall-distance-dependent Reynolds number and Karlovitz number. It is found that the flames enter the laminar flame regime shortly before wall quenching, instead of the broken reaction regime suggested in previous studies. To support the analysis, the turbulent flame dynamics, including turbulent burning rate, turbulent flame surface area, flame stretch factor, local displacement speed, flame dilatation, flame strain rate (both tangential and normal) and flame alignment with the principal strain rate are quantified, providing a full picture of near-wall turbulent flames for the considered conditions.