I've got a question about this LCD..
I bought 5 of these for a work project, intending to write a driver for the beaglebone, based on an existing st7735 frame buffer driver..
Comparing to the hx8340 datasheet, the registers & the spi protocol used in your example code are completely different. Your example makes use of a weird 9 bit SPI that I can't really do in hardware, whereas the actual hx8340 datasheet (p51,52) can use 8bit spi & the first byte of each transfer to flag whether data / command index is being sent.
The actual display data sheet for the btl221722 LCD module you're using matches your driver perfectly tho, and does say hx8340b..
I can't reconcile the two, and wondered am I missing something - or have I really got to bit bash the entire 50k or so of data each frame?? If it really is a hx8340 based display, what are configuration inputs im0 & im2 connected to??