2020-10-05 07:08 AM
where can i find the names of individual bits inside each register? i like to be able to use these to go
thing -> register |= 1<<name;
but although i know the header file that contains the register names, i can't find the names of the bits within the registers
2020-10-05 08:19 AM
Consult the reference manual.
The header files also include macros such as TIM_CR1_CEN for the CEN bit within the CR1 register.
2020-10-05 08:21 AM
do you mean that they are the same names as in the reference manual?
2020-10-05 08:23 AM
if i use
I2C2 ->CR2 |= 1<<START;
START being the name of the bit listed in the ref manual, it doesn't work
2020-10-05 08:28 AM
2020-10-05 08:32 AM
where in the ref manual? the names given in the register descriptions dont work
2020-10-05 08:56 AM
Guessing theprune is using the L4
Exact naming will be in the CMSIS Include file, gives bit positions, etc. Might have subtly different names, or prefix/suffix to keep the namespaces unique
Repository\STM32Cube_FW_L4_V1.14.0\Drivers\CMSIS\Device\ST\STM32L4xx\Include\stm32l432xx.h
#define DAC_CR_DMAEN2_Pos (28U)
#define DAC_CR_DMAEN2_Msk (0x1UL << DAC_CR_DMAEN2_Pos) /*!< 0x10000000 */
#define DAC_CR_DMAEN2 DAC_CR_DMAEN2_Msk /*!<DAC channel2 DMA enabled */
#define DAC_CR_DMAUDRIE2_Pos (29U)
#define DAC_CR_DMAUDRIE2_Msk (0x1UL << DAC_CR_DMAUDRIE2_Pos) /*!< 0x20000000 */
#define DAC_CR_DMAUDRIE2 DAC_CR_DMAUDRIE2_Msk /*!<DAC channel2 DMA underrun interrupt enable >*/
#define DAC_CR_CEN2_Pos (30U)
#define DAC_CR_CEN2_Msk (0x1UL << DAC_CR_CEN2_Pos) /*!< 0x40000000 */
#define DAC_CR_CEN2 DAC_CR_CEN2_Msk /*!<DAC channel2 calibration enable >*/