A controller of an in-cell type display device, the display device comprising sensor electrodes for receiving downlink signals from a stylus and transmitting uplink signals to the stylus, wherein a display cycle, which is a cycle of display operation, includes N blank periods (T1-T40) during which a pixel driving process is halted, wherein N>1, wherein the controller is configured to perform a stylus detection operation, wherein, after the stylus is detected by the detection operation, the controller transmits, once within the display cycle using one of the N blank periods, a second command that identifies data to be transmitted by the stylus, and the controller is configured to detect a position of the stylus in each of stylus detection periods by using blank periods of the N blank periods other than the blank period used for transmitting the second command, wherein, before the stylus is detected by the detection operation, the controller transmits, a plurality of times within the display cycle, a first command including type identification information using at least two of the N blank periods (T1, T21), wherein the type identification information indicates that a type of the display device is the in-cell type display device, wherein the type of the display device identifies a communication protocol to be used by the stylus to send a downlink signal, and the controller is configured to perform the stylus detection operation in each of stylus detection periods by using blank periods of the N blank periods other than the blank periods used for transmitting the first command, and wherein the controller, in operation, detects the stylus by receiving a downlink signal transmitted by the stylus in response to one of the first commands transmitted a plurality of times during the display cycle. wherein a display cycle, which is a cycle of display operation, includes N blank periods (T1-T40) during which a pixel driving process is halted, wherein N>1, wherein the controller is configured to perform a stylus detection operation, wherein, after the stylus is detected by the detection operation, the controller transmits, once within the display cycle using one of the N blank periods, a second command that identifies data to be transmitted by the stylus, and the controller is configured to detect a position of the stylus in each of stylus detection periods by using blank periods of the N blank periods other than the blank period used for transmitting the second command, wherein, before the stylus is detected by the detection operation, the controller transmits, a plurality of times within the display cycle, a first command including type identification information using at least two of the N blank periods (T1, T21), wherein the type identification information indicates that a type of the display device is the in-cell type display device, wherein the type of the display device identifies a communication protocol to be used by the stylus to send a downlink signal, and the controller is configured to perform the stylus detection operation in each of stylus detection periods by using blank periods of the N blank periods other than the blank periods used for transmitting the first command, and wherein the controller, in operation, detects the stylus by receiving a downlink signal transmitted by the stylus in response to one of the first commands transmitted a plurality of times during the display cycle.