Skip to content

Commit

Permalink
changed bcm2835 clock divider 16 --> 128
Browse files Browse the repository at this point in the history
  • Loading branch information
EricSchulze committed Aug 27, 2024
1 parent 7b90d75 commit 302dced
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/framework/raspberrypi/pal/spic-rpi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* This function sets the basics for a SPIC and the default SPI.
*
*/
SPICRpi::SPICRpi() : lsb(BCM2835_SPI_BIT_ORDER_LSBFIRST), mode(BCM2835_SPI_MODE1), clock(BCM2835_SPI_CLOCK_DIVIDER_16)
SPICRpi::SPICRpi() : lsb(BCM2835_SPI_BIT_ORDER_LSBFIRST), mode(BCM2835_SPI_MODE1), clock(BCM2835_SPI_CLOCK_DIVIDER_128)
{

}
Expand All @@ -28,7 +28,7 @@ SPICRpi::SPICRpi() : lsb(BCM2835_SPI_BIT_ORDER_LSBFIRST), mode(BCM2835_SPI_MODE1
* @param mode SPI mode
* @param clock SPI clock divider
*/
SPICRpi::SPICRpi(uint8_t lsb, uint8_t mode, uint8_t clock) : lsb(BCM2835_SPI_BIT_ORDER_LSBFIRST), mode(BCM2835_SPI_MODE1), clock(BCM2835_SPI_CLOCK_DIVIDER_16)
SPICRpi::SPICRpi(uint8_t lsb, uint8_t mode, uint8_t clock) : lsb(BCM2835_SPI_BIT_ORDER_LSBFIRST), mode(BCM2835_SPI_MODE1), clock(BCM2835_SPI_CLOCK_DIVIDER_128)
{
this->lsb = lsb;
this->mode = mode;
Expand All @@ -46,7 +46,7 @@ SPICRpi::SPICRpi(uint8_t lsb, uint8_t mode, uint8_t clock) : lsb(BCM2835_SPI_BIT
* @param mosiPin mosi pin number
* @param sckPin systemclock pin number
*/
SPICRpi::SPICRpi(uint8_t csPin, uint8_t misoPin, uint8_t mosiPin, uint8_t sckPin) : lsb(BCM2835_SPI_BIT_ORDER_LSBFIRST), mode(BCM2835_SPI_MODE1), clock(BCM2835_SPI_CLOCK_DIVIDER_16)
SPICRpi::SPICRpi(uint8_t csPin, uint8_t misoPin, uint8_t mosiPin, uint8_t sckPin) : lsb(BCM2835_SPI_BIT_ORDER_LSBFIRST), mode(BCM2835_SPI_MODE1), clock(BCM2835_SPI_CLOCK_DIVIDER_128)
{
this->csPin = csPin;
this->misoPin = misoPin;
Expand Down Expand Up @@ -74,7 +74,7 @@ Error_t SPICRpi::init()
}
bcm2835_spi_setBitOrder(BCM2835_SPI_BIT_ORDER_LSBFIRST); // The default
bcm2835_spi_setDataMode(BCM2835_SPI_MODE1); // The default
bcm2835_spi_setClockDivider(BCM2835_SPI_CLOCK_DIVIDER_32);
bcm2835_spi_setClockDivider(BCM2835_SPI_CLOCK_DIVIDER_128);
bcm2835_spi_chipSelect(BCM2835_SPI_CS0); // The default
bcm2835_spi_setChipSelectPolarity(BCM2835_SPI_CS0, LOW); // The default
return OK;
Expand Down

0 comments on commit 302dced

Please sign in to comment.